фикс косячных строк в json, фича: SNR в вебке
This commit is contained in:
@@ -668,7 +668,10 @@ std::string api_driver::buildEscapedString(const std::string& source) {
|
||||
str.replace(start_pos, 1, "\\\"");
|
||||
start_pos += 2;
|
||||
}
|
||||
return "\"" + str + "\"";
|
||||
for (start_pos = 0; start_pos < str.size() && (str[start_pos] == ' ' || str[start_pos] == '\n' || str[start_pos] == '\t'); start_pos++) {}
|
||||
size_t end_pos = str.size() - 1;
|
||||
for (; end_pos > start_pos && end_pos != 0 && (str[end_pos] == ' ' || str[end_pos] == '\n' || str[end_pos] == '\t'); end_pos--) {}
|
||||
return "\"" + str.substr(start_pos, end_pos - start_pos + 1) + "\"";
|
||||
}
|
||||
|
||||
static void writeDouble(std::ostream& out, double value, int prec = 2) {
|
||||
|
Reference in New Issue
Block a user