Files
UnrealEngineUWP/Engine/Source/Editor/UnrealEd/Private/EditorFolderUtils.cpp
roey borsteinas 1cb9a4f91d Moved FolderDragDropOp out of SceneOutliner module
#rb patrick.enfedaque
#jira none

[CL 14190028 by roey borsteinas in ue5-main branch]
2020-08-26 12:46:21 -04:00

31 lines
771 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "EditorFolderUtils.h"
FName FEditorFolderUtils::GetLeafName(const FName& InPath)
{
FString PathString = InPath.ToString();
int32 LeafIndex = 0;
if (PathString.FindLastChar('/', LeafIndex))
{
return FName(*PathString.RightChop(LeafIndex + 1));
}
else
{
return InPath;
}
}
bool FEditorFolderUtils::PathIsChildOf(const FString& PotentialChild, const FString& Parent)
{
const int32 ParentLen = Parent.Len();
return
PotentialChild.Len() > ParentLen&&
PotentialChild[ParentLen] == '/' &&
PotentialChild.Left(ParentLen) == Parent;
}
bool FEditorFolderUtils::PathIsChildOf(const FName& PotentialChild, const FName& Parent)
{
return PathIsChildOf(PotentialChild.ToString(), Parent.ToString());
}