| 9531 | } |
| 9532 | |
| 9533 | bool replaceInPlace(std::string &str, std::string const &replaceThis, std::string const &withThis) { |
| 9534 | bool replaced = false; |
| 9535 | std::size_t i = str.find(replaceThis); |
| 9536 | while (i != std::string::npos) { |
| 9537 | replaced = true; |
| 9538 | str = str.substr(0, i) + withThis + str.substr(i + replaceThis.size()); |
| 9539 | if (i < str.size() - withThis.size()) |
| 9540 | i = str.find(replaceThis, i + withThis.size()); |
| 9541 | else |
| 9542 | i = std::string::npos; |
| 9543 | } |
| 9544 | return replaced; |
| 9545 | } |
| 9546 | |
| 9547 | pluralise::pluralise(std::size_t count, std::string const &label) : m_count(count), m_label(label) { |
| 9548 | } |