MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / JsonEscape

Function JsonEscape

apps/tools/Tools/commands/ScanCommand.cpp:493–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493static std::string JsonEscape(const std::string& s)
494{
495 std::string out;
496 out.reserve(s.size() + 8);
497 for (char c : s)
498 {
499 switch (c)
500 {
501 case '"':
502 out += "\\\"";
503 break;
504 case '\\':
505 out += "\\\\";
506 break;
507 case '\n':
508 out += "\\n";
509 break;
510 case '\r':
511 out += "\\r";
512 break;
513 case '\t':
514 out += "\\t";
515 break;
516 default:
517 out += c;
518 break;
519 }
520 }
521 return out;
522}
523
524static void RunScan(const std::string& directory, int threadCount, bool verbose, bool jsonOutput)
525{

Callers 2

RunScanFunction · 0.70
sink_it_Method · 0.50

Calls 2

reserveMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected