DCL 3.7.4
Loading...
Searching...
No Matches
STRING_T Class Reference

#include <__STRING.h>

Public Types

enum  EscapeFlags { ESCAPE_DEFAULT , ESCAPE_EXTENDED , ESCAPE_ALL , ESCAPE_XML }

Public Member Functions

 ~STRING_T ()
 STRING_T ()
 STRING_T (const STRING_T &_str)
 STRING_T (CHAR_T _ch, size_t _repeat=1)
 STRING_T (const CHAR_T *_ps, size_t _start, size_t _len)
 STRING_T (const CHAR_T *_psz, size_t _len=(size_t) -1)
 STRING_T (const CHAR_T *_begin, const CHAR_T *_end)
 STRING_T (BUFFER_T *_buf)
STRING_Tassign (const STRING_T &_str)
STRING_Tassign (CHAR_T _ch, size_t _repeat=1)
STRING_Tassign (const CHAR_T *_ps, size_t _start, size_t _len)
STRING_Tassign (const CHAR_T *_psz, size_t _len=(size_t) -1)
STRING_Tassign (const CHAR_T *_begin, const CHAR_T *_end)
STRING_Tassign (BUFFER_T *_buf)
STRING_Toperator= (const STRING_T &_str)
STRING_Toperator= (const CHAR_T *_psz)
STRING_Toperator= (CHAR_T _ch)
STRING_Toperator= (BUFFER_T *_buf)
void clear ()
size_t indexOf (CHAR_T _ch, size_t _start=0) const
size_t indexOf (const CHAR_T *_psz, size_t _start=0) const
size_t indexOf (const STRING_T &_str, size_t _start=0) const
size_t lastIndexOf (CHAR_T _ch, size_t _start=0) const
size_t lastIndexOf (const STRING_T &_str, size_t _start=0) const
size_t lastIndexOf (const CHAR_T *_psz, size_t _start=0) const
bool contains (CHAR_T _ch) const
bool contains (const CHAR_T *_psz) const
bool contains (const STRING_T &_str) const
bool endsWith (const CHAR_T *_suffix) const
bool startsWith (const CHAR_T *_prefix) const
bool endsWith (const STRING_T &_suffix) const
bool startsWith (const STRING_T &_prefix) const
int compare (const CHAR_T *_psz, size_t _len=(size_t) -1) const
int compareNoCase (const CHAR_T *_psz, size_t _len=(size_t) -1) const
STRING_T mid (size_t _first, size_t _len=(size_t) -1) const
STRING_T left (size_t _len) const
STRING_T right (size_t _len) const
STRING_T substring (size_t _first) const
STRING_T substring (size_t _first, size_t _last) const
STRING_T padCenter (size_t _len, CHAR_T _ch) const
STRING_T padLeft (size_t _len, CHAR_T _ch) const
STRING_T padRight (size_t _len, CHAR_T _ch) const
STRING_T replace (size_t _start, size_t _len, const CHAR_T *_new, size_t _newlen=(size_t) -1) const
STRING_T replace (size_t _start, const STRING_T &_new) const
STRING_T rreplace (size_t _start, size_t _len, const CHAR_T *_new, size_t _newlen=(size_t) -1) const
STRING_T rreplace (size_t _start, const STRING_T &_new) const
STRING_T replace (CHAR_T _old, CHAR_T _new) const
STRING_T replace (const CHAR_T *_old, const CHAR_T *_new) const
STRING_T replace (const STRING_T &_old, const STRING_T &_new) const
STRING_T replace (const CHAR_T *_old, size_t _oldlen, const CHAR_T *_new, size_t _newlen) const
size_t search (const CHAR_T *_regex, bool _icase) const __DCL_THROWS1(RegexException *)
size_t search (const STRING_T &_regex, bool _icase) const __DCL_THROWS1(RegexException *)
STRING_T substring (const CHAR_T *_regex, bool _icase) const __DCL_THROWS1(RegexException *)
STRING_T substring (const STRING_T &_regex, bool _icase) const __DCL_THROWS1(RegexException *)
bool searches (const CHAR_T *_regex, bool _icase) const __DCL_THROWS1(RegexException *)
bool searches (const STRING_T &_regex, bool _icase) const __DCL_THROWS1(RegexException *)
bool matches (const CHAR_T *_regex, bool _icase) const __DCL_THROWS1(RegexException *)
bool matches (const STRING_T &_regex, bool _icase) const __DCL_THROWS1(RegexException *)
STRING_T replace_r (const CHAR_T *_regex, const CHAR_T *_replacment, bool _icase, size_t _limit=(size_t) -1) const __DCL_THROWS1(RegexException *)
STRING_T replace_r (const STRING_T &_regex, const STRING_T &_replacement, bool _icase, size_t _limit=(size_t) -1) const __DCL_THROWS1(RegexException *)
ARRAY_Tsplit_r (const CHAR_T *_regex, bool _icase, ARRAY_T &_results, size_t _limit=(size_t) -1) const __DCL_THROWS1(RegexException *)
ARRAY_Tsplit_r (const STRING_T &_regex, bool _icase, ARRAY_T &_results, size_t _limit=(size_t) -1) const __DCL_THROWS1(RegexException *)
STRING_T toUpperCase () const
STRING_T toLowerCase () const
String toString () const
STRING_T trim () const
STRING_T trimLeft () const
STRING_T trimRight () const
STRING_T trim (const CHAR_T *_chars) const
STRING_T trimLeft (const CHAR_T *_chars) const
STRING_T trimRight (const CHAR_T *_chars) const
bool isEmpty () const
size_t length () const
const CHAR_Tdata () const
 operator const CHAR_T * () const
CHAR_T operator[] (size_t _index) const
size_t split (const STRING_T &_delimiter, ARRAY_T &_results, size_t _limit=(size_t) -1) const
size_t split (CHAR_T _delimiter, ARRAY_T &_results, size_t _limit=(size_t) -1) const

Static Public Member Functions

static int compare (const CHAR_T *psz1, const CHAR_T *psz2, size_t _len=(size_t) -1)
static int compareNoCase (const CHAR_T *psz1, const CHAR_T *psz2, size_t _len=(size_t) -1)
static size_t length (const CHAR_T *_psz, size_t _max=(size_t) -1)
static STRING_T format (const CHAR_T *_format,...)
static STRING_T escape (const CHAR_T *_ps, size_t _len, EscapeFlags _flag=ESCAPE_DEFAULT)
static STRING_T unescape (const CHAR_T *_psz, size_t _len)
static STRING_T toHexString (const char *_bytes, size_t _len, size_t _max=(size_t) -1, bool _prefix=true)
static STRING_T toHexString (const ByteString &_bytes, 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)
static STRING_T tryString (const ByteString &_bytes, size_t _max=(size_t) -1)
static CHAR_Tfind (const CHAR_T *_begin, const CHAR_T *_end, CHAR_T _ch)
static CHAR_Trfind (const CHAR_T *_begin, const CHAR_T *_end, CHAR_T _ch)
static CHAR_Tfind (const CHAR_T *_begin, const CHAR_T *_end, const CHAR_T *_sub, size_t _sublen)
static CHAR_Trfind (const CHAR_T *_begin, const CHAR_T *_end, const CHAR_T *_sub, size_t _sublen)
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)
static size_t split (const CHAR_T *_begin, const CHAR_T *_end, CHAR_T _delimiter, ARRAY_T &_results, size_t _limit=(size_t) -1)
static STRING_T join (const ARRAY_T &_array, CHAR_T _delimiter, bool _hasEmpty=false)
static STRING_T valueOf (bool _b)
static STRING_T valueOf (char _n)
static STRING_T valueOf (unsigned char _n)
static STRING_T valueOf (short _n)
static STRING_T valueOf (unsigned short _n)
static STRING_T valueOf (int _n)
static STRING_T valueOf (unsigned int _n)
static STRING_T valueOf (long _n)
static STRING_T valueOf (unsigned long _n)
static STRING_T valueOf (long long _n)
static STRING_T valueOf (unsigned long long _n)
static STRING_T valueOf (float _n)
static STRING_T valueOf (double _n)
static STRING_T valueOf (long double _n)

Protected Member Functions

BUFFER_T__buf () const
void assignAlloc (size_t _len)
void assign (const CHAR_T *_ps1, size_t _len1, const CHAR_T *_ps2, size_t _len2)

Protected Attributes

CHAR_T__psz

Friends

class STRING_BUILDER_T
DCLCAPI friend STRING_T operator+ (const STRING_T &_str1, const STRING_T &_str2)
DCLCAPI friend STRING_T operator+ (const STRING_T &_str, CHAR_T _ch)
DCLCAPI friend STRING_T operator+ (CHAR_T _ch, const STRING_T &_str)
DCLCAPI friend STRING_T operator+ (const STRING_T &_str, const CHAR_T *_psz)
DCLCAPI friend STRING_T operator+ (const CHAR_T *_psz, const STRING_T &_str)

Detailed Description

Definition at line 54 of file __STRING.h.

Member Enumeration Documentation

◆ EscapeFlags

enum STRING_T::EscapeFlags
Enumerator
ESCAPE_DEFAULT 
ESCAPE_EXTENDED 
ESCAPE_ALL 
ESCAPE_XML 

Definition at line 237 of file __STRING.h.

237 {
238 ESCAPE_DEFAULT, // ASCII_0 ~ ASCII_31, ASCII_127 ~ 256, " ' / \ ?
239 ESCAPE_EXTENDED, // exclusive 0~9 a~z A~Z
241 ESCAPE_XML // &<>"'
242 };
@ ESCAPE_DEFAULT
Definition __STRING.h:238
@ ESCAPE_XML
Definition __STRING.h:241
@ ESCAPE_ALL
Definition __STRING.h:240
@ ESCAPE_EXTENDED
Definition __STRING.h:239

Constructor & Destructor Documentation

◆ ~STRING_T()

STRING_T::~STRING_T ( )

Definition at line 322 of file __STRING.cpp.

323{
324 if (__psz != __EMPTY) {
325 __DCL_ASSERT(__buf()->__refCount != 0);
326 __buf()->release();
327 }
328}
#define __EMPTY
Definition __STRING.cpp:301
#define __DCL_ASSERT(expr)
Definition Object.h:394
BUFFER_T * __buf() const
Definition __STRING.h:59
long release()
Definition __STRING.cpp:102

◆ STRING_T() [1/7]

STRING_T::STRING_T ( )

Definition at line 330 of file __STRING.cpp.

331{
332 __psz = __EMPTY;
333}
CHAR_T * __psz
Definition __STRING.h:58

◆ STRING_T() [2/7]

STRING_T::STRING_T ( const STRING_T & _str)

Definition at line 344 of file __STRING.cpp.

345{
346 __psz = __EMPTY;
347 assign(_str);
348}
STRING_T & assign(const STRING_T &_str)
Definition __STRING.cpp:387

◆ STRING_T() [3/7]

STRING_T::STRING_T ( CHAR_T _ch,
size_t _repeat = 1 )

Definition at line 350 of file __STRING.cpp.

351{
352 __psz = __EMPTY;
353 assign(_ch, _repeat);
354}

◆ STRING_T() [4/7]

STRING_T::STRING_T ( const CHAR_T * _ps,
size_t _start,
size_t _len )

Definition at line 356 of file __STRING.cpp.

357{
358 __psz = __EMPTY;
359 assign(_psz, _start, _len);
360}

◆ STRING_T() [5/7]

STRING_T::STRING_T ( const CHAR_T * _psz,
size_t _len = (size_t)-1 )

Definition at line 362 of file __STRING.cpp.

363{
364 __psz = __EMPTY;
365 assign(_psz, _len);
366}

◆ STRING_T() [6/7]

STRING_T::STRING_T ( const CHAR_T * _begin,
const CHAR_T * _end )

Definition at line 368 of file __STRING.cpp.

369{
370 __psz = __EMPTY;
371 assign(_begin, _end);
372}

◆ STRING_T() [7/7]

STRING_T::STRING_T ( BUFFER_T * _buf)

Definition at line 335 of file __STRING.cpp.

336{
337 __DCL_ASSERT_PARAM(_buf != NULL);
338 __DCL_ASSERT(_buf->__refCount >= 1);
339
340 __psz = __EMPTY;
341 assign(_buf);
342}
#define NULL
Definition Config.h:312
#define __DCL_ASSERT_PARAM(expr)
Definition Object.h:409
volatile long __refCount
Definition __STRING.h:32

Member Function Documentation

◆ __buf()

BUFFER_T * STRING_T::__buf ( ) const
inlineprotected

Definition at line 59 of file __STRING.h.

59{ return (BUFFER_T*)__psz - 1; }
#define BUFFER_T
Definition __STRING.h:22

◆ assign() [1/7]

STRING_T & STRING_T::assign ( BUFFER_T * _buf)

Definition at line 374 of file __STRING.cpp.

375{
376 __DCL_ASSERT_PARAM(_buf != NULL);
377 __DCL_ASSERT(_buf->__refCount >= 1);
378 if (__psz != _buf->data()) {
379 if (__psz != __EMPTY)
380 __buf()->release();
381 __psz = _buf->data();
382 _buf->addRef();
383 }
384 return *this;
385}
long addRef()
Definition __STRING.cpp:96
CHAR_T * data()
Definition __STRING.h:36

◆ assign() [2/7]

STRING_T & STRING_T::assign ( CHAR_T _ch,
size_t _repeat = 1 )

Definition at line 405 of file __STRING.cpp.

406{
407 if (_repeat) {
408 assignAlloc(_repeat);
409
410 CHAR_T* p = __psz;
411 CHAR_T* _end = p + _repeat;
412 while(p < _end)
413 *p++ = _ch;
414
415 __buf()->__dataLength = _repeat;
416 __DCL_ASSERT(__psz[_repeat] == _T('\0'));
417 }
418 else
419 clear();
420
421 return *this;
422}
#define _T(s)
Definition __STRING.h:19
#define CHAR_T
Definition __STRING.h:20
void assignAlloc(size_t _len)
Definition __STRING.cpp:303
void clear()
Definition __STRING.cpp:475
size_t __dataLength
Definition __STRING.h:34

◆ assign() [3/7]

STRING_T & STRING_T::assign ( const CHAR_T * _begin,
const CHAR_T * _end )

Definition at line 448 of file __STRING.cpp.

449{
450 __DCL_ASSERT_PARAM(_begin <= _end);
451 return assign(_begin, 0, _end - _begin);
452}

◆ assign() [4/7]

STRING_T & STRING_T::assign ( const CHAR_T * _ps,
size_t _start,
size_t _len )

Definition at line 424 of file __STRING.cpp.

425{
426 __DCL_ASSERT_PARAM(_ps != NULL);
427 if (_len) {
428 assignAlloc(_len);
429
430 memcpy(__psz, _ps + _start, _len * sizeof(CHAR_T));
431
432 __buf()->__dataLength = _len;
433 __DCL_ASSERT(__psz[_len] == _T('\0'));
434 }
435 else
436 clear();
437
438 return *this;
439}

◆ assign() [5/7]

void STRING_T::assign ( const CHAR_T * _ps1,
size_t _len1,
const CHAR_T * _ps2,
size_t _len2 )
protected

Definition at line 454 of file __STRING.cpp.

458{
459 __DCL_ASSERT_PARAM(_ps1 != NULL && _ps2 != NULL);
460
461 size_t _len = _len1 + _len2;
462 if (_len) {
463 assignAlloc(_len);
464
465 memcpy(__psz, _ps1, _len1 * sizeof(CHAR_T));
466 memcpy(__psz + _len1, _ps2, _len2 * sizeof(CHAR_T));
467
468 __buf()->__dataLength = _len;
469 __DCL_ASSERT(__psz[_len] == _T('\0'));
470 }
471 else
472 clear();
473}

◆ assign() [6/7]

STRING_T & STRING_T::assign ( const CHAR_T * _psz,
size_t _len = (size_t)-1 )

Definition at line 441 of file __STRING.cpp.

442{
443 if (_len == (size_t)-1)
444 _len = STRING_T::length(_psz);
445 return assign(_psz, 0, _len);
446}
size_t length() const
Definition __STRING.h:626

◆ assign() [7/7]

STRING_T & STRING_T::assign ( const STRING_T & _str)

Definition at line 387 of file __STRING.cpp.

388{
389 if (__psz != _str.__psz) {
390 if (_str.__buf()->__refCount > 0) {
391 __DCL_ASSERT(_str.__psz != __EMPTY);
392 if (__psz != __EMPTY)
393 __buf()->release();
394 __psz = _str.__psz;
395 __buf()->addRef();
396 }
397 else {
398 // -1, 0
399 assign(_str, _str.length());
400 }
401 }
402 return *this;
403}

◆ assignAlloc()

void STRING_T::assignAlloc ( size_t _len)
protected

Definition at line 303 of file __STRING.cpp.

304{
305 __DCL_ASSERT_PARAM(_len > 0);
306
307 BUFFER_T* buf = __buf();
308 if (buf->__refCount == 0) {
309 __DCL_ASSERT(__psz == __EMPTY);
310 buf = BUFFER_T::create(_len);
311 }
312 else {
313 __DCL_ASSERT(__psz != __EMPTY);
314 buf->release();
315 buf = BUFFER_T::create(_len);
316 }
317 __psz = buf->data();
318 // assignAlloc을 호출한 곳에는 '\0' 설정하지 않는다.
319 __psz[_len] = _T('\0');
320}
static BUFFER_T * create(size_t _len)
Definition __STRING.cpp:149

◆ clear()

void STRING_T::clear ( )

Definition at line 475 of file __STRING.cpp.

476{
477 if (__psz != __EMPTY) {
478 __buf()->release();
479 __psz = __EMPTY;
480 }
481}

◆ compare() [1/2]

int STRING_T::compare ( const CHAR_T * _psz,
size_t _len = (size_t)-1 ) const
inline

Definition at line 377 of file __STRING.h.

378{
379 return STRING_T::compare(__psz, _psz, _len);
380}
int compare(const CHAR_T *_psz, size_t _len=(size_t) -1) const
Definition __STRING.h:377

◆ compare() [2/2]

int STRING_T::compare ( const CHAR_T * psz1,
const CHAR_T * psz2,
size_t _len = (size_t)-1 )
static

Definition at line 591 of file __STRING.cpp.

595{
596 __DCL_ASSERT_PARAM(psz1 != NULL && psz2 != NULL);
597
598 if (_len == (size_t)-1)
599 return STRCMP(psz1, psz2);
600 else
601 return STRNCMP(psz1, psz2, _len);
602}
#define STRCMP(s1, s2)
Definition __STRING.cpp:66
#define STRNCMP(s1, s2, n)
Definition __STRING.cpp:67

◆ compareNoCase() [1/2]

int STRING_T::compareNoCase ( const CHAR_T * _psz,
size_t _len = (size_t)-1 ) const
inline

Definition at line 382 of file __STRING.h.

383{
384 return STRING_T::compareNoCase(__psz, _psz, _len);
385}
int compareNoCase(const CHAR_T *_psz, size_t _len=(size_t) -1) const
Definition __STRING.h:382

◆ compareNoCase() [2/2]

int STRING_T::compareNoCase ( const CHAR_T * psz1,
const CHAR_T * psz2,
size_t _len = (size_t)-1 )
static

Definition at line 604 of file __STRING.cpp.

608{
609 __DCL_ASSERT_PARAM(psz1 != NULL && psz2 != NULL);
610
611 if (_len == (size_t)-1)
612 return STRCASECMP(psz1, psz2);
613 else
614 return STRNCASECMP(psz1, psz2, _len);
615}
#define STRCASECMP(s1, s2)
Definition __STRING.cpp:74
#define STRNCASECMP(s1, s2, n)
Definition __STRING.cpp:75

◆ contains() [1/3]

bool STRING_T::contains ( CHAR_T _ch) const
inline

Definition at line 551 of file __STRING.h.

552{
553 return indexOf(_ch, 0) != (size_t)-1;
554}
size_t indexOf(CHAR_T _ch, size_t _start=0) const
Definition __STRING.cpp:521

◆ contains() [2/3]

bool STRING_T::contains ( const CHAR_T * _psz) const
inline

Definition at line 556 of file __STRING.h.

557{
558 return indexOf(_psz, 0) != (size_t)-1;
559}

◆ contains() [3/3]

bool STRING_T::contains ( const STRING_T & _str) const
inline

Definition at line 561 of file __STRING.h.

562{
563 return indexOf(_str, 0) != (size_t)-1;
564}

◆ data()

const CHAR_T * STRING_T::data ( ) const
inline

Definition at line 631 of file __STRING.h.

632{
633 return __psz;
634}

◆ endsWith() [1/2]

bool STRING_T::endsWith ( const CHAR_T * _suffix) const
inline

Definition at line 566 of file __STRING.h.

567{
568 size_t len = STRING_T::length(_suffix);
569 return length() >= len &&
570 STRING_T::compare(__psz + length() - len,
571 _suffix, len) == 0;
572}

◆ endsWith() [2/2]

bool STRING_T::endsWith ( const STRING_T & _suffix) const
inline

Definition at line 578 of file __STRING.h.

579{
580 return length() >= _suffix.length() &&
581 STRING_T::compare(__psz + length() - _suffix.length(),
582 _suffix.__psz, _suffix.length()) == 0;
583}

◆ escape()

STRING_T STRING_T::escape ( const CHAR_T * _ps,
size_t _len,
EscapeFlags _flag = ESCAPE_DEFAULT )
static

Definition at line 1361 of file __STRING.cpp.

1366{
1367 __DCL_ASSERT_PARAM(_ps != NULL);
1368
1369 if (_len == 0)
1370 return STRING_T();
1371
1372 // javascript
1373 // byte_t sizeof(CHAR_T) == 1 "\xff" "%ff"
1374 // Windows sizeof(CHAR_T) == 2 "\uffff" "%uffff"
1375 // Linux sizeof(CHAR_T) == 4 "\u00ffffff" "%uffffff" ??
1376
1377 BUFFER_T* buf = BUFFER_T::create(_len * 4);
1378 const UCHAR_T* src = (const UCHAR_T*) _ps;
1379 const UCHAR_T* _end = src + _len;
1380
1381 if (_flag == ESCAPE_XML) {
1382 for( ; src < _end; src++) {
1383 CHAR_T c = *src;
1384 switch (c) {
1385 case _T('&') : BUFFER_T::write(buf, _T("&amp;"), 5); break;
1386 case _T('<') : BUFFER_T::write(buf, _T("&lt;"), 4); break;
1387 case _T('>') : BUFFER_T::write(buf, _T("&gt;"), 4); break;
1388 case _T('\"') : BUFFER_T::write(buf, _T("&quot;"), 6); break;
1389 case _T('\'') : BUFFER_T::write(buf, _T("&#39;"), 5); break;
1390 default:
1391 BUFFER_T::write(buf, c);
1392 }
1393 }
1394 }
1395 else {
1396 // ESCAPE_DEFAULT, ESCAPE_EXTENDED, ESCAPE_ALL
1397 for ( ; src < _end; src++) {
1398 unsigned int c = *src;
1399 if (__escapeable(c, _flag)) {
1400 BUFFER_T::write(buf, _T('\\'));
1401 switch(c) {
1402 case _T('\0') : BUFFER_T::write(buf, _T('0')); break; // NULL
1403 case _T('\a') : BUFFER_T::write(buf, _T('a')); break; // BEL, alert
1404 case _T('\b') : BUFFER_T::write(buf, _T('b')); break; // backspace
1405 case _T('\t') : BUFFER_T::write(buf, _T('t')); break; // horizontal tab
1406 case _T('\n') : BUFFER_T::write(buf, _T('n')); break; // line feed, new line
1407 case _T('\v') : BUFFER_T::write(buf, _T('v')); break; // vertical tab
1408 case _T('\f') : BUFFER_T::write(buf, _T('f')); break; // form feed
1409 case _T('\r') : BUFFER_T::write(buf, _T('r')); break; // carriage return
1410 case _T('\"') : // double quotation mark
1411 case _T('\'') : // single quotation mark
1412 case _T('\\') : // back slash
1413 BUFFER_T::write(buf, c);
1414 break;
1415 default :
1416 if ( c <= 0xff) {
1417 BUFFER_T::write(buf, _T('x'));
1418 BUFFER_T::write(buf, __hex__[c >> 4]);
1419 BUFFER_T::write(buf, __hex__[c & 0x0f]);
1420 }
1421 else if (c <= 0xffff) {
1422 // 16bit unicode BMP
1423 BUFFER_T::write(buf, _T('u'));
1424 unsigned char a[4];
1425 a[3] = c & 0x0f;
1426 c >>= 4;
1427 a[2] = c & 0x0f;
1428 c >>= 4;
1429 a[1] = c & 0x0f;
1430 c >>= 4;
1431 a[0] = c;
1432
1433 for(int i = 0; i < 4; i++)
1434 BUFFER_T::write(buf, __hex__[a[i]]);
1435 }
1436 else {
1437 BUFFER_T::write(buf, c);
1438 }
1439 }
1440 }
1441 else
1442 BUFFER_T::write(buf, c);
1443 }
1444 }
1445
1446 BUFFER_T::shrink(buf);
1447
1448 STRING_T r(buf);
1449 buf->release();
1450 return r;
1451}
bool __escapeable(unsigned int c, STRING_T::EscapeFlags _flag)
#define STRING_T
Definition __STRING.h:23
#define UCHAR_T
Definition __STRING.h:21
IOException *size_t r
Definition MediaInfo.cpp:82
static void write(BUFFER_T *&_buf, const CHAR_T *_str, size_t _len)
Definition __STRING.cpp:214
static void shrink(BUFFER_T *&_buf)
Definition __STRING.cpp:195

◆ find() [1/2]

CHAR_T * STRING_T::find ( const CHAR_T * _begin,
const CHAR_T * _end,
CHAR_T _ch )
static

Definition at line 1660 of file __STRING.cpp.

1665{
1666 __DCL_ASSERT_PARAM(_begin != NULL && _begin <= _end);
1667
1668 while (_begin < _end) {
1669 if (*_begin == _ch)
1670 return (CHAR_T*)_begin;
1671 _begin++;
1672 }
1673 return NULL;
1674}

◆ find() [2/2]

CHAR_T * STRING_T::find ( const CHAR_T * _begin,
const CHAR_T * _end,
const CHAR_T * _sub,
size_t _sublen )
static

Definition at line 1691 of file __STRING.cpp.

1697{
1698 __DCL_ASSERT_PARAM(_begin != NULL && _begin <= _end);
1699 __DCL_ASSERT_PARAM(_sub != NULL);
1700
1701 const CHAR_T* subbegin = _sub;
1702 const CHAR_T* subend = _sub + _sublen;
1703
1704 if (_begin == _end) {
1705 if (subbegin == subend)
1706 return (CHAR_T*)_begin;
1707 return NULL;
1708 }
1709
1710 CHAR_T c = *subbegin++;
1711 while (_begin < _end) {
1712 if (c == *_begin++) {
1713 // found first char
1714 const CHAR_T* s = _begin;// s++;
1715 const CHAR_T* _sub = subbegin;
1716 while (s < _end && _sub < subend && *s == *_sub)
1717 s++, _sub++;
1718
1719 if (_sub == subend)
1720// return (CHAR_T*)_begin;
1721 return (CHAR_T*)--_begin;
1722 }
1723// _begin++;
1724 }
1725
1726 return NULL;
1727}

◆ format()

STRING_T STRING_T::format ( const CHAR_T * _format,
... )
static

Definition at line 1318 of file __STRING.cpp.

1319{
1320 size_t len = STRING_T::length(_format) * 4;
1321 BUFFER_T* buf = BUFFER_T::create_e(len);
1322
1323 va_list arglist;
1324 va_start(arglist, _format);
1325 int __UNUSED__ n = BUFFER_T::vformat(buf, _format, arglist);
1326 va_end(arglist);
1327
1328 STRING_T r = buf;
1329 buf->release();
1330#ifdef __DCL_DEBUG
1331 const CHAR_T* p = r;
1332 __DCL_ASSERT(p[r.length()] == __T('\0'));
1333#endif
1334 return r;
1335}
#define __UNUSED__
Definition Config.h:341
#define __T(str)
Definition Object.h:60
static BUFFER_T * create_e(size_t _len)
Definition __STRING.cpp:168
static int vformat(BUFFER_T *&_buf, const CHAR_T *_format, va_list _arglist)
Definition __STRING.cpp:230

◆ indexOf() [1/3]

size_t STRING_T::indexOf ( CHAR_T _ch,
size_t _start = 0 ) const

Definition at line 521 of file __STRING.cpp.

522{
523 __DCL_ASSERT_PARAM(_start <= length());
524 const CHAR_T* p = STRING_T::find(__psz + _start,
525 __psz + length(), _ch);
526 if (p)
527 return p - __psz;
528 return (size_t)-1;
529}
static CHAR_T * find(const CHAR_T *_begin, const CHAR_T *_end, CHAR_T _ch)

◆ indexOf() [2/3]

size_t STRING_T::indexOf ( const CHAR_T * _psz,
size_t _start = 0 ) const

Definition at line 531 of file __STRING.cpp.

532{
533 __DCL_ASSERT_PARAM(_start <= length());
534 __DCL_ASSERT_PARAM(_psz != NULL);
535
536 const CHAR_T* p = STRSTR(__psz + _start, _psz);
537 if (p)
538 return p - __psz;
539 return (size_t)-1;
540}
#define STRSTR(s, cs)
Definition __STRING.cpp:80

◆ indexOf() [3/3]

size_t STRING_T::indexOf ( const STRING_T & _str,
size_t _start = 0 ) const

Definition at line 542 of file __STRING.cpp.

543{
544 __DCL_ASSERT_PARAM(_start <= length());
545 const CHAR_T* p = STRING_T::find(
546 __psz + _start, __psz + length(),
547 _str, _str.length()
548 );
549 if (p)
550 return p - __psz;
551 return (size_t)-1;
552}

◆ isEmpty()

bool STRING_T::isEmpty ( ) const
inline

Definition at line 621 of file __STRING.h.

622{
623 return length() == 0;
624}

◆ join()

STRING_T STRING_T::join ( const ARRAY_T & _array,
CHAR_T _delimiter,
bool _hasEmpty = false )
static

Definition at line 1823 of file __STRING.cpp.

1828{
1830 ARRAY_T::ConstIterator it = _array.begin();
1831 if (it != _array.end()) {
1832 for ( ; ; ) {
1833 const STRING_T& s = *it;
1834 r += s;
1835 if (++it == _array.end()) {
1836 break;
1837 }
1838
1839 if (s.isEmpty()) {
1840 if (_hasEmpty) {
1841 r += _delimiter;
1842 }
1843 }
1844 else {
1845 r += _delimiter;
1846 }
1847 }
1848 }
1849
1850 return r;
1851}
#define STRING_BUILDER_T
Definition __STRING.h:56
const ELEMENT_T * ConstIterator
Definition __ARRAY.h:56
ConstIterator end() const
Definition __ARRAY.h:134
ConstIterator begin() const
Definition __ARRAY.h:127
bool isEmpty() const
Definition __STRING.h:621

◆ lastIndexOf() [1/3]

size_t STRING_T::lastIndexOf ( CHAR_T _ch,
size_t _start = 0 ) const

Definition at line 554 of file __STRING.cpp.

555{
556 __DCL_ASSERT_PARAM(_start <= length());
557 const CHAR_T* p = STRING_T::rfind(
558 __psz, __psz + length() - _start,
559 _ch
560 );
561 if (p)
562 return p - __psz;
563 return (size_t)-1;
564}
static CHAR_T * rfind(const CHAR_T *_begin, const CHAR_T *_end, CHAR_T _ch)

◆ lastIndexOf() [2/3]

size_t STRING_T::lastIndexOf ( const CHAR_T * _psz,
size_t _start = 0 ) const

Definition at line 566 of file __STRING.cpp.

567{
568 __DCL_ASSERT_PARAM(_start <= length());
569 __DCL_ASSERT_PARAM(_psz != NULL);
570 const CHAR_T* p = STRING_T::rfind(
571 __psz, __psz + length() - _start,
572 _psz, STRING_T::length(_psz)
573 );
574 if (p)
575 return p - __psz;
576 return (size_t)-1;
577}

◆ lastIndexOf() [3/3]

size_t STRING_T::lastIndexOf ( const STRING_T & _str,
size_t _start = 0 ) const

Definition at line 579 of file __STRING.cpp.

580{
581 __DCL_ASSERT_PARAM(_start <= length());
582 const CHAR_T* p = STRING_T::rfind(
583 __psz, __psz + length() - _start,
584 _str, _str.length()
585 );
586 if (p)
587 return p - __psz;
588 return (size_t)-1;
589}

◆ left()

STRING_T STRING_T::left ( size_t _len) const

Definition at line 634 of file __STRING.cpp.

635{
636 return mid(0, _len);
637}
STRING_T mid(size_t _first, size_t _len=(size_t) -1) const
Definition __STRING.cpp:617

◆ length() [1/2]

size_t STRING_T::length ( ) const
inline

Definition at line 626 of file __STRING.h.

627{
628 return __buf()->__dataLength;
629}

◆ length() [2/2]

size_t STRING_T::length ( const CHAR_T * _psz,
size_t _max = (size_t)-1 )
static

Definition at line 1305 of file __STRING.cpp.

1309{
1310 __DCL_ASSERT_PARAM(_psz != NULL);
1311 size_t r = 0;
1312 while (*_psz++ && r < _max) {
1313 r++;
1314 }
1315 return r;
1316}

◆ matches() [1/2]

bool STRING_T::matches ( const CHAR_T * _regex,
bool _icase ) const

Definition at line 928 of file __STRING.cpp.

932{
933 __DCL_ASSERT_PARAM(_regex != NULL);
934 return __regex_matches(
935 _regex, _regex + STRING_T::length(_regex),
936 __psz, __psz + length(),
937 _icase
938 );
939}
bool __regex_matches(const wchar_t *_regex, const wchar_t *_regexend, const wchar_t *_begin, const wchar_t *_end, bool _icase) __DCL_THROWS1(RegexException *)
Definition _regex.cpp:191

◆ matches() [2/2]

bool STRING_T::matches ( const STRING_T & _regex,
bool _icase ) const

Definition at line 941 of file __STRING.cpp.

945{
946 return __regex_matches(
947 _regex.__psz, _regex.__psz + _regex.length(),
948 __psz, __psz + length(),
949 _icase
950 );
951}

◆ mid()

STRING_T STRING_T::mid ( size_t _first,
size_t _len = (size_t)-1 ) const

Definition at line 617 of file __STRING.cpp.

620{
621 __DCL_ASSERT_PARAM(_first <= length());
622
623 if (_len == (size_t)-1)
624 _len = length() - _first;
625
626 __DCL_ASSERT((_first + _len) <= length());
627
628 if (_first == 0 && _len == length())
629 return *this;
630
631 return STRING_T(__psz, _first, _len);
632}

◆ operator const CHAR_T *()

STRING_T::operator const CHAR_T * ( ) const
inline

Definition at line 636 of file __STRING.h.

637{
638 return __psz;
639}

◆ operator=() [1/4]

STRING_T & STRING_T::operator= ( BUFFER_T * _buf)
inline

Definition at line 372 of file __STRING.h.

373{
374 return assign(_buf);
375}

◆ operator=() [2/4]

STRING_T & STRING_T::operator= ( CHAR_T _ch)
inline

Definition at line 367 of file __STRING.h.

368{
369 return assign(&_ch, 1);
370}

◆ operator=() [3/4]

STRING_T & STRING_T::operator= ( const CHAR_T * _psz)
inline

Definition at line 362 of file __STRING.h.

363{
364 return assign(_psz, (size_t)-1);
365}

◆ operator=() [4/4]

STRING_T & STRING_T::operator= ( const STRING_T & _str)
inline

Definition at line 357 of file __STRING.h.

358{
359 return assign(_str);
360}

◆ operator[]()

CHAR_T STRING_T::operator[] ( size_t _index) const

Definition at line 1296 of file __STRING.cpp.

1297{
1298 __DCL_ASSERT(0 < length() && _index < length());
1299// if (!(_index < __buf->__dataLength))
1300// throw(new InvalidIndexException(0, __buf->__dataLength - 1, _index));
1301 return __psz[_index];
1302}

◆ padCenter()

STRING_T STRING_T::padCenter ( size_t _len,
CHAR_T _ch ) const

Definition at line 646 of file __STRING.cpp.

647{
648 if (_len <= length()) {
649 return mid((length() - _len) / 2, _len);
650 }
651
652 BUFFER_T* buf = BUFFER_T::create(_len);
653 buf->__dataLength = _len;
654
655 CHAR_T* dst = buf->data();
656 CHAR_T* end = dst + ((_len - length()) / 2);
657 while (dst < end) {
658 *dst++ = _ch;
659 }
660
661 end = dst + length();
662 const CHAR_T* src = __psz;
663 while (dst < end) {
664 *dst++ = *src++;
665 }
666
667 end = buf->data() + _len;
668 *end = _T('\0');
669 while (dst < end) {
670 *dst++ = _ch;
671 }
672 __DCL_ASSERT(*(buf->data() + _len) == _T('\0'));
673
674 STRING_T r = buf;
675 buf->release();
676 return r;
677}

◆ padLeft()

STRING_T STRING_T::padLeft ( size_t _len,
CHAR_T _ch ) const

Definition at line 679 of file __STRING.cpp.

680{
681 if (_len <= length()) {
682 return mid(length() - _len, _len);
683 }
684
685 BUFFER_T* buf = BUFFER_T::create(_len);
686 buf->__dataLength = _len;
687
688 CHAR_T* dst = buf->data();
689 CHAR_T* end = dst + (_len - length());
690 while (dst < end) {
691 *dst++ = _ch;
692 }
693
694 end = buf->data() + _len;
695 *end = _T('\0');
696 const CHAR_T* src = __psz;
697 while (dst < end) {
698 *dst++ = *src++;
699 }
700
701 __DCL_ASSERT(*(buf->data() + _len) == _T('\0'));
702
703 STRING_T r = buf;
704 buf->release();
705 return r;
706}

◆ padRight()

STRING_T STRING_T::padRight ( size_t _len,
CHAR_T _ch ) const

Definition at line 708 of file __STRING.cpp.

709{
710 if (_len <= length()) {
711 return mid(0, _len);
712 }
713
714 BUFFER_T* buf = BUFFER_T::create(_len);
715 buf->__dataLength = _len;
716
717 CHAR_T* dst = buf->data();
718 CHAR_T* end = dst + length();
719 const CHAR_T* src = __psz;
720 while (dst < end) {
721 *dst++ = *src++;
722 }
723
724 end = buf->data() + _len;
725 *end = _T('\0');
726 while (dst < end) {
727 *dst++ = _ch;
728 }
729 __DCL_ASSERT(*(buf->data() + _len) == _T('\0'));
730
731 STRING_T r = buf;
732 buf->release();
733 return r;
734}

◆ replace() [1/6]

STRING_T STRING_T::replace ( CHAR_T _old,
CHAR_T _new ) const

Definition at line 775 of file __STRING.cpp.

776{
777 if (_old == _new || __psz == __EMPTY) {
778 return *this;
779 }
780
782 buf->__dataLength = length();
783
784 CHAR_T* dst = buf->data();
785 CHAR_T* end = dst + buf->__dataLength;
786 *end = _T('\0');
787 const CHAR_T* src = __psz;
788
789 while (dst < end) {
790 *dst++ = *src == _old ? _new : *src;
791 src++;
792 }
793 __DCL_ASSERT(*(buf->data() + buf->__dataLength) == _T('\0'));
794
795 STRING_T r = buf;
796 buf->release();
797 return r;
798}

◆ replace() [2/6]

STRING_T STRING_T::replace ( const CHAR_T * _old,
const CHAR_T * _new ) const
inline

Definition at line 610 of file __STRING.h.

611{
612 return replace(_old, STRING_T::length(_old),
613 _new, STRING_T::length(_new));
614}
STRING_T replace(size_t _start, size_t _len, const CHAR_T *_new, size_t _newlen=(size_t) -1) const
Definition __STRING.cpp:736

◆ replace() [3/6]

STRING_T STRING_T::replace ( const CHAR_T * _old,
size_t _oldlen,
const CHAR_T * _new,
size_t _newlen ) const

Definition at line 800 of file __STRING.cpp.

804{
805 __DCL_ASSERT_PARAM(_old != NULL && _new != NULL);
806
807 if (_oldlen == 0 || __psz == __EMPTY) {
808 return *this;
809 }
810
811 size_t count = 0;
812 const CHAR_T* _start = __psz;
813 const CHAR_T* _end = _start + length();
814 const CHAR_T* _sub;
815 while ((_sub = STRING_T::find(_start, _end, _old, _oldlen)) != NULL) {
816 count++;
817 _start = _sub + _oldlen;
818 }
819
820 if (!count) {
821 return *this;
822 }
823
824 size_t allocLength = length() + (count * _newlen) - (count * _oldlen);
825 BUFFER_T* buf = BUFFER_T::create(allocLength);
826 buf->__dataLength = allocLength;
827 CHAR_T* dst = buf->data();
828 *(dst + allocLength) = _T('\0');
829 size_t _len = 0;
830 _start = __psz;
831 while ((_sub = STRING_T::find(_start, _end, _old, _oldlen)) != NULL) {
832 _len = _sub - _start;
833 memcpy(dst, _start, _len * sizeof(CHAR_T));
834 dst += _len;
835 memcpy(dst, _new, _newlen * sizeof(CHAR_T));
836 dst += _newlen;
837
838 _start = _sub + _oldlen;
839 }
840 _len = _end - _start;
841 memcpy(dst, _start, _len * sizeof(CHAR_T));
842#ifdef __DCL_DEBUG
843 dst += _len;
844 __DCL_ASSERT((dst >= buf->data()) && ((size_t) (dst - buf->data()) == allocLength));
845#endif
846 __DCL_ASSERT(*(buf->data() + buf->__dataLength) == _T('\0'));
847
848 STRING_T r = buf;
849 buf->release();
850 return r;
851}

◆ replace() [4/6]

STRING_T STRING_T::replace ( const STRING_T & _old,
const STRING_T & _new ) const
inline

Definition at line 616 of file __STRING.h.

617{
618 return replace(_old, _old.length(), _new, _new.length());
619}

◆ replace() [5/6]

STRING_T STRING_T::replace ( size_t _start,
const STRING_T & _new ) const
inline

Definition at line 600 of file __STRING.h.

601{
602 return replace(_start, _new.length(), _new, _new.length());
603}

◆ replace() [6/6]

STRING_T STRING_T::replace ( size_t _start,
size_t _len,
const CHAR_T * _new,
size_t _newlen = (size_t)-1 ) const

Definition at line 736 of file __STRING.cpp.

740{
741 __DCL_ASSERT_PARAM((_start + _len) <= length());
742 __DCL_ASSERT_PARAM(_new != NULL);
743
744 if (_newlen == (size_t)-1)
745 _newlen = STRING_T::length(_new);
746
747 size_t len = length() - _len + _newlen;
748 BUFFER_T* buf = BUFFER_T::create(len);
749 buf->__dataLength = len;
750 CHAR_T* p = buf->data();
751 *(p + len) = _T('\0');
752
753 memcpy(p, __psz, _start * sizeof(CHAR_T));
754 memcpy(p + _start, _new, _newlen * sizeof(CHAR_T));
755 memcpy(p + _start + _newlen, __psz + _start + _len,
756 (length() - (_start + _len)) * sizeof(CHAR_T));
757
758 __DCL_ASSERT(p[buf->__dataLength] == _T('\0'));
759
760 STRING_T r(buf);
761 buf->release();
762 return r;
763}

◆ replace_r() [1/2]

STRING_T STRING_T::replace_r ( const CHAR_T * _regex,
const CHAR_T * _replacment,
bool _icase,
size_t _limit = (size_t)-1 ) const

Definition at line 953 of file __STRING.cpp.

959{
960 __DCL_ASSERT_PARAM(_regex != NULL);
961 __DCL_ASSERT_PARAM(_replacment != NULL);
962 return __regex_replace(
963 _regex, _regex + STRING_T::length(_regex),
964 __psz, __psz + length(),
965 _replacment, _replacment + STRING_T::length(_replacment),
966 _icase,
967 _limit
968 );
969}
String __regex_replace(const wchar_t *_regex, const wchar_t *_regexend, const wchar_t *_begin, const wchar_t *_end, const wchar_t *_replacement, const wchar_t *_replacementend, bool _icase, size_t _limit=(size_t) -1) __DCL_THROWS1(RegexException *)
Definition _regex.cpp:370

◆ replace_r() [2/2]

STRING_T STRING_T::replace_r ( const STRING_T & _regex,
const STRING_T & _replacement,
bool _icase,
size_t _limit = (size_t)-1 ) const

Definition at line 971 of file __STRING.cpp.

977{
978 return __regex_replace(
979 _regex.__psz, _regex.__psz + _regex.length(),
980 __psz, __psz + length(),
981 _replacement.__psz, _replacement.__psz + _replacement.length(),
982 _icase,
983 _limit
984 );
985}

◆ rfind() [1/2]

CHAR_T * STRING_T::rfind ( const CHAR_T * _begin,
const CHAR_T * _end,
CHAR_T _ch )
static

Definition at line 1676 of file __STRING.cpp.

1681{
1682 __DCL_ASSERT_PARAM(_begin != NULL && _begin <= _end);
1683
1684 while (_begin <= --_end) {
1685 if (*_end == _ch)
1686 return (CHAR_T*)_end;;
1687 }
1688 return NULL;
1689}

◆ rfind() [2/2]

CHAR_T * STRING_T::rfind ( const CHAR_T * _begin,
const CHAR_T * _end,
const CHAR_T * _sub,
size_t _sublen )
static

Definition at line 1729 of file __STRING.cpp.

1735{
1736 __DCL_ASSERT_PARAM(_begin != NULL && _begin <= _end);
1737 __DCL_ASSERT_PARAM(_sub != NULL);
1738
1739 const CHAR_T* subbegin = _sub;
1740 const CHAR_T* subend = _sub + _sublen;
1741
1742 if (_begin == _end) {
1743 if (subbegin == subend)
1744 return (CHAR_T*)_begin;
1745 return NULL;
1746 }
1747
1748 _end -= _sublen;
1749 CHAR_T c = *subbegin++;
1750 while (_begin <= _end) {
1751 if (c == *_end) {
1752 // found first char
1753 const CHAR_T* s = _end; s++;
1754 const CHAR_T* _sub = subbegin;
1755 while (_sub < subend && *s == *_sub)
1756 s++, _sub++;
1757
1758 if (_sub == subend)
1759 return (CHAR_T*)_end;
1760 }
1761 _end--;
1762 }
1763 return NULL;
1764}

◆ right()

STRING_T STRING_T::right ( size_t _len) const

Definition at line 639 of file __STRING.cpp.

640{
641 if (length() < _len)
642 _len = length();
643 return mid(length() - _len, _len);
644}

◆ rreplace() [1/2]

STRING_T STRING_T::rreplace ( size_t _start,
const STRING_T & _new ) const
inline

Definition at line 605 of file __STRING.h.

606{
607 return rreplace(_start, _new.length(), _new, _new.length());
608}
STRING_T rreplace(size_t _start, size_t _len, const CHAR_T *_new, size_t _newlen=(size_t) -1) const
Definition __STRING.cpp:765

◆ rreplace() [2/2]

STRING_T STRING_T::rreplace ( size_t _start,
size_t _len,
const CHAR_T * _new,
size_t _newlen = (size_t)-1 ) const

Definition at line 765 of file __STRING.cpp.

769{
770 __DCL_ASSERT_PARAM((_start + _len) <= length());
771 __DCL_ASSERT_PARAM(_new != NULL);
772 return replace(length() - _start - _len, _len, _new, _newlen);
773}

◆ search() [1/2]

size_t STRING_T::search ( const CHAR_T * _regex,
bool _icase ) const

Definition at line 853 of file __STRING.cpp.

857{
858 __DCL_ASSERT_PARAM(_regex != NULL);
859 return __regex_search(
860 _regex, _regex + STRING_T::length(_regex),
861 __psz, __psz + length(),
862 _icase
863 );
864}
bool __regex_search(regex_handle _handle, const wchar_t *_begin, const wchar_t *_end, match_result **_results, unsigned int _flags)
Definition _regex.cpp:143

◆ search() [2/2]

size_t STRING_T::search ( const STRING_T & _regex,
bool _icase ) const

Definition at line 866 of file __STRING.cpp.

870{
871 return __regex_search(
872 _regex.__psz, _regex.__psz + _regex.length(),
873 __psz, __psz + length(),
874 _icase
875 );
876}

◆ searches() [1/2]

bool STRING_T::searches ( const CHAR_T * _regex,
bool _icase ) const

Definition at line 903 of file __STRING.cpp.

907{
908 __DCL_ASSERT_PARAM(_regex != NULL);
909 return __regex_search(
910 _regex, _regex + STRING_T::length(_regex),
911 __psz, __psz + length(),
912 _icase
913 ) != (size_t)-1;
914}

◆ searches() [2/2]

bool STRING_T::searches ( const STRING_T & _regex,
bool _icase ) const

Definition at line 916 of file __STRING.cpp.

920{
921 return __regex_search(
922 _regex.__psz, _regex.__psz + _regex.length(),
923 __psz, __psz + length(),
924 _icase
925 ) != (size_t)-1;
926}

◆ split() [1/4]

size_t STRING_T::split ( CHAR_T _delimiter,
ARRAY_T & _results,
size_t _limit = (size_t)-1 ) const
inline

Definition at line 672 of file __STRING.h.

677{
678 return STRING_T::split(
679 __psz, __psz + length(),
680 _delimiter,
681 _results,
682 _limit
683 );
684}
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)

◆ split() [2/4]

size_t STRING_T::split ( const CHAR_T * _begin,
const CHAR_T * _end,
CHAR_T _delimiter,
ARRAY_T & _results,
size_t _limit = (size_t)-1 )
static

Definition at line 1795 of file __STRING.cpp.

1802{
1803 size_t count = 0;
1804 while (_begin < _end && count < _limit) {
1805 const CHAR_T* s = STRING_T::find(_begin, _end, _delimiter);
1806 if (s) {
1807 _results.add(STRING_T(_begin, s));
1808 _begin = s + 1;
1809 count++;
1810 }
1811 else
1812 break;
1813 }
1814
1815 if ((count < _limit) && ((_begin < _end) || (count == 0 && _begin == _end))) {
1816 _results.add(STRING_T(_begin, _end));
1817 count++;
1818 }
1819
1820 return count;
1821}
ARRAY_T & add(CONST_ELEMENT_REF _element)
Definition __ARRAY.h:155

◆ split() [3/4]

size_t STRING_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 )
static

Definition at line 1766 of file __STRING.cpp.

1774{
1775 size_t count = 0;
1776 while (_begin < _end && count < _limit) {
1777 const CHAR_T* s = STRING_T::find(_begin, _end, _delimiter, _delimiterlen);
1778 if (s) {
1779 _results.add(STRING_T(_begin, s));
1780 _begin = s + _delimiterlen;
1781 count++;
1782 }
1783 else
1784 break;
1785 }
1786
1787 if ((count < _limit) && ((_begin < _end) || (count == 0 && _begin == _end))) {
1788 _results.add(STRING_T(_begin, _end));
1789 count++;
1790 }
1791
1792 return count;
1793}

◆ split() [4/4]

size_t STRING_T::split ( const STRING_T & _delimiter,
ARRAY_T & _results,
size_t _limit = (size_t)-1 ) const
inline

Definition at line 658 of file __STRING.h.

663{
664 return STRING_T::split(
665 __psz, __psz + length(),
666 _delimiter.__psz, _delimiter.length(),
667 _results,
668 _limit
669 );
670}

◆ split_r() [1/2]

ARRAY_T & STRING_T::split_r ( const CHAR_T * _regex,
bool _icase,
ARRAY_T & _results,
size_t _limit = (size_t)-1 ) const

Definition at line 987 of file __STRING.cpp.

993{
994 __DCL_ASSERT_PARAM(_regex != NULL);
995 return __regex_split(
996 _regex, _regex + STRING_T::length(_regex),
997 __psz, __psz + length(),
998 _icase,
999 _results,
1000 _limit
1001 );
1002}
StringArray & __regex_split(const wchar_t *_regex, const wchar_t *_regexend, const wchar_t *_begin, const wchar_t *_end, bool _icase, StringArray &_results, size_t _limit=(size_t) -1) __DCL_THROWS1(RegexException *)
Definition _regex.cpp:452

◆ split_r() [2/2]

ARRAY_T & STRING_T::split_r ( const STRING_T & _regex,
bool _icase,
ARRAY_T & _results,
size_t _limit = (size_t)-1 ) const

Definition at line 1004 of file __STRING.cpp.

1010{
1011 return __regex_split(
1012 _regex.__psz, _regex.__psz + _regex.length(),
1013 __psz, __psz + length(),
1014 _icase,
1015 _results,
1016 _limit
1017 );
1018}

◆ startsWith() [1/2]

bool STRING_T::startsWith ( const CHAR_T * _prefix) const
inline

Definition at line 574 of file __STRING.h.

574 {
575 return STRING_T::compare(__psz, _prefix, STRING_T::length(_prefix)) == 0;
576}

◆ startsWith() [2/2]

bool STRING_T::startsWith ( const STRING_T & _prefix) const
inline

Definition at line 585 of file __STRING.h.

586{
587 return STRING_T::compare(__psz, _prefix.__psz, _prefix.length()) == 0;
588}

◆ substring() [1/4]

STRING_T STRING_T::substring ( const CHAR_T * _regex,
bool _icase ) const

Definition at line 878 of file __STRING.cpp.

882{
883 __DCL_ASSERT_PARAM(_regex != NULL);
884 return __regex_substring(
885 _regex, _regex + STRING_T::length(_regex),
886 __psz, __psz + length(),
887 _icase
888 );
889}
String __regex_substring(const wchar_t *_regex, const wchar_t *_regexend, const wchar_t *_begin, const wchar_t *_end, bool _icase) __DCL_THROWS1(RegexException *)
Definition _regex.cpp:305

◆ substring() [2/4]

STRING_T STRING_T::substring ( const STRING_T & _regex,
bool _icase ) const

Definition at line 891 of file __STRING.cpp.

895{
896 return __regex_substring(
897 _regex.__psz, _regex.__psz + _regex.length(),
898 __psz, __psz + length(),
899 _icase
900 );
901}

◆ substring() [3/4]

STRING_T STRING_T::substring ( size_t _first) const
inline

Definition at line 590 of file __STRING.h.

591{
592 return mid(_first);
593}

◆ substring() [4/4]

STRING_T STRING_T::substring ( size_t _first,
size_t _last ) const
inline

Definition at line 595 of file __STRING.h.

596{
597 return mid(_first, _last - _first);
598}

◆ toHexString() [1/2]

STRING_T STRING_T::toHexString ( const ByteString & _bytes,
size_t _max = (size_t)-1,
bool _prefix = true )
inlinestatic

Definition at line 641 of file __STRING.h.

646{
647 return STRING_T::toHexString(_bytes, _bytes.length(), _max, _prefix);
648}
static STRING_T toHexString(const char *_bytes, size_t _len, size_t _max=(size_t) -1, bool _prefix=true)

◆ toHexString() [2/2]

STRING_T STRING_T::toHexString ( const char * _bytes,
size_t _len,
size_t _max = (size_t)-1,
bool _prefix = true )
static

Definition at line 1556 of file __STRING.cpp.

1562{
1563 __DCL_ASSERT_PARAM(_bytes != NULL);
1564
1565 size_t len = __MIN(_len, _max);
1566 /*
1567 size_t dstlen = len * 2;
1568 if (_prefix) // "0x"
1569 dstlen += 2;
1570 if (_max <= _len) // "..."
1571 dstlen += 3;
1572 */
1573 size_t dstlen = len * 2 + 5;
1574
1575 BUFFER_T* buf = BUFFER_T::create(dstlen);
1576 CHAR_T* dst = buf->data();
1577 if (_prefix) {
1578 *dst++ = _T('\\');
1579 *dst++ = _T('x');
1580 }
1581
1582 const byte_t* src = (const byte_t*) _bytes;
1583 const byte_t* end = src + len;
1584
1585 while (src < end) {
1586 *dst++ = __hex__[*src >> 4];
1587 *dst++ = __hex__[*src & 0x0f];
1588 src++;
1589 }
1590
1591 if (_max < _len) {
1592 *dst++ = _T('.');
1593 *dst++ = _T('.');
1594 *dst++ = _T('.');
1595 }
1596
1597 *dst = _T('\0');
1598 //__DCL_TRACE2(__T("[%zd] [%zd]\n"), dstlen, dst - buf->data());
1599 __DCL_ASSERT(dst <= buf->data() + dstlen);
1600 buf->__dataLength = dst - buf->data();
1601
1602 STRING_T r(buf);
1603 buf->release();
1604 return r;
1605}
unsigned char byte_t
Definition Config.h:246
const CHAR_T * data() const
Definition __STRING.h:631
size_t __MIN(size_t x, size_t y)
Definition size_t.h:27

◆ toLowerCase()

STRING_T STRING_T::toLowerCase ( ) const

Definition at line 1039 of file __STRING.cpp.

1040{
1042 CHAR_T* dst = buf->data();
1043 const CHAR_T* src = __psz;
1044 const CHAR_T* _end = __psz + length();
1045 while (src < _end) {
1046 *dst = TOLOWER((UCHAR_T)*src);
1047 src++;
1048 dst++;
1049 }
1050 *dst = _T('\0');
1051 buf->__dataLength = dst - buf->data();
1052
1053 STRING_T r(buf);
1054 buf->release();
1055 return r;
1056}
#define TOLOWER(c)
Definition __STRING.cpp:84

◆ toString()

String STRING_T::toString ( ) const

Definition at line 1104 of file __STRING.cpp.

1105{
1106 return String::toHexString(*this, 20);
1107}

◆ toUpperCase()

STRING_T STRING_T::toUpperCase ( ) const

Definition at line 1020 of file __STRING.cpp.

1021{
1023 CHAR_T* dst = buf->data();
1024 const CHAR_T* src = __psz;
1025 const CHAR_T* _end = __psz + length();
1026 while (src < _end) {
1027 *dst = TOUPPER((UCHAR_T)*src);
1028 src++;
1029 dst++;
1030 }
1031 *dst = _T('\0');
1032 buf->__dataLength = dst - buf->data();
1033
1034 STRING_T r(buf);
1035 buf->release();
1036 return r;
1037}
#define TOUPPER(c)
Definition __STRING.cpp:83

◆ trim() [1/2]

STRING_T STRING_T::trim ( ) const

Definition at line 1110 of file __STRING.cpp.

1111{
1112 CHAR_T* first = __psz;
1113 CHAR_T* last = __psz + length();
1114
1115 while(first < last) {
1116 if (!ISSPACE((UCHAR_T)*first))
1117 break;
1118 first++;
1119 }
1120
1121 while(first < last) {
1122 if (!ISSPACE((UCHAR_T)*(last - 1)))
1123 break;
1124 last--;
1125 }
1126
1127 __DCL_ASSERT(first <= last);
1128
1129 if (__psz < first || last < __psz + length()) {
1130 size_t len = last - first;
1131 if (len) {
1132 BUFFER_T* buf = BUFFER_T::create(len);
1133 buf->__dataLength = len;
1134 CHAR_T* p = buf->data();
1135 *(p + len) = _T('\0');
1136 memcpy(p, first, len * sizeof(CHAR_T));
1137
1138 STRING_T r = buf;
1139 buf->release();
1140 return r;
1141 }
1142 }
1143 return *this;
1144}
#define ISSPACE(c)
Definition __STRING.cpp:81

◆ trim() [2/2]

STRING_T STRING_T::trim ( const CHAR_T * _chars) const

Definition at line 1202 of file __STRING.cpp.

1203{
1204 CHAR_T* first = __psz;
1205 CHAR_T* last = __psz + length();
1206
1207 while (first < last) {
1208 if (STRCHR(_chars, (UCHAR_T)*first) == NULL)
1209 break;
1210 first++;
1211 }
1212
1213 while (first < last) {
1214 if (STRCHR(_chars, (UCHAR_T)*(last - 1)) == NULL)
1215 break;
1216 last--;
1217 }
1218
1219 __DCL_ASSERT(first <= last);
1220
1221 if (__psz < first || last < __psz + length()) {
1222 size_t len = last - first;
1223 if (len) {
1224 BUFFER_T* buf = BUFFER_T::create(len);
1225 buf->__dataLength = len;
1226 CHAR_T* p = buf->data();
1227 *(p + len) = _T('\0');
1228 memcpy(p, first, len * sizeof(CHAR_T));
1229
1230 STRING_T r = buf;
1231 buf->release();
1232 return r;
1233 }
1234 return STRING_T();
1235 }
1236 return *this;
1237}
#define STRCHR(s, c)
Definition __STRING.cpp:79

◆ trimLeft() [1/2]

STRING_T STRING_T::trimLeft ( ) const

Definition at line 1146 of file __STRING.cpp.

1147{
1148 CHAR_T* first = __psz;
1149 CHAR_T* last = __psz + length();
1150
1151 while (first < last) {
1152 if (!ISSPACE((UCHAR_T)*first))
1153 break;
1154 first++;
1155 }
1156
1157 if (__psz < first) {
1158 size_t len = last - first;
1159 if (len) {
1160 BUFFER_T* buf = BUFFER_T::create(len);
1161 buf->__dataLength = len;
1162 CHAR_T* p = buf->data();
1163 *(p + len) = _T('\0');
1164 memcpy(p, first, len * sizeof(CHAR_T));
1165
1166 STRING_T r = buf;
1167 buf->release();
1168 return r;
1169 }
1170 }
1171 return *this;
1172}

◆ trimLeft() [2/2]

STRING_T STRING_T::trimLeft ( const CHAR_T * _chars) const

Definition at line 1239 of file __STRING.cpp.

1240{
1241 CHAR_T* first = __psz;
1242 CHAR_T* last = __psz + length();
1243
1244 while (first < last) {
1245 if (STRCHR(_chars, (UCHAR_T)*first) == NULL)
1246 break;
1247 first++;
1248 }
1249
1250 if (__psz < first) {
1251 size_t len = last - first;
1252 if (len)
1253 {
1254 BUFFER_T* buf = BUFFER_T::create(len);
1255 buf->__dataLength = len;
1256 CHAR_T* p = buf->data();
1257 *(p + len) = _T('\0');
1258 memcpy(p, first, len * sizeof(CHAR_T));
1259
1260 STRING_T r = buf;
1261 buf->release();
1262 return r;
1263 }
1264 }
1265 return *this;
1266}

◆ trimRight() [1/2]

STRING_T STRING_T::trimRight ( ) const

Definition at line 1174 of file __STRING.cpp.

1175{
1176 CHAR_T* first = __psz;
1177 CHAR_T* last = __psz + length();
1178
1179 while(first < last) {
1180 if (!ISSPACE((UCHAR_T)*(last - 1)))
1181 break;
1182 last--;
1183 }
1184
1185 if (last < __psz + length()) {
1186 size_t len = last - first;
1187 if (len) {
1188 BUFFER_T* buf = BUFFER_T::create(len);
1189 buf->__dataLength = len;
1190 CHAR_T* p = buf->data();
1191 *(p + len) = _T('\0');
1192 memcpy(p, first, len * sizeof(CHAR_T));
1193
1194 STRING_T r = buf;
1195 buf->release();
1196 return r;
1197 }
1198 }
1199 return *this;
1200}

◆ trimRight() [2/2]

STRING_T STRING_T::trimRight ( const CHAR_T * _chars) const

Definition at line 1268 of file __STRING.cpp.

1269{
1270 CHAR_T* first = __psz;
1271 CHAR_T* last = __psz + length();
1272
1273 while (first < last) {
1274 if (STRCHR(_chars, (UCHAR_T)*(last - 1)) == NULL)
1275 break;
1276 last--;
1277 }
1278
1279 if (last < __psz + length()) {
1280 size_t len = last - first;
1281 if (len) {
1282 BUFFER_T* buf = BUFFER_T::create(len);
1283 buf->__dataLength = len;
1284 CHAR_T* p = buf->data();
1285 *(p + len) = _T('\0');
1286 memcpy(p, first, len * sizeof(CHAR_T));
1287
1288 STRING_T r = buf;
1289 buf->release();
1290 return r;
1291 }
1292 }
1293 return *this;
1294}

◆ tryString() [1/2]

STRING_T STRING_T::tryString ( const ByteString & _bytes,
size_t _max = (size_t)-1 )
inlinestatic

Definition at line 650 of file __STRING.h.

654{
655 return STRING_T::tryString(_bytes, _bytes.length(), _max);
656}
static STRING_T tryString(const char *_bytes, size_t _len, size_t _max=(size_t) -1)

◆ tryString() [2/2]

STRING_T STRING_T::tryString ( const char * _bytes,
size_t _len,
size_t _max = (size_t)-1 )
static

Definition at line 1607 of file __STRING.cpp.

1612{
1613 // "12345\0\1\2\3\4\5"
1614 // "12345\x00\x01\x02\x03\x04\x05"
1615
1616 __DCL_ASSERT_PARAM(_bytes != NULL);
1617
1618 size_t len = __MIN(_len, _max);
1619 /*
1620 size_t dstlen = len * 4; // \x01
1621 if (_max <= len)
1622 dstlen += 3; // ...
1623 */
1624 size_t dstlen = len * 4 + 3;
1625
1626 BUFFER_T* buf = BUFFER_T::create(dstlen);
1627 CHAR_T* dst = buf->data();
1628 const byte_t* src = (const byte_t*)_bytes;
1629 const byte_t* end = src + len;
1630
1631 while (src < end) {
1632 if (isprint(*src)) {
1633 *dst++ = *src;
1634 }
1635 else {
1636 *dst++ = _T('\\');
1637 *dst++ = _T('x');
1638 *dst++ = __hex__[*src >> 4];
1639 *dst++ = __hex__[*src & 0x0f];
1640 }
1641 src++;
1642 }
1643
1644 if (_max < _len) {
1645 *dst++ = _T('.');
1646 *dst++ = _T('.');
1647 *dst++ = _T('.');
1648 }
1649
1650 *dst = _T('\0');
1651 //__DCL_TRACE2(__T("[%zd] [%zd]\n"), dstlen, dst - buf->data());
1652 __DCL_ASSERT(dst <= buf->data() + dstlen);
1653 buf->__dataLength = dst - buf->data();
1654
1655 STRING_T r(buf);
1656 buf->release();
1657 return r;
1658}

◆ unescape()

STRING_T STRING_T::unescape ( const CHAR_T * _psz,
size_t _len )
static

Definition at line 1466 of file __STRING.cpp.

1470{
1471 __DCL_ASSERT_PARAM(_psz != NULL);
1472 if (_len == (size_t)-1)
1473 _len = STRING_T::length(_psz);
1474
1475 if (_len == 0)
1476 return STRING_T();
1477
1478 BUFFER_T* buf = BUFFER_T::create(_len);
1479 const CHAR_T* src = (const CHAR_T*)_psz;
1480 const CHAR_T* end = src + _len;
1481
1482 for ( ; src < end; src++) {
1483 if (*src == _T('\\') && (src + 1) < end) {
1484 switch (*++src) {
1485 case _T('0') : BUFFER_T::write(buf, _T('\0')); break;
1486 case _T('a') : BUFFER_T::write(buf, _T('\a')); break;
1487 case _T('b') : BUFFER_T::write(buf, _T('\b')); break;
1488 case _T('t') : BUFFER_T::write(buf, _T('\t')); break;
1489 case _T('n') : BUFFER_T::write(buf, _T('\n')); break;
1490 case _T('v') : BUFFER_T::write(buf, _T('\v')); break;
1491 case _T('f') : BUFFER_T::write(buf, _T('\f')); break;
1492 case _T('r') : BUFFER_T::write(buf, _T('\r')); break;
1493 case _T('\"') :
1494 case _T('\'') :
1495// case _T('\?') :
1496 case _T('\\') :
1497 BUFFER_T::write(buf, *src);
1498 break;
1499 case _T('x') :
1500 case _T('X') :
1501 if ((src + 2) < end) {
1502 int high = __hex2int(src[1]);
1503 int low = __hex2int(src[2]);
1504 if (high >= 0 && low >= 0)
1505 {
1506 BUFFER_T::write(buf, (high << 4) | low);
1507 src += 2;
1508 break;
1509 }
1510 }
1511 goto __no_escape;
1512 case _T('u') :
1513 case _T('U') :
1514 if ((src + 4) < end) {
1515 int n;
1516 UCHAR_T c = 0;
1517#ifdef __DCL_COMPILE_UNICODE__
1518 for (int i = 1; i <= 4; i++) {
1519 if ((n = __hex2int(src[i])) < 0)
1520 goto __no_escape;
1521 c = (c << 4) | n;
1522 }
1523#else
1524 for (int i = 1; i <= 4; i++) {
1525 if ((n = __hex2int(src[i])) < 0)
1526 goto __no_escape;
1527 c = (c << 4) | n;
1528 if (i == 1) {
1529 BUFFER_T::write(buf, c);
1530 c = 0;
1531 }
1532 }
1533#endif
1534 BUFFER_T::write(buf, c);
1535 src += 4;
1536 break;
1537 }
1538 default :
1539__no_escape:
1540 BUFFER_T::write(buf, _T('\\'));
1541 BUFFER_T::write(buf, *src);
1542 }
1543 }
1544 else {
1545 // normal
1546 BUFFER_T::write(buf, *src);
1547 }
1548 }
1549 BUFFER_T::shrink(buf);
1550
1551 STRING_T r(buf);
1552 buf->release();
1553 return r;
1554}
if(r==0)
Definition MediaInfo.cpp:83

◆ valueOf() [1/14]

STRING_T STRING_T::valueOf ( bool _b)
static

Definition at line 1853 of file __STRING.cpp.

1854{
1855 return _b ? _T("true") : _T("false");
1856}

◆ valueOf() [2/14]

STRING_T STRING_T::valueOf ( char _n)
static

Definition at line 1858 of file __STRING.cpp.

1859{
1860#ifdef __DCL_COMPILE_UNICODE__
1861 return Int32::toString((int32_t) _n, 10);
1862#else
1863 return Int32::toByteString((int32_t) _n, 10);
1864#endif
1865}
static ByteString toByteString(int32_t _n, unsigned _base=10)
Definition Numeric.cpp:355
String toString(unsigned _base=10) const
Definition Numeric.inl:93

◆ valueOf() [3/14]

STRING_T STRING_T::valueOf ( double _n)
static

Definition at line 1973 of file __STRING.cpp.

1974{
1975#ifdef __DCL_COMPILE_UNICODE__
1976 return String::format(L"%.16g", _n);
1977#else
1978 return ByteString::format("%.16g", _n);
1979#endif
1980}

◆ valueOf() [4/14]

STRING_T STRING_T::valueOf ( float _n)
static

Definition at line 1964 of file __STRING.cpp.

1965{
1966#ifdef __DCL_COMPILE_UNICODE__
1967 return String::format(L"%.8g", _n);
1968#else
1969 return ByteString::format("%.8g", _n);
1970#endif
1971}

◆ valueOf() [5/14]

STRING_T STRING_T::valueOf ( int _n)
static

Definition at line 1894 of file __STRING.cpp.

1895{
1896#ifdef __DCL_COMPILE_UNICODE__
1897 return Int32::toString((int32_t) _n, 10);
1898#else
1899 return Int32::toByteString((int32_t) _n, 10);
1900#endif
1901}

◆ valueOf() [6/14]

STRING_T STRING_T::valueOf ( long _n)
static

Definition at line 1912 of file __STRING.cpp.

1913{
1914#if __WORDSIZE == 64
1915#ifdef __DCL_COMPILE_UNICODE__
1916 return Int64::toString((int64_t) _n, 10);
1917#else
1918 return Int64::toByteString((int64_t) _n, 10);
1919#endif
1920#else
1921#ifdef __DCL_COMPILE_UNICODE__
1922 return UInt32::toString((uint32_t) _n, 10);
1923#else
1924 return UInt32::toByteString((uint32_t) _n, 10);
1925#endif
1926#endif
1927}
static ByteString toByteString(int64_t _n, unsigned _base=10)
Definition Numeric.cpp:587
String toString(unsigned _base=10) const
Definition Numeric.inl:117
static ByteString toByteString(uint32_t _u, unsigned _base=10)
Definition Numeric.cpp:470
String toString(unsigned _base=10) const
Definition Numeric.inl:105

◆ valueOf() [7/14]

STRING_T STRING_T::valueOf ( long double _n)
static

Definition at line 1982 of file __STRING.cpp.

1983{
1984#ifdef __DCL_COMPILE_UNICODE__
1985 return String::format(L"%.32Lg", _n);
1986#else
1987 return ByteString::format("%.32Lg", _n);
1988#endif
1989}

◆ valueOf() [8/14]

STRING_T STRING_T::valueOf ( long long _n)
static

Definition at line 1946 of file __STRING.cpp.

1947{
1948#ifdef __DCL_COMPILE_UNICODE__
1949 return Int64::toString((int64_t) _n, 10);
1950#else
1951 return Int64::toByteString((int64_t) _n, 10);
1952#endif
1953}

◆ valueOf() [9/14]

STRING_T STRING_T::valueOf ( short _n)
static

Definition at line 1876 of file __STRING.cpp.

1877{
1878#ifdef __DCL_COMPILE_UNICODE__
1879 return Int32::toString((int32_t) _n, 10);
1880#else
1881 return Int32::toByteString((int32_t) _n, 10);
1882#endif
1883}

◆ valueOf() [10/14]

STRING_T STRING_T::valueOf ( unsigned char _n)
static

Definition at line 1867 of file __STRING.cpp.

1868{
1869#ifdef __DCL_COMPILE_UNICODE__
1870 return UInt32::toString((uint32_t) _n, 10);
1871#else
1872 return UInt32::toByteString((uint32_t) _n, 10);
1873#endif
1874}

◆ valueOf() [11/14]

STRING_T STRING_T::valueOf ( unsigned int _n)
static

Definition at line 1903 of file __STRING.cpp.

1904{
1905#ifdef __DCL_COMPILE_UNICODE__
1906 return UInt32::toString((uint32_t) _n, 10);
1907#else
1908 return UInt32::toByteString((uint32_t) _n, 10);
1909#endif
1910}

◆ valueOf() [12/14]

STRING_T STRING_T::valueOf ( unsigned long _n)
static

Definition at line 1929 of file __STRING.cpp.

1930{
1931#if __WORDSIZE == 64
1932#ifdef __DCL_COMPILE_UNICODE__
1933 return UInt64::toString((uint64_t) _n, 10);
1934#else
1935 return UInt64::toByteString((uint64_t) _n, 10);
1936#endif
1937#else
1938#ifdef __DCL_COMPILE_UNICODE__
1939 return UInt32::toString((uint32_t) _n, 10);
1940#else
1941 return UInt32::toByteString((uint32_t) _n, 10);
1942#endif
1943#endif
1944}
static ByteString toByteString(uint64_t _u, unsigned _base=10)
Definition Numeric.cpp:692
String toString(unsigned _base=10) const
Definition Numeric.inl:129

◆ valueOf() [13/14]

STRING_T STRING_T::valueOf ( unsigned long long _n)
static

Definition at line 1955 of file __STRING.cpp.

1956{
1957#ifdef __DCL_COMPILE_UNICODE__
1958 return UInt64::toString((uint64_t) _n, 10);
1959#else
1960 return UInt64::toByteString((uint64_t) _n, 10);
1961#endif
1962}

◆ valueOf() [14/14]

STRING_T STRING_T::valueOf ( unsigned short _n)
static

Definition at line 1885 of file __STRING.cpp.

1886{
1887#ifdef __DCL_COMPILE_UNICODE__
1888 return UInt32::toString((uint32_t) _n, 10);
1889#else
1890 return UInt32::toByteString((uint32_t) _n, 10);
1891#endif
1892}

◆ operator+ [1/5]

DCLCAPI friend STRING_T operator+ ( CHAR_T _ch,
const STRING_T & _str )
friend

Definition at line 497 of file __STRING.cpp.

498{
499 STRING_T r;
500 r.assign(&_ch, 1, _str, _str.length());
501 return r;
502}

◆ operator+ [2/5]

DCLCAPI friend STRING_T operator+ ( const CHAR_T * _psz,
const STRING_T & _str )
friend

Definition at line 512 of file __STRING.cpp.

513{
514 __DCL_ASSERT_PARAM(_psz != NULL);
515 STRING_T r;
516 r.assign(_psz, STRING_T::length(_psz), _str, _str.length());
517 return r;
518}

◆ operator+ [3/5]

DCLCAPI friend STRING_T operator+ ( const STRING_T & _str,
CHAR_T _ch )
friend

Definition at line 490 of file __STRING.cpp.

491{
492 STRING_T r;
493 r.assign(_str, _str.length(), &_ch, 1);
494 return r;
495}

◆ operator+ [4/5]

DCLCAPI friend STRING_T operator+ ( const STRING_T & _str,
const CHAR_T * _psz )
friend

Definition at line 504 of file __STRING.cpp.

505{
506 __DCL_ASSERT_PARAM(_psz != NULL);
507 STRING_T r;
508 r.assign(_str, _str.length(), _psz, STRING_T::length(_psz));
509 return r;
510}

◆ operator+ [5/5]

DCLCAPI friend STRING_T operator+ ( const STRING_T & _str1,
const STRING_T & _str2 )
friend

Definition at line 483 of file __STRING.cpp.

484{
485 STRING_T r;
486 r.assign(_str1, _str1.length(), _str2, _str2.length());
487 return r;
488}

◆ STRING_BUILDER_T

friend class STRING_BUILDER_T
friend

Definition at line 56 of file __STRING.h.

Member Data Documentation

◆ __psz

CHAR_T* STRING_T::__psz
protected

Definition at line 58 of file __STRING.h.


The documentation for this class was generated from the following files: