From 5b9b8d3dadf8471ff3a722fe714bd0900fc6c7ba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Jul 2015 10:26:32 +0200 Subject: Add path iterator range constructor --- butl/path.ixx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'butl/path.ixx') 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 + inline basic_path:: + 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 inline basic_path& basic_path:: complete () { -- cgit v1.1