| 315 | } |
| 316 | |
| 317 | static std::vector<std::string> split(const std::string &str, const std::string &sep=" ") |
| 318 | { |
| 319 | std::vector<std::string> ret; |
| 320 | for (std::string::size_type startPos = 0U; startPos < str.size();) { |
| 321 | startPos = str.find_first_not_of(sep, startPos); |
| 322 | if (startPos == std::string::npos) |
| 323 | break; |
| 324 | |
| 325 | if (str[startPos] == '\"') { |
| 326 | const std::string::size_type endPos = str.find('\"', startPos + 1); |
| 327 | ret.push_back(str.substr(startPos + 1, endPos - startPos - 1)); |
| 328 | startPos = (endPos < str.size()) ? (endPos + 1) : endPos; |
| 329 | continue; |
| 330 | } |
| 331 | |
| 332 | const std::string::size_type endPos = str.find(sep, startPos + 1); |
| 333 | ret.push_back(str.substr(startPos, endPos - startPos)); |
| 334 | startPos = endPos; |
| 335 | } |
| 336 | |
| 337 | return ret; |
| 338 | } |
| 339 | |
| 340 | static std::string getDumpFileName(const Settings& settings, const FileWithDetails& file) |
| 341 | { |
no test coverage detected