Commit 6c582882 authored by Denis Krjuchkov's avatar Denis Krjuchkov

fs/AllocatedPath.hxx: add FromFS(std::string) method

parent 9dd824ba
...@@ -54,6 +54,8 @@ class AllocatedPath { ...@@ -54,6 +54,8 @@ class AllocatedPath {
AllocatedPath(const_pointer _value):value(_value) {} AllocatedPath(const_pointer _value):value(_value) {}
AllocatedPath(string &&_value):value(_value) {}
public: public:
/** /**
* Copy a #AllocatedPath object. * Copy a #AllocatedPath object.
...@@ -115,6 +117,15 @@ public: ...@@ -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. * Convert a UTF-8 C string to a #AllocatedPath instance.
* Returns return a "nulled" instance on error. * Returns return a "nulled" instance on error.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment