MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Load

Method Load

Source/XML/Parsers/assetloadwarningparser.cpp:37–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37uint32_t AssetLoadWarningParser::Load(const std::string& path) {
38 TiXmlDocument doc(path.c_str());
39 doc.LoadFile();
40 if (!doc.Error()) {
41 TiXmlElement* pRoot = doc.RootElement();
42 if (pRoot) {
43 TiXmlElement* e = pRoot->FirstChildElement("AssetWarning");
44 while (e) {
45 uint32_t flags;
46 string_flags_to_uint32(&flags, nullAsEmpty(e->Attribute("load_flags")));
47 asset_warnings.insert(AssetWarning(nullAsEmpty(e->Attribute("path")), flags, nullAsEmpty(e->Attribute("asset_type")), nullAsEmpty(e->Attribute("level_name"))));
48 e = e->NextSiblingElement("AssetWarning");
49 }
50 }
51 }
52 return 0;
53}
54
55bool AssetLoadWarningParser::Save(const std::string& path) {
56 TiXmlDocument doc;

Callers

nothing calls this directly

Calls 11

string_flags_to_uint32Function · 0.85
nullAsEmptyFunction · 0.85
AssetWarningClass · 0.85
RootElementMethod · 0.80
c_strMethod · 0.45
LoadFileMethod · 0.45
ErrorMethod · 0.45
FirstChildElementMethod · 0.45
AttributeMethod · 0.45
insertMethod · 0.45
NextSiblingElementMethod · 0.45

Tested by

no test coverage detected