Simple value type wrapping std::filesystem::path. More...
#include <filepath.h>
Public Member Functions | |
| FilePath ()=default | |
| Constructs an empty file path. | |
| FilePath (const String &path) | |
| Constructs a FilePath from a String. | |
| FilePath (const char *path) | |
| Constructs a FilePath from a C string. | |
| FilePath (const std::filesystem::path &path) | |
| Constructs a FilePath from a std::filesystem::path. | |
| bool | isEmpty () const |
| Returns true if the path is empty. | |
| String | fileName () const |
| Returns the filename component (including extension). | |
| String | baseName () const |
| Returns the filename without its extension. | |
| String | suffix () const |
| Returns the file extension without the leading dot. | |
| String | completeSuffix () const |
| Returns the complete suffix (all extensions). | |
| FilePath | parent () const |
| Returns the parent directory as a FilePath. | |
| FilePath | join (const FilePath &other) const |
| Joins this path with another path component. | |
| FilePath | operator/ (const FilePath &other) const |
| Joins this path with another path component. | |
| FilePath | operator/ (const String &other) const |
| Joins this path with a string path component. | |
| FilePath | operator/ (const char *other) const |
| Joins this path with a C string path component. | |
| bool | exists () const |
| Returns true if the path exists on the filesystem. | |
| bool | isAbsolute () const |
| Returns true if the path is absolute. | |
| bool | isRelative () const |
| Returns true if the path is relative. | |
| FilePath | absolutePath () const |
| Returns the absolute form of this path. | |
| String | toString () const |
| Converts the path to a String. | |
| const std::filesystem::path & | toStdPath () const |
| Returns the underlying std::filesystem::path. | |
| bool | operator== (const FilePath &other) const |
| Equality comparison. | |
| bool | operator!= (const FilePath &other) const |
| Inequality comparison. | |
| bool | operator< (const FilePath &other) const |
| Less-than comparison for ordered containers. | |
Simple value type wrapping std::filesystem::path.
Provides a convenient interface for path decomposition, joining, and filesystem queries. This is a simple data object — always copied by value, no shared ownership.
This class is not thread-safe. Concurrent access to a single instance requires external synchronization.
Constructs a FilePath from a C string.
| path | The path string. |
|
inline |
Constructs a FilePath from a std::filesystem::path.
| path | The filesystem path. |
|
inline |
Returns the absolute form of this path.
|
inline |
Returns the filename without its extension.
|
inline |
Returns the complete suffix (all extensions).
For "archive.tar.gz", returns "tar.gz".
|
inline |
Returns true if the path exists on the filesystem.
|
inline |
Returns the filename component (including extension).
|
inline |
Returns true if the path is absolute.
|
inline |
Returns true if the path is empty.
|
inline |
Returns true if the path is relative.
Joins this path with another path component.
| other | The path component to append. |
Joins this path with a C string path component.
| other | The path component to append. |
Joins this path with another path component.
| other | The path component to append. |
Joins this path with a string path component.
| other | The path component to append. |
|
inline |
Returns the parent directory as a FilePath.
|
inline |
Returns the file extension without the leading dot.
|
inline |
Returns the underlying std::filesystem::path.
|
inline |