| 283 | } |
| 284 | |
| 285 | void ThemeData::parseIncludes(const pugi::xml_node& root) |
| 286 | { |
| 287 | ThemeException error; |
| 288 | error.setFiles(mPaths); |
| 289 | |
| 290 | for(pugi::xml_node node = root.child("include"); node; node = node.next_sibling("include")) |
| 291 | { |
| 292 | std::string relPath = resolvePlaceholders(node.text().as_string()); |
| 293 | std::string path = Utils::FileSystem::resolveRelativePath(relPath, mPaths.back(), true); |
| 294 | if(!ResourceManager::getInstance()->fileExists(path)) |
| 295 | throw error << "Included file \"" << relPath << "\" not found! (resolved to \"" << path << "\")"; |
| 296 | |
| 297 | error << " from included file \"" << relPath << "\":\n "; |
| 298 | |
| 299 | mPaths.push_back(path); |
| 300 | |
| 301 | LOG(LogInfo) << "Parsing include file: " << path; |
| 302 | |
| 303 | pugi::xml_document includeDoc; |
| 304 | pugi::xml_parse_result result = includeDoc.load_file(path.c_str()); |
| 305 | if(!result) |
| 306 | throw error << "Error parsing file: \n " << result.description(); |
| 307 | |
| 308 | pugi::xml_node theme = includeDoc.child("theme"); |
| 309 | if(!theme) |
| 310 | throw error << "Missing <theme> tag!"; |
| 311 | |
| 312 | parseVariables(theme); |
| 313 | parseIncludes(theme); |
| 314 | parseViews(theme); |
| 315 | parseFeatures(theme); |
| 316 | |
| 317 | mPaths.pop_back(); |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | void ThemeData::parseFeatures(const pugi::xml_node& root) |
| 322 | { |
nothing calls this directly
no test coverage detected