40 std::string
unescape(
const std::string &istr)
const
43 std::string str = istr;
44 i = str.find_first_of(
"&");
45 while (i != std::string::npos)
49 if (!str.compare(i + 1, 3,
"lt;"))
50 str.replace(i, 4, 1,
'<');
51 else if (!str.compare(i + 1, 3,
"gt;"))
52 str.replace(i, 4, 1,
'>');
53 else if (!str.compare(i + 1, 4,
"amp;"))
54 str.replace(i, 5, 1,
'&');
55 else if (!str.compare(i + 1, 5,
"apos;"))
56 str.replace(i, 6, 1,
'\'');
57 else if (!str.compare(i + 1, 5,
"quot;"))
58 str.replace(i, 6, 1,
'"');
60 i = str.find_first_of(
"&", i + 1);
81 typedef unsigned char uchar;
86 case '<': str <<
"<";
break;
87 case '>': str <<
">";
break;
88 case '&': str <<
"&";
break;
89 case '"': str <<
""";
break;
90 case '\'': str <<
"'";
break;
100 if ( uchar(ch) < 32u )
std::string unescape(const std::string &in_r)
Unescape xml special charaters (& -> &; from IoBind library)
std::ostream & dumpOn(std::ostream &str) const
std::string unescape(const std::string &istr) const