| 107 | } |
| 108 | |
| 109 | std::string makeJSONString(const std::string &msg) { |
| 110 | std::string json(msg); |
| 111 | std::string::iterator it = json.begin(); |
| 112 | while (it != json.end()) { |
| 113 | if (*it == '"' || *it == '\\' || *it == '/' || *it == '\b' || |
| 114 | *it == '\f' || *it == '\n' || *it == '\r' || *it == '\t') { |
| 115 | it = json.insert(it, '\\'); |
| 116 | if (it != json.end()) { |
| 117 | ++it; |
| 118 | } |
| 119 | } |
| 120 | ++it; |
| 121 | } |
| 122 | return json; |
| 123 | } |
| 124 | |
| 125 | // ======================================================================= |
| 126 | // -- Data members ------------------------------------------------------- |
nothing calls this directly
no outgoing calls
no test coverage detected