aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/Path.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 23:23:25 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 23:23:25 +0200
commitb3611524f45c2a478f9decd6d22ecd1dbbbb64b9 (patch)
treed15d0c161e24e5db7d77b768458aa11cb6650878 /src/fs/Path.cxx
parenta63613dba0374367907180be5e244db450ff234b (diff)
downloadmpd-b3611524f45c2a478f9decd6d22ecd1dbbbb64b9.tar.gz
mpd-b3611524f45c2a478f9decd6d22ecd1dbbbb64b9.tar.xz
mpd-b3611524f45c2a478f9decd6d22ecd1dbbbb64b9.zip
fs/Path: move definitions to struct PathTraits
Diffstat (limited to 'src/fs/Path.cxx')
-rw-r--r--src/fs/Path.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx
index 4a4292d05..ecdf73e49 100644
--- a/src/fs/Path.cxx
+++ b/src/fs/Path.cxx
@@ -29,11 +29,6 @@
#include <assert.h>
#include <string.h>
-#ifdef WIN32
-#include <windows.h> // for GetACP()
-#include <stdio.h> // for sprintf()
-#endif
-
inline Path::Path(Donate, pointer _value)
:value(_value) {
g_free(_value);
@@ -86,14 +81,14 @@ Path::RelativeFS(const char *other_fs) const
other_fs += l;
if (*other_fs != 0) {
- if (!IsSeparatorFS(*other_fs))
+ if (!PathTraits::IsSeparatorFS(*other_fs))
/* mismatch */
return nullptr;
/* skip remaining path separators */
do {
++other_fs;
- } while (IsSeparatorFS(*other_fs));
+ } while (PathTraits::IsSeparatorFS(*other_fs));
}
return other_fs;
@@ -105,7 +100,7 @@ Path::ChopSeparators()
size_t l = length();
const char *p = data();
- while (l >= 2 && IsSeparatorFS(p[l - 1])) {
+ while (l >= 2 && PathTraits::IsSeparatorFS(p[l - 1])) {
--l;
#if GCC_CHECK_VERSION(4,7) && !defined(__clang__)