29 #ifndef Pt_System_Path_h
30 #define Pt_System_Path_h
32 #include <Pt/System/Api.h>
33 #include <Pt/String.h>
68 Path(
const char* s, std::size_t n);
100 {
return assign(s); }
105 {
return assign(s); }
138 {
return append(p); }
145 {
return append(s); }
152 {
return append(s); }
183 {
return concat(p); }
190 {
return concat(s); }
197 {
return concat(s); }
261 const PathImpl* impl()
const
269 std::string _pathData;
330 #endif // Pt_System_Path_h
Path & append(const Path &p)
Appends a path name.
void clear()
Clears the path.
Core module.
Definition: Allocator.h:33
bool empty() const
Returns true if path is empty.
Pt::String extension() const
Returns the file name extension.
Path()
Default constructor.
Path & assign(const Path &p)
Assigns a path name.
bool operator==(const Path &a, const Path &b)
Compares two paths.
Definition: Path.h:303
Path & assign(const char *s)
Assigns an UTF-8 encoded path name.
Path operator/(const Path &a, const Path &b)
Appends a paths to another.
Definition: Path.h:276
Path & assign(const Pt::String &s)
Assigns a path name.
bool operator!=(const Path &a, const Path &b)
Compares two paths.
Definition: Path.h:312
Path(const Path &p)
Copy constructor.
Path & operator/=(const char *s)
Appends an UTF-8 encoded path name.
Definition: Path.h:151
Path & append(const char *s)
Appends an UTF-8 encoded path name.
Pt::String dirName() const
Returns the directory part.
Path & operator+=(const Path &p)
Concatenates a path name.
Definition: Path.h:182
Pt::String fileName() const
Returns the file name without the directroy part.
Path & operator=(const char *s)
Assigns an UTF-8 encoded path name.
Definition: Path.h:104
Path & concat(const Path &p)
Concatenates a path name.
Path(const char *s)
Construct from an UTF-8 encoded path name.
Path & operator/=(const Pt::String &s)
Appends a path name.
Definition: Path.h:144
Path & append(const Pt::String &s)
Appends a path name.
static Pt::String dirsep()
Returns the directory separator string.
Path & concat(const char *s, std::size_t n)
Appends an UTF-8 encoded path name.
Path & operator=(const Path &p)
Assignment operator.
Definition: Path.h:94
Path & append(const char *s, std::size_t n)
Appends an UTF-8 encoded path name.
static Pt::String curdir()
Returns the current directory string.
Path operator/(const Path &a, const Pt::String &b)
Appends a paths to another.
Definition: Path.h:285
Path & operator+=(const Pt::String &s)
Concatenates a path name.
Definition: Path.h:189
bool operator<(const Path &a, const Path &b)
Compares two paths.
Definition: Path.h:321
Represents a path in the file-system.
Definition: Path.h:48
Path & concat(const Pt::String &s)
Concatenates a path name.
Path & operator+=(const char *s)
Concatenates a path name.
Definition: Path.h:196
Path operator/(const Path &a, const char *b)
Appends a paths to another.
Definition: Path.h:294
Path & operator/=(const Path &p)
Appends a path name.
Definition: Path.h:137
Pt::String toString() const
Returns the path name.
Path & assign(const char *s, std::size_t n)
Assigns an UTF-8 encoded path name.
static Pt::String updir()
Returns the parent directory string.
Pt::String baseName() const
Returns the file name without directory and extension.
Unicode capable basic_string.
Definition: Api-String.h:44
int compare(const Path &p) const
Compares two paths (with strcmp semantics).
Path & operator=(const Pt::String &s)
Assigns a path name.
Definition: Path.h:99
Path(const Pt::String &s)
Construct from a path name.
Path(const char *s, std::size_t n)
Construct from an UTF-8 encoded path name.
std::string toLocal() const
Returns the path name in local encoding.
Path & concat(const char *s)
Concatenates a path name.