MCPcopy Create free account
hub / github.com/SOUI2/soui / rewriteValueTree

Function rewriteValueTree

third-part/jsoncpp/src/jsontestrunner/main.cpp:194–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192 return Json::writeString(builder, root);
193}
194static int rewriteValueTree(
195 const JSONCPP_STRING& rewritePath,
196 const Json::Value& root,
197 Options::writeFuncType write,
198 JSONCPP_STRING* rewrite)
199{
200 *rewrite = write(root);
201 FILE* fout = fopen(rewritePath.c_str(), "wt");
202 if (!fout) {
203 printf("Failed to create rewrite file: %s\n", rewritePath.c_str());
204 return 2;
205 }
206 fprintf(fout, "%s\n", rewrite->c_str());
207 fclose(fout);
208 return 0;
209}
210
211static JSONCPP_STRING removeSuffix(const JSONCPP_STRING& path,
212 const JSONCPP_STRING& extension) {

Callers 1

runTestFunction · 0.70

Calls 2

writeFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected