aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-12-03 13:50:50 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-12-03 13:50:50 +0600
commiteeeef3eab5aec6362094239138843476f31a2b53 (patch)
treef5c7bcc2146bbc624fc0a520fbf7481e9561ff89
parent96413b16046f2edbb53ab7abcca73809f6cb3a54 (diff)
downloadmpd-eeeef3eab5aec6362094239138843476f31a2b53.tar.gz
mpd-eeeef3eab5aec6362094239138843476f31a2b53.tar.xz
mpd-eeeef3eab5aec6362094239138843476f31a2b53.zip
fs/AllocatedPath: use PathTraits::BuildFS
Diffstat (limited to '')
-rw-r--r--src/fs/AllocatedPath.cxx6
-rw-r--r--src/fs/AllocatedPath.hxx18
2 files changed, 14 insertions, 10 deletions
diff --git a/src/fs/AllocatedPath.cxx b/src/fs/AllocatedPath.cxx
index c6c01376f..5da748ea8 100644
--- a/src/fs/AllocatedPath.cxx
+++ b/src/fs/AllocatedPath.cxx
@@ -37,12 +37,6 @@ inline AllocatedPath::AllocatedPath(Donate, pointer _value)
AllocatedPath::~AllocatedPath() {}
AllocatedPath
-AllocatedPath::Build(const_pointer a, const_pointer b)
-{
- return AllocatedPath(Donate(), g_build_filename(a, b, nullptr));
-}
-
-AllocatedPath
AllocatedPath::FromUTF8(const char *path_utf8)
{
return AllocatedPath(Donate(), ::PathFromUTF8(path_utf8));
diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx
index 3d557f92e..5b5221b45 100644
--- a/src/fs/AllocatedPath.hxx
+++ b/src/fs/AllocatedPath.hxx
@@ -55,6 +55,10 @@ class AllocatedPath {
AllocatedPath(string &&_value):value(_value) {}
+ static AllocatedPath Build(const_pointer a, size_t a_size,
+ const_pointer b, size_t b_size) {
+ return AllocatedPath(PathTraits::BuildFS(a, a_size, b, b_size));
+ }
public:
/**
* Copy a #AllocatedPath object.
@@ -88,22 +92,28 @@ public:
* Join two path components with the path separator.
*/
gcc_pure gcc_nonnull_all
- static AllocatedPath Build(const_pointer a, const_pointer b);
+ static AllocatedPath Build(const_pointer a, const_pointer b) {
+ return Build(a, PathTraits::GetLengthFS(a),
+ b, PathTraits::GetLengthFS(b));
+ }
gcc_pure gcc_nonnull_all
static AllocatedPath Build(const_pointer a, const AllocatedPath &b) {
- return Build(a, b.c_str());
+ return Build(a, PathTraits::GetLengthFS(a),
+ b.value.c_str(), b.value.size());
}
gcc_pure gcc_nonnull_all
static AllocatedPath Build(const AllocatedPath &a, const_pointer b) {
- return Build(a.c_str(), b);
+ return Build(a.value.c_str(), a.value.size(),
+ b, PathTraits::GetLengthFS(b));
}
gcc_pure
static AllocatedPath Build(const AllocatedPath &a,
const AllocatedPath &b) {
- return Build(a.c_str(), b.c_str());
+ return Build(a.value.c_str(), a.value.size(),
+ b.value.c_str(), b.value.size());
}
/**