aboutsummaryrefslogtreecommitdiff
path: root/butl/path.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-14 10:26:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-14 10:26:32 +0200
commit5b9b8d3dadf8471ff3a722fe714bd0900fc6c7ba (patch)
tree9bd7aa37f3ea121eb8f90e47d9b686c6455a35ea /butl/path.ixx
parent80b4ee65c55c896f12109c338ba9aa386b5719c6 (diff)
Add path iterator range constructor
Diffstat (limited to 'butl/path.ixx')
-rw-r--r--butl/path.ixx20
1 files changed, 20 insertions, 0 deletions
diff --git a/butl/path.ixx b/butl/path.ixx
index 3e8a9cc..7ce8c63 100644
--- a/butl/path.ixx
+++ b/butl/path.ixx
@@ -147,6 +147,26 @@ namespace butl
}
template <typename C, typename K>
+ inline basic_path<C, K>::
+ basic_path (const iterator& b, const iterator& e)
+ {
+ //assert (b.p_ == e.p_);
+
+ if (b != e)
+ {
+ this->path_.assign (
+ *b.p_, b.b_, (e.b_ != string_type::npos ? e.b_ - b.b_ - 1 : e.b_));
+
+#ifndef _WIN32
+ if (this->path_.empty ())
+ this->path_ = '/';
+#endif
+
+ // No init() should be necessary.
+ }
+ }
+
+ template <typename C, typename K>
inline basic_path<C, K>& basic_path<C, K>::
complete ()
{