fs/Traits: add string_view

This commit is contained in:
Max Kellermann 2020-03-13 19:43:39 +01:00
parent 87f78b9c39
commit 189f6eaa6f
2 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,7 @@
class AllocatedPath {
using Traits = PathTraitsFS;
using string = Traits::string;
using string_view = Traits::string_view;
using value_type = Traits::value_type;
using pointer = Traits::pointer;
using const_pointer = Traits::const_pointer;

View File

@ -44,8 +44,10 @@
struct PathTraitsFS {
#ifdef _WIN32
using string = std::wstring;
using string_view = std::wstring_view;
#else
using string = std::string;
using string_view = std::string_view;
#endif
using char_traits = string::traits_type;
using value_type = char_traits::char_type;
@ -177,6 +179,7 @@ struct PathTraitsFS {
*/
struct PathTraitsUTF8 {
using string = std::string;
using string_view = std::string_view;
using char_traits = string::traits_type;
using value_type = char_traits::char_type;
using pointer = value_type *;