version 1.119, 2006/01/30 16:17:08
|
version 1.121, 2006/05/30 15:41:57
|
|
|
{ | { |
#ifndef PEGASUS_STRING_NO_THROW | #ifndef PEGASUS_STRING_NO_THROW |
| |
if (x > 0x0FFFFFFF) |
// Check for potential overflow in x |
throw PEGASUS_STD(bad_alloc)(); |
PEGASUS_CHECK_CAPACITY_OVERFLOW(x); |
| |
#endif | #endif |
| |
|
|
{ | { |
#ifndef PEGASUS_STRING_NO_THROW | #ifndef PEGASUS_STRING_NO_THROW |
| |
// Any string bigger than this is seriously suspect. |
// Check for potential overflow in cap |
if (cap > 0x0FFFFFFF) |
PEGASUS_CHECK_CAPACITY_OVERFLOW(cap); |
throw PEGASUS_STD(bad_alloc)(); |
|
| |
#endif | #endif |
| |
|
|
| |
String& String::append(const String& str) | String& String::append(const String& str) |
{ | { |
return append((Char16*)str._rep->data, str._rep->size); |
return append((Char16*)(&(str._rep->data[0])), str._rep->size); |
} | } |
| |
String& String::append(const char* str, Uint32 size) | String& String::append(const char* str, Uint32 size) |
|
|
if (n == PEG_NOT_FOUND || n > _rep->size - index) | if (n == PEG_NOT_FOUND || n > _rep->size - index) |
n = _rep->size - index; | n = _rep->size - index; |
| |
return String((Char16*)_rep->data + index, n); |
return String((Char16*)(_rep->data + index), n); |
} | } |
| |
return String(); | return String(); |