diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/string/subst.h | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 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 8855e818fa..45b622fbef 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; +} |