| 59 | } |
| 60 | |
| 61 | bool CommaSeparatedContains(const std::string& cs_list, const std::string& item) { |
| 62 | size_t pos = 0; |
| 63 | while (pos < cs_list.size()) { |
| 64 | size_t comma_pos = cs_list.find(',', pos); |
| 65 | if (comma_pos == string::npos) return cs_list.compare(pos, string::npos, item) == 0; |
| 66 | if (cs_list.compare(pos, comma_pos - pos, item) == 0) return true; |
| 67 | pos = comma_pos + 1; |
| 68 | } |
| 69 | return false; |
| 70 | } |
| 71 | |
| 72 | bool EndsWith(const std::string& full_string, const std::string& end) { |
| 73 | if (full_string.size() >= end.size()) { |