|
| Path () |
| Initialize path with an empty value.
|
|
| Path (const char *path) |
| Initialize path with a given C-string value.
|
|
| Path (const std::string &path) |
| Initialize path with a given string value.
|
|
| Path (const wchar_t *path) |
| Initialize path with a given wide C-string value.
|
|
| Path (const std::wstring &path) |
| Initialize path with a given wide string value.
|
|
| Path (const Path &)=default |
|
| Path (Path &&)=default |
|
| ~Path ()=default |
|
Path & | operator= (const Path &)=default |
|
Path & | operator= (Path &&)=default |
|
| operator bool () const noexcept |
| Check if the path is not empty.
|
|
Path & | operator/= (const Path &path) |
|
Path & | operator+= (const Path &path) |
|
const std::string & | string () const noexcept |
| Get the path value as UTF-8 string.
|
|
std::wstring | wstring () const |
| Get the path value as a wide string.
|
|
Path | root () const |
| Decompose root path from the current path.
|
|
Path | relative () const |
| Decompose relative path from the current path.
|
|
Path | parent () const |
| Decompose parent path from the current path.
|
|
Path | filename () const |
| Decompose filename from the current path.
|
|
Path | stem () const |
| Decompose stem from the current path.
|
|
Path | extension () const |
| Decompose extension from the current path.
|
|
Path | absolute () const |
| Transform the current path to the real path on a filesystem.
|
|
Path | canonical () const |
| Transform the current path and replace all '.' and '..' properly.
|
|
Path | validate (char placeholder='_') const |
| Transform the current path and replace all deprecated characters with a given placeholder (default is '_')
|
|
FileType | type () const |
| Get the path file type.
|
|
Flags< FileAttributes > | attributes () const |
| Get the path file attributes.
|
|
Flags< FilePermissions > | permissions () const |
| Get the path file permissions.
|
|
UtcTimestamp | created () const |
| Get the path created UTC timestamp.
|
|
UtcTimestamp | modified () const |
| Get the path modified UTC timestamp.
|
|
size_t | hardlinks () const |
| Get the path count of hardlinks.
|
|
SpaceInfo | space () const |
| Get the path space information.
|
|
bool | empty () const noexcept |
| Is the path empty?
|
|
bool | HasRoot () const |
| Has root path?
|
|
bool | HasRelative () const |
| Has relative path?
|
|
bool | HasParent () const |
| Has parent path?
|
|
bool | HasFilename () const |
| Has filename?
|
|
bool | HasStem () const |
| Has stem?
|
|
bool | HasExtension () const |
| Has extension?
|
|
bool | IsAbsolute () const |
| Is absolute path?
|
|
bool | IsRelative () const |
| Is relative path?
|
|
bool | IsExists () const |
| Is the path exists?
|
|
bool | IsRegularFile () const |
| Is the path points to regular file?
|
|
bool | IsDirectory () const |
| Is the path points to directory?
|
|
bool | IsSymlink () const |
| Is the path points to symbolic link?
|
|
bool | IsOther () const |
| Is the path points to special file (block, character, FIFO, socket)?
|
|
bool | IsEquivalent (const Path &path) const |
| Is the current path is equivalent to the given one (points to the same node on a filesystem)?
|
|
void | Clear () noexcept |
| Clear the path content.
|
|
Path & | Assign (const Path &path) |
| Assign the given path to the current one.
|
|
Path & | Append (const Path &path) |
| Append the given path to the current one.
|
|
Path & | Concat (const Path &path) |
| Concatenate the given path to the current one.
|
|
Path & | MakePreferred () |
| Convert all path separators to system ones ('\' for Windows or '/' for Unix)
|
|
Path & | ReplaceFilename (const Path &filename) |
| Replace the current path filename with a given one.
|
|
Path & | ReplaceExtension (const Path &extension) |
| Replace the current path extension with a given one.
|
|
Path & | RemoveFilename () |
| Remove the current path filename.
|
|
Path & | RemoveExtension () |
| Remove the current path extension.
|
|
Path & | RemoveTrailingSeparators () |
| Remove all trailing separators form the current path.
|
|
void | swap (Path &path) noexcept |
| Swap two instances.
|
|
|
static bool | deprecated (char character) noexcept |
| Is the given character is deprecated by the filesystem?
|
|
static bool | deprecated (wchar_t character) noexcept |
| Is the given wide character is deprecated by the filesystem?
|
|
static std::string | deprecated () |
| Get filesystem deprecated characters ('\', '/', '?', '', '*', ':', '|', '"', '<', '>')
|
|
static char | separator () noexcept |
| Get the system path separator character ('\' for Windows or '/' for Unix)
|
|
static Path | initial () |
| Get the initial path of the process.
|
|
static Path | current () |
| Get the current path of the process.
|
|
static Path | executable () |
| Get the executable path of the process.
|
|
static Path | home () |
| Get the home path of the process.
|
|
static Path | temp () |
| Get the temporary path of the process.
|
|
static Path | unique () |
| Get the unique filename in UUID format "00000000-0000-0000-0000-000000000000".
|
|
static Path | Copy (const Path &src, const Path &dst, bool overwrite=false) |
| Copy the given source path to destination path (file, empty directory, symlink, etc)
|
|
static Path | CopyIf (const Path &src, const Path &dst, const std::string &pattern="", bool overwrite=false) |
| Copy all matched files from the the given source path to destination path (files, directories, symlinks, etc)
|
|
static Path | CopyAll (const Path &src, const Path &dst, bool overwrite=false) |
| Recursively copy the given source path to destination path (files, directories, symlinks, etc)
|
|
static Path | Rename (const Path &src, const Path &dst) |
| Rename the given source path to destination path (file, empty directory, symlink, etc)
|
|
static Path | Remove (const Path &path) |
| Remove the given path (file, empty directory, symlink, etc) from the filesystem.
|
|
static Path | RemoveAll (const Path &path) |
| Recursively remove the given path (file, empty directory, symlink, etc) from the filesystem.
|
|
static Path | RemoveIf (const Path &path, const std::string &pattern="") |
| Recursively remove the given path matched to the given pattern (file, empty directory, symlink, etc) from the filesystem.
|
|
static void | SetAttributes (const Path &path, const Flags< FileAttributes > &attributes) |
| Set file attributes for the given path.
|
|
static void | SetPermissions (const Path &path, const Flags< FilePermissions > &permissions) |
| Set file permissions for the given path.
|
|
static void | SetCreated (const Path &path, const UtcTimestamp ×tamp) |
| Set created UTC timestamp for the given path.
|
|
static void | SetModified (const Path &path, const UtcTimestamp ×tamp) |
| Set modified UTC timestamp for the given path.
|
|
static void | SetCurrent (const Path &path) |
| Set the given path of the process as a current one.
|
|
static void | Touch (const Path &path) |
| Touch the given path and set its modified UTC timestamp to the current value.
|
|
|
Path | operator/ (const Path &path1, const Path &path2) |
|
Path | operator+ (const Path &path1, const Path &path2) |
|
bool | operator== (const Path &path1, const Path &path2) |
|
bool | operator!= (const Path &path1, const Path &path2) |
|
bool | operator< (const Path &path1, const Path &path2) |
|
bool | operator> (const Path &path1, const Path &path2) |
|
bool | operator<= (const Path &path1, const Path &path2) |
|
bool | operator>= (const Path &path1, const Path &path2) |
|
std::istream & | operator>> (std::istream &is, Path &path) |
| Input instance from the given input stream.
|
|
std::ostream & | operator<< (std::ostream &os, const Path &path) |
| Output instance into the given output stream.
|
|
void | swap (Path &path1, Path &path2) noexcept |
|
Filesystem path.
Filesystem path wraps string directory, filename, symlink and other path types in a class and provide utility methods to check type of the path, status and permissions in a file system. Additionally path contains operators and methods for path manipulation (concatenation, canonization, absolute path).
Path is managed in UTF-8 encoding!
Not thread-safe.
Definition at line 89 of file path.h.