diff options
Diffstat (limited to 'source/core/slang-string.h')
| -rw-r--r-- | source/core/slang-string.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/core/slang-string.h b/source/core/slang-string.h index 6b9a73bcb..85f7b894f 100644 --- a/source/core/slang-string.h +++ b/source/core/slang-string.h @@ -168,6 +168,9 @@ namespace Slang /// Trims any 'c' from the start or the end, and returns as a substring UnownedStringSlice trim(char c) const; + /// Trims any horizonatl whitespace from start and returns as a substring + UnownedStringSlice trimStart() const; + HashCode getHashCode() const { return Slang::getHashCode(m_begin, size_t(m_end - m_begin)); @@ -409,7 +412,7 @@ namespace Slang static String fromWString(const wchar_t * wstr); static String fromWString(const wchar_t * wstr, const wchar_t * wend); static String fromWChar(const wchar_t ch); - static String fromUnicodePoint(unsigned int codePoint); + static String fromUnicodePoint(Char32 codePoint); String() { } @@ -619,9 +622,9 @@ namespace Slang len = getLength() - id; #if _DEBUG if (id < 0 || id >= getLength() || (id + len) > getLength()) - throw "SubString: index out of range."; + SLANG_ASSERT_FAILURE("SubString: index out of range."); if (len < 0) - throw "SubString: length less than zero."; + SLANG_ASSERT_FAILURE("SubString: length less than zero."); #endif return StringSlice(m_buffer, id, id + len); } @@ -997,9 +1000,9 @@ namespace Slang { #if _DEBUG if (id >= length || id < 0) - throw "Remove: Index out of range."; + SLANG_ASSERT_FAILURE("Remove: Index out of range."); if (len < 0) - throw "Remove: remove length smaller than zero."; + SLANG_ASSERT_FAILURE("Remove: remove length smaller than zero."); #endif int actualDelLength = ((id + len) >= length) ? (length - id) : len; for (int i = id + actualDelLength; i <= length; i++) |
