| 382 | bool valid() const { return count > 0 && !value.empty(); } |
| 383 | |
| 384 | void remove_self(std::vector<std::string>& entries) const |
| 385 | { |
| 386 | if (this->valid()) { |
| 387 | long to_skip = this->count; |
| 388 | size_t index_to_remove = 0; |
| 389 | for (auto const& path : entries) { |
| 390 | if (path == this->value && --to_skip == 0) { |
| 391 | break; |
| 392 | } |
| 393 | ++index_to_remove; |
| 394 | } |
| 395 | if (index_to_remove < entries.size() && to_skip == 0) { |
| 396 | entries.erase(entries.begin() + index_to_remove); |
| 397 | } |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | long count = -1; |
| 402 | std::string value; |
no test coverage detected