diff options
author | Denis Krjuchkov <denis@crazydev.net> | 2013-12-03 12:16:53 +0600 |
---|---|---|
committer | Denis Krjuchkov <denis@crazydev.net> | 2013-12-03 12:16:53 +0600 |
commit | 6c5828822c7602090cc55629b9b7e973388baaf3 (patch) | |
tree | acaa83828ff852985a1ea436f290b57026f44dd9 /src | |
parent | 9dd824ba500e70dfd9fb0731a09f3e738918ec7e (diff) | |
download | mpd-6c5828822c7602090cc55629b9b7e973388baaf3.tar.gz mpd-6c5828822c7602090cc55629b9b7e973388baaf3.tar.xz mpd-6c5828822c7602090cc55629b9b7e973388baaf3.zip |
fs/AllocatedPath.hxx: add FromFS(std::string) method
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/AllocatedPath.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx index 94da284c8..502f30d17 100644 --- a/src/fs/AllocatedPath.hxx +++ b/src/fs/AllocatedPath.hxx @@ -54,6 +54,8 @@ class AllocatedPath { AllocatedPath(const_pointer _value):value(_value) {} + AllocatedPath(string &&_value):value(_value) {} + public: /** * Copy a #AllocatedPath object. @@ -115,6 +117,15 @@ public: } /** + * Convert a C++ string that is already in the filesystem + * character set to a #Path instance. + */ + gcc_pure + static AllocatedPath FromFS(string &&fs) { + return AllocatedPath(std::move(fs)); + } + + /** * Convert a UTF-8 C string to a #AllocatedPath instance. * Returns return a "nulled" instance on error. */ |