diff options
author | Max Kellermann <max@musicpd.org> | 2020-03-13 19:46:12 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-03-13 19:46:29 +0100 |
commit | 1d560c8f0feb9156d62a0a9b4708ae7a8e8a8241 (patch) | |
tree | d77cf34d5ce006258310af1fa669b1c8fb821375 /src/fs | |
parent | 189f6eaa6f9b6e3eab8d26097cd4045eee8a7a13 (diff) |
fs/AllocatedPath: add `string_view` constructor
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/AllocatedPath.hxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx index cdd53b327..097217c7b 100644 --- a/src/fs/AllocatedPath.hxx +++ b/src/fs/AllocatedPath.hxx @@ -47,6 +47,9 @@ class AllocatedPath { explicit AllocatedPath(const_pointer _value) noexcept :value(_value) {} + explicit AllocatedPath(string_view _value) noexcept + :value(_value) {} + AllocatedPath(const_pointer _begin, const_pointer _end) noexcept :value(_begin, _end) {} @@ -142,6 +145,11 @@ public: } gcc_pure + static AllocatedPath FromFS(string_view fs) noexcept { + return AllocatedPath(fs); + } + + gcc_pure static AllocatedPath FromFS(const_pointer _begin, const_pointer _end) noexcept { return AllocatedPath(_begin, _end); |