MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / escape

Function escape

3rd/nlohmann_json/single_include/nlohmann/json.hpp:2674–2679  ·  view source on GitHub ↗

! * @brief string escaping as described in RFC 6901 (Sect. 4) * @param[in] s string to escape * @return escaped string * * Note the order of escaping "~" to "~0" and "/" to "~1" is important. */

Source from the content-addressed store, hash-verified

2672 * Note the order of escaping "~" to "~0" and "/" to "~1" is important.
2673 */
2674inline std::string escape(std::string s)
2675{
2676 replace_substring(s, "~", "~0");
2677 replace_substring(s, "/", "~1");
2678 return s;
2679}
2680
2681/*!
2682 * @brief string unescaping as described in RFC 6901 (Sect. 4)

Callers 4

diagnosticsMethod · 0.70
to_stringMethod · 0.70
json.hppFile · 0.70
basic_json diffFunction · 0.70

Calls 1

replace_substringFunction · 0.70

Tested by

no test coverage detected