Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/FPathViews
Description
Calls AncestorVisitor with the given path and its ancestor paths. If AncestorVisitor returns false, iteration stops. If the string begins with a path root as understood by SplitVolumeSpecifier, that will be the last item visited with the modification that a separator following a drive specifier will be included by this function.
Examples: "" -> { "" } "/" -> { "/" } "A/B.C" -> { "A/B.C", "A" } "A/B/C" -> { "A/B/C", "A/B", "A" } "../../A/B/C.D" -> { "../../A/B/C.D", "../../A/B", "../../A", "../..", ".." } "/A/B" -> { "/A/B", "/A", "/" } "/A/B/" -> { "/A/B", "/A", "/" } "C:/A/B" -> { "C:/A/B", "C:/A", "C:/" } "C:A/B" -> { "C:A/B", "C:A", "C:" } "\ShareName/A/B" -> { "\ShareName/A/B", "\ShareName/A", "\ShareName" }
When moving to the next ancestor, extra trailing separators are also removed, e.g. "/A//B" -> { "/A//B", "/A" } Note that separators are not removed except at the end of the current path, as with visiting "/A//B" above.
| Name | IterateAncestors |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/PathViews.h |
| Include Path | #include "Misc/PathViews.h" |
| Source | /Engine/Source/Runtime/Core/Private/Misc/PathViews.cpp |
static void IterateAncestors
(
FStringView InPath,
TFunctionRef < bool> AncestorVisitor
)