///Разбор подключаемого узла void PrepareIncludeNode (const ParseNode& decl) { const char* source_name = get<const char*> (decl, "source"); bool ignore_unavailability = strcmp (get<const char*> (decl, "ignore_unavailability", "false"), "true") == 0; if (!source_name) return; //попытка найти в списке уже загруженных IncludeMap::iterator iter = includes.find (source_name); if (iter != includes.end ()) return; //парсинг if (!FileSystem::IsFileExist (source_name) && ignore_unavailability) return; common::ParseLog root_log = root.Log (); Parser parser (root_log, source_name, "xml"); const ParseNode& xscene_root = parser.Root ().First (); if (strcmp (xscene_root.Name (), XSCENE_ROOT)) throw xtl::format_operation_exception ("", "Bad XML scene file '%s'. Root node not found", source_name); bool partial = strcmp (get<const char*> (xscene_root, "partial", ""), "true") == 0; if (!partial) throw xtl::format_operation_exception ("", "Bad XML scene file '%s'. Only partial definitions are allowed in this context", source_name); //сохранение ссылки на подключаемый файл includes.insert_pair (source_name, xscene_root); //вложенный разбор Prepare (xscene_root); }
const_iterator find(const std::string &_key) const { std::string key = _key; std::transform(key.begin(), key.end(), key.begin(), ToKey ); return includeMap.find(key); }