|
|
|
@ -699,9 +699,8 @@ plString operator+(const plString &left, const plString &right)
|
|
|
|
|
return str; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
plStringStream &plStringStream::operator<<(const char *text) |
|
|
|
|
plStringStream &plStringStream::append(const char *data, size_t length) |
|
|
|
|
{ |
|
|
|
|
size_t length = strlen(text); |
|
|
|
|
if (fLength + length > fBufSize) { |
|
|
|
|
char *bigger = new char[fBufSize * 2]; |
|
|
|
|
memcpy(bigger, fBuffer, fBufSize); |
|
|
|
@ -709,11 +708,17 @@ plStringStream &plStringStream::operator<<(const char *text)
|
|
|
|
|
fBuffer = bigger; |
|
|
|
|
fBufSize *= 2; |
|
|
|
|
} |
|
|
|
|
memcpy(fBuffer + fLength, text, length); |
|
|
|
|
memcpy(fBuffer + fLength, data, length); |
|
|
|
|
fLength += length; |
|
|
|
|
return *this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
plStringStream &plStringStream::operator<<(const char *text) |
|
|
|
|
{ |
|
|
|
|
size_t length = strlen(text); |
|
|
|
|
return append(text, length); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
plStringStream &plStringStream::operator<<(int num) |
|
|
|
|
{ |
|
|
|
|
char buffer[12]; |
|
|
|
@ -727,9 +732,3 @@ plStringStream &plStringStream::operator<<(unsigned int num)
|
|
|
|
|
snprintf(buffer, 12, "%u", num); |
|
|
|
|
return operator<<(buffer); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
plStringStream &plStringStream::operator<<(char ch) |
|
|
|
|
{ |
|
|
|
|
char buffer[2] = { ch, 0 }; |
|
|
|
|
return operator<<(buffer); |
|
|
|
|
} |
|
|
|
|