63 size_t pos, last_pos = 0;
64 std::stringstream escaping;
67 escaping <<
str.substr(last_pos, pos - last_pos);
68 escaping <<
ESC <<
str.substr(pos, 1);
71 if (last_pos !=
str.size()) {
72 escaping <<
str.substr(last_pos);
74 escaped = escaping.str();
75 if (escaped.empty() || (escaped.c_str()[0] ==
QUO && escaped.c_str()[escaped.length() - 1] ==
QUO)) {
78 escaping <<
QUO << escaped <<
QUO;
79 escaped = escaping.str();