![]() |
TrinityCore
|
Parsing of file system paths. More...
#include <FileSystem.h>
Static Public Member Functions | |
| static std::string | concat (const std::string &a, const std::string &b) |
| static bool | isRoot (const std::string &f) |
| static std::string | removeTrailingSlash (const std::string &f) |
| static std::string | ext (const std::string &path) |
| static std::string | baseExt (const std::string &path) |
| static std::string | base (const std::string &path) |
| static std::string | parent (const std::string &path) |
| static bool | containsWildcards (const std::string &p) |
| static std::string | canonicalize (std::string x) |
| static std::string | expandEnvironmentVariables (const std::string &path) |
Replaces $VAR and patterns with the corresponding environment variable. Throws std::string if the environment variable is not defined. More... | |
| static void | parse (const std::string &filename, std::string &drive, Array< std::string > &path, std::string &base, std::string &ext) |
| static bool | matches (const std::string &path, const std::string &pattern, bool caseSensitive=true) |
| static std::string | makeLegalFilename (const std::string &f, size_t maxLength=100000) |
Parsing of file system paths.
None of these routines touch the disk–they are purely string manipulation.
In "/a/b/base.ext",
|
static |
Returns everything between the right-most slash and the following '.'
|
static |
Returns everything to the right of the last slash (or, on Windows, the last ':')
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Convert all slashes to '/'
Here is the call graph for this function:
Here is the caller graph for this function:Appends file onto dirname, ensuring a / if needed.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Replaces $VAR and patterns with the corresponding environment variable. Throws std::string if the environment variable is not defined.
Here is the call graph for this function:
Here is the caller graph for this function:
|
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.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
Returns true if path matches pattern, with standard filesystem wildcards.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns everything to the left of the right-most slash
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Parses a filename into four useful pieces.
Examples:
c:\a\b\d.e root = "c:\\" path = "a" "b" base = "d" ext = "e"
/a/b/d.e root = "/" path = "a" "b" base = "d" ext = "e"
/a/b root = "/" path = "a" base = "b" ext = "e"
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Removes the trailing slash unless f is a filesystem root
Here is the call graph for this function:
Here is the caller graph for this function:
1.8.8