DCL 4.0
Loading...
Searching...
No Matches
__STRING.cpp File Reference

Go to the source code of this file.

Macros

#define _T(s)
#define CHAR_T   char
#define UCHAR_T   unsigned char
#define BUFFER_T   ByteBuffer
#define STRING_T   ByteString
#define ARRAY_T   ByteStringArray
#define STRING_BUILDER_T   ByteStringBuilder
#define STRLEN(s)
#define STRCMP(s1, s2)
#define STRNCMP(s1, s2, n)
#define STRCASECMP(s1, s2)
#define STRNCASECMP(s1, s2, n)
#define VSNPRINTF(buf, len, fmt, args)
#define STRCHR(s, c)
#define STRSTR(s, cs)
#define ISSPACE(c)
#define ISALNUM(c)
#define TOUPPER(c)
#define TOLOWER(c)
#define TOUPPER_L(c, l)
#define TOLOWER_L(c, l)
#define __EXTENDED_LENGTH_DEFINED
#define __EXTENDED_MAX   1024 * 1024
#define __EXTEND_MIN   32
#define __EMPTY_STR   __CONCAT(__empty, CHAR_T)
#define __EMPTY   __EMPTY_STR()
#define __A_HEX_DEFINED
#define ASCII_32   _T(' ')
#define ASCII_126   _T('~')

Functions

size_t __extended_length (size_t _allocLength)
 __CONCAT (__empty__, CHAR_T)
DCLCAPI STRING_T operator+ (const STRING_T &_str1, const STRING_T &_str2)
DCLCAPI STRING_T operator+ (const STRING_T &_str, CHAR_T _ch)
DCLCAPI STRING_T operator+ (CHAR_T _ch, const STRING_T &_str)
DCLCAPI STRING_T operator+ (const STRING_T &_str, const CHAR_T *_psz)
DCLCAPI STRING_T operator+ (const CHAR_T *_psz, const STRING_T &_str)
bool __escapeable (unsigned int c, STRING_T::EscapeFlags _flag)
int __hex2int (UCHAR_T c)

Macro Definition Documentation

◆ __A_HEX_DEFINED

#define __A_HEX_DEFINED

Definition at line 1308 of file __STRING.cpp.

◆ __EMPTY

#define __EMPTY   __EMPTY_STR()

Definition at line 294 of file __STRING.cpp.

◆ __EMPTY_STR

CHAR_T * __EMPTY_STR   __CONCAT(__empty, CHAR_T)

Definition at line 290 of file __STRING.cpp.

291 return ((CHAR_T*)& __CONCAT(__empty__, CHAR_T).__nil);
292}
#define __EMPTY_STR
Definition __STRING.cpp:290
#define CHAR_T
Definition __STRING.h:20
#define __CONCAT(x, y)
Definition Object.h:38

◆ __EXTEND_MIN

#define __EXTEND_MIN   32

◆ __EXTENDED_LENGTH_DEFINED

#define __EXTENDED_LENGTH_DEFINED

Definition at line 112 of file __STRING.cpp.

◆ __EXTENDED_MAX

#define __EXTENDED_MAX   1024 * 1024

◆ _T

#define _T ( s)
Value:
s

Definition at line 57 of file __STRING.cpp.

◆ ARRAY_T

#define ARRAY_T   ByteStringArray

Definition at line 62 of file __STRING.cpp.

◆ ASCII_126

#define ASCII_126   _T('~')

Definition at line 1313 of file __STRING.cpp.

◆ ASCII_32

#define ASCII_32   _T(' ')

Definition at line 1312 of file __STRING.cpp.

◆ BUFFER_T

#define BUFFER_T   ByteBuffer

Definition at line 60 of file __STRING.cpp.

◆ CHAR_T

#define CHAR_T   char

Definition at line 58 of file __STRING.cpp.

◆ ISALNUM

#define ISALNUM ( c)
Value:
isalnum(c)

Definition at line 82 of file __STRING.cpp.

◆ ISSPACE

#define ISSPACE ( c)
Value:
isspace(c)

Definition at line 81 of file __STRING.cpp.

◆ STRCASECMP

#define STRCASECMP ( s1,
s2 )
Value:
strcasecmp(s1, s2)

Definition at line 74 of file __STRING.cpp.

◆ STRCHR

#define STRCHR ( s,
c )
Value:
strchr(s, c)

Definition at line 79 of file __STRING.cpp.

◆ STRCMP

#define STRCMP ( s1,
s2 )
Value:
strcmp(s1, s2)

Definition at line 66 of file __STRING.cpp.

◆ STRING_BUILDER_T

#define STRING_BUILDER_T   ByteStringBuilder

Definition at line 56 of file __STRING.h.

◆ STRING_T

#define STRING_T   ByteString

Definition at line 61 of file __STRING.cpp.

◆ STRLEN

#define STRLEN ( s)
Value:
strlen(s)

Definition at line 65 of file __STRING.cpp.

◆ STRNCASECMP

#define STRNCASECMP ( s1,
s2,
n )
Value:
strncasecmp(s1, s2, n)
void CharsetConvertException *size_t n
Definition SQLField.cpp:253

Definition at line 75 of file __STRING.cpp.

◆ STRNCMP

#define STRNCMP ( s1,
s2,
n )
Value:
strncmp(s1, s2, n)

Definition at line 67 of file __STRING.cpp.

◆ STRSTR

#define STRSTR ( s,
cs )
Value:
strstr(s, cs)

Definition at line 80 of file __STRING.cpp.

◆ TOLOWER

#define TOLOWER ( c)
Value:
tolower(c)

Definition at line 84 of file __STRING.cpp.

◆ TOLOWER_L

#define TOLOWER_L ( c,
l )
Value:
tolower_l(c, l)

Definition at line 86 of file __STRING.cpp.

◆ TOUPPER

#define TOUPPER ( c)
Value:
toupper(c)

Definition at line 83 of file __STRING.cpp.

◆ TOUPPER_L

#define TOUPPER_L ( c,
l )
Value:
toupper_l(c, l)

Definition at line 85 of file __STRING.cpp.

◆ UCHAR_T

#define UCHAR_T   unsigned char

Definition at line 59 of file __STRING.cpp.

◆ VSNPRINTF

#define VSNPRINTF ( buf,
len,
fmt,
args )
Value:
vsnprintf(buf, len, fmt, args)
size_t len
ByteBuffer * buf

Definition at line 76 of file __STRING.cpp.

Function Documentation

◆ __CONCAT()

__CONCAT ( __empty__ ,
CHAR_T  )

◆ __escapeable()

bool __escapeable ( unsigned int c,
STRING_T::EscapeFlags _flag )

Definition at line 1315 of file __STRING.cpp.

1316{
1317 bool r = false;
1318 if (_flag == STRING_T::ESCAPE_DEFAULT) {
1319 r = (c <= 0xff) && (c < ASCII_32 || ASCII_126 < c
1320 || c == _T('\"') || c == _T('\'') || c == _T('\\'));
1321 }
1322 else if (_flag == STRING_T::ESCAPE_EXTENDED) {
1323 r = ISALNUM(c) != 0;
1324 }
1325 else
1326 r = true;
1327
1328 return r;
1329}
#define ASCII_32
#define ASCII_126
#define _T(s)
Definition __STRING.cpp:57
#define ISALNUM(c)
Definition __STRING.cpp:82
ByteString r

◆ __extended_length()

size_t __extended_length ( size_t _allocLength)

Definition at line 113 of file __STRING.cpp.

114{
115 if (_allocLength <= 32)
116 _allocLength = 32;
117 else if (_allocLength <= 64)
118 _allocLength = 64;
119 else if (_allocLength <= 128)
120 _allocLength = 128;
121 else if (_allocLength <= 256)
122 _allocLength = 256;
123 else if (_allocLength <= 512)
124 _allocLength = 512;
125 else if (_allocLength <= 1024)
126 _allocLength = 1024;
127 else {
128 size_t m = _allocLength / 2048;
129 if (_allocLength % 2048)
130 m++;
131 _allocLength = m * 2048;
132 }
133 return _allocLength;
134}

◆ __hex2int()

int __hex2int ( UCHAR_T c)

Definition at line 1423 of file __STRING.cpp.

1424{
1425 if (_T('0') <= c && c <= _T('9'))
1426 return c - _T('0');
1427 else if (_T('A') <= c && c <= _T('F'))
1428 return c - _T('A') + 10;
1429 else if (_T('a') <= c && c <= _T('f'))
1430 return c - _T('a') + 10;
1431 else {
1432 return -1;
1433 }
1434}

◆ operator+() [1/5]

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

Definition at line 488 of file __STRING.cpp.

489{
490 STRING_T r;
491 r.assign(&_ch, 1, _str, _str.length());
492 return r;
493}
#define STRING_T
Definition __STRING.h:23
size_t length() const
Definition __STRING.h:636

◆ operator+() [2/5]

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

Definition at line 503 of file __STRING.cpp.

504{
505 __DCL_ASSERT_PARAM(_psz != NULL);
506 STRING_T r;
507 r.assign(_psz, STRING_T::length(_psz), _str, _str.length());
508 return r;
509}
#define NULL
Definition Config.h:340
#define __DCL_ASSERT_PARAM(expr)
Definition Object.h:384

◆ operator+() [3/5]

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

Definition at line 481 of file __STRING.cpp.

482{
483 STRING_T r;
484 r.assign(_str, _str.length(), &_ch, 1);
485 return r;
486}

◆ operator+() [4/5]

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

Definition at line 495 of file __STRING.cpp.

496{
497 __DCL_ASSERT_PARAM(_psz != NULL);
498 STRING_T r;
499 r.assign(_str, _str.length(), _psz, STRING_T::length(_psz));
500 return r;
501}

◆ operator+() [5/5]

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

Definition at line 474 of file __STRING.cpp.

475{
476 STRING_T r;
477 r.assign(_str1, _str1.length(), _str2, _str2.length());
478 return r;
479}