Commit 75307708 authored by Max Kellermann's avatar Max Kellermann

fs/AllocatedPath: add FromFS() with pointer range

parent 11ea72e2
...@@ -48,6 +48,9 @@ class AllocatedPath { ...@@ -48,6 +48,9 @@ class AllocatedPath {
AllocatedPath(std::nullptr_t):value() {} AllocatedPath(std::nullptr_t):value() {}
explicit AllocatedPath(const_pointer_type _value):value(_value) {} explicit AllocatedPath(const_pointer_type _value):value(_value) {}
AllocatedPath(const_pointer_type _begin, const_pointer_type _end)
:value(_begin, _end) {}
AllocatedPath(string &&_value):value(std::move(_value)) {} AllocatedPath(string &&_value):value(std::move(_value)) {}
static AllocatedPath Build(const_pointer_type a, size_t a_size, static AllocatedPath Build(const_pointer_type a, size_t a_size,
...@@ -132,6 +135,12 @@ public: ...@@ -132,6 +135,12 @@ public:
return AllocatedPath(fs); return AllocatedPath(fs);
} }
gcc_pure
static AllocatedPath FromFS(const_pointer_type _begin,
const_pointer_type _end) {
return AllocatedPath(_begin, _end);
}
/** /**
* Convert a C++ string that is already in the filesystem * Convert a C++ string that is already in the filesystem
* character set to a #Path instance. * character set to a #Path instance.
......
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