| 11141 | } |
| 11142 | |
| 11143 | bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { |
| 11144 | bool replaced = false; |
| 11145 | std::size_t i = str.find( replaceThis ); |
| 11146 | while( i != std::string::npos ) { |
| 11147 | replaced = true; |
| 11148 | str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() ); |
| 11149 | if( i < str.size()-withThis.size() ) |
| 11150 | i = str.find( replaceThis, i+withThis.size() ); |
| 11151 | else |
| 11152 | i = std::string::npos; |
| 11153 | } |
| 11154 | return replaced; |
| 11155 | } |
| 11156 | |
| 11157 | pluralise::pluralise( std::size_t count, std::string const& label ) |
| 11158 | : m_count( count ), |