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

Function FindObjectIds

Source/Engine/Content/Storage/JsonStorageProxy.cpp:63–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61#if USE_EDITOR
62
63void FindObjectIds(const rapidjson_flax::Value& obj, const rapidjson_flax::Document& document, HashSet<Guid>& ids, const char* parentName = nullptr)
64{
65 if (obj.IsObject())
66 {
67 for (rapidjson_flax::Value::ConstMemberIterator i = obj.MemberBegin(); i != obj.MemberEnd(); ++i)
68 {
69 FindObjectIds(i->value, document, ids, i->name.GetString());
70 }
71 }
72 else if (obj.IsArray())
73 {
74 for (rapidjson::SizeType i = 0; i < obj.Size(); i++)
75 {
76 FindObjectIds(obj[i], document, ids, parentName);
77 }
78 }
79 else if (obj.IsString() && obj.GetStringLength() == 32)
80 {
81 if (parentName && StringUtils::Compare(parentName, "ID") == 0)
82 {
83 auto value = JsonTools::GetGuid(obj);
84 if (value.IsValid())
85 {
86 ids.Add(value);
87 }
88 }
89 }
90}
91
92#endif
93

Callers 1

ChangeIdMethod · 0.85

Calls 8

GetGuidFunction · 0.85
MemberBeginMethod · 0.80
MemberEndMethod · 0.80
GetStringMethod · 0.45
SizeMethod · 0.45
GetStringLengthMethod · 0.45
IsValidMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected