| 428 | } |
| 429 | |
| 430 | size_t find_first_substr(const std::string& findin, const std::string findwhat, size_t offset) { |
| 431 | if (findwhat.size()) { |
| 432 | for (size_t f = offset; f < findin.size(); f++) { |
| 433 | if (findin[f] == findwhat[0]) { |
| 434 | size_t start = f; |
| 435 | for (size_t w = 1; w < findwhat.size(); w++) { |
| 436 | if (f + w > findin.size()) { |
| 437 | return std::string::npos; |
| 438 | } |
| 439 | if (findin[f + w] != findwhat[w]) { |
| 440 | f += w; |
| 441 | w = findwhat.size(); |
| 442 | } |
| 443 | } |
| 444 | if (start == f) { |
| 445 | return f; |
| 446 | } |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | return std::string::npos; |
| 451 | } |
| 452 | |
| 453 | std::string getStringRange(const std::string& find, size_t start, size_t end) { |
| 454 | std::string ret; |
no test coverage detected