| 61 | #if USE_EDITOR |
| 62 | |
| 63 | void 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 |
no test coverage detected