MCPcopy Create free account
hub / github.com/axmolengine/axmol / writeValueVectorToFile

Method writeValueVectorToFile

core/platform/FileUtils.cpp:393–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393bool FileUtils::writeValueVectorToFile(const ValueVector& vecData, std::string_view fullPath) const
394{
395 pugi::xml_document doc;
396 doc.load_string(R"(<?xml version="1.0" encoding="UTF-8" ?>
397<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
398<plist />)",
399 pugi::parse_full);
400
401 auto rootEle = doc.document_element();
402 generateElementForArray(vecData, rootEle);
403 std::stringstream ss;
404 doc.save(ss, " ");
405 return writeStringToFile(ss.str(), fullPath);
406}
407
408static void generateElementForObject(const Value& value, pugi::xml_node& parent)
409{

Callers 1

FileUtilsTests.cppFile · 0.80

Calls 7

generateElementForArrayFunction · 0.85
getInstanceFunction · 0.85
load_stringMethod · 0.80
document_elementMethod · 0.80
saveMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected