|
| static bool | IsPathSeparator (xiiUInt32 c) |
| | Returns whether c is any known path separator.
|
| static bool | IsValidFilenameChar (xiiUInt32 uiCharacter) |
| | Checks if a given character is allowed in a filename (not path!).
|
| static bool | ContainsInvalidFilenameChars (xiiStringView sPath) |
| static const char * | FindPreviousSeparator (const char *szPathStart, const char *szStartSearchAt) |
| | Copyright (c) Theophilus Eriata. All Rights Reserved.
|
|
static bool | HasAnyExtension (xiiStringView sPath) |
| | Checks whether the given path has any file extension.
|
| static bool | HasExtension (xiiStringView sPath, xiiStringView sExtension) |
| static xiiStringView | GetFileExtension (xiiStringView sPath, bool bFullExtension=false) |
| static xiiStringView | GetFileName (xiiStringView sPath, bool bRemoveFullExtension=false) |
|
static xiiStringView | GetWithoutExtension (xiiStringView sPath, bool bRemoveFullExtension=false) |
| | Returns the path, excluding the file extension.
|
| static xiiStringView | GetFileNameAndExtension (xiiStringView sPath) |
| static xiiStringView | GetFileDirectory (xiiStringView sPath) |
|
static bool | IsAbsolutePath (xiiStringView sPath) |
| | Returns true, if the given path represents an absolute path on the current OS.
|
|
static bool | IsRelativePath (xiiStringView sPath) |
| | Returns true, if the given path represents a relative path on the current OS.
|
| static bool | IsRootedPath (xiiStringView sPath) |
| static void | GetRootedPathParts (xiiStringView sPath, xiiStringView &ref_sRoot, xiiStringView &ref_sRelPath) |
|
static xiiStringView | GetRootedPathRootName (xiiStringView sPath) |
| | Special case of GetRootedPathParts that returns the root of the input path and discards the relative path.
|
| static void | MakeValidFilename (xiiStringView sFilename, xiiUInt32 uiReplacementCharacter, xiiStringBuilder &out_sFilename) |
|
static bool | IsSubPath (xiiStringView sPrefixPath, xiiStringView sFullPath) |
| | Checks whether sFullPath starts with sPrefixPath.
|
|
static bool | IsSubPath_NoCase (xiiStringView sPrefixPath, xiiStringView sFullPath) |
| | Checks whether sFullPath starts with sPrefixPath. Case insensitive.
|
Contains Helper functions to work with paths.
Only functions that require read-only access to a string are provided here All functions that require to modify the path are provided by xiiStringBuilder. Many functions return xiiStringView's, which will always be strict sub-strings of their input data. That allows that these functions can work without any additional memory allocations.
Splits the passed path into its root portion and the relative path
":MyRoot\file.txt" -> root = "MyRoot", relPath="file.txt" ":MyRoot\folder\file.txt" -> root = "MyRoot", relPath = "folder\file.txt" ":\MyRoot\folder\file.txt" -> root = "MyRoot", relPath = "folder\file.txt" ":/MyRoot\folder\file.txt" -> root = "MyRoot", relPath = "folder\file.txt" If the path is not rooted, then root will be an empty string and relPath is set to the full input path.
Checks whether the path ends with the given file extension. szExtension may or may not start with a dot. The check is case insensitive.
HasExtension("file.txt", "txt") -> true HasExtension("file.txt", ".txt") -> true HasExtension("file.a.b", ".b") -> true HasExtension("file.a.b", "a.b") -> true HasExtension("file.a.b", ".a.b") -> true HasExtension("file.a.b", "file.a.b") -> false