From 0a1f1a516321cd9a623bedb39f7626142103109b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Aug 2016 16:32:34 +0200 Subject: Rename path::diff_ to path::tsep_ This helps a bit when seeing this member in a debugger. --- butl/path.ixx | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'butl/path.ixx') diff --git a/butl/path.ixx b/butl/path.ixx index d1fa34c..169f05d 100644 --- a/butl/path.ixx +++ b/butl/path.ixx @@ -43,7 +43,7 @@ namespace butl path_cast_impl (const basic_path& p, basic_path*) { typename basic_path::data_type d ( - typename basic_path::string_type (p.path_), p.diff_); + typename basic_path::string_type (p.path_), p.tsep_); K1::cast (d); return basic_path (std::move (d)); } @@ -52,7 +52,7 @@ namespace butl inline basic_path path_cast_impl (basic_path&& p, basic_path*) { - typename basic_path::data_type d (std::move (p.path_), p.diff_); + typename basic_path::data_type d (std::move (p.path_), p.tsep_); K1::cast (d); return basic_path (std::move (d)); } @@ -166,7 +166,7 @@ namespace butl : string_type::npos); return p != string_type::npos - ? basic_path (data_type (string_type (s, p + 1), this->diff_)) + ? basic_path (data_type (string_type (s, p + 1), this->tsep_)) : *this; } @@ -216,7 +216,7 @@ namespace butl // : (e.b_ != string_type::npos ? data_type (string_type (b.p_->path_, b.b_, e.b_ - b.b_)) - : data_type (string_type (b.p_->path_, b.b_), b.p_->diff_))) + : data_type (string_type (b.p_->path_, b.b_), b.p_->tsep_))) { //assert (b.p_ == e.p_); } @@ -261,7 +261,7 @@ namespace butl ? dir_type ( s.size () > 2 ? data_type (string_type (s, 0, 3)) - : data_type (string_type (s), this->diff_ != 0 ? this->diff_ : 1)) + : data_type (string_type (s), this->tsep_ != 0 ? this->tsep_ : 1)) : dir_type (); #else return absolute () @@ -279,7 +279,7 @@ namespace butl size_type p (traits::find_extension (s)); return p != string_type::npos - ? basic_path (data_type (string_type (s, 0, p), this->diff_)) + ? basic_path (data_type (string_type (s, 0, p), this->tsep_)) : *this; } @@ -324,24 +324,24 @@ namespace butl template inline void basic_path:: - combine (const C* r, size_type rn, difference_type rd) + combine (const C* r, size_type rn, difference_type rts) { //assert (rn != 0); string_type& l (this->path_); - difference_type& d (this->diff_); + difference_type& ts (this->tsep_); // Handle the separator. LHS should be empty or already have one. // - switch (d) + switch (ts) { case 0: if (!l.empty ()) throw invalid_basic_path (l); break; case -1: break; // Already in the string. - default: l += path_traits::directory_separators[d - 1]; + default: l += path_traits::directory_separators[ts - 1]; } l.append (r, rn); - d = rd; // New trailing separator from RHS. + ts = rts; // New trailing separator from RHS. } template @@ -372,7 +372,7 @@ namespace butl throw invalid_basic_path (r.path_); if (!r.empty ()) - combine (r.path_.c_str (), r.path_.size (), r.diff_); + combine (r.path_.c_str (), r.path_.size (), r.tsep_); return *this; } @@ -401,7 +401,7 @@ namespace butl inline void basic_path:: append (const C* r, size_type rn) { - //assert (this->diff_ != -1); // Append to root? + //assert (this->tsep_ != -1); // Append to root? this->path_.append (r, rn); } @@ -435,8 +435,8 @@ namespace butl { string_type r (this->path_); - if (this->diff_ > 0) - r += path_traits::directory_separators[this->diff_ - 1]; + if (this->tsep_ > 0) + r += path_traits::directory_separators[this->tsep_ - 1]; return r; } @@ -448,8 +448,8 @@ namespace butl string_type r; r.swap (this->path_); - if (this->diff_ > 0) - r += path_traits::directory_separators[this->diff_ - 1]; + if (this->tsep_ > 0) + r += path_traits::directory_separators[this->tsep_ - 1]; return r; } @@ -458,9 +458,9 @@ namespace butl inline C basic_path:: separator () const { - return (this->diff_ == 0 ? 0 : - this->diff_ == -1 ? this->path_[0] : - path_traits::directory_separators[this->diff_ - 1]); + return (this->tsep_ == 0 ? 0 : + this->tsep_ == -1 ? this->path_[0] : + path_traits::directory_separators[this->tsep_ - 1]); } template @@ -477,7 +477,7 @@ namespace butl { // Add trailing slash if one isn't already there. // - if (!d.path_.empty () && d.diff_ == 0) - d.diff_ = 1; // Canonical separator is always first. + if (!d.path_.empty () && d.tsep_ == 0) + d.tsep_ = 1; // Canonical separator is always first. } } -- cgit v1.1