10#ifdef __DCL_COMPILE_UNICODE__
12 #define CHAR_T wchar_t
13 #define UCHAR_T wint_t
14 #define BUFFER_T CharBuffer
15 #define STRING_T String
16 #define STRING_BUILDER_T StringBuilder
17 #define ARRAY_T StringArray
21 #define UCHAR_T byte_t
22 #define BUFFER_T ByteBuffer
23 #define STRING_T ByteString
24 #define STRING_BUILDER_T ByteStringBuilder
25 #define ARRAY_T ByteStringArray
43 static BUFFER_T* create(
size_t _len);
44 static BUFFER_T* create_e(
size_t _len);
46 static void extend(
BUFFER_T*& _buf,
size_t _len);
49 static void write(
BUFFER_T*& _buf,
const CHAR_T* _str,
size_t _len);
51 static int vformat(
BUFFER_T*& _buf,
const CHAR_T* _format, va_list _arglist);
61 void assignAlloc(
size_t _len);
88 void assign(
const CHAR_T* _ps1,
size_t _len1,
const CHAR_T* _ps2,
size_t _len2);
98 size_t indexOf(
CHAR_T _ch,
size_t _start = 0)
const;
99 size_t indexOf(
const CHAR_T* _psz,
size_t _start = 0)
const;
100 size_t indexOf(
const STRING_T& _str,
size_t _start = 0)
const;
101 size_t lastIndexOf(
CHAR_T _ch,
size_t _start = 0)
const;
102 size_t lastIndexOf(
const STRING_T& _str,
size_t _start = 0)
const;
103 size_t lastIndexOf(
const CHAR_T* _psz,
size_t _start = 0)
const;
105 bool contains(
CHAR_T _ch)
const;
106 bool contains(
const CHAR_T* _psz)
const;
107 bool contains(
const STRING_T& _str)
const;
109 bool endsWith(
const CHAR_T* _suffix)
const;
110 bool startsWith(
const CHAR_T* _prefix)
const;
111 bool endsWith(
const STRING_T& _suffix)
const;
112 bool startsWith(
const STRING_T& _prefix)
const;
114 int compare(
const CHAR_T* _psz,
size_t _len = (
size_t)-1)
const;
115 int compareNoCase(
const CHAR_T* _psz,
size_t _len = (
size_t)-1)
const;
116 static int compare(
const CHAR_T* psz1,
const CHAR_T* psz2,
size_t _len = (
size_t)-1);
117 static int compareNoCase(
const CHAR_T* psz1,
const CHAR_T* psz2,
size_t _len = (
size_t)-1);
119 STRING_T mid(
size_t _first,
size_t _len = (
size_t)-1)
const;
123 STRING_T substring(
size_t _first)
const;
124 STRING_T substring(
size_t _first,
size_t _last)
const;
130 STRING_T replace(
size_t _start,
size_t _len,
131 const CHAR_T* _new,
size_t _newlen = (
size_t)-1)
const;
133 STRING_T rreplace(
size_t _start,
size_t _len,
134 const CHAR_T* _new,
size_t _newlen = (
size_t)-1)
const;
141 const CHAR_T* _new,
size_t _newlen)
const;
193 const CHAR_T* _replacment,
195 size_t _limit = (
size_t)-1
203 size_t _limit = (
size_t)-1
211 size_t _limit = (
size_t)-1
219 size_t _limit = (
size_t)-1) const
224#ifdef __DCL_INCLUDED_LOCALE_H
225 STRING_T toUpperCase(locale_t _locale)
const;
226 STRING_T toLowerCase(locale_t _locale)
const;
228 String toString()
const;
237 bool isEmpty()
const;
238 size_t length()
const;
239 const CHAR_T* data()
const;
240 operator const CHAR_T* ()
const;
241 CHAR_T operator[](
size_t _index)
const;
243 static size_t length(
const CHAR_T* _psz,
size_t _max = (
size_t)-1);
257 EscapeFlags _flag = ESCAPE_DEFAULT
268 size_t _max = (
size_t)-1,
273 const ByteString& _bytes,
274 size_t _max = (
size_t)-1,
281 size_t _max = (
size_t)-1
285 const ByteString& _bytes,
286 size_t _max = (
size_t)-1
320 size_t _delimiterlen,
322 size_t _limit = (
size_t)-1
330 size_t _limit = (
size_t)-1
336 size_t _limit = (
size_t)-1
342 size_t _limit = (
size_t)-1
348 bool _hasEmpty =
false
353 static STRING_T valueOf(
unsigned char _n);
355 static STRING_T valueOf(
unsigned short _n);
357 static STRING_T valueOf(
unsigned int _n);
359 static STRING_T valueOf(
unsigned long _n);
360 static STRING_T valueOf(
long long _n);
361 static STRING_T valueOf(
unsigned long long _n);
364 static STRING_T valueOf(
long double _n);
374 return assign(_psz, (
size_t)-1);
404 return _str1.
compare(_psz) == 0;
409 return _str2.
compare(_psz) == 0;
414 CHAR_T sz[2] = { _ch, 0 };
420 CHAR_T sz[2] = { _ch, 0 };
431 return _str.
compare(_psz) != 0;
436 return _str2.
compare(_psz) != 0;
441 CHAR_T sz[2] = { _ch, 0 };
447 CHAR_T sz[2] = { _ch, 0 };
454 return n == 0 ? _str1.
compare(_str2) > 0 :
n > 0;
459 return _str1.
compare(_psz) > 0;
464 return _str2.
compare(_psz) < 0;
469 CHAR_T sz[2] = { _ch, 0 };
475 CHAR_T sz[2] = { _ch, 0 };
482 return n == 0 ? _str1.
compare(_str2) < 0 :
n < 0;
487 return _str1.
compare(_psz) < 0;
492 return _str2.
compare(_psz) > 0;
497 CHAR_T sz[2] = { _ch, 0 };
503 CHAR_T sz[2] = { _ch, 0 };
509 return _str1.
compare(_str2) >= 0;
514 return _str1.
compare(_psz) >= 0;
519 return _str2.
compare(_psz) <= 0;
524 CHAR_T sz[2] = { _ch, 0 };
536 return _str1.
compare(_str2) <= 0;
541 return _str1.
compare(_psz) <= 0;
546 return _str2.
compare(_psz) >= 0;
551 CHAR_T sz[2] = { _ch, 0 };
557 CHAR_T sz[2] = { _ch, 0 };
563 return indexOf(_ch, 0) != (size_t)-1;
568 return indexOf(_psz, 0) != (size_t)-1;
573 return indexOf(_str, 0) != (size_t)-1;
607 return mid(_first, _last - _first);
638 return __buf()->__dataLength;
646inline STRING_T::operator
const CHAR_T* ()
const
652 const ByteString& _bytes,
661 const ByteString& _bytes,
701#undef STRING_BUILDER_T
DCLCAPI bool operator!=(const STRING_T &_str1, const STRING_T &_str2)
DCLCAPI bool operator>=(const STRING_T &_str1, const STRING_T &_str2)
DCLCAPI bool operator==(const STRING_T &_str1, const STRING_T &_str2)
DCLCAPI bool operator<(const STRING_T &_str1, const STRING_T &_str2)
DCLCAPI bool operator>(const STRING_T &_str1, const STRING_T &_str2)
DCLCAPI bool operator<=(const STRING_T &_str1, const STRING_T &_str2)
DCLCAPI Date operator+(const Date &d, long nDays)
void CharsetConvertException *size_t n
void CharsetConvertException *__fields clear()
int compare(const CHAR_T *_psz, size_t _len=(size_t) -1) const
static size_t split(const CHAR_T *_begin, const CHAR_T *_end, const CHAR_T *_delimiter, size_t _delimiterlen, ARRAY_T &_results, size_t _limit=(size_t) -1)
bool startsWith(const CHAR_T *_prefix) const
const CHAR_T * data() const
static STRING_T toHexString(const char *_bytes, size_t _len, size_t _max=(size_t) -1, bool _prefix=true)
static STRING_T tryString(const char *_bytes, size_t _len, size_t _max=(size_t) -1)
STRING_T mid(size_t _first, size_t _len=(size_t) -1) const
bool endsWith(const CHAR_T *_suffix) const
friend class STRING_BUILDER_T
STRING_T replace(size_t _start, size_t _len, const CHAR_T *_new, size_t _newlen=(size_t) -1) const
bool contains(CHAR_T _ch) const
int compareNoCase(const CHAR_T *_psz, size_t _len=(size_t) -1) const
size_t indexOf(CHAR_T _ch, size_t _start=0) const
STRING_T & assign(const STRING_T &_str)
STRING_T substring(size_t _first) const
STRING_T rreplace(size_t _start, size_t _len, const CHAR_T *_new, size_t _newlen=(size_t) -1) const