MCPcopy Create free account
hub / github.com/Tencent/libpag / WriteDefaultConfigFile

Function WriteDefaultConfigFile

exporter/src/config/ConfigFile.cpp:174–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174int WriteDefaultConfigFile(const std::string& fileName) {
175 if (fileName.empty()) {
176 return -1;
177 }
178
179 XMLDocument doc;
180 XMLDeclaration* decl = doc.NewDeclaration("xml version=\"1.0\" encoding=\"utf-8\"");
181 doc.InsertFirstChild(decl);
182
183 XMLElement* root = doc.NewElement("pag-exporter");
184 doc.InsertEndChild(root);
185
186 ConfigParam defaultConfig;
187 WriteCommonConfig(root, &defaultConfig);
188 WriteBitmapConfig(root, &defaultConfig);
189
190 if (doc.SaveFile(std::string(fileName).c_str()) != XML_SUCCESS) {
191 return -1;
192 }
193 return 0;
194}
195
196bool ReadConfigFile(ConfigParam* configParam) {
197 if (!configParam) {

Callers 1

ReadConfigFileFunction · 0.85

Calls 3

WriteCommonConfigFunction · 0.85
WriteBitmapConfigFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected