libwolfram20

◆ parseInput()

std::string WAQuery::parseInput ( std::string  str)
staticprivate

Given an string it creates a copy but with % code More information here

Parameters
[in]strString to parse
Returns
Parsed string
48 {
49 std::stringstream result;
50
51 std::string::iterator it;
52 for (it = str.begin(); it < str.end(); it++) {
53 if (WAQuery::_special_char.find(*it) != WAQuery::_special_char.end()) {
54 result << '%';
55 result << std::hex << (int)(*it);
56 }
57 else if (*it == ' ') result << '+'; // space is special; it should be '+'
58 else result << (*it);
59 }
60
61 return result.str();
62}
static std::set< char > _special_char
Characters on https://es.wikipedia.org/wiki/C%C3%B3digo_porciento.
Definition: WAQuery.h:151