MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / EscapeJsonString

Function EscapeJsonString

Source/Wasm/WasmRuntime.cpp:2785–2811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2783}
2784
2785static std::string EscapeJsonString(const std::string& input) {
2786 std::string output;
2787 output.reserve(input.size());
2788 for (char ch : input) {
2789 switch (ch) {
2790 case '\\':
2791 output += "\\\\";
2792 break;
2793 case '"':
2794 output += "\\\"";
2795 break;
2796 case '\n':
2797 output += "\\n";
2798 break;
2799 case '\r':
2800 output += "\\r";
2801 break;
2802 case '\t':
2803 output += "\\t";
2804 break;
2805 default:
2806 output += ch;
2807 break;
2808 }
2809 }
2810 return output;
2811}
2812
2813std::unordered_map<int64_t, Git::GitHandle>& Git::handles() {
2814 static std::unordered_map<int64_t, GitHandle> gitHandles;

Callers 2

runJobMethod · 0.85
cancelMethod · 0.85

Calls 2

reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected