fs: use using instead of typedef

This commit is contained in:
Max Kellermann 2020-03-13 19:32:51 +01:00
parent 3796247d6d
commit 58c7ec07a4
4 changed files with 20 additions and 20 deletions

View File

@ -36,10 +36,10 @@
*/ */
class AllocatedPath { class AllocatedPath {
using Traits = PathTraitsFS; using Traits = PathTraitsFS;
typedef Traits::string string; using string = Traits::string;
typedef Traits::value_type value_type; using value_type = Traits::value_type;
typedef Traits::pointer pointer; using pointer = Traits::pointer;
typedef Traits::const_pointer const_pointer; using const_pointer = Traits::const_pointer;
string value; string value;

View File

@ -37,11 +37,11 @@
*/ */
class NarrowPath { class NarrowPath {
#ifdef _UNICODE #ifdef _UNICODE
typedef AllocatedString<> Value; using Value = AllocatedString<>;
#else #else
typedef StringPointer<> Value; using Value = StringPointer<>;
#endif #endif
typedef typename Value::const_pointer const_pointer; using const_pointer = typename Value::const_pointer;
Value value; Value value;

View File

@ -36,7 +36,7 @@ class AllocatedPath;
*/ */
class Path : public PathTraitsFS::Pointer { class Path : public PathTraitsFS::Pointer {
using Traits = PathTraitsFS; using Traits = PathTraitsFS;
typedef Traits::Pointer Base; using Base = Traits::Pointer;
constexpr Path(const_pointer _value) noexcept:Base(_value) {} constexpr Path(const_pointer _value) noexcept:Base(_value) {}

View File

@ -43,15 +43,15 @@
*/ */
struct PathTraitsFS { struct PathTraitsFS {
#ifdef _WIN32 #ifdef _WIN32
typedef std::wstring string; using string = std::wstring;
#else #else
typedef std::string string; using string = std::string;
#endif #endif
typedef string::traits_type char_traits; using char_traits = string::traits_type;
typedef char_traits::char_type value_type; using value_type = char_traits::char_type;
typedef StringPointer<value_type> Pointer; using Pointer = StringPointer<value_type>;
typedef Pointer::pointer pointer; using pointer = Pointer::pointer;
typedef Pointer::const_pointer const_pointer; using const_pointer = Pointer::const_pointer;
#ifdef _WIN32 #ifdef _WIN32
static constexpr value_type SEPARATOR = '\\'; static constexpr value_type SEPARATOR = '\\';
@ -176,11 +176,11 @@ struct PathTraitsFS {
* This class describes the nature of a MPD internal filesystem path. * This class describes the nature of a MPD internal filesystem path.
*/ */
struct PathTraitsUTF8 { struct PathTraitsUTF8 {
typedef std::string string; using string = std::string;
typedef string::traits_type char_traits; using char_traits = string::traits_type;
typedef char_traits::char_type value_type; using value_type = char_traits::char_type;
typedef value_type *pointer; using pointer = value_type *;
typedef const value_type *const_pointer; using const_pointer = const value_type *;
static constexpr value_type SEPARATOR = '/'; static constexpr value_type SEPARATOR = '/';