aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-12-03 12:26:05 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-12-03 12:26:05 +0600
commit3a183f869f1697cb5337e392cb341a07bd7c6295 (patch)
treee9cb41eb5c350f96dc45d050dca6fef23ceea6de
parent6c5828822c7602090cc55629b9b7e973388baaf3 (diff)
downloadmpd-3a183f869f1697cb5337e392cb341a07bd7c6295.tar.gz
mpd-3a183f869f1697cb5337e392cb341a07bd7c6295.tar.xz
mpd-3a183f869f1697cb5337e392cb341a07bd7c6295.zip
fs/Traits.hxx: add GetLengthFS()
There is no GetLengthUTF8() because strlen or std::string::size() could be used instead.
Diffstat (limited to '')
-rw-r--r--src/fs/Traits.hxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx
index 51941cb70..df412b12b 100644
--- a/src/fs/Traits.hxx
+++ b/src/fs/Traits.hxx
@@ -29,6 +29,7 @@
#include <string>
+#include <string.h>
#include <assert.h>
/**
@@ -79,6 +80,11 @@ struct PathTraits {
return IsSeparatorUTF8(*p);
}
+ gcc_pure
+ static size_t GetLengthFS(const_pointer p) {
+ return strlen(p);
+ }
+
/**
* Determine the "base" file name of the given UTF-8 path.
* The return value points inside the given string.