| 1131 | } |
| 1132 | |
| 1133 | Properties* 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 | |
| 1176 | bool Properties::parseVec2(const char* str, Vec2* out) |
| 1177 | { |
no test coverage detected