MPD
0.20.18
|
A path name in the native file system character set. More...
#include <AllocatedPath.hxx>
Public Member Functions | |
AllocatedPath (const AllocatedPath &)=default | |
Copy an AllocatedPath object. More... | |
AllocatedPath (AllocatedPath &&other) | |
Move an AllocatedPath object. More... | |
AllocatedPath (Path other) | |
~AllocatedPath () | |
gcc_pure | operator Path () const noexcept |
AllocatedPath & | operator= (const AllocatedPath &)=default |
Copy an AllocatedPath object. More... | |
AllocatedPath & | operator= (AllocatedPath &&other) |
Move an AllocatedPath object. More... | |
gcc_pure bool | operator== (const AllocatedPath &other) const noexcept |
gcc_pure bool | operator!= (const AllocatedPath &other) const noexcept |
string && | Steal () |
Allows the caller to "steal" the internal value by providing a rvalue reference to the std::string attribute. More... | |
bool | IsNull () const noexcept |
Check if this is a "nulled" instance. More... | |
void | SetNull () noexcept |
Clear this object's value, make it "nulled". More... | |
gcc_pure size_t | length () const noexcept |
gcc_pure const_pointer_type | c_str () const noexcept |
Returns the value as a const C string. More... | |
gcc_pure const_pointer_type | data () const noexcept |
Returns a pointer to the raw value, not necessarily null-terminated. More... | |
gcc_pure std::string | ToUTF8 () const noexcept |
Convert the path to UTF-8. More... | |
gcc_pure AllocatedPath | GetDirectoryName () const noexcept |
Gets directory name of this path. More... | |
gcc_pure const_pointer_type | Relative (Path other_fs) const noexcept |
Determine the relative part of the given path to this object, not including the directory separator. More... | |
void | ChopSeparators () noexcept |
Chop trailing directory separators. More... | |
gcc_pure bool | IsAbsolute () const noexcept |
Static Public Member Functions | |
static gcc_const AllocatedPath | Null () noexcept |
Return a "nulled" instance. More... | |
gcc_pure static gcc_nonnull_all AllocatedPath | Build (const_pointer_type a, const_pointer_type b) noexcept |
Join two path components with the path separator. More... | |
gcc_pure static gcc_nonnull_all AllocatedPath | Build (Path a, const_pointer_type b) noexcept |
gcc_pure static gcc_nonnull_all AllocatedPath | Build (Path a, Path b) noexcept |
gcc_pure static gcc_nonnull_all AllocatedPath | Build (const_pointer_type a, const AllocatedPath &b) noexcept |
gcc_pure static gcc_nonnull_all AllocatedPath | Build (const AllocatedPath &a, const_pointer_type b) noexcept |
static gcc_pure AllocatedPath | Build (const AllocatedPath &a, const AllocatedPath &b) noexcept |
static gcc_pure AllocatedPath | FromFS (const_pointer_type fs) noexcept |
Convert a C string that is already in the filesystem character set to a Path instance. More... | |
static gcc_pure AllocatedPath | FromFS (const_pointer_type _begin, const_pointer_type _end) noexcept |
static gcc_pure AllocatedPath | FromFS (string &&fs) noexcept |
Convert a C++ string that is already in the filesystem character set to a Path instance. More... | |
gcc_pure static gcc_nonnull_all AllocatedPath | FromUTF8 (const char *path_utf8) noexcept |
Convert a UTF-8 C string to an AllocatedPath instance. More... | |
static gcc_nonnull_all AllocatedPath | FromUTF8Throw (const char *path_utf8) |
Convert a UTF-8 C string to an AllocatedPath instance. More... | |
A path name in the native file system character set.
This class manages the memory chunk where this path string is stored.
Definition at line 38 of file AllocatedPath.hxx.
|
default |
Copy an AllocatedPath object.
|
inline |
Move an AllocatedPath object.
Definition at line 67 of file AllocatedPath.hxx.
|
inlineexplicit |
Definition at line 69 of file AllocatedPath.hxx.
AllocatedPath::~AllocatedPath | ( | ) |
|
inlinestaticnoexcept |
Join two path components with the path separator.
Definition at line 93 of file AllocatedPath.hxx.
|
inlinestaticnoexcept |
Definition at line 100 of file AllocatedPath.hxx.
|
inlinestaticnoexcept |
Definition at line 105 of file AllocatedPath.hxx.
|
inlinestaticnoexcept |
Definition at line 110 of file AllocatedPath.hxx.
|
inlinestaticnoexcept |
Definition at line 117 of file AllocatedPath.hxx.
|
inlinestaticnoexcept |
Definition at line 124 of file AllocatedPath.hxx.
|
inlinenoexcept |
Returns the value as a const C string.
The returned pointer is invalidated whenever the value of life of this instance ends.
Definition at line 231 of file AllocatedPath.hxx.
|
noexcept |
Chop trailing directory separators.
|
inlinenoexcept |
Returns a pointer to the raw value, not necessarily null-terminated.
Definition at line 240 of file AllocatedPath.hxx.
|
inlinestaticnoexcept |
Convert a C string that is already in the filesystem character set to a Path instance.
Definition at line 135 of file AllocatedPath.hxx.
|
inlinestaticnoexcept |
Definition at line 140 of file AllocatedPath.hxx.
|
inlinestaticnoexcept |
Convert a C++ string that is already in the filesystem character set to a Path instance.
Definition at line 150 of file AllocatedPath.hxx.
|
staticnoexcept |
Convert a UTF-8 C string to an AllocatedPath instance.
Returns return a "nulled" instance on error.
|
static |
Convert a UTF-8 C string to an AllocatedPath instance.
Throws a std::runtime_error on error.
|
noexcept |
Gets directory name of this path.
Returns a "nulled" instance on error.
|
inlinenoexcept |
Definition at line 276 of file AllocatedPath.hxx.
|
inlinenoexcept |
Check if this is a "nulled" instance.
A "nulled" instance must not be used.
Definition at line 203 of file AllocatedPath.hxx.
|
inlinenoexcept |
Definition at line 221 of file AllocatedPath.hxx.
|
inlinestaticnoexcept |
Return a "nulled" instance.
Its IsNull() method will return true. Such an object must not be used.
Definition at line 80 of file AllocatedPath.hxx.
Definition at line 85 of file AllocatedPath.hxx.
|
inlinenoexcept |
Definition at line 187 of file AllocatedPath.hxx.
|
default |
Copy an AllocatedPath object.
|
inline |
Move an AllocatedPath object.
Definition at line 176 of file AllocatedPath.hxx.
|
inlinenoexcept |
Definition at line 182 of file AllocatedPath.hxx.
Determine the relative part of the given path to this object, not including the directory separator.
Returns an empty string if the given path equals this object or nullptr on mismatch.
Definition at line 266 of file AllocatedPath.hxx.
|
inlinenoexcept |
Clear this object's value, make it "nulled".
Definition at line 212 of file AllocatedPath.hxx.
|
inline |
Allows the caller to "steal" the internal value by providing a rvalue reference to the std::string attribute.
Definition at line 195 of file AllocatedPath.hxx.
|
noexcept |
Convert the path to UTF-8.
Returns empty string on error or if this instance is "nulled" (IsNull returns true).