39 #define String_LengthIsSize (UPInt(1) << String::Flag_LengthIsSizeShift)
65 pdata1, size1, pdata2, size2);
66 memcpy(pdataDesc->
Data + size1 + size2, pdata3, size3);
116 pdesc->
Data[size] = 0;
118 pdesc->
Size = size | lengthIsSize;
124 const char* pdata,
UPInt copySize)
132 const char* pdata1,
UPInt copySize1,
133 const char* pdata2,
UPInt copySize2)
137 memcpy(pdesc->
Data + copySize1, pdata2, copySize2);
167 const char* buf = pdata->
Data;
185 const char* buf = pdata->
Data;
186 const char* end = buf + pdata->
GetSize();
219 SPInt encodeSize = 0;
226 pdata->
Data, size, buff, (
UPInt)encodeSize));
241 pdata->
Data, oldSize);
251 if (!putf8str || !utf8StrSz)
260 pdata->
Data, oldSize, putf8str, (
UPInt)utf8StrSz));
320 srcSize = psrcData->GetSize();
324 pourData->
Data, ourSize, psrcData->Data, srcSize));
332 tmp1 += (str ? str :
"");
354 if ((posAt + removeLength) > length)
355 removeLength = length - posAt;
362 pdata->
Data, bytePos,
363 pData->Data + bytePos + removeSize, (oldSize - bytePos - removeSize)));
371 if ((start >= length) || (start >= end))
378 return String(pdata->
Data + start, end - start);
400 SPInt bufferOffset = 0;
403 while(psource < pend)
408 }
while ((psource < pend) && (bufferOffset <
SPInt(
sizeof(buffer)-8)));
424 SPInt bufferOffset = 0;
427 while(psource < pend)
432 }
while ((psource < pend) && (bufferOffset <
SPInt(
sizeof(buffer)-8)));
455 poldData->
Data, byteIndex, substr, insertSize);
456 memcpy(pnewData->
Data + byteIndex + insertSize,
457 poldData->
Data + byteIndex, oldSize - byteIndex);
481 buf[(
UPInt)index] = 0;
483 Insert(buf, posAt, index);
503 }
while (--len && f && (f == l) && *b != 0);
505 if (f == l && (len != 0 || *b != 0))
528 h = ((h << 5) + h) ^ (unsigned) pdata[size];
556 #define OVR_SBUFF_DEFAULT_GROW_SIZE 512
611 UPInt size = 1<<bits;
612 GrowSize = size == growSize ? growSize : size;
674 UPInt size = origSize + srcSize;
687 UPInt size = srcSize + origSize;
695 if (!putf8str || !utf8StrSz)
701 UPInt size = utf8StrSz + origSize;
710 pstr = pstr ? pstr :
"";
718 pstr = pstr ? pstr : L
"";
748 memmove(
pData + byteIndex + insertSize,
pData + byteIndex, oldSize - byteIndex + 1);
751 Size = oldSize + insertSize;
UPInt InsertCharAt(UInt32 c, UPInt posAt)
#define String_LengthIsSize
int OVR_CDECL OVR_tolower(int c)
void operator=(const char *str)
UInt32 OVR_STDCALL GetCharAt(SPInt index, const char *putf8str, SPInt length)
int OVR_CDECL OVR_towupper(wchar_t charCode)
void SetGrowSize(UPInt growSize)
void SetData(DataDesc *pdesc)
__BEGIN_NAMESPACE_STD void * memcpy(void *__restrict __dest, const void *__restrict __src, size_t __n) __THROW __nonnull((1
SPInt OVR_STDCALL GetLength(const char *buf, SPInt buflen)
UInt32 GetNextChar(const char **offset) const
UInt32 OVR_STDCALL DecodeNextChar_Advance0(const char **putf8Buffer)
int OVR_CDECL OVR_towlower(wchar_t charCode)
void Remove(UPInt posAt, SPInt len=1)
void OVR_STDCALL EncodeChar(char *pbuffer, SPInt *pindex, UInt32 ucs_character)
UInt32 GetCharAt(UPInt index) const
const char * ToCStr() const
#define OVR_SBUFF_DEFAULT_GROW_SIZE
__BEGIN_NAMESPACE_STD void void * memmove(void *__dest, const void *__src, size_t __n) __THROW __nonnull((1
UPInt InsertCharAt(UInt32 c, UPInt posAt)
const char * ToCStr() const
static UPInt OVR_STDCALL BernsteinHashFunctionCIS(const void *pdataIn, UPInt size, UPInt seed=5381)
UInt32 DecodeNextChar(const char **putf8Buffer)
UByte UpperBit(UPInt val)
UInt32 GetFirstCharAt(UPInt index, const char **offset) const
UPInt GetLengthFlag() const
virtual void InitString(char *pbuffer, UPInt size) const =0
String Substring(UPInt start, UPInt end) const
void AppendString(const wchar_t *pstr, SPInt len=-1)
int OVR_CDECL OVR_stricmp(const char *a, const char *b)
void AppendChar(UInt32 ch)
void Insert(const char *substr, UPInt posAt, SPInt len=-1)
void operator+=(const String &src)
SPInt OVR_STDCALL GetByteIndex(SPInt index, const char *putf8str, SPInt length)
void operator=(const char *str)
bool LengthIsSize() const
DataDesc * GetData() const
void Reserve(UPInt _size)
void OVR_STDCALL EncodeString(char *pbuff, const wchar_t *pchar, SPInt length)
SPInt OVR_STDCALL GetEncodeStringSize(const wchar_t *pchar, SPInt length)
#define OVR_REALLOC(p, s)
int char * index(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1))
DataDesc * AllocData(UPInt size, UPInt lengthIsSize)
void AppendChar(UInt32 ch)
static UPInt OVR_STDCALL BernsteinHashFunction(const void *pdataIn, UPInt size, UPInt seed=5381)
static int OVR_STDCALL CompareNoCase(const char *a, const char *b)
UPInt OVR_CDECL OVR_strlen(const char *str)
void AssignString(const InitStruct &src, UPInt size)
void AppendString(const wchar_t *pstr, SPInt len=-1)
DataDesc * AllocDataCopy2(UPInt size, UPInt lengthIsSize, const char *pdata1, UPInt copySize1, const char *pdata2, UPInt copySize2)
String & Insert(const char *substr, UPInt posAt, SPInt len=-1)
String operator+(const char *str) const
DataDesc * AllocDataCopy1(UPInt size, UPInt lengthIsSize, const char *pdata, UPInt copySize)