MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / escape

Function escape

Source/Utils/json.hpp:12362–12367  ·  view source on GitHub ↗

escape "~" to "~0" and "/" to "~1"

Source from the content-addressed store, hash-verified

12360
12361 /// escape "~" to "~0" and "/" to "~1"
12362 static std::string escape(std::string s)
12363 {
12364 replace_substring(s, "~", "~0");
12365 replace_substring(s, "/", "~1");
12366 return s;
12367 }
12368
12369 /// unescape "~1" to tilde and "~0" to slash (order is important!)
12370 static void unescape(std::string& s)

Callers 3

to_stringMethod · 0.85
flattenFunction · 0.85
basic_json diffFunction · 0.85

Calls 1

replace_substringFunction · 0.85

Tested by

no test coverage detected