aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/Traits.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-03-05 07:47:42 +0100
committerMax Kellermann <max@duempel.org>2015-03-05 08:58:04 +0100
commit44565e22a054b9bdeb48e79e1d23f914b7efaa0f (patch)
treeca233106f6a0e13ed724f2448d52a91b45c4aef1 /src/fs/Traits.hxx
parentddec10d494a7177156bf58c2bb9d2cbffc184918 (diff)
downloadmpd-44565e22a054b9bdeb48e79e1d23f914b7efaa0f.tar.gz
mpd-44565e22a054b9bdeb48e79e1d23f914b7efaa0f.tar.xz
mpd-44565e22a054b9bdeb48e79e1d23f914b7efaa0f.zip
fs/Traits: use string.h API wrappers
Diffstat (limited to '')
-rw-r--r--src/fs/Traits.hxx22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx
index 0860dfb8a..1a2cd8226 100644
--- a/src/fs/Traits.hxx
+++ b/src/fs/Traits.hxx
@@ -22,6 +22,7 @@
#include "check.h"
#include "Compiler.h"
+#include "util/StringAPI.hxx"
#ifdef WIN32
#include "util/CharUtil.hxx"
@@ -29,7 +30,6 @@
#include <string>
-#include <string.h>
#include <assert.h>
/**
@@ -71,7 +71,7 @@ struct PathTraitsFS {
--pos;
return IsSeparator(*pos) ? pos : nullptr;
#else
- return strrchr(p, SEPARATOR);
+ return StringFindLast(p, SEPARATOR);
#endif
}
@@ -98,17 +98,12 @@ struct PathTraitsFS {
gcc_pure gcc_nonnull_all
static size_t GetLength(const_pointer p) {
- return char_traits::length(p);
- }
-
- gcc_pure gcc_nonnull_all
- static const_pointer Find(const_pointer p, size_t n, value_type ch) {
- return char_traits::find(p, n, ch);
+ return StringLength(p);
}
gcc_pure gcc_nonnull_all
static const_pointer Find(const_pointer p, value_type ch) {
- return strchr(p, ch);
+ return StringFind(p, ch);
}
/**
@@ -202,17 +197,12 @@ struct PathTraitsUTF8 {
gcc_pure gcc_nonnull_all
static size_t GetLength(const_pointer p) {
- return char_traits::length(p);
- }
-
- gcc_pure gcc_nonnull_all
- static const_pointer Find(const_pointer p, size_t n, value_type ch) {
- return char_traits::find(p, n, ch);
+ return StringLength(p);
}
gcc_pure gcc_nonnull_all
static const_pointer Find(const_pointer p, value_type ch) {
- return strchr(p, ch);
+ return StringFind(p, ch);
}
/**