version 1.114, 2005/10/24 19:35:25
|
version 1.115, 2005/11/27 03:11:36
|
|
|
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <cassert> |
#include <Pegasus/Common/PegasusAssert.h> |
#include <cstring> | #include <cstring> |
#include "InternalException.h" | #include "InternalException.h" |
#include "CommonUTF.h" | #include "CommonUTF.h" |
|
|
if (_rep->refs.get() != 1) | if (_rep->refs.get() != 1) |
_rep = StringRep::copyOnWrite(_rep); | _rep = StringRep::copyOnWrite(_rep); |
| |
assert(index + n <= _rep->size); |
PEGASUS_ASSERT(index + n <= _rep->size); |
| |
size_t rem = _rep->size - (index + n); | size_t rem = _rep->size - (index + n); |
Uint16* data = _rep->data; | Uint16* data = _rep->data; |
|
|
| |
int String::compare(const String& s1, const String& s2, Uint32 n) | int String::compare(const String& s1, const String& s2, Uint32 n) |
{ | { |
assert(n <= s1._rep->size); |
PEGASUS_ASSERT(n <= s1._rep->size); |
assert(n <= s2._rep->size); |
PEGASUS_ASSERT(n <= s2._rep->size); |
| |
// Ignoring error in which n is greater than s1.size() or s2.size() | // Ignoring error in which n is greater than s1.size() or s2.size() |
return _compare(s1._rep->data, s2._rep->data, n); | return _compare(s1._rep->data, s2._rep->data, n); |