| 9 | namespace { |
| 10 | |
| 11 | std::string replace_all(std::string text, const std::string & needle, const std::string & replacement) { |
| 12 | if (needle.empty()) { |
| 13 | return text; |
| 14 | } |
| 15 | size_t pos = 0; |
| 16 | while ((pos = text.find(needle, pos)) != std::string::npos) { |
| 17 | text.replace(pos, needle.size(), replacement); |
| 18 | pos += replacement.size(); |
| 19 | } |
| 20 | return text; |
| 21 | } |
| 22 | |
| 23 | std::string decode_with_optional_skip( |
| 24 | const std::vector<std::string> & id_to_token, |
no test coverage detected