Commit dfcfeeb5 authored by Max Kellermann's avatar Max Kellermann

fs/Traits: use std::char_traits

parent 820debf4
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
*/ */
struct PathTraitsFS { struct PathTraitsFS {
typedef std::string string; typedef std::string string;
typedef char value_type; typedef string::traits_type char_traits;
typedef char_traits::char_type value_type;
typedef value_type *pointer; typedef value_type *pointer;
typedef const value_type *const_pointer; typedef const value_type *const_pointer;
...@@ -97,7 +98,7 @@ struct PathTraitsFS { ...@@ -97,7 +98,7 @@ struct PathTraitsFS {
gcc_pure gcc_nonnull_all gcc_pure gcc_nonnull_all
static size_t GetLength(const_pointer p) { static size_t GetLength(const_pointer p) {
return strlen(p); return char_traits::length(p);
} }
/** /**
...@@ -145,7 +146,8 @@ struct PathTraitsFS { ...@@ -145,7 +146,8 @@ struct PathTraitsFS {
*/ */
struct PathTraitsUTF8 { struct PathTraitsUTF8 {
typedef std::string string; typedef std::string string;
typedef char value_type; typedef string::traits_type char_traits;
typedef char_traits::char_type value_type;
typedef value_type *pointer; typedef value_type *pointer;
typedef const value_type *const_pointer; typedef const value_type *const_pointer;
...@@ -190,7 +192,7 @@ struct PathTraitsUTF8 { ...@@ -190,7 +192,7 @@ struct PathTraitsUTF8 {
gcc_pure gcc_nonnull_all gcc_pure gcc_nonnull_all
static size_t GetLength(const_pointer p) { static size_t GetLength(const_pointer p) {
return strlen(p); return char_traits::length(p);
} }
/** /**
......
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