summaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-01-03 15:49:29 +0100
committerMax Kellermann <max@musicpd.org>2020-01-03 15:55:06 +0100
commit4937d77cb651462d8c24827b4512f6eb22f83601 (patch)
tree26bc504f416a463b101d69145266e13bad2f8d67 /src/fs
parent53f805318894b62867d44be66bb9f4b7e2e7a1bf (diff)
util/{Const,Writable}Buffer: drop "_type" from type names
Behave like STL.
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/AllocatedPath.hxx36
-rw-r--r--src/fs/Charset.cxx4
-rw-r--r--src/fs/Charset.hxx4
-rw-r--r--src/fs/DirectoryReader.hxx6
-rw-r--r--src/fs/FileSystem.hxx2
-rw-r--r--src/fs/LookupFile.cxx6
-rw-r--r--src/fs/NarrowPath.hxx6
-rw-r--r--src/fs/Path.cxx2
-rw-r--r--src/fs/Path.hxx12
-rw-r--r--src/fs/StandardDirectory.cxx6
-rw-r--r--src/fs/Traits.cxx52
-rw-r--r--src/fs/Traits.hxx66
12 files changed, 100 insertions, 102 deletions
diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx
index 43df85348..e7bf9c80e 100644
--- a/src/fs/AllocatedPath.hxx
+++ b/src/fs/AllocatedPath.hxx
@@ -38,23 +38,22 @@ class AllocatedPath {
using Traits = PathTraitsFS;
typedef Traits::string string;
typedef Traits::value_type value_type;
- typedef Traits::pointer_type pointer_type;
- typedef Traits::const_pointer_type const_pointer_type;
+ typedef Traits::pointer pointer;
+ typedef Traits::const_pointer const_pointer;
string value;
- explicit AllocatedPath(const_pointer_type _value) noexcept
+ explicit AllocatedPath(const_pointer _value) noexcept
:value(_value) {}
- AllocatedPath(const_pointer_type _begin,
- const_pointer_type _end) noexcept
+ AllocatedPath(const_pointer _begin, const_pointer _end) noexcept
:value(_begin, _end) {}
AllocatedPath(string &&_value) noexcept
:value(std::move(_value)) {}
- static AllocatedPath Build(const_pointer_type a, size_t a_size,
- const_pointer_type b, size_t b_size) noexcept {
+ static AllocatedPath Build(const_pointer a, size_t a_size,
+ const_pointer b, size_t b_size) noexcept {
return AllocatedPath(Traits::Build(a, a_size, b, b_size));
}
public:
@@ -91,14 +90,13 @@ public:
* Join two path components with the path separator.
*/
gcc_pure gcc_nonnull_all
- static AllocatedPath Build(const_pointer_type a,
- const_pointer_type b) noexcept {
+ static AllocatedPath Build(const_pointer a, const_pointer b) noexcept {
return Build(a, Traits::GetLength(a),
b, Traits::GetLength(b));
}
gcc_pure gcc_nonnull_all
- static AllocatedPath Build(Path a, const_pointer_type b) noexcept {
+ static AllocatedPath Build(Path a, const_pointer b) noexcept {
return Build(a.c_str(), b);
}
@@ -108,7 +106,7 @@ public:
}
gcc_pure gcc_nonnull_all
- static AllocatedPath Build(const_pointer_type a,
+ static AllocatedPath Build(const_pointer a,
const AllocatedPath &b) noexcept {
return Build(a, Traits::GetLength(a),
b.value.c_str(), b.value.size());
@@ -116,7 +114,7 @@ public:
gcc_pure gcc_nonnull_all
static AllocatedPath Build(const AllocatedPath &a,
- const_pointer_type b) noexcept {
+ const_pointer b) noexcept {
return Build(a.value.c_str(), a.value.size(),
b, Traits::GetLength(b));
}
@@ -138,13 +136,13 @@ public:
* character set to a #Path instance.
*/
gcc_pure
- static AllocatedPath FromFS(const_pointer_type fs) noexcept {
+ static AllocatedPath FromFS(const_pointer fs) noexcept {
return AllocatedPath(fs);
}
gcc_pure
- static AllocatedPath FromFS(const_pointer_type _begin,
- const_pointer_type _end) noexcept {
+ static AllocatedPath FromFS(const_pointer _begin,
+ const_pointer _end) noexcept {
return AllocatedPath(_begin, _end);
}
@@ -247,7 +245,7 @@ public:
* instance ends.
*/
gcc_pure
- const_pointer_type c_str() const noexcept {
+ const_pointer c_str() const noexcept {
return value.c_str();
}
@@ -256,7 +254,7 @@ public:
* null-terminated.
*/
gcc_pure
- const_pointer_type data() const noexcept {
+ const_pointer data() const noexcept {
return value.data();
}
@@ -290,12 +288,12 @@ public:
* nullptr on mismatch.
*/
gcc_pure
- const_pointer_type Relative(Path other_fs) const noexcept {
+ const_pointer Relative(Path other_fs) const noexcept {
return Traits::Relative(c_str(), other_fs.c_str());
}
gcc_pure
- const_pointer_type GetSuffix() const noexcept {
+ const_pointer GetSuffix() const noexcept {
return ((Path)*this).GetSuffix();
}
diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx
index 880a0101c..7fa1bdbcd 100644
--- a/src/fs/Charset.cxx
+++ b/src/fs/Charset.cxx
@@ -91,7 +91,7 @@ FixSeparators(PathTraitsUTF8::string &&s)
}
PathTraitsUTF8::string
-PathToUTF8(PathTraitsFS::const_pointer_type path_fs)
+PathToUTF8(PathTraitsFS::const_pointer path_fs)
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
@@ -117,7 +117,7 @@ PathToUTF8(PathTraitsFS::const_pointer_type path_fs)
#if defined(HAVE_FS_CHARSET) || defined(_WIN32)
PathTraitsFS::string
-PathFromUTF8(PathTraitsUTF8::const_pointer_type path_utf8)
+PathFromUTF8(PathTraitsUTF8::const_pointer path_utf8)
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
diff --git a/src/fs/Charset.hxx b/src/fs/Charset.hxx
index 8c6ac9efe..dde6338a6 100644
--- a/src/fs/Charset.hxx
+++ b/src/fs/Charset.hxx
@@ -46,7 +46,7 @@ DeinitFSCharset() noexcept;
*/
gcc_nonnull_all
PathTraitsUTF8::string
-PathToUTF8(PathTraitsFS::const_pointer_type path_fs);
+PathToUTF8(PathTraitsFS::const_pointer path_fs);
/**
* Convert the path from UTF-8.
@@ -55,6 +55,6 @@ PathToUTF8(PathTraitsFS::const_pointer_type path_fs);
*/
gcc_nonnull_all
PathTraitsFS::string
-PathFromUTF8(PathTraitsUTF8::const_pointer_type path_utf8);
+PathFromUTF8(PathTraitsUTF8::const_pointer path_utf8);
#endif
diff --git a/src/fs/DirectoryReader.hxx b/src/fs/DirectoryReader.hxx
index f5be9b6f3..7546f182d 100644
--- a/src/fs/DirectoryReader.hxx
+++ b/src/fs/DirectoryReader.hxx
@@ -36,10 +36,10 @@ class DirectoryReader {
bool first = true;
class MakeWildcardPath {
- PathTraitsFS::pointer_type path;
+ PathTraitsFS::pointer path;
public:
- MakeWildcardPath(PathTraitsFS::const_pointer_type _path) {
+ MakeWildcardPath(PathTraitsFS::const_pointer _path) {
auto l = _tcslen(_path);
path = new PathTraitsFS::value_type[l + 3];
_tcscpy(path, _path);
@@ -52,7 +52,7 @@ class DirectoryReader {
delete[] path;
}
- operator PathTraitsFS::const_pointer_type() const {
+ operator PathTraitsFS::const_pointer() const {
return path;
}
};
diff --git a/src/fs/FileSystem.hxx b/src/fs/FileSystem.hxx
index 724b49348..9df3f6851 100644
--- a/src/fs/FileSystem.hxx
+++ b/src/fs/FileSystem.hxx
@@ -39,7 +39,7 @@ class AllocatedPath;
* Wrapper for fopen() that uses #Path names.
*/
static inline FILE *
-FOpen(Path file, PathTraitsFS::const_pointer_type mode)
+FOpen(Path file, PathTraitsFS::const_pointer mode)
{
#ifdef _WIN32
return _tfopen(file.c_str(), mode);
diff --git a/src/fs/LookupFile.cxx b/src/fs/LookupFile.cxx
index 9cee68262..e2f4bfaac 100644
--- a/src/fs/LookupFile.cxx
+++ b/src/fs/LookupFile.cxx
@@ -22,8 +22,8 @@
#include "system/Error.hxx"
gcc_pure
-static PathTraitsFS::pointer_type
-FindSlash(PathTraitsFS::pointer_type p, size_t i) noexcept
+static PathTraitsFS::pointer
+FindSlash(PathTraitsFS::pointer p, size_t i) noexcept
{
for (; i > 0; --i)
if (p[i] == '/')
@@ -38,7 +38,7 @@ LookupFile(Path pathname)
PathTraitsFS::string buffer(pathname.c_str());
size_t idx = buffer.size();
- PathTraitsFS::pointer_type slash = nullptr;
+ PathTraitsFS::pointer slash = nullptr;
while (true) {
try {
diff --git a/src/fs/NarrowPath.hxx b/src/fs/NarrowPath.hxx
index b8cca2d45..053a1068f 100644
--- a/src/fs/NarrowPath.hxx
+++ b/src/fs/NarrowPath.hxx
@@ -41,7 +41,7 @@ class NarrowPath {
#else
typedef StringPointer<> Value;
#endif
- typedef typename Value::const_pointer_type const_pointer_type;
+ typedef typename Value::const_pointer const_pointer;
Value value;
@@ -57,11 +57,11 @@ public:
explicit NarrowPath(Path _path):value(_path.c_str()) {}
#endif
- operator const_pointer_type() const {
+ operator const_pointer() const {
return c_str();
}
- const_pointer_type c_str() const {
+ const_pointer c_str() const {
return value.c_str();
}
};
diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx
index 1b332ec3a..d053bc773 100644
--- a/src/fs/Path.cxx
+++ b/src/fs/Path.cxx
@@ -36,7 +36,7 @@ Path::ToUTF8Throw() const
return ::PathToUTF8(c_str());
}
-Path::const_pointer_type
+Path::const_pointer
Path::GetSuffix() const noexcept
{
const auto base = GetBase().c_str();
diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx
index 63a2d04c7..d236c52a2 100644
--- a/src/fs/Path.hxx
+++ b/src/fs/Path.hxx
@@ -39,7 +39,7 @@ class Path : public PathTraitsFS::Pointer {
using Traits = PathTraitsFS;
typedef Traits::Pointer Base;
- constexpr Path(const_pointer_type _value) noexcept:Base(_value) {}
+ constexpr Path(const_pointer _value) noexcept:Base(_value) {}
public:
/**
@@ -59,7 +59,7 @@ public:
* Create a new instance pointing to the specified path
* string.
*/
- static constexpr Path FromFS(const_pointer_type fs) noexcept {
+ static constexpr Path FromFS(const_pointer fs) noexcept {
return Path(fs);
}
@@ -101,7 +101,7 @@ public:
* pointer is invalidated whenever the value of life of this
* instance ends.
*/
- constexpr const_pointer_type c_str() const noexcept {
+ constexpr const_pointer c_str() const noexcept {
return Base::c_str();
}
@@ -109,7 +109,7 @@ public:
* Returns a pointer to the raw value, not necessarily
* null-terminated.
*/
- constexpr const_pointer_type data() const noexcept {
+ constexpr const_pointer data() const noexcept {
return c_str();
}
@@ -159,7 +159,7 @@ public:
* nullptr on mismatch.
*/
gcc_pure
- const_pointer_type Relative(Path other_fs) const noexcept {
+ const_pointer Relative(Path other_fs) const noexcept {
return Traits::Relative(c_str(), other_fs.c_str());
}
@@ -169,7 +169,7 @@ public:
}
gcc_pure
- const_pointer_type GetSuffix() const noexcept;
+ const_pointer GetSuffix() const noexcept;
};
/**
diff --git a/src/fs/StandardDirectory.cxx b/src/fs/StandardDirectory.cxx
index f3db5c01f..0037daab1 100644
--- a/src/fs/StandardDirectory.cxx
+++ b/src/fs/StandardDirectory.cxx
@@ -87,20 +87,20 @@ public:
#ifndef ANDROID
static inline bool
-IsValidPathString(PathTraitsFS::const_pointer_type path)
+IsValidPathString(PathTraitsFS::const_pointer path)
{
return path != nullptr && *path != '\0';
}
static inline bool
-IsValidDir(PathTraitsFS::const_pointer_type dir)
+IsValidDir(PathTraitsFS::const_pointer dir)
{
return PathTraitsFS::IsAbsolute(dir) &&
DirectoryExists(Path::FromFS(dir));
}
static inline AllocatedPath
-SafePathFromFS(PathTraitsFS::const_pointer_type dir)
+SafePathFromFS(PathTraitsFS::const_pointer dir)
{
if (IsValidPathString(dir) && IsValidDir(dir))
return AllocatedPath::FromFS(dir);
diff --git a/src/fs/Traits.cxx b/src/fs/Traits.cxx
index 0e4a6c3c3..4d8450986 100644
--- a/src/fs/Traits.cxx
+++ b/src/fs/Traits.cxx
@@ -24,8 +24,8 @@
template<typename Traits>
typename Traits::string
-BuildPathImpl(typename Traits::const_pointer_type a, size_t a_size,
- typename Traits::const_pointer_type b, size_t b_size) noexcept
+BuildPathImpl(typename Traits::const_pointer a, size_t a_size,
+ typename Traits::const_pointer b, size_t b_size) noexcept
{
assert(a != nullptr);
assert(b != nullptr);
@@ -52,15 +52,15 @@ BuildPathImpl(typename Traits::const_pointer_type a, size_t a_size,
}
template<typename Traits>
-typename Traits::const_pointer_type
-GetBasePathImpl(typename Traits::const_pointer_type p) noexcept
+typename Traits::const_pointer
+GetBasePathImpl(typename Traits::const_pointer p) noexcept
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(p != nullptr);
#endif
- typename Traits::const_pointer_type sep = Traits::FindLastSeparator(p);
+ typename Traits::const_pointer sep = Traits::FindLastSeparator(p);
return sep != nullptr
? sep + 1
: p;
@@ -68,14 +68,14 @@ GetBasePathImpl(typename Traits::const_pointer_type p) noexcept
template<typename Traits>
typename Traits::string
-GetParentPathImpl(typename Traits::const_pointer_type p) noexcept
+GetParentPathImpl(typename Traits::const_pointer p) noexcept
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(p != nullptr);
#endif
- typename Traits::const_pointer_type sep = Traits::FindLastSeparator(p);
+ typename Traits::const_pointer sep = Traits::FindLastSeparator(p);
if (sep == nullptr)
return typename Traits::string(Traits::CURRENT_DIRECTORY);
if (sep == p)
@@ -88,9 +88,9 @@ GetParentPathImpl(typename Traits::const_pointer_type p) noexcept
}
template<typename Traits>
-typename Traits::const_pointer_type
-RelativePathImpl(typename Traits::const_pointer_type base,
- typename Traits::const_pointer_type other) noexcept
+typename Traits::const_pointer
+RelativePathImpl(typename Traits::const_pointer base,
+ typename Traits::const_pointer other) noexcept
{
assert(base != nullptr);
assert(other != nullptr);
@@ -122,32 +122,32 @@ RelativePathImpl(typename Traits::const_pointer_type base,
}
PathTraitsFS::string
-PathTraitsFS::Build(const_pointer_type a, size_t a_size,
- const_pointer_type b, size_t b_size) noexcept
+PathTraitsFS::Build(const_pointer a, size_t a_size,
+ const_pointer b, size_t b_size) noexcept
{
return BuildPathImpl<PathTraitsFS>(a, a_size, b, b_size);
}
-PathTraitsFS::const_pointer_type
-PathTraitsFS::GetBase(PathTraitsFS::const_pointer_type p) noexcept
+PathTraitsFS::const_pointer
+PathTraitsFS::GetBase(PathTraitsFS::const_pointer p) noexcept
{
return GetBasePathImpl<PathTraitsFS>(p);
}
PathTraitsFS::string
-PathTraitsFS::GetParent(PathTraitsFS::const_pointer_type p) noexcept
+PathTraitsFS::GetParent(PathTraitsFS::const_pointer p) noexcept
{
return GetParentPathImpl<PathTraitsFS>(p);
}
-PathTraitsFS::const_pointer_type
-PathTraitsFS::Relative(const_pointer_type base, const_pointer_type other) noexcept
+PathTraitsFS::const_pointer
+PathTraitsFS::Relative(const_pointer base, const_pointer other) noexcept
{
return RelativePathImpl<PathTraitsFS>(base, other);
}
PathTraitsFS::string
-PathTraitsFS::Apply(const_pointer_type base, const_pointer_type path) noexcept
+PathTraitsFS::Apply(const_pointer base, const_pointer path) noexcept
{
// TODO: support the Windows syntax (absolute path with or without drive, drive with relative path)
@@ -161,27 +161,27 @@ PathTraitsFS::Apply(const_pointer_type base, const_pointer_type path) noexcept
}
PathTraitsUTF8::string
-PathTraitsUTF8::Build(const_pointer_type a, size_t a_size,
- const_pointer_type b, size_t b_size) noexcept
+PathTraitsUTF8::Build(const_pointer a, size_t a_size,
+ const_pointer b, size_t b_size) noexcept
{
return BuildPathImpl<PathTraitsUTF8>(a, a_size, b, b_size);
}
-PathTraitsUTF8::const_pointer_type
-PathTraitsUTF8::GetBase(const_pointer_type p) noexcept
+PathTraitsUTF8::const_pointer
+PathTraitsUTF8::GetBase(const_pointer p) noexcept
{
return GetBasePathImpl<PathTraitsUTF8>(p);
}
PathTraitsUTF8::string
-PathTraitsUTF8::GetParent(const_pointer_type p) noexcept
+PathTraitsUTF8::GetParent(const_pointer p) noexcept
{
return GetParentPathImpl<PathTraitsUTF8>(p);
}
-PathTraitsUTF8::const_pointer_type
-PathTraitsUTF8::Relative(const_pointer_type base,
- const_pointer_type other) noexcept
+PathTraitsUTF8::const_pointer
+PathTraitsUTF8::Relative(const_pointer base,
+ const_pointer other) noexcept
{
return RelativePathImpl<PathTraitsUTF8>(base, other);
}
diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx
index 7fd296298..949053a52 100644
--- a/src/fs/Traits.hxx
+++ b/src/fs/Traits.hxx
@@ -51,8 +51,8 @@ struct PathTraitsFS {
typedef string::traits_type char_traits;
typedef char_traits::char_type value_type;
typedef StringPointer<value_type> Pointer;
- typedef Pointer::pointer_type pointer_type;
- typedef Pointer::const_pointer_type const_pointer_type;
+ typedef Pointer::pointer pointer;
+ typedef Pointer::const_pointer const_pointer;
#ifdef _WIN32
static constexpr value_type SEPARATOR = '\\';
@@ -60,7 +60,7 @@ struct PathTraitsFS {
static constexpr value_type SEPARATOR = '/';
#endif
- static constexpr const_pointer_type CURRENT_DIRECTORY = PATH_LITERAL(".");
+ static constexpr const_pointer CURRENT_DIRECTORY = PATH_LITERAL(".");
static constexpr bool IsSeparator(value_type ch) noexcept {
return
@@ -71,14 +71,14 @@ struct PathTraitsFS {
}
gcc_pure gcc_nonnull_all
- static const_pointer_type FindLastSeparator(const_pointer_type p) noexcept {
+ static const_pointer FindLastSeparator(const_pointer p) noexcept {
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(p != nullptr);
#endif
#ifdef _WIN32
- const_pointer_type pos = p + GetLength(p);
+ const_pointer pos = p + GetLength(p);
while (p != pos && !IsSeparator(*pos))
--pos;
return IsSeparator(*pos) ? pos : nullptr;
@@ -89,13 +89,13 @@ struct PathTraitsFS {
#ifdef _WIN32
gcc_pure gcc_nonnull_all
- static constexpr bool IsDrive(const_pointer_type p) noexcept {
+ static constexpr bool IsDrive(const_pointer p) noexcept {
return IsAlphaASCII(p[0]) && p[1] == ':';
}
#endif
gcc_pure gcc_nonnull_all
- static bool IsAbsolute(const_pointer_type p) noexcept {
+ static bool IsAbsolute(const_pointer p) noexcept {
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(p != nullptr);
@@ -109,12 +109,12 @@ struct PathTraitsFS {
}
gcc_pure gcc_nonnull_all
- static size_t GetLength(const_pointer_type p) noexcept {
+ static size_t GetLength(const_pointer p) noexcept {
return StringLength(p);
}
gcc_pure gcc_nonnull_all
- static const_pointer_type Find(const_pointer_type p, value_type ch) noexcept {
+ static const_pointer Find(const_pointer p, value_type ch) noexcept {
return StringFind(p, ch);
}
@@ -123,7 +123,7 @@ struct PathTraitsFS {
* The return value points inside the given string.
*/
gcc_pure gcc_nonnull_all
- static const_pointer_type GetBase(const_pointer_type p) noexcept;
+ static const_pointer GetBase(const_pointer p) noexcept;
/**
* Determine the "parent" file name of the given native path.
@@ -131,7 +131,7 @@ struct PathTraitsFS {
* separator in the given input string.
*/
gcc_pure gcc_nonnull_all
- static string GetParent(const_pointer_type p) noexcept;
+ static string GetParent(const_pointer p) noexcept;
/**
* Determine the relative part of the given path to this
@@ -140,8 +140,8 @@ struct PathTraitsFS {
* nullptr on mismatch.
*/
gcc_pure gcc_nonnull_all
- static const_pointer_type Relative(const_pointer_type base,
- const_pointer_type other) noexcept;
+ static const_pointer Relative(const_pointer base,
+ const_pointer other) noexcept;
/**
* Constructs the path from the given components.
@@ -150,11 +150,11 @@ struct PathTraitsFS {
* If both components are empty strings, empty string is returned.
*/
gcc_pure gcc_nonnull_all
- static string Build(const_pointer_type a, size_t a_size,
- const_pointer_type b, size_t b_size) noexcept;
+ static string Build(const_pointer a, size_t a_size,
+ const_pointer b, size_t b_size) noexcept;
gcc_pure gcc_nonnull_all
- static string Build(const_pointer_type a, const_pointer_type b) noexcept {
+ static string Build(const_pointer a, const_pointer b) noexcept {
return Build(a, GetLength(a), b, GetLength(b));
}
@@ -163,8 +163,8 @@ struct PathTraitsFS {
* base, and return the concatenated path.
*/
gcc_pure
- static string Apply(const_pointer_type base,
- const_pointer_type path) noexcept;
+ static string Apply(const_pointer base,
+ const_pointer path) noexcept;
};
/**
@@ -174,19 +174,19 @@ struct PathTraitsUTF8 {
typedef std::string string;
typedef string::traits_type char_traits;
typedef char_traits::char_type value_type;
- typedef value_type *pointer_type;
- typedef const value_type *const_pointer_type;
+ typedef value_type *pointer;
+ typedef const value_type *const_pointer;
static constexpr value_type SEPARATOR = '/';
- static constexpr const_pointer_type CURRENT_DIRECTORY = ".";
+ static constexpr const_pointer CURRENT_DIRECTORY = ".";
static constexpr bool IsSeparator(value_type ch) {
return ch == SEPARATOR;
}
gcc_pure gcc_nonnull_all
- static const_pointer_type FindLastSeparator(const_pointer_type p) noexcept {
+ static const_pointer FindLastSeparator(const_pointer p) noexcept {
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(p != nullptr);
@@ -197,13 +197,13 @@ struct PathTraitsUTF8 {
#ifdef _WIN32
gcc_pure gcc_nonnull_all
- static constexpr bool IsDrive(const_pointer_type p) noexcept {
+ static constexpr bool IsDrive(const_pointer p) noexcept {
return IsAlphaASCII(p[0]) && p[1] == ':';
}
#endif
gcc_pure gcc_nonnull_all
- static bool IsAbsolute(const_pointer_type p) noexcept {
+ static bool IsAbsolute(const_pointer p) noexcept {
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert(p != nullptr);
@@ -217,12 +217,12 @@ struct PathTraitsUTF8 {
}
gcc_pure gcc_nonnull_all
- static size_t GetLength(const_pointer_type p) noexcept {
+ static size_t GetLength(const_pointer p) noexcept {
return StringLength(p);
}
gcc_pure gcc_nonnull_all
- static const_pointer_type Find(const_pointer_type p, value_type ch) noexcept {
+ static const_pointer Find(const_pointer p, value_type ch) noexcept {
return StringFind(p, ch);
}
@@ -231,7 +231,7 @@ struct PathTraitsUTF8 {
* The return value points inside the given string.
*/
gcc_pure gcc_nonnull_all
- static const_pointer_type GetBase(const_pointer_type p) noexcept;
+ static const_pointer GetBase(const_pointer p) noexcept;
/**
* Determine the "parent" file name of the given UTF-8 path.
@@ -239,7 +239,7 @@ struct PathTraitsUTF8 {
* separator in the given input string.
*/
gcc_pure gcc_nonnull_all
- static string GetParent(const_pointer_type p) noexcept;
+ static string GetParent(const_pointer p) noexcept;
/**
* Determine the relative part of the given path to this
@@ -248,8 +248,8 @@ struct PathTraitsUTF8 {
* nullptr on mismatch.
*/
gcc_pure gcc_nonnull_all
- static const_pointer_type Relative(const_pointer_type base,
- const_pointer_type other) noexcept;
+ static const_pointer Relative(const_pointer base,
+ const_pointer other) noexcept;
/**
* Constructs the path from the given components.
@@ -258,11 +258,11 @@ struct PathTraitsUTF8 {
* If both components are empty strings, empty string is returned.
*/
gcc_pure gcc_nonnull_all
- static string Build(const_pointer_type a, size_t a_size,
- const_pointer_type b, size_t b_size) noexcept;
+ static string Build(const_pointer a, size_t a_size,
+ const_pointer b, size_t b_size) noexcept;
gcc_pure gcc_nonnull_all
- static string Build(const_pointer_type a, const_pointer_type b) noexcept {
+ static string Build(const_pointer a, const_pointer b) noexcept {
return Build(a, GetLength(a), b, GetLength(b));
}
};