MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / newRoot

Method newRoot

framework/serialization/serialize.cpp:176–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176SerializationNode *XMLSerializationArchive::newRoot(const UString &prefix, const char *name)
177{
178 auto path = prefix + name + ".xml";
179 auto root = this->docRoots[path].root().append_child();
180 auto decl = this->docRoots[path].prepend_child(pugi::node_declaration);
181 decl.append_attribute("version") = "1.0";
182 decl.append_attribute("encoding") = "UTF-8";
183 root.set_name(name);
184 const UString *newPrefix = &this->prefixes.emplace_back(prefix + name + "/");
185 return &this->nodes.emplace_back(this, root, newPrefix);
186}
187
188SerializationNode *XMLSerializationArchive::getRoot(const UString &prefix, const char *name)
189{

Callers 4

serializeManifestMethod · 0.80
serializeMethod · 0.80
serializeFunction · 0.80
addSectionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected