8std::string GstreamerJsonFactory::jsonEscape(
const std::string& s) {
10 out.reserve(s.size() + 8);
12 for (
unsigned char c : s) {
14 case '\\': out +=
"\\\\";
16 case '"': out +=
"\\\"";
18 case '\b': out +=
"\\b";
20 case '\f': out +=
"\\f";
22 case '\n': out +=
"\\n";
24 case '\r': out +=
"\\r";
26 case '\t': out +=
"\\t";
31 static const char* hex =
"0123456789abcdef";
33 out += hex[(c >> 4) & 0xF];
37 out.push_back(
static_cast<char>(c));
JSON streamer plugin declarations.