MCPcopy Create free account
hub / github.com/MyGUI/mygui / loadFromXmlNode

Method loadFromXmlNode

MyGUIEngine/src/MyGUI_ResourceManager.cpp:65–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 void ResourceManager::loadFromXmlNode(xml::ElementPtr _node, std::string_view /*unused*/, Version _version)
66 {
67 FactoryManager& factory = FactoryManager::getInstance();
68
69 // берем детей и крутимся, основной цикл
70 xml::ElementEnumerator root = _node->getElementEnumerator();
71 while (root.next(mCategoryName))
72 {
73 // парсим атрибуты
74 std::string type;
75 std::string name;
76 root->findAttribute("type", type);
77 root->findAttribute("name", name);
78
79 if (name.empty())
80 continue;
81
82 IObject* object = factory.createObject(mCategoryName, type);
83 if (object == nullptr)
84 {
85 MYGUI_LOG(Error, "resource type '" << type << "' not found");
86 continue;
87 }
88
89 MapResource::iterator item = mResources.find(name);
90 if (item != mResources.end())
91 {
92 MYGUI_LOG(Warning, "duplicate resource name '" << name << "'");
93
94 // ресурсами могут пользоваться
95 mRemovedResources.push_back((*item).second);
96 mResources.erase(item);
97 }
98
99 IResourcePtr resource = object->castType<IResource>();
100 resource->deserialization(root.current(), _version);
101
102 mResources[name] = resource;
103 }
104 }
105
106 void ResourceManager::_loadList(xml::ElementPtr _node, std::string_view /*unused*/, Version _version)
107 {

Callers 3

loadOldFontFormatMethod · 0.80
loadOldPointerFormatMethod · 0.80
generateSkinMethod · 0.80

Calls 11

getElementEnumeratorMethod · 0.80
findAttributeMethod · 0.80
nextMethod · 0.45
emptyMethod · 0.45
createObjectMethod · 0.45
findMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
eraseMethod · 0.45
deserializationMethod · 0.45
currentMethod · 0.45

Tested by 1

generateSkinMethod · 0.64