diff options
| author | Yong He <yonghe@outlook.com> | 2017-11-07 16:55:08 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-07 16:55:08 -0500 |
| commit | 417c9f3939e0545125317f49316a6dfb060d6c2c (patch) | |
| tree | b7560ff41a43cda235ab7db8a19fd2371e3f7ba8 /source/core | |
| parent | d1b45f3059e100d096327eb178c1bac365e564f1 (diff) | |
| parent | a54364303241e3cd7c3d075ee1dd4164915d939f (diff) | |
Merge pull request #256 from tfoleyNV/falcor-integration-work
Falcor integration work
Diffstat (limited to 'source/core')
| -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; |
