ASL
|
This class is a utility to process file system path names.
#include <Path.h>
Public Member Functions | |
Path (const String &p) | |
Constructs a path with a string (turns backslashes into slashes). | |
bool | operator== (const String &s) const |
Tests if this path is equal to the given string (ignoring backslash vs slash). | |
bool | equals (const Path &p) const |
Tests if this path refers to the same as p as absolute paths. | |
String | name () const |
Returns the path file name (without its directory) | |
String | extension () const |
Returns the path extension (what follows the last dot) | |
bool | hasExtension (const String &exts) const |
Returns true if this path's extension is any of those given (separated by '|'), case-insensitively. | |
bool | hasDir () const |
Returns true if this path has a parent directory, not just a file name. | |
Path | directory () const |
Returns the directory containing this path (without a trailing '/') | |
Path | noExt () const |
Returns this path without its extension. | |
String | nameNoExt () const |
Returns this path's file name without its extension. | |
Path | absolute () const |
Returns the absolute path corresponding to this, possibly relative, path. | |
bool | isAbsolute () const |
Returns true if this is an absolute path. | |
bool | hasDirectory () const |
Returns true if this has a parent directory and is not just a name. | |
Path & | removeDDots () |
Removes double dots in a path by stepping up one directory each time. | |
Path | operator+ (const String &s) const |
Concatenates this path with a suffix. | |
Path | operator/ (const String &p) const |
Concatenates this path with another, and removes possible double slashes. | |