aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/Kernel/OVR_String.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'LibOVR/Src/Kernel/OVR_String.cpp')
-rw-r--r--LibOVR/Src/Kernel/OVR_String.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/LibOVR/Src/Kernel/OVR_String.cpp b/LibOVR/Src/Kernel/OVR_String.cpp
index 86aa126..75b7c0e 100644
--- a/LibOVR/Src/Kernel/OVR_String.cpp
+++ b/LibOVR/Src/Kernel/OVR_String.cpp
@@ -569,7 +569,7 @@ StringBuffer::StringBuffer(UPInt growSize)
StringBuffer::StringBuffer(const char* data)
: pData(NULL), Size(0), BufferSize(0), GrowSize(OVR_SBUFF_DEFAULT_GROW_SIZE), LengthIsSize(false)
{
- *this = data;
+ AppendString(data);
}
StringBuffer::StringBuffer(const char* data, UPInt dataSize)
@@ -585,10 +585,9 @@ StringBuffer::StringBuffer(const String& src)
}
StringBuffer::StringBuffer(const StringBuffer& src)
- : pData(NULL), Size(0), BufferSize(src.GetGrowSize()), GrowSize(OVR_SBUFF_DEFAULT_GROW_SIZE), LengthIsSize(false)
+ : pData(NULL), Size(0), BufferSize(0), GrowSize(OVR_SBUFF_DEFAULT_GROW_SIZE), LengthIsSize(false)
{
AppendString(src.ToCStr(), src.GetSize());
- LengthIsSize = src.LengthIsSize;
}
StringBuffer::StringBuffer(const wchar_t* data)
@@ -728,6 +727,12 @@ void StringBuffer::operator = (const String& src)
memcpy(pData, src.ToCStr(), src.GetSize());
}
+void StringBuffer::operator = (const StringBuffer& src)
+{
+ Clear();
+ AppendString(src.ToCStr(), src.GetSize());
+}
+
// Inserts substr at posAt
void StringBuffer::Insert(const char* substr, UPInt posAt, SPInt len)