|
| static std::string | base (const std::string &path) |
| | Returns everything between the right-most slash and the following '.
|
| |
| static std::string | baseExt (const std::string &path) |
| | Returns everything to the right of the last slash (or, on Windows, the last ':')
|
| |
| static std::string | canonicalize (std::string x) |
| | Convert all slashes to '/'.
|
| |
| static std::string | concat (const std::string &a, const std::string &b) |
| | Appends file onto dirname, ensuring a / if needed.
|
| |
| static bool | containsWildcards (const std::string &p) |
| | Returns true if '*' or '?' appear in the filename.
|
| |
| static std::string | expandEnvironmentVariables (const std::string &path) |
| | Replaces $VAR and patterns with the corresponding environment variable.
|
| |
| static std::string | ext (const std::string &path) |
| | Returns everything to the right of the last '.
|
| |
| static bool | isRoot (const std::string &f) |
| | Returns true if f specifies a path that parses as root of the filesystem.
|
| |
| static std::string | makeLegalFilename (const std::string &f, size_t maxLength=100000) |
| | Replaces characters that are illegal in a filename with legal equivalents.
|
| |
| static bool | matches (const std::string &path, const std::string &pattern, bool caseSensitive=true) |
| | Returns true if path matches pattern, with standard filesystem wildcards.
|
| |
| static std::string | parent (const std::string &path) |
| | Returns everything to the left of the right-most slash.
|
| |
| static void | parse (const std::string &filename, std::string &drive, Array< std::string > &path, std::string &base, std::string &ext) |
| | Parses a filename into four useful pieces.
|
| |
| static std::string | removeTrailingSlash (const std::string &f) |
| | Removes the trailing slash unless f is a filesystem root.
|
| |
Parsing of file system paths.
None of these routines touch the disk–they are purely string manipulation.
In "/a/b/base.ext",
-
base = "base"
-
ext = "ext"
-
parentPath = "/a/b"
-
baseExt = "base.ext"
| static bool G3D::FilePath::isRoot |
( |
const std::string & |
f | ) |
|
|
static |
Returns true if f specifies a path that parses as root of the filesystem.
On OS X and other Unix-based operating systems, "/" is the only root. On Windows, drive letters and shares are roots, e.g., "c:\", "\\foo\". Does not check on Windows to see if the root is actually mounted or a legal drive letter–this is a purely string based test.