diff options
author | Denis Krjuchkov <denis@crazydev.net> | 2013-12-05 03:53:43 +0600 |
---|---|---|
committer | Denis Krjuchkov <denis@crazydev.net> | 2013-12-05 03:53:43 +0600 |
commit | 0a6c4c31b2a9e79c9c0119202f9e50e123f98ac6 (patch) | |
tree | eeea8005badbf5b9c8ccea8b961ea498d2da3d47 /src/fs/Traits.cxx | |
parent | 02fcf184b5620c9ccbbc26024f9b0f341061a39a (diff) | |
download | mpd-0a6c4c31b2a9e79c9c0119202f9e50e123f98ac6.tar.gz mpd-0a6c4c31b2a9e79c9c0119202f9e50e123f98ac6.tar.xz mpd-0a6c4c31b2a9e79c9c0119202f9e50e123f98ac6.zip |
fs/Traits: split PathTraits type into PathTraitsFS and PathTraitsUTF8
Diffstat (limited to '')
-rw-r--r-- | src/fs/Traits.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
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 <string.h> -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("."); |