summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorTim Foley <tim.foley.is@gmail.com>2017-08-10 15:25:04 -0700
committerGitHub <noreply@github.com>2017-08-10 15:25:04 -0700
commitdb4079f7e3635a6a61b8725643b1d7ecf68b97d8 (patch)
tree224c16ad374c5ed533a497beeb75753e7ce2d771 /source/core
parent6e4830f4d74adef0a47c6503d84dc114240fafa3 (diff)
parenta5a436c4783fb75a0d089a6483219c06db91f593 (diff)
Merge pull request #156 from tfoleyNV/source-file-cleanup
Make source location lightweight
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-string.cpp6
-rw-r--r--source/core/slang-string.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/source/core/slang-string.cpp b/source/core/slang-string.cpp
index 459396f69..9bc9e3a54 100644
--- a/source/core/slang-string.cpp
+++ b/source/core/slang-string.cpp
@@ -51,6 +51,12 @@ namespace Slang
, endIndex(0)
{}
+ StringSlice::StringSlice(String const& str)
+ : representation(str.buffer)
+ , beginIndex(0)
+ , endIndex(str.Length())
+ {}
+
StringSlice::StringSlice(String const& str, UInt beginIndex, UInt endIndex)
: representation(str.buffer)
, beginIndex(beginIndex)
diff --git a/source/core/slang-string.h b/source/core/slang-string.h
index 552afe833..98fd51a07 100644
--- a/source/core/slang-string.h
+++ b/source/core/slang-string.h
@@ -155,6 +155,8 @@ namespace Slang
public:
StringSlice();
+ StringSlice(String const& str);
+
StringSlice(String const& str, UInt beginIndex, UInt endIndex);
UInt getLength() const