#include <T2String8.h>
|
static TCHAR * | CreateCopy (const TCHAR *a_pcString, TSIZE a_uiSize=-1) |
|
static TINT | FormatV (TCHAR *a_pcString, TINT size, const TCHAR *a_pcFormat, va_list args) |
|
static TINT | FormatV (TCHAR *a_pcString, const TCHAR *a_pcFormat, va_list args) |
|
static TINT | Format (TCHAR *a_pcString, TINT size, const TCHAR *a_pcFormat,...) |
|
static TINT | Format (TCHAR *a_pcString, const TCHAR *a_pcFormat,...) |
|
static TINT | Compare (const TCHAR *str1, const TCHAR *str2, TSIZE size=-1) |
|
static TINT | CompareNoCase (const TCHAR *str1, const TCHAR *str2, TSIZE size=-1) |
|
static TCHAR * | Copy (TCHAR *dst, const TCHAR *src, TSIZE size=-1) |
|
static TCHAR * | CopySafe (TCHAR *dst, const TCHAR *src, TSIZE size) |
|
static TCHAR * | Concat (TCHAR *dst, const TCHAR *src, TSIZE size=-1) |
|
static TCHAR * | FindChar (TCHAR *str, TCHAR character) |
|
static const TCHAR * | FindChar (const TCHAR *str, TCHAR character) |
|
static TCHAR * | FindString (TCHAR *str, const TCHAR *substr) |
|
static const TCHAR * | FindString (const TCHAR *str, const TCHAR *substr) |
|
static TSIZE | Length (const TCHAR *str) |
|
static TBOOL | IsLowerCase (const TCHAR *str) |
|
static TBOOL | IsUpperCase (const TCHAR *str) |
|
static void | ToLowerCase (TCHAR *str) |
|
static void | ToUpperCase (TCHAR *str) |
|
static void | IntToString (TINT value, TCHAR *dst, TINT unused, TINT radix) |
|
static void | IntToString (TINT value, TCHAR *dst, TINT radix) |
|
static TINT | StringToInt (const TCHAR *src) |
|
static TFLOAT | StringToFloat (const TCHAR *src) |
|
static TCHAR * | SkipSpaces (TCHAR *str) |
|
static const TCHAR * | SkipSpaces (const TCHAR *str) |
|
static T2Allocator * | GetDefaultAllocatorCB () |
|
Definition at line 9 of file T2String8.h.
◆ Compare()
Definition at line 52 of file T2String8.cpp.
53{
54 if ( size != -1 )
55 return strncmp( str1, str2, size );
56
57 return strcmp( str1, str2 );
58}
◆ CompareNoCase()
Definition at line 60 of file T2String8.cpp.
61{
62 if ( size != -1 )
63 return _strnicmp( str1, str2, size );
64
65 return _stricmp( str1, str2 );
66}
◆ Concat()
Definition at line 76 of file T2String8.cpp.
77{
78 if ( size != -1 )
79 return strncat( dst, src, size );
80
81 return strcat( dst, src );
82}
◆ Copy()
Definition at line 68 of file T2String8.cpp.
69{
70 if ( size != -1 )
71 return strncpy( dst, src, size );
72
73 return strcpy( dst, src );
74}
◆ CopySafe()
Definition at line 84 of file T2String8.cpp.
85{
88 strncpy( dst, src, size );
89 dst[ size ] = '\0';
90 return dst;
91}
TFORCEINLINE const T & Min(const T &a, const T &b)
static TSIZE Length(const TCHAR *str)
◆ CreateCopy()
TCHAR * T2String8::CreateCopy |
( |
const TCHAR * | a_pcString, |
|
|
TSIZE | a_uiSize = -1 ) |
|
static |
Definition at line 203 of file T2String8.cpp.
204{
206
209 pcBuffer[ uiSize ] = '\0';
210
211 return pcBuffer;
212}
static void * MemCopy(void *dst, const void *src, TSIZE size)
◆ FindChar() [1/2]
Definition at line 93 of file T2String8.cpp.
94{
96 {
97 if ( *str ==
'\0' )
return TNULL;
98 if ( *str == character ) return str;
99 str++;
100 }
101
103}
◆ FindChar() [2/2]
Definition at line 105 of file T2String8.cpp.
106{
108 {
109 if ( *str ==
'\0' )
return TNULL;
110 if ( *str == character ) return str;
111 str++;
112 }
113
115}
◆ FindString() [1/2]
const TCHAR * T2String8::FindString |
( |
const TCHAR * | str, |
|
|
const TCHAR * | substr ) |
|
static |
Definition at line 117 of file T2String8.cpp.
118{
119 return strstr( str, substr );
120}
◆ FindString() [2/2]
Definition at line 122 of file T2String8.cpp.
123{
124 return strstr( str, substr );
125}
◆ Format() [1/2]
TINT T2String8::Format |
( |
TCHAR * | a_pcString, |
|
|
const TCHAR * | a_pcFormat, |
|
|
| ... ) |
|
static |
Definition at line 30 of file T2String8.cpp.
31{
32 va_list args;
33
34 va_start( args, a_pcFormat );
35 TINT iResult =
FormatV( a_pcString, a_pcFormat, args );
36 va_end( args );
37
38 return iResult;
39}
static TINT FormatV(TCHAR *a_pcString, TINT size, const TCHAR *a_pcFormat, va_list args)
◆ Format() [2/2]
Definition at line 41 of file T2String8.cpp.
42{
43 va_list args;
44
45 va_start( args, a_pcFormat );
46 TINT iResult =
FormatV( a_pcString, size, a_pcFormat, args );
47 va_end( args );
48
49 return iResult;
50}
◆ FormatV() [1/2]
TINT T2String8::FormatV |
( |
TCHAR * | a_pcString, |
|
|
const TCHAR * | a_pcFormat, |
|
|
va_list | args ) |
|
static |
Definition at line 15 of file T2String8.cpp.
16{
17 TINT iResult = vsprintf( a_pcString, a_pcFormat, args );
18 TASSERT( iResult != -1,
"PS2/GC/X360 do not correctly support _vsnprintf, this code will cause memory to be clobbered on those platforms! Increase the size of the destination string to avoid this problem" );
19 return iResult;
20}
◆ FormatV() [2/2]
TINT T2String8::FormatV |
( |
TCHAR * | a_pcString, |
|
|
TINT | size, |
|
|
const TCHAR * | a_pcFormat, |
|
|
va_list | args ) |
|
static |
Definition at line 22 of file T2String8.cpp.
23{
24 TINT iResult = _vsnprintf( a_pcString, size, a_pcFormat, args );
25 TASSERT( iResult != -1,
"PS2/GC/X360 do not correctly support _vsnprintf, this code will cause memory to be clobbered on those platforms! Increase the size of the destination string to avoid this problem" );
26 a_pcString[ size - 1 ] = '\0';
27 return iResult;
28}
◆ GetDefaultAllocatorCB()
static T2Allocator * T2String8::GetDefaultAllocatorCB |
( |
| ) |
|
|
inlinestatic |
Definition at line 54 of file T2String8.h.
55 {
57 }
TFORCEINLINE T2Allocator * GetGlobalAllocator()
◆ IntToString() [1/2]
void T2String8::IntToString |
( |
TINT | value, |
|
|
TCHAR * | dst, |
|
|
TINT | radix ) |
|
static |
Definition at line 167 of file T2String8.cpp.
168{
169 _itoa( value, dst, radix );
170}
◆ IntToString() [2/2]
Definition at line 172 of file T2String8.cpp.
173{
174 _itoa( value, dst, radix );
175}
◆ IsLowerCase()
Definition at line 133 of file T2String8.cpp.
134{
136 str++;
137
138 return *str == '\0';
139}
static TBOOL IsLowerCase(TINT a_cChar)
◆ IsUpperCase()
Definition at line 141 of file T2String8.cpp.
142{
144 str++;
145
146 return *str == '\0';
147}
static TBOOL IsUpperCase(TINT a_cChar)
◆ Length()
Definition at line 127 of file T2String8.cpp.
128{
129 if ( str !=
TNULL )
return strlen( str );
130 return -1;
131}
◆ SkipSpaces() [1/2]
const TCHAR * T2String8::SkipSpaces |
( |
const TCHAR * | str | ) |
|
|
static |
Definition at line 195 of file T2String8.cpp.
196{
197 const TCHAR* pszCursor = str;
199
200 return pszCursor;
201}
static TBOOL IsSpace(TINT a_cChar)
◆ SkipSpaces() [2/2]
Definition at line 187 of file T2String8.cpp.
188{
189 TCHAR* pszCursor = str;
191
192 return pszCursor;
193}
◆ StringToFloat()
◆ StringToInt()
TINT T2String8::StringToInt |
( |
const TCHAR * | src | ) |
|
|
static |
◆ ToLowerCase()
void T2String8::ToLowerCase |
( |
TCHAR * | str | ) |
|
|
static |
Definition at line 149 of file T2String8.cpp.
150{
151 while ( *str )
152 {
154 str++;
155 }
156}
static CharType ToLowerCase(TINT a_cChar)
◆ ToUpperCase()
void T2String8::ToUpperCase |
( |
TCHAR * | str | ) |
|
|
static |
Definition at line 158 of file T2String8.cpp.
159{
160 while ( *str )
161 {
163 str++;
164 }
165}
static CharType ToUpperCase(TINT a_cChar)
◆ ms_aScratchMem
TCHAR T2String8::ms_aScratchMem |
|
static |
◆ SCRATCH_MEM_SIZE
TSIZE T2String8::SCRATCH_MEM_SIZE = 2048 |
|
staticconstexpr |
◆ sm_pDefaultAllocatorCB
The documentation for this class was generated from the following files: