From 275fe302cd03adf59fff1a0e4a08f13c6cfcaf31 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 23 Jan 2022 21:48:08 +0800 Subject: ... --- include/cru/common/String.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/cru/common/String.hpp') diff --git a/include/cru/common/String.hpp b/include/cru/common/String.hpp index 5891e929..22d68980 100644 --- a/include/cru/common/String.hpp +++ b/include/cru/common/String.hpp @@ -226,6 +226,9 @@ class CRU_BASE_API String { int Compare(const String& other) const; int CaseInsensitiveCompare(const String& other) const; + bool CaseInsensitiveEqual(const String& other) const { + return CaseInsensitiveCompare(other) == 0; + } private: static char16_t kEmptyBuffer[1]; @@ -310,6 +313,9 @@ class CRU_BASE_API StringView { public: int Compare(const StringView& other) const; int CaseInsensitiveCompare(const StringView& other) const; + bool CaseInsensitiveEqual(const StringView& other) const { + return CaseInsensitiveCompare(other) == 0; + } String ToString() const { return String(ptr_, size_); } -- cgit v1.2.3