diff options
author | crupest <crupest@outlook.com> | 2022-01-23 21:48:08 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-01-23 21:48:08 +0800 |
commit | 275fe302cd03adf59fff1a0e4a08f13c6cfcaf31 (patch) | |
tree | 542bd59bca9459b93813c9cae9e964b229efafd4 /include/cru/common/String.hpp | |
parent | da9bdf2baced1ff51350c98047b7ade68fcae930 (diff) | |
download | cru-275fe302cd03adf59fff1a0e4a08f13c6cfcaf31.tar.gz cru-275fe302cd03adf59fff1a0e4a08f13c6cfcaf31.tar.bz2 cru-275fe302cd03adf59fff1a0e4a08f13c6cfcaf31.zip |
...
Diffstat (limited to 'include/cru/common/String.hpp')
-rw-r--r-- | include/cru/common/String.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
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_); } |