Open alexey-malov opened 8 years ago
static const vector<pair<string, string>> decodeTable = {{"apos;", "'"}, ...};
...
string str;
size_t pos;
auto it = find_if(decodeTable.begin(), decodeTable.end(), [&](auto & entity){
return (str.compare(entity.first, pos, entity.first.length() == 0)
});
// replace with it->second if it != decodeTable.end()