aboutsummaryrefslogtreecommitdiff
path: root/src/common/Utilities/Util.h
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-09-10 15:19:17 +0200
committerGitHub <noreply@github.com>2020-09-10 15:19:17 +0200
commitfeaaa595cae735bb6093b24a88562c27b2723cfe (patch)
tree18a313b5b0f53340a11068933bda27bf0537adf8 /src/common/Utilities/Util.h
parent5189f134cae4ee9bcb9e04d5c87550b130f36474 (diff)
Core/ChatCommands: make ExactSequence more readable
Diffstat (limited to 'src/common/Utilities/Util.h')
-rw-r--r--src/common/Utilities/Util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h
index a355d1af6d3..170fbbd52d9 100644
--- a/src/common/Utilities/Util.h
+++ b/src/common/Utilities/Util.h
@@ -331,7 +331,8 @@ inline std::vector<uint8> HexStrToByteVector(std::string_view str, bool reverse
}
TC_COMMON_API bool StringEqualI(std::string_view str1, std::string_view str2);
-TC_COMMON_API bool StringStartsWith(std::string_view haystack, std::string_view needle);
+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)