#include <Pt/System/Path.h>
Represents a path in the file-system.
Public Member Functions | |
Path () | |
Default constructor. | |
Path (const Path &p) | |
Copy constructor. | |
Path (const Pt::String &s) | |
Construct from a path name. | |
Path (const char *s) | |
Construct from an UTF-8 encoded path name. | |
Path (const char *s, std::size_t n) | |
Construct from an UTF-8 encoded path name. | |
~Path () | |
Destructor. | |
Path & | append (const Path &p) |
Appends a path name. More... | |
Path & | append (const Pt::String &s) |
Appends a path name. More... | |
Path & | append (const char *s) |
Appends an UTF-8 encoded path name. More... | |
Path & | append (const char *s, std::size_t n) |
Appends an UTF-8 encoded path name. More... | |
Path & | assign (const Path &p) |
Assigns a path name. | |
Path & | assign (const Pt::String &s) |
Assigns a path name. | |
Path & | assign (const char *s) |
Assigns an UTF-8 encoded path name. | |
Path & | assign (const char *s, std::size_t n) |
Assigns an UTF-8 encoded path name. | |
Pt::String | baseName () const |
Returns the file name without directory and extension. | |
void | clear () |
Clears the path. | |
int | compare (const Path &p) const |
Compares two paths (with strcmp semantics). | |
Path & | concat (const Path &p) |
Concatenates a path name. More... | |
Path & | concat (const Pt::String &s) |
Concatenates a path name. More... | |
Path & | concat (const char *s) |
Concatenates a path name. More... | |
Path & | concat (const char *s, std::size_t n) |
Appends an UTF-8 encoded path name. More... | |
Pt::String | dirName () const |
Returns the directory part. | |
bool | empty () const |
Returns true if path is empty. | |
Pt::String | extension () const |
Returns the file name extension. | |
Pt::String | fileName () const |
Returns the file name without the directroy part. | |
Path & | operator+= (const Path &p) |
Concatenates a path name. | |
Path & | operator+= (const Pt::String &s) |
Concatenates a path name. More... | |
Path & | operator+= (const char *s) |
Concatenates a path name. More... | |
Path & | operator/= (const Path &p) |
Appends a path name. More... | |
Path & | operator/= (const Pt::String &s) |
Appends a path name. More... | |
Path & | operator/= (const char *s) |
Appends an UTF-8 encoded path name. More... | |
Path & | operator= (const Path &p) |
Assignment operator. | |
Path & | operator= (const Pt::String &s) |
Assigns a path name. | |
Path & | operator= (const char *s) |
Assigns an UTF-8 encoded path name. | |
std::string | toLocal () const |
Returns the path name in local encoding. | |
Pt::String | toString () const |
Returns the path name. | |
Static Public Member Functions | |
static Pt::String | curdir () |
Returns the current directory string. | |
static Pt::String | dirsep () |
Returns the directory separator string. | |
static Pt::String | updir () |
Returns the parent directory string. | |
Related Functions | |
bool | operator!= (const Path &a, const Path &b) |
Compares two paths. | |
Path | operator/ (const Path &a, const Path &b) |
Appends a paths to another. | |
Path | operator/ (const Path &a, const Pt::String &b) |
Appends a paths to another. | |
Path | operator/ (const Path &a, const char *b) |
Appends a paths to another. | |
bool | operator< (const Path &a, const Path &b) |
Compares two paths. | |
bool | operator== (const Path &a, const Path &b) |
Compares two paths. | |
Path& append | ( | const Pt::String & | s | ) |
A directory separator is added if this path is not empty.
Path& append | ( | const char * | s | ) |
A directory separator is added if this path is not empty.
Path& append | ( | const char * | s, |
std::size_t | n | ||
) |
A directory separator is added if this path is not empty.
Path& operator/= | ( | const Pt::String & | s | ) |
A directory separator is added if this path is not empty.
Path& operator/= | ( | const char * | s | ) |
A directory separator is added if this path is not empty.
Path& concat | ( | const Pt::String & | s | ) |
The two paths are directly joined and no separator is added.
Path& concat | ( | const char * | s | ) |
The two paths are directly joined and no separator is added.
Path& concat | ( | const char * | s, |
std::size_t | n | ||
) |
The two paths are directly joined and no separator is added.
Path& operator+= | ( | const Pt::String & | s | ) |
The two paths are directly joined and no separator is added.
Path& operator+= | ( | const char * | s | ) |
The two paths are directly joined and no separator is added.