1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

More ctors

This commit is contained in:
Brian Fiete 2021-05-12 07:08:52 -04:00
parent ad7c628715
commit 7772041ea1

View file

@ -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;