From 0a6c4c31b2a9e79c9c0119202f9e50e123f98ac6 Mon Sep 17 00:00:00 2001 From: Denis Krjuchkov Date: Thu, 5 Dec 2013 03:53:43 +0600 Subject: fs/Traits: split PathTraits type into PathTraitsFS and PathTraitsUTF8 --- src/fs/Traits.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/fs/Traits.cxx') diff --git a/src/fs/Traits.cxx b/src/fs/Traits.cxx index aaf0a59e1..3bbc67c5b 100644 --- a/src/fs/Traits.cxx +++ b/src/fs/Traits.cxx @@ -22,9 +22,9 @@ #include -PathTraits::string -PathTraits::BuildFS(PathTraits::const_pointer a, size_t a_size, - PathTraits::const_pointer b, size_t b_size) +PathTraitsFS::string +PathTraitsFS::Build(PathTraitsFS::const_pointer a, size_t a_size, + PathTraitsFS::const_pointer b, size_t b_size) { assert(a != nullptr); assert(b != nullptr); @@ -36,10 +36,10 @@ PathTraits::BuildFS(PathTraits::const_pointer a, size_t a_size, string result(a, a_size); - if (!IsSeparatorFS(a[a_size - 1])) - result.push_back(SEPARATOR_FS); + if (!IsSeparator(a[a_size - 1])) + result.push_back(SEPARATOR); - if (IsSeparatorFS(b[0])) + if (IsSeparator(b[0])) result.append(b + 1, b_size - 1); else result.append(b, b_size); @@ -48,22 +48,22 @@ PathTraits::BuildFS(PathTraits::const_pointer a, size_t a_size, } const char * -PathTraits::GetBaseUTF8(const char *p) +PathTraitsUTF8::GetBase(const char *p) { assert(p != nullptr); - const char *slash = strrchr(p, SEPARATOR_UTF8); + const char *slash = strrchr(p, SEPARATOR); return slash != nullptr ? slash + 1 : p; } std::string -PathTraits::GetParentUTF8(const char *p) +PathTraitsUTF8::GetParent(const char *p) { assert(p != nullptr); - const char *slash = strrchr(p, SEPARATOR_UTF8); + const char *slash = strrchr(p, SEPARATOR); return slash != nullptr ? std::string(p, slash) : std::string("."); -- cgit v1.2.3