MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetNamePath

Method GetNamePath

Source/Engine/Level/SceneObject.cpp:62–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62String SceneObject::GetNamePath(Char separatorChar) const
63{
64 Array<StringView, InlinedAllocation<8>> names;
65 const Actor* a = dynamic_cast<const Actor*>(this);
66 if (!a)
67 a = GetParent();
68 while (a)
69 {
70 names.Add(a->GetName());
71 a = a->GetParent();
72 }
73 if (names.IsEmpty())
74 return String::Empty;
75 int32 length = names.Count() - 1;
76 for (int32 i = 0; i < names.Count(); i++)
77 length += names[i].Length();
78 if (length == 0)
79 return String::Empty;
80 String result;
81 result.ReserveSpace(length);
82 Char* ptr = result.Get();
83 for (int32 i = names.Count() - 1; i >= 0; i--)
84 {
85 const String& name = names[i];
86 Platform::MemoryCopy(ptr, name.Get(), name.Length() * sizeof(Char));
87 ptr += name.Length();
88 if (i != 0)
89 *ptr++ = separatorChar;
90 }
91 *ptr = 0;
92 return result.ToString();
93}
94
95void SceneObject::Serialize(SerializeStream& stream, const void* otherObj)
96{

Callers 8

cacheStaticGeometryTreeFunction · 0.80
GetDebugInfoMethod · 0.80
PrintMethod · 0.80
ToStringMethod · 0.80
InitBoneMethod · 0.80
OnAddStringClickedMethod · 0.80

Calls 10

ReserveSpaceMethod · 0.80
GetParentFunction · 0.70
AddMethod · 0.45
GetNameMethod · 0.45
GetParentMethod · 0.45
IsEmptyMethod · 0.45
CountMethod · 0.45
LengthMethod · 0.45
GetMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected