|
ActiveLib
|
Class to represent the path of a node in the local file system. More...
#include <Path.h>


Public Types | |
| using | Unique = std::unique_ptr<Path> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<Path> |
| Unique pointer. | |
Public Member Functions | |
| Path () | |
| Path (const utility::String &path, bool isRelative=false) | |
| Path (const std::filesystem::path &path) | |
| Path (const Path &source) | |
| ~Path () | |
| Path * | clonePtr () const |
| Path & | operator= (const Path &source) |
| bool | operator== (const Path &ref) const |
| bool | operator!= (const Path &ref) const |
| Path | operator/ (const utility::String &toAppend) const |
| Path | operator+ (const utility::String &toAppend) const |
| Path & | operator/= (const utility::String &toAppend) |
| Path & | operator+= (const utility::String &toConcat) |
| operator const std::filesystem::path & () const | |
| operator utility::String () const | |
| bool | empty () const |
| utility::String | getNodeName (bool isExtensionDeleted=false) const |
| utility::String | getExtension () const |
| utility::String | platformSpecific () const |
| Path | rootDirectory () const |
| Path | rootName () const |
| Path | rootPath () const |
| Path | relativePath () const |
| Path | lexicallyNormal () const |
| bool | hasFileName () const |
| Path & | append (const utility::String &toAppend) |
| Path & | concat (const utility::String &toConcat) |
| Path & | removeFileName () |
| Path & | replaceFileName (const utility::String &replacement=utility::String{}) |
| Path & | replaceExtension (const utility::String &replacement=utility::String{}) |
Public Member Functions inherited from active::utility::Cloner | |
| virtual | ~Cloner ()=default |
Static Public Member Functions | |
| static Path | current () |
Static Public Attributes | |
| static const utility::String | delimiter = "/" |
| The path delimiter expression for the current platform. | |
Class to represent the path of a node in the local file system.
| Path::Path | ( | ) |
Constructor

| Path::Path | ( | const utility::String & | path, |
| bool | isRelative = false ) |
Constructor
| path | The path (typically plaform-specific) |
| isRelative | True if the path is relative to the current path |

| Path::Path | ( | const std::filesystem::path & | path | ) |
Constructor
| path | A file system path |
| Path::Path | ( | const Path & | source | ) |
Copy constructor
| source | The object to copy |
|
inline |
Destructor
| Path & Path::append | ( | const utility::String & | toAppend | ) |
Appends a name to the path (with a prefixed directory separator)
| toAppend | The string to append to this path (with a directory separator) |


|
inlinevirtual |
Object cloning
Implements active::utility::Cloner.

| Path & Path::concat | ( | const utility::String & | toConcat | ) |
Concatenates text to the path (without inserting a path separator - also use /=)
| toConcat | The string to concatenate to this path (as a directory node name - also use +=) |


|
static |
Get the current path


|
inline |
Determine if the path is empty
| String Path::getExtension | ( | ) | const |
Get the node name extension, e.g. "xml" (no dot)

| String Path::getNodeName | ( | bool | isExtensionDeleted = false | ) | const |
Get the name of the node (last name in the path)
| isExtensionDeleted | True if the extension should be deleted |

| bool Path::hasFileName | ( | ) | const |
Determine if the path has a file name (if any name remains past the last '/')
|
inline |
Get a lexically normal path from this path (e.g. resolve ../ into the previous directory)
|
inline |
Conversion operator
| active::file::Path::operator utility::String | ( | ) | const |
Conversion operator

|
inline |
Inequality operator
| ref | The object to compare |
| Path Path::operator+ | ( | const utility::String & | toAppend | ) | const |
Addition operator
| toAppend | The string to append to this path (as a file node name) |

|
inline |
Concatenate a name to the path (with a prefixed directory separator)
| toConcat | The string to concatenate to this path (with a directory separator) |

|
inline |
Create a path with a name appended to this path with a directory separator
| toAppend | The string to append to this path (with a directory separator) |

|
inline |
Append a name to the path (with a prefixed directory separator)
| toAppend | The string to append to this path (with a directory separator) |

Assignment operator
| source | The object to copy |
| bool Path::operator== | ( | const Path & | ref | ) | const |
Equality operator
| ref | The object to compare |
| String Path::platformSpecific | ( | ) | const |
Get the path as a platform-specific string

|
inline |
Get a relative path (from the root directory)
| Path & Path::removeFileName | ( | ) |
Remove the filename component of the path (if any name remains past the last '/')

| Path & Path::replaceExtension | ( | const utility::String & | replacement = utility::String{} | ) |
Replace the file name extension
| replacement | The new extension (an emply string simply removes the extension) |

| Path & Path::replaceFileName | ( | const utility::String & | replacement = utility::String{} | ) |
Replace the file name
| replacement | The new name (an emply string simply removes the name) |


|
inline |
Get the path root directory
|
inline |
Get the path root name
|
inline |
Get the path root directory