MCPcopy Create free account
hub / github.com/axmolengine/axmol / getPropertiesFromNamespacePath

Function getPropertiesFromNamespacePath

core/base/Properties.cpp:1133–1174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1131}
1132
1133Properties* getPropertiesFromNamespacePath(Properties* properties, const std::vector<std::string_view>& namespacePath)
1134{
1135 // If the url references a specific namespace within the file,
1136 // return the specified namespace or notify the user if it cannot be found.
1137 if (!namespacePath.empty())
1138 {
1139 size_t size = namespacePath.size();
1140 properties->rewind();
1141 Properties* iter = properties->getNextNamespace();
1142 for (size_t i = 0; i < size;)
1143 {
1144 while (true)
1145 {
1146 if (iter == NULL)
1147 {
1148 AXLOGW("Failed to load properties object from url.");
1149 return nullptr;
1150 }
1151
1152 if (iter->getId() == namespacePath[i])
1153 {
1154 if (i != size - 1)
1155 {
1156 properties = iter->getNextNamespace();
1157 iter = properties;
1158 }
1159 else
1160 properties = iter;
1161
1162 i++;
1163 break;
1164 }
1165
1166 iter = properties->getNextNamespace();
1167 }
1168 }
1169
1170 return properties;
1171 }
1172 else
1173 return properties;
1174}
1175
1176bool Properties::parseVec2(const char* str, Vec2* out)
1177{

Callers 1

createNonRefCountedMethod · 0.85

Calls 5

getNextNamespaceMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
rewindMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected