* Replace the next argument placeholder with @a val. * @param val The value to place in the next placeholder's position. * @return A translated string with all occurences of the marker replaced by @a val. */
| 28 | * @return A translated string with all occurences of the marker replaced by @a val. |
| 29 | */ |
| 30 | LocalizedText LocalizedText::arg(std::wstring const &val) const |
| 31 | { |
| 32 | std::wostringstream os; |
| 33 | os << '{' << _nextArg << '}'; |
| 34 | std::wstring marker(os.str()); |
| 35 | size_t pos = _text.find(marker); |
| 36 | if (std::wstring::npos == pos) |
| 37 | return *this; |
| 38 | std::wstring ntext(_text); |
| 39 | for (/*empty*/ ; std::wstring::npos != pos; pos = ntext.find(marker, pos + val.length())) |
| 40 | { |
| 41 | ntext.replace(pos, marker.length(), val); |
| 42 | } |
| 43 | return LocalizedText(ntext, _nextArg); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Replace the next argument placeholder with @a val. |
nothing calls this directly
no test coverage detected