Romasmi / cpp-practice

0 stars 0 forks source link

Замечания по HtmlEncode / HtmlDecode #15

Closed alexey-malov closed 5 years ago

alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
std::string HtmlDecode(const std::string str)
alexey-malov commented 5 years ago
    for (HtmlEntityCode item : HTML_ENTITIES_CODES)
    {
        if (code == item.second)
        {
            return item.first;
        }
    }
alexey-malov commented 5 years ago
        const string code = GetEntityCode(ch);
        if (!code.empty())
        {
            processedString.append(code);
        }
        else
        {
            processedString += ch;
        }