diff options
| author | Tim Foley <tim.foley.is@gmail.com> | 2017-08-10 15:25:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-10 15:25:04 -0700 |
| commit | db4079f7e3635a6a61b8725643b1d7ecf68b97d8 (patch) | |
| tree | 224c16ad374c5ed533a497beeb75753e7ce2d771 /source/core | |
| parent | 6e4830f4d74adef0a47c6503d84dc114240fafa3 (diff) | |
| parent | a5a436c4783fb75a0d089a6483219c06db91f593 (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.cpp | 6 | ||||
| -rw-r--r-- | source/core/slang-string.h | 2 |
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 |
