aboutsummaryrefslogtreecommitdiff
path: root/src/common/Utilities/Util.h
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-06-08 14:37:54 +0200
committerShauren <shauren.trinity@gmail.com>2025-06-08 14:37:54 +0200
commitff6df050c55b5ae56c6daaef9c44860992f927d1 (patch)
treec58449346c3f092dcbdcdda1c8b3583001a40dee /src/common/Utilities/Util.h
parent0f9a0accf17ba3a9f20d6a7575b51ed2cb09a73c (diff)
Core/Misc: Remove boost/algorithm dependency
Diffstat (limited to 'src/common/Utilities/Util.h')
-rw-r--r--src/common/Utilities/Util.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h
index 8e78797caef..a16e6ba0e89 100644
--- a/src/common/Utilities/Util.h
+++ b/src/common/Utilities/Util.h
@@ -464,11 +464,6 @@ TC_COMMON_API bool StringEqualI(std::string_view str1, std::string_view str2);
inline bool StringStartsWith(std::string_view haystack, std::string_view needle) { return (haystack.substr(0, needle.length()) == needle); }
inline bool StringStartsWithI(std::string_view haystack, std::string_view needle) { return StringEqualI(haystack.substr(0, needle.length()), needle); }
TC_COMMON_API bool StringContainsStringI(std::string_view haystack, std::string_view needle);
-template <typename T>
-inline bool ValueContainsStringI(std::pair<T, std::string_view> const& haystack, std::string_view needle)
-{
- return StringContainsStringI(haystack.second, needle);
-}
TC_COMMON_API bool StringCompareLessI(std::string_view a, std::string_view b);
struct StringCompareLessI_T
@@ -476,6 +471,15 @@ struct StringCompareLessI_T
bool operator()(std::string_view a, std::string_view b) const { return StringCompareLessI(a, b); }
};
+TC_COMMON_API void StringReplaceAll(std::string* str, std::string_view text, std::string_view replacement);
+
+[[nodiscard]] inline std::string StringReplaceAll(std::string_view str, std::string_view text, std::string_view replacement)
+{
+ std::string result(str);
+ StringReplaceAll(&result, text, replacement);
+ return result;
+}
+
// simple class for not-modifyable list
template <typename T>
class HookList final