| 155 | } |
| 156 | |
| 157 | std::string GetStrAfterPattern(const std::string &str, |
| 158 | const std::string &pattern) { |
| 159 | std::string whitespaces(" \t\f\v\n\r"); |
| 160 | size_t pat_start; |
| 161 | size_t idx = str.find(pattern); |
| 162 | if (idx == std::string::npos) { |
| 163 | return ""; |
| 164 | } |
| 165 | pat_start = str.find_first_not_of(whitespaces, idx+pattern.size()); |
| 166 | if (pat_start == std::string::npos) { |
| 167 | return ""; |
| 168 | } |
| 169 | idx = str.find_first_of(whitespaces, pat_start); |
| 170 | if (idx == std::string::npos) { |
| 171 | return str.substr(pat_start); |
| 172 | } |
| 173 | return str.substr(pat_start, idx-pat_start); |
| 174 | } |
| 175 | } // namespace mace |
no test coverage detected