version 1.119, 2006/01/30 16:17:08
|
version 1.119.2.3, 2007/02/07 21:06:04
|
|
|
{ | { |
#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(); |
|
|
if (InitializeICU::initICUSuccessful()) | if (InitializeICU::initICUSuccessful()) |
{ | { |
return u_strcasecmp( | return u_strcasecmp( |
str1._rep->data, str2._rep->data, U_FOLD_CASE_DEFAULT); |
(const UChar*)str1._rep->data, |
|
(const UChar*)str2._rep->data, |
|
U_FOLD_CASE_DEFAULT |
|
); |
} | } |
| |
#endif /* PEGASUS_HAS_ICU */ | #endif /* PEGASUS_HAS_ICU */ |