| 60 | } |
| 61 | |
| 62 | String 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 | |
| 95 | void SceneObject::Serialize(SerializeStream& stream, const void* otherObj) |
| 96 | { |
no test coverage detected