TGUI
0.8.9
|
Object to represent paths on a filesystem. More...
#include <TGUI/Filesystem.hpp>
Public Member Functions | |
Path ()=default | |
Default constructor that creates an empty path object. | |
Path (const String &path) | |
Default constructor that creates an empty path object. More... | |
bool | isEmpty () const |
Check if this object is empty. More... | |
String | asString () const |
Returns the path as a string. More... | |
Path | getParentPath () const |
Returns to path to the parent directory. More... | |
std::string | asNativeString () const |
Returns the path as a string, but with a string type and contents that depends on the OS. More... | |
Path | operator/ (const Path &path) const |
Returns a new path that consists of this object joined with another path. More... | |
Path | operator/ (const String &path) const |
Returns a new path that consists of this object joined with another path. More... | |
Path & | operator/= (const Path &path) |
Joins this object with another path. More... | |
Path & | operator/= (const String &path) |
Joins this object with another path. More... | |
Object to represent paths on a filesystem.
tgui::Filesystem::Path::Path | ( | const String & | path | ) |
Default constructor that creates an empty path object.
path | The path to be parsed and stored in this object |
std::string tgui::Filesystem::Path::asNativeString | ( | ) | const |
Returns the path as a string, but with a string type and contents that depends on the OS.
An std::wstring is returned on Windows with backslashes as separator. On other platforms, a UTF-8 encoded std::string is returned with slashes as separator.
String tgui::Filesystem::Path::asString | ( | ) | const |
Returns the path as a string.
Slashes are always used as separator on any OS so that relative paths are portable.
Path tgui::Filesystem::Path::getParentPath | ( | ) | const |
Returns to path to the parent directory.
If the path has a filename then the parent directory is the directory containing that file.
bool tgui::Filesystem::Path::isEmpty | ( | ) | const |
Check if this object is empty.
Returns a new path that consists of this object joined with another path.
path | The path to join to this one |
Returns a new path that consists of this object joined with another path.
path | The path to join to this one |
Joins this object with another path.
path | The path to join to this one |
Joins this object with another path.
path | The path to join to this one |