diff options
author | Vlad Yaroslavlev <[email protected]> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /util/string/subst.h | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) |
Restoring authorship annotation for Vlad Yaroslavlev <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/string/subst.h')
-rw-r--r-- | util/string/subst.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/util/string/subst.h b/util/string/subst.h index 45b622fbefd..8855e818fac 100644 --- a/util/string/subst.h +++ b/util/string/subst.h @@ -36,21 +36,21 @@ size_t SubstGlobal(TUtf32String& text, wchar32 what, wchar32 with, size_t from = // TODO(yazevnul): // - rename `SubstGlobal` to `ReplaceAll` for convenience -// - add `SubstGlobalCopy(TStringBuf)` for convenience +// - add `SubstGlobalCopy(TStringBuf)` for convenience // - add `RemoveAll(text, what, from)` as a shortcut for `SubstGlobal(text, what, "", from)` // - rename file to `replace.h` - -/* Replace all occurences of substring or character `what` with string or character `with` starting from position `from`, and return result string. - * - * @param text String to modify. - * @param what Substring/character to replace. - * @param with Substring/character to use as replacement. - * @param from Position at with to start replacement. - * - * @return Result string - */ -template <class TStringType, class TPatternType> + +/* Replace all occurences of substring or character `what` with string or character `with` starting from position `from`, and return result string. + * + * @param text String to modify. + * @param what Substring/character to replace. + * @param with Substring/character to use as replacement. + * @param from Position at with to start replacement. + * + * @return Result string + */ +template <class TStringType, class TPatternType> Y_WARN_UNUSED_RESULT TStringType SubstGlobalCopy(TStringType result, TPatternType what, TPatternType with, size_t from = 0) { - SubstGlobal(result, what, with, from); - return result; -} + SubstGlobal(result, what, with, from); + return result; +} |