Classes |
| struct | Foundry::Katana::Util::Path::FnMatchInfo |
Functions |
| std::string | Foundry::Katana::Util::Path::GetLocationParent (FnPlatform::StringView locationPath) |
| std::string | Foundry::Katana::Util::Path::GetLeafName (FnPlatform::StringView locationPath) |
| void | Foundry::Katana::Util::Path::GetLocationStack (std::vector< std::string > &returnStack, const std::string &locationPath, const std::string &rootPath=std::string()) |
| bool | Foundry::Katana::Util::Path::IsAncestorOrEqual (FnPlatform::StringView locA, FnPlatform::StringView locB) |
| bool | Foundry::Katana::Util::Path::IsAncestor (FnPlatform::StringView locA, FnPlatform::StringView locB) |
| std::string | Foundry::Katana::Util::Path::RelativeToAbsPath (const std::string &rootPath, const std::string &path) |
| std::string | Foundry::Katana::Util::Path::NormalizedRelativePath (const std::string &rootpath, const std::string &path) |
| std::string | Foundry::Katana::Util::Path::RelativePath (const std::string &rootPath, const std::string &path) |
| void | Foundry::Katana::Util::Path::FnMatch (FnMatchInfo &matchInfo, FnPlatform::StringView testpath, FnPlatform::StringView pattern) |
| void | Foundry::Katana::Util::Path::FnMatchIncludingAncestors (FnMatchInfo &matchInfo, FnPlatform::StringView testpath, FnPlatform::StringView pattern) |
| void | Foundry::Katana::Util::Path::ExactMatch (FnMatchInfo &matchInfo, FnPlatform::StringView testpath, FnPlatform::StringView pattern) |
| int | Foundry::Katana::Util::Path::Compare (FnPlatform::StringView pathA, FnPlatform::StringView pathB) |
| | Compares two scene graph location paths.
|
Detailed Description
All of these functions (which take as input an absolute scene graph location path) assume a properly normalized scene graph path:
- no trailing slash '/'
- no redundent internal separator (A//B, A/B/, A/./B and A/foo/../B all become A/B.)
Examples of normalized locations:
/root
/root/world/geo
/root/world/taco/a/b
Examples of un-normalised locations:
/root/
/root/world/
/root/world/../a
/root/world/taco
Function Documentation
| int Foundry::Katana::Util::Path::Compare |
( |
FnPlatform::StringView |
pathA, |
|
|
FnPlatform::StringView |
pathB |
|
) |
| |
Compares two scene graph location paths.
Each path component of pathA is compared lexicographically with the corresponding component of pathB. The function assumes normalized, absolute paths (except for superfluous trailing slashes, which are ignored).
- Parameters:
-
| pathA | scene graph location path A |
| pathB | scene graph location path A |
- Returns:
- a negative value if
pathA sorts before pathB, zero if both paths compare equal, and a positive value if pathA sorts after pathB.
| void Foundry::Katana::Util::Path::ExactMatch |
( |
FnMatchInfo & |
matchInfo, |
|
|
FnPlatform::StringView |
testpath, |
|
|
FnPlatform::StringView |
pattern |
|
) |
| |
- Note:
- testpath and pattern should be absolute scene graph paths, normalized in the style of
pystring::normpath_posix
- Parameters:
-
| matchInfo | instance of match info |
| testpath | scene graph path to be tested |
| pattern | pattern to match against. |
| void Foundry::Katana::Util::Path::FnMatch |
( |
FnMatchInfo & |
matchInfo, |
|
|
FnPlatform::StringView |
testpath, |
|
|
FnPlatform::StringView |
pattern |
|
) |
| |
- Note:
testpath and pattern should be absolute scene graph paths, normalized in the style of pystring::normpath_posix
- Parameters:
-
| matchInfo | instance of match info |
| testpath | scene graph path to be tested |
| pattern | pattern to match against. |
| void Foundry::Katana::Util::Path::FnMatchIncludingAncestors |
( |
FnMatchInfo & |
matchInfo, |
|
|
FnPlatform::StringView |
testpath, |
|
|
FnPlatform::StringView |
pattern |
|
) |
| |
- Note:
testpath and pattern should be absolute scene graph paths, normalized in the style of pystring::normpath_posix
- Parameters:
-
| matchInfo | instance of match info |
| testpath | scene graph path to be tested |
| pattern | pattern to match against. |
| std::string Foundry::Katana::Util::Path::GetLeafName |
( |
FnPlatform::StringView |
locationPath | ) |
|
- Returns:
- the leaf for the given input e.g.
| std::string Foundry::Katana::Util::Path::GetLocationParent |
( |
FnPlatform::StringView |
locationPath | ) |
|
- Returns:
- the parent scene graph location path for the given input e.g.
| void Foundry::Katana::Util::Path::GetLocationStack |
( |
std::vector< std::string > & |
returnStack, |
|
|
const std::string & |
locationPath, |
|
|
const std::string & |
rootPath = std::string() |
|
) |
| |
Example:
- Parameters:
-
| returnStack | container that will be populated with the return stack |
| locationPath | the location path to be processed |
| rootPath | an optional 'root' location from which to begin. |
| bool Foundry::Katana::Util::Path::IsAncestor |
( |
FnPlatform::StringView |
locA, |
|
|
FnPlatform::StringView |
locB |
|
) |
| |
Example
- Parameters:
-
| locA | scene graph location A |
| locB | scene graph location B |
- Returns:
- true if location A is an ancestor of location B
| bool Foundry::Katana::Util::Path::IsAncestorOrEqual |
( |
FnPlatform::StringView |
locA, |
|
|
FnPlatform::StringView |
locB |
|
) |
| |
Example:
- Parameters:
-
| locA | scene graph location A |
| locB | scene graph location B |
- Returns:
- true if location A is an ancestor or equal of location B
| std::string Foundry::Katana::Util::Path::NormalizedRelativePath |
( |
const std::string & |
rootpath, |
|
|
const std::string & |
path |
|
) |
| |
Given a rootpath, and either a relative or absolute path, create a normalized relative path.
- Note:
- This function will throw an exception if root is not ancestor or equal to path.
Example:
- Parameters:
-
| rootpath | the root path |
| path | the full path from which to generate the relative path. |
- Returns:
- a normalized relative path
| std::string Foundry::Katana::Util::Path::RelativePath |
( |
const std::string & |
rootPath, |
|
|
const std::string & |
path |
|
) |
| |
Given two absolute paths, create a relative path from rootPath to path even if rootPath is not an ancestor of path).
Example:
RelativePath('/root/world/geo', '/root/world/geo/a') -> 'a'
RelativePath('/root/world/geo/a', '/root/world/geo') -> '..'
RelativePath('/root/world/geo/a', '/root/world/geo/b') -> '../b'
RelativePath('/root/world/geo/a', '/root/world/geo/a') -> ''
RelativePath('/root/world/geo/a', '/root/world/cam/a') -> '../../cam/a'
- Parameters:
-
| rootPath | the root path |
| path | path to generate the relative path to. |
- Returns:
- a relative path from rootPath to path
| std::string Foundry::Katana::Util::Path::RelativeToAbsPath |
( |
const std::string & |
rootPath, |
|
|
const std::string & |
path |
|
) |
| |
Example:
- Parameters:
-
| rootPath | the path from which to generate the new absolute path |
| path | the relative path specifier. |
- Returns:
- a new absolute path given the
rootPath and path.