fs/{,Allocated}Path: add typedef Traits
This commit is contained in:
+12
-11
@@ -36,10 +36,11 @@
|
||||
* stored.
|
||||
*/
|
||||
class AllocatedPath {
|
||||
typedef PathTraitsFS::string string;
|
||||
typedef PathTraitsFS::value_type value_type;
|
||||
typedef PathTraitsFS::pointer_type pointer_type;
|
||||
typedef PathTraitsFS::const_pointer_type const_pointer_type;
|
||||
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;
|
||||
|
||||
string value;
|
||||
|
||||
@@ -52,7 +53,7 @@ class AllocatedPath {
|
||||
|
||||
static AllocatedPath Build(const_pointer_type a, size_t a_size,
|
||||
const_pointer_type b, size_t b_size) {
|
||||
return AllocatedPath(PathTraitsFS::Build(a, a_size, b, b_size));
|
||||
return AllocatedPath(Traits::Build(a, a_size, b, b_size));
|
||||
}
|
||||
public:
|
||||
/**
|
||||
@@ -88,8 +89,8 @@ public:
|
||||
gcc_pure gcc_nonnull_all
|
||||
static AllocatedPath Build(const_pointer_type a,
|
||||
const_pointer_type b) noexcept {
|
||||
return Build(a, PathTraitsFS::GetLength(a),
|
||||
b, PathTraitsFS::GetLength(b));
|
||||
return Build(a, Traits::GetLength(a),
|
||||
b, Traits::GetLength(b));
|
||||
}
|
||||
|
||||
gcc_pure gcc_nonnull_all
|
||||
@@ -105,7 +106,7 @@ public:
|
||||
gcc_pure gcc_nonnull_all
|
||||
static AllocatedPath Build(const_pointer_type a,
|
||||
const AllocatedPath &b) noexcept {
|
||||
return Build(a, PathTraitsFS::GetLength(a),
|
||||
return Build(a, Traits::GetLength(a),
|
||||
b.value.c_str(), b.value.size());
|
||||
}
|
||||
|
||||
@@ -113,7 +114,7 @@ public:
|
||||
static AllocatedPath Build(const AllocatedPath &a,
|
||||
const_pointer_type b) noexcept {
|
||||
return Build(a.value.c_str(), a.value.size(),
|
||||
b, PathTraitsFS::GetLength(b));
|
||||
b, Traits::GetLength(b));
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
@@ -260,7 +261,7 @@ public:
|
||||
*/
|
||||
gcc_pure
|
||||
const_pointer_type Relative(Path other_fs) const noexcept {
|
||||
return PathTraitsFS::Relative(c_str(), other_fs.c_str());
|
||||
return Traits::Relative(c_str(), other_fs.c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,7 +271,7 @@ public:
|
||||
|
||||
gcc_pure
|
||||
bool IsAbsolute() const noexcept {
|
||||
return PathTraitsFS::IsAbsolute(c_str());
|
||||
return Traits::IsAbsolute(c_str());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user