diff --git a/BeefySysLib/util/String.h b/BeefySysLib/util/String.h index f86cf312..231ed50c 100644 --- a/BeefySysLib/util/String.h +++ b/BeefySysLib/util/String.h @@ -182,6 +182,18 @@ public: this->mPtr = sv.mPtr; this->mLength = sv.mLength; } + + StringView(const StringView& sv, int offset) + { + this->mPtr = sv.mPtr + offset; + this->mLength = sv.mLength - offset; + } + + StringView(const StringView& sv, int offset, int length) + { + this->mPtr = sv.mPtr + offset; + this->mLength = length; + } StringView(const StringImpl& str); StringView(const StringImpl& str, int offset); @@ -908,6 +920,15 @@ public: void Append(const StringImpl& str, const StringImpl& str2, const StringImpl& str3); void Append(char c, int count = 1); + void Release() + { + if (IsDynAlloc()) + DeletePtr(); + this->mLength = 0; + this->mPtr = NULL; + this->mAllocSizeAndFlags = 0; + } + void Clear() { this->mLength = 0;