CUTB
|
An object of this class analyzes a path string and gives information about its parent path, stem, and extension. More...
Public Member Functions | |
FilePath (const char *const path) | |
Constructs a new file path object from the parameter. More... | |
size_t | parent_size () const |
Returns the parent path size. More... | |
size_t | stem_size () const |
Returns the stem size. More... | |
size_t | extension_size () const |
Returns the extension size. More... | |
size_t | filename_size () const |
Returns the filename size, which is stem size plus extension size. More... | |
const char * | parent_ptr () const |
Returns a pointer to a string of the parent path. More... | |
const char * | stem_ptr () const |
Returns a pointer to a string of the stem. More... | |
const char * | extension_ptr () const |
Returns a pointer to a string of the extension. More... | |
const char * | filename_ptr () const |
Returns a pointer to a string of the filename, which is stem plus extension. More... | |
An object of this class analyzes a path string and gives information about its parent path, stem, and extension.
This class does a rough analysis, using the last slash and the last dot in the path string.
In this class,
For example, "../foo/bar.baz" is split into the parent path of "../foo/", the stem of "bar", and the extension of ".baz".
This analysis does not work correctly for special paths such as dot (".") or dot-dot ("..").
|
inline |
Constructs a new file path object from the parameter.
path | a null-terminated string of a file path |
|
inline |
Returns a pointer to a string of the extension.
If there is no extension, NULL is returned.
|
inline |
Returns the extension size.
If there is no extension, zero is returned.
|
inline |
Returns a pointer to a string of the filename, which is stem plus extension.
If there is neither stem nor extension, NULL is returned.
|
inline |
Returns the filename size, which is stem size plus extension size.
If there is neither stem nor extension, zero is returned.
|
inline |
Returns a pointer to a string of the parent path.
If there is no parent path, NULL is returned.
|
inline |
Returns the parent path size.
If there is no parent path, zero is returned.
|
inline |
Returns a pointer to a string of the stem.
If there is no stem, NULL is returned.
|
inline |
Returns the stem size.
If there is no stem, zero is returned.