diff options
| -rw-r--r-- | source/core/slang-string.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/core/slang-string.h b/source/core/slang-string.h index 0808d9715..a0f2b48a1 100644 --- a/source/core/slang-string.h +++ b/source/core/slang-string.h @@ -154,6 +154,22 @@ namespace Slang return endData; } + UInt size() const + { + return endData - beginData; + } + + bool operator==(UnownedStringSlice const& other) + { + return size() == other.size() + && memcmp(begin(), other.begin(), size()) == 0; + } + + bool operator==(char const* str) + { + return (*this) == UnownedStringSlice(str, str + strlen(str)); + } + private: char const* beginData; char const* endData; |
