![]() |
Murl Engine API
Version 2018.3
|
String manipulation and test functions. More...
Enumerations | |
enum | Murl::Util::MatchOptions { Murl::Util::MATCH_DEFAULT, Murl::Util::MATCH_NOESCAPE, Murl::Util::MATCH_PATHNAME, Murl::Util::MATCH_PERIOD, Murl::Util::MATCH_CASEFOLD, Murl::Util::MATCH_LEADING_DIR } |
Match option flags, can be combined using bitwise OR. More... | |
Functions | |
String | Murl::Util::GetFilePath (const String &filePathAndName) |
Get the file path substring of a file path and name. More... | |
String | Murl::Util::GetFileName (const String &filePathAndName) |
Get the file name substring of a file path and name. More... | |
String | Murl::Util::GetFileExtension (const String &fileName) |
Get the file extension substring of a file name. More... | |
String | Murl::Util::StripExtension (const String &fileName) |
Strip the file extension from a file name. More... | |
String | Murl::Util::StripPathAndExtension (const String &filePathAndName) |
Strip the file path and extension from a file path and name. More... | |
String | Murl::Util::JoinPaths (const String &leftPath, const String &rightPath) |
Join two path strings. More... | |
String | Murl::Util::GetUnixPath (const String &windowsPath) |
Exchange all '\' with '/' characters. More... | |
String | Murl::Util::GetWindowsPath (const String &unixPath) |
Exchange all '/' with '\' characters. More... | |
String | Murl::Util::GetNormalizedPath (const String &path) |
Get a normalized path. More... | |
String | Murl::Util::GetRelativePath (const String &absolutePath, const String &absoluteBasePath) |
Get a relative path from an absolute one. More... | |
String | Murl::Util::GetAbsolutePath (const String &relativePath, const String &absoluteBasePath) |
Get an absolute path from a relative one. More... | |
Bool | Murl::Util::HasMatchPattern (const String &name, UInt32 matchOption=MATCH_DEFAULT) |
Check if a name contains pattern matching statements. More... | |
Bool | Murl::Util::IsNameMatching (const String &pattern, const String &name, UInt32 matchOptions=MATCH_DEFAULT) |
Check if a name matches a specified pattern. More... | |
String manipulation and test functions.
Match option flags, can be combined using bitwise OR.
Get the file path substring of a file path and name.
Returns the substring before the last '/' character.
filePathAndName | The file path and name. |
Get the file name substring of a file path and name.
Returns the substring behind the last '/' character.
filePathAndName | The file path and name. |
Get the file extension substring of a file name.
Returns the substring behind the last '.' character.
fileName | The file name. |
Strip the file extension from a file name.
Returns the substring before the last '.' character.
fileName | The file name. |
Strip the file path and extension from a file path and name.
Returns the substring from the last '/' to the last '.' character.
filePathAndName | The file path and name. |
Join two path strings.
Ensures exactly one '/' character between the left and the right part.
leftPath | The left path string. |
rightPath | The right path string. |
Exchange all '\' with '/' characters.
windowsPath | The path string to convert. |
Exchange all '/' with '\' characters.
unixPath | The path string to convert. |
Get a normalized path.
Returns the given path, with all occurrences of "." removed, and any occurrences of ".." revursively joined with the previous sub-path.
path | The path to normalize. |
Get a relative path from an absolute one.
When the relative path cannot be resolved, the given absolute path is returned. This may happen e.g. when both given paths are located on different volumes.
absolutePath | The absolute path to convert. |
absoluteBasePath | The absolute base path relative to which the path is converted. |
Get an absolute path from a relative one.
When the given relative path is actually representing an absolute location (i.e. starting with "/"), it is directly returned. Otherwise, the base path and relative path are concatenated and normalized.
relativePath | The relative path to convert. |
absoluteBasePath | The absolute base path relative to which the path is converted. |
Bool Murl::Util::HasMatchPattern | ( | const String & | name, |
UInt32 | matchOption = MATCH_DEFAULT |
||
) |
Check if a name contains pattern matching statements.
Pattern matching is supported by IsNameMatching().
name | The name string to check. |
matchOption | The option for checking, either MATCH_DEFAULT or MATCH_NOESCAPE. |
Bool Murl::Util::IsNameMatching | ( | const String & | pattern, |
const String & | name, | ||
UInt32 | matchOptions = MATCH_DEFAULT |
||
) |
Check if a name matches a specified pattern.
Matches patterns according to the Unix-like globbing rules * ? [0-z]
. See HasMatchPattern() to check a name for patterns.
pattern | The pattern string. |
name | The name string to check. |
matchOptions | The options for checking, any MatchOptions can be combined using bitwise OR. |