summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2017-11-07 16:55:08 -0500
committerGitHub <noreply@github.com>2017-11-07 16:55:08 -0500
commit417c9f3939e0545125317f49316a6dfb060d6c2c (patch)
treeb7560ff41a43cda235ab7db8a19fd2371e3f7ba8 /source/core
parentd1b45f3059e100d096327eb178c1bac365e564f1 (diff)
parenta54364303241e3cd7c3d075ee1dd4164915d939f (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.h16
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;