OpenBarnyard
 
Loading...
Searching...
No Matches
TString16 Class Reference

#include <TString16.h>

Public Member Functions

 TString16 ()
 
 TString16 (T2Allocator *allocator)
 
 TString16 (TString16 &&src) noexcept
 
 TString16 (const TString16 &src, T2Allocator *allocator=nullptr)
 
 TString16 (const TWCHAR *src, T2Allocator *allocator=nullptr)
 
 TString16 (TINT size, T2Allocator *allocator=nullptr)
 
 ~TString16 ()
 
void Copy (const TString16 &src, TINT size=-1)
 
void Copy (const TWCHAR *src, TINT size=-1)
 
void FreeBuffer ()
 
TBOOL AllocBuffer (TINT size, TBOOL freeMemory=true)
 
TString16VFormat (const TWCHAR *a_pcFormat, va_list a_vargs)
 
void ForceSetData (TWCHAR *a_cString, TINT a_ilength)
 
void UndoForceSetData ()
 
TINT FindReverse (TWCHAR a_findChar, TINT pos=-1) const
 
void Truncate (TINT length)
 
TINT Find (TWCHAR character, TINT pos=0) const
 
TINT Find (const TWCHAR *substr, TINT pos=0) const
 
const TWCHARGetString (TINT index=0) const
 
TWCHARGetStringUnsafe (TINT a_iIndex=0)
 
TString16Concat (const TString16 &str, TINT size=-1)
 
TString16Concat (const TWCHAR *src, TINT size=-1)
 
TString16Reserve (TINT size)
 
TINT Compare (const TWCHAR *a_wszString, TINT a_iLength=-1) const
 
TINT CompareNoCase (const TWCHAR *a_wszString, TINT a_iLength=-1) const
 
TString16 Mid (TINT a_iFirst, TINT a_iCount) const
 
TString16 Right (TINT a_iFrom) const
 
TString16MakeUpper ()
 
TString16MakeLower ()
 
TINT Length () const
 
TUINT16 ExcessLength () const
 
TBOOL IsAllLowerCase () const
 
TBOOL IsAllUpperCase () const
 
TBOOL IsIndexValid (TINT index) const
 
TBOOL IsEmpty () const
 
TBOOL IsUnicode () const
 
TString16 operator+ (TWCHAR const *a_wszStr) const
 
TString16operator+= (TWCHAR const *a_wszStr)
 
TString16operator+= (TString16 &str)
 
TWCHARoperator[] (TINT index)
 
const TWCHARoperator[] (TINT index) const
 
 operator const TWCHAR * () const
 
TBOOL operator! ()
 
TBOOL operator== (const TWCHAR *a_wszStr) const
 
TBOOL operator== (const TString16 &str) const
 
TBOOL operator!= (const TWCHAR *a_wszStr) const
 
TBOOL operator!= (const TString16 &str) const
 
TBOOL operator< (const TWCHAR *a_wszStr) const
 
TBOOL operator< (const TString16 &str) const
 
TBOOL operator<= (const TWCHAR *a_wszStr) const
 
TBOOL operator<= (const TString16 &str) const
 
TString16operator= (const TWCHAR *a_wszStr)
 
TString16operator= (const TString16 &str)
 
TString16operator= (TString16 &&str)
 

Static Public Member Functions

static TString16 Format (const TWCHAR *a_pcFormat,...)
 

Detailed Description

Definition at line 7 of file TString16.h.

Constructor & Destructor Documentation

◆ TString16() [1/6]

TString16::TString16 ( )

Definition at line 14 of file TString16.cpp.

15{
16 Reset();
17 m_pAllocator = GetAllocator();
18}

◆ TString16() [2/6]

TString16::TString16 ( T2Allocator * allocator)

Definition at line 20 of file TString16.cpp.

21{
22 Reset();
23 m_pAllocator = allocator == TNULL ? GetAllocator() : allocator;
24}
#define TNULL
Definition Typedefs.h:23

◆ TString16() [3/6]

TString16::TString16 ( TString16 && src)
noexcept

Definition at line 26 of file TString16.cpp.

27{
28 TString16::m_pAllocator = src.m_pAllocator;
29 TString16::m_iExcessLen = src.m_iExcessLen;
30 TString16::m_iStrLen = src.m_iStrLen;
31 TString16::m_pBuffer = src.m_pBuffer;
32 src.Reset();
33}

◆ TString16() [4/6]

TString16::TString16 ( const TString16 & src,
T2Allocator * allocator = nullptr )

Definition at line 35 of file TString16.cpp.

36{
37 Reset();
38 m_pAllocator = allocator == TNULL ? GetAllocator() : allocator;
39 Copy( src, -1 );
40}
void Copy(const TString16 &src, TINT size=-1)
Definition TString16.h:18

◆ TString16() [5/6]

TString16::TString16 ( const TWCHAR * src,
T2Allocator * allocator = nullptr )

Definition at line 49 of file TString16.cpp.

50{
51 Reset();
52 m_pAllocator = allocator == TNULL ? GetAllocator() : allocator;
53 Copy( src );
54}

◆ TString16() [6/6]

TString16::TString16 ( TINT size,
T2Allocator * allocator = nullptr )

Definition at line 42 of file TString16.cpp.

43{
44 Reset();
45 m_pAllocator = allocator == TNULL ? GetAllocator() : allocator;
46 AllocBuffer( size );
47}
TBOOL AllocBuffer(TINT size, TBOOL freeMemory=true)
Definition TString16.cpp:95

◆ ~TString16()

TString16::~TString16 ( )
inline

Definition at line 16 of file TString16.h.

16{ FreeBuffer(); }
void FreeBuffer()

Member Function Documentation

◆ AllocBuffer()

TBOOL TString16::AllocBuffer ( TINT size,
TBOOL freeMemory = true )

Definition at line 95 of file TString16.cpp.

96{
97 TBOOL hasChanged = TFALSE;
98 TINT currentLength = Length();
99
100 TASSERT( a_iLength >= 0, "Length can't be less than 0" );
101 TASSERT( a_iLength <= 0xFFFFFF, "Too big string" );
102
103 if ( a_iLength != currentLength )
104 {
105 if ( a_iLength == 0 )
106 {
107 if ( freeMemory ) m_pAllocator->Free( m_pBuffer );
108
109 m_pBuffer = NullWString;
110 m_iExcessLen = 0;
111
112 hasChanged = TTRUE;
113 }
114 else
115 {
116 TINT newExcessLen = ( currentLength - a_iLength ) + m_iExcessLen;
117
118 if ( newExcessLen < 0 || newExcessLen > 0xFF )
119 {
120 if ( currentLength != 0 && freeMemory )
121 {
122 m_pAllocator->Free( m_pBuffer );
123 }
124
125 m_pBuffer = (TWCHAR*)m_pAllocator->Malloc( ( a_iLength + 1 ) * sizeof( TWCHAR ) );
126 m_iExcessLen = 0;
127
128 hasChanged = TTRUE;
129 }
130 else
131 {
132 m_iExcessLen = newExcessLen;
133 hasChanged = TFALSE;
134 }
135 }
136
137 m_iStrLen = a_iLength;
138 }
139
140 if ( freeMemory ) m_pBuffer[ 0 ] = L'\0';
141 return hasChanged;
142}
#define TASSERT(X,...)
Definition Defines.h:138
wchar_t TWCHAR
Definition Typedefs.h:21
int TINT
Definition Typedefs.h:7
#define TFALSE
Definition Typedefs.h:24
#define TTRUE
Definition Typedefs.h:25
bool TBOOL
Definition Typedefs.h:6
TINT Length() const
Definition TString16.h:73

◆ Compare()

TINT TString16::Compare ( const TWCHAR * a_wszString,
TINT a_iLength = -1 ) const

Definition at line 286 of file TString16.cpp.

287{
288 TASSERT( a_pcString != TNULL, "TCString::CompareNoCase - Passed string cannot be TNULL" );
289 TASSERT( IsIndexValid( 0 ), "TCString::CompareNoCase - Index 0 is not valid" );
290 TASSERT( GetString() != TNULL, "TCString::CompareNoCase - String cannot be TNULL" );
291
292 if ( param_2 != -1 )
293 {
294 return wcsncmp( GetString(), a_pcString, param_2 );
295 }
296
297 const TWCHAR* str = GetString();
298 TWCHAR bVar1 = 0;
299 TWCHAR bVar4 = 0;
300 while ( TTRUE )
301 {
302 bVar1 = *str;
303 bVar4 = bVar1 < *a_pcString;
304
305 if ( bVar1 != *a_pcString ) break;
306 if ( bVar1 == 0 ) return 0;
307
308 bVar1 = str[ 1 ];
309 bVar4 = bVar1 < a_pcString[ 1 ];
310
311 if ( bVar1 != a_pcString[ 1 ] ) break;
312 if ( bVar1 == 0 ) return 0;
313
314 str += 2;
315 a_pcString += 2;
316 }
317 return bVar4 | 1;
318}
const TWCHAR * GetString(TINT index=0) const
TBOOL IsIndexValid(TINT index) const
Definition TString16.h:78

◆ CompareNoCase()

TINT TString16::CompareNoCase ( const TWCHAR * a_wszString,
TINT a_iLength = -1 ) const

Definition at line 343 of file TString16.cpp.

344{
345 TASSERT( a_pcString != TNULL, "TWString::CompareNoCase - Passed string cannot be TNULL" );
346 TASSERT( IsIndexValid( 0 ), "TWString::CompareNoCase - Index 0 is not valid" );
347 TASSERT( GetString() != TNULL, "TWString::CompareNoCase - String cannot be TNULL" );
348
349 if ( param_2 == -1 )
350 {
351 return _wcsicmp( GetString(), a_pcString );
352 }
353
354 TASSERT( IsIndexValid( 0 ), "TWString::CompareNoCase - Index 0 is not valid" );
355
356 return _wcsnicmp( GetString(), a_pcString, param_2 );
357}

◆ Concat() [1/2]

TString16 & TString16::Concat ( const TString16 & str,
TINT size = -1 )
inline

Definition at line 48 of file TString16.h.

48{ return Concat( str.m_pBuffer, size ); };
TString16 & Concat(const TString16 &str, TINT size=-1)
Definition TString16.h:48

◆ Concat() [2/2]

TString16 & TString16::Concat ( const TWCHAR * src,
TINT size = -1 )

Definition at line 252 of file TString16.cpp.

253{
255
256 if ( ( len < size ) || ( size == -1 ) )
257 {
258 size = len;
259 }
260
261 TINT oldLength = m_iStrLen;
262 TWCHAR* oldString = m_pBuffer;
263
264 TBOOL allocated = AllocBuffer( m_iStrLen + size, TFALSE );
265
266 if ( allocated )
267 {
268 // since it has made a new buffer
269 // it need to copy the old string
270 // to the new buffer
271
272 TStringManager::String16Copy( m_pBuffer, oldString, -1 );
273 }
274
275 TStringManager::String16Copy( m_pBuffer + oldLength, str, size );
276 m_pBuffer[ m_iStrLen ] = 0;
277
278 if ( allocated && oldLength != 0 )
279 {
280 m_pAllocator->Free( oldString );
281 }
282
283 return *this;
284}
static TWCHAR * String16Copy(TWCHAR *dst, const TWCHAR *src, TSIZE size=-1)
static TSIZE String16Length(const TWCHAR *str)

◆ Copy() [1/2]

void TString16::Copy ( const TString16 & src,
TINT size = -1 )
inline

Definition at line 18 of file TString16.h.

18{ Copy( src.m_pBuffer, size ); }

◆ Copy() [2/2]

void TString16::Copy ( const TWCHAR * src,
TINT size = -1 )

Definition at line 56 of file TString16.cpp.

57{
58 if ( src != m_pBuffer )
59 {
60 TINT srcLen = src ? (TINT)TStringManager::String16Length( src ) : 0;
61 TASSERT( srcLen <= 0xFFFFFF, "Too big string" );
62
63 if ( srcLen < size || size == -1 )
64 {
65 size = srcLen;
66 }
67
68 AllocBuffer( size, TTRUE );
69 TUtil::MemCopy( m_pBuffer, src, size * sizeof( TWCHAR ) );
70
71 m_pBuffer[ size ] = 0;
72 }
73}
static void * MemCopy(void *dst, const void *src, TSIZE size)
Definition TUtil.h:90

◆ ExcessLength()

TUINT16 TString16::ExcessLength ( ) const
inline

Definition at line 74 of file TString16.h.

74{ return m_iExcessLen; }

◆ Find() [1/2]

TINT TString16::Find ( const TWCHAR * substr,
TINT pos = 0 ) const

Definition at line 85 of file TString16.cpp.

86{
87 if ( !IsIndexValid( pos ) ) return -1;
88
89 const TWCHAR* foundAt = wcsstr( GetString( pos ), substr );
90 if ( foundAt == TNULL ) return -1;
91
92 return (TINT)( foundAt - m_pBuffer );
93}

◆ Find() [2/2]

TINT TString16::Find ( TWCHAR character,
TINT pos = 0 ) const

Definition at line 75 of file TString16.cpp.

76{
77 if ( !IsIndexValid( pos ) ) return -1;
78
79 const TWCHAR* foundAt = wcschr( &m_pBuffer[ pos ], character );
80 if ( foundAt == TNULL ) return -1;
81
82 return (TINT)( foundAt - m_pBuffer );
83}

◆ FindReverse()

TINT TString16::FindReverse ( TWCHAR a_findChar,
TINT pos = -1 ) const

Definition at line 186 of file TString16.cpp.

187{
188 if ( pos == -1 )
189 {
190 pos = m_iStrLen;
191 }
192 else
193 {
194 if ( !IsIndexValid( pos ) ) return -1;
195 }
196
197
198 for ( ; pos > -1; pos-- )
199 {
200 if ( a_findChar == m_pBuffer[ pos ] )
201 {
202 return pos;
203 }
204 }
205
206 return -1;
207}

◆ ForceSetData()

void TString16::ForceSetData ( TWCHAR * a_cString,
TINT a_ilength )

Definition at line 170 of file TString16.cpp.

171{
172 m_pBuffer = a_cString;
173
174 if ( a_iLength < 0 )
175 {
176 m_iStrLen = TStringManager::String16Length( a_cString );
177 }
178 else
179 {
180 m_iStrLen = a_iLength;
181 }
182
183 m_iExcessLen = 0;
184}

◆ Format()

TString16 TString16::Format ( const TWCHAR * a_pcFormat,
... )
static

Definition at line 144 of file TString16.cpp.

145{
146 TWCHAR buffer[ 0x400 ];
147 TString16 buffer2;
148 va_list args;
149
150 va_start( args, a_pcFormat );
151
152 TINT iResult = _vsnwprintf( buffer, sizeof( buffer ), a_pcFormat, args );
153 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" );
154 buffer2.Copy( buffer, -1 );
155
156 return buffer2;
157}

◆ FreeBuffer()

void TString16::FreeBuffer ( )

Definition at line 232 of file TString16.cpp.

233{
234 if ( Length() != 0 ) m_pAllocator->Free( m_pBuffer );
235 Reset();
236}

◆ GetString()

const TWCHAR * TString16::GetString ( TINT index = 0) const

Definition at line 238 of file TString16.cpp.

239{
240 TASSERT( a_iIndex >= 0 && a_iIndex <= m_iStrLen );
241 if ( IsIndexValid( a_iIndex ) ) { return &m_pBuffer[ a_iIndex ]; }
242 return TNULL;
243}

◆ GetStringUnsafe()

TWCHAR * TString16::GetStringUnsafe ( TINT a_iIndex = 0)

Definition at line 245 of file TString16.cpp.

246{
247 TASSERT( a_iIndex >= 0 && a_iIndex <= m_iStrLen );
248 if ( IsIndexValid( a_iIndex ) ) { return &m_pBuffer[ a_iIndex ]; }
249 return TNULL;
250}

◆ IsAllLowerCase()

TBOOL TString16::IsAllLowerCase ( ) const

Definition at line 388 of file TString16.cpp.

389{
390 if ( m_iStrLen != 0 )
391 {
392 TWCHAR* iter = m_pBuffer;
393 TWCHAR* endStr = m_pBuffer + m_iStrLen;
394
395 do
396 {
397 TWCHAR currentC = *iter++;
398 if ( !iswlower( currentC ) ) return TFALSE;
399 } while ( iter < endStr );
400 }
401
402 return TTRUE;
403}

◆ IsAllUpperCase()

TBOOL TString16::IsAllUpperCase ( ) const

Definition at line 405 of file TString16.cpp.

406{
407 if ( m_iStrLen != 0 )
408 {
409 TWCHAR* iter = m_pBuffer;
410 TWCHAR* endStr = m_pBuffer + m_iStrLen;
411
412 do
413 {
414 TWCHAR currentC = *iter++;
415 if ( !iswupper( currentC ) ) return TFALSE;
416 } while ( iter < endStr );
417 }
418
419 return TTRUE;
420}

◆ IsEmpty()

TBOOL TString16::IsEmpty ( ) const
inline

Definition at line 79 of file TString16.h.

79{ return m_iStrLen == 0; }

◆ IsIndexValid()

TBOOL TString16::IsIndexValid ( TINT index) const
inline

Definition at line 78 of file TString16.h.

78{ return index >= 0 && index <= Length(); }

◆ IsUnicode()

TBOOL TString16::IsUnicode ( ) const
inline

Definition at line 80 of file TString16.h.

80{ return TFALSE; } // Who would have known?

◆ Length()

TINT TString16::Length ( ) const
inline

Definition at line 73 of file TString16.h.

73{ return m_iStrLen; }

◆ MakeLower()

TString16 & TString16::MakeLower ( )
inline

Definition at line 67 of file TString16.h.

68 {
69 _wcslwr( m_pBuffer );
70 return *this;
71 }

◆ MakeUpper()

TString16 & TString16::MakeUpper ( )
inline

Definition at line 62 of file TString16.h.

63 {
64 _wcsupr( m_pBuffer );
65 return *this;
66 }

◆ Mid()

TString16 TString16::Mid ( TINT a_iFirst,
TINT a_iCount ) const

Definition at line 359 of file TString16.cpp.

360{
361 if ( a_iFirst < 0 )
362 {
363 a_iFirst = 0;
364 }
365 else if ( Length() <= a_iFirst )
366 {
367 // Can't return string bigger that the original
368 return TString16();
369 }
370
371 if ( a_iCount < 0 || Length() < a_iFirst + a_iCount )
372 {
373 a_iCount = Length() - a_iFirst;
374 }
375
376 TString16 strResult( a_iCount, TNULL );
377 TUtil::MemCopy( strResult.GetStringUnsafe(), GetString( a_iFirst ), a_iCount * 2 );
378 strResult[ a_iCount ] = '\0';
379
380 return strResult;
381}

◆ operator const TWCHAR *()

TString16::operator const TWCHAR * ( ) const
inline

Definition at line 103 of file TString16.h.

103{ return m_pBuffer; }

◆ operator!()

TBOOL TString16::operator! ( )
inline

Definition at line 105 of file TString16.h.

105{ return m_iStrLen == 0; }

◆ operator!=() [1/2]

TBOOL TString16::operator!= ( const TString16 & str) const
inline

Definition at line 109 of file TString16.h.

109{ return Compare( str.m_pBuffer, -1 ) != 0; }
TINT Compare(const TWCHAR *a_wszString, TINT a_iLength=-1) const

◆ operator!=() [2/2]

TBOOL TString16::operator!= ( const TWCHAR * a_wszStr) const
inline

Definition at line 108 of file TString16.h.

108{ return Compare( a_wszStr, -1 ) != 0; }

◆ operator+()

TString16 TString16::operator+ ( TWCHAR const * a_wszStr) const
inline

Definition at line 83 of file TString16.h.

84 {
85 TString16 str = TString16( *this );
86 return std::move( str.Concat( a_wszStr ) );
87 }

◆ operator+=() [1/2]

TString16 * TString16::operator+= ( TString16 & str)
inline

Definition at line 95 of file TString16.h.

96 {
97 Concat( str, -1 );
98 return this;
99 }

◆ operator+=() [2/2]

TString16 * TString16::operator+= ( TWCHAR const * a_wszStr)
inline

Definition at line 89 of file TString16.h.

90 {
91 Concat( a_wszStr, -1 );
92 return this;
93 }

◆ operator<() [1/2]

TBOOL TString16::operator< ( const TString16 & str) const
inline

Definition at line 111 of file TString16.h.

111{ return Compare( str.m_pBuffer, -1 ) > -1; };

◆ operator<() [2/2]

TBOOL TString16::operator< ( const TWCHAR * a_wszStr) const
inline

Definition at line 110 of file TString16.h.

110{ return Compare( a_wszStr, -1 ) > -1; };

◆ operator<=() [1/2]

TBOOL TString16::operator<= ( const TString16 & str) const
inline

Definition at line 113 of file TString16.h.

113{ return Compare( str.m_pBuffer, -1 ) > 0; };

◆ operator<=() [2/2]

TBOOL TString16::operator<= ( const TWCHAR * a_wszStr) const
inline

Definition at line 112 of file TString16.h.

112{ return Compare( a_wszStr, -1 ) > 0; };

◆ operator=() [1/3]

TString16 & TString16::operator= ( const TString16 & str)
inline

Definition at line 121 of file TString16.h.

122 {
123 Copy( str, -1 );
124 return *this;
125 }

◆ operator=() [2/3]

TString16 & TString16::operator= ( const TWCHAR * a_wszStr)
inline

Definition at line 115 of file TString16.h.

116 {
117 Copy( a_wszStr, -1 );
118 return *this;
119 }

◆ operator=() [3/3]

TString16 & TString16::operator= ( TString16 && str)
inline

Definition at line 127 of file TString16.h.

128 {
129 FreeBuffer();
130 m_pBuffer = str.m_pBuffer;
131 m_iExcessLen = str.m_iExcessLen;
132 m_iStrLen = str.m_iStrLen;
133 m_pAllocator = str.m_pAllocator;
134
135 str.Reset();
136 return *this;
137 }

◆ operator==() [1/2]

TBOOL TString16::operator== ( const TString16 & str) const
inline

Definition at line 107 of file TString16.h.

107{ return Compare( str.m_pBuffer, -1 ) == 0; }

◆ operator==() [2/2]

TBOOL TString16::operator== ( const TWCHAR * a_wszStr) const
inline

Definition at line 106 of file TString16.h.

106{ return Compare( a_wszStr, -1 ) == 0; }

◆ operator[]() [1/2]

TWCHAR & TString16::operator[] ( TINT index)
inline

Definition at line 101 of file TString16.h.

101{ return m_pBuffer[ index ]; }

◆ operator[]() [2/2]

const TWCHAR & TString16::operator[] ( TINT index) const
inline

Definition at line 102 of file TString16.h.

102{ return *GetString( index ); }

◆ Reserve()

TString16 & TString16::Reserve ( TINT size)

Definition at line 320 of file TString16.cpp.

321{
322 if ( size > Length() + TINT( ExcessLength() ) )
323 {
324 TINT iOldLength = m_iStrLen;
325 TWCHAR* pOldString = m_pBuffer;
326 TINT iCopySize = TMath::Min( iOldLength, size );
327
328 TBOOL bAllocated = AllocBuffer( size, TFALSE );
329
330 if ( bAllocated )
331 {
332 TStringManager::String16Copy( m_pBuffer, pOldString, iCopySize );
333 m_pBuffer[ iCopySize ] = 0;
334 }
335
336 if ( bAllocated && iOldLength != 0 )
337 m_pAllocator->Free( pOldString );
338 }
339
340 return *this;
341}
TFORCEINLINE const T & Min(const T &a, const T &b)
TUINT16 ExcessLength() const
Definition TString16.h:74

◆ Right()

TString16 TString16::Right ( TINT a_iFrom) const

Definition at line 383 of file TString16.cpp.

384{
385 return Mid( a_iFrom, Length() - a_iFrom );
386}
TString16 Mid(TINT a_iFirst, TINT a_iCount) const

◆ Truncate()

void TString16::Truncate ( TINT length)

Definition at line 209 of file TString16.cpp.

210{
211 if ( Length() < length )
212 {
213 length = Length();
214 }
215
216 TWCHAR* oldBuffer = m_pBuffer;
217
218 TBOOL allocated = AllocBuffer( length, TFALSE );
219 if ( allocated )
220 {
221 TStringManager::String16Copy( m_pBuffer, oldBuffer, length );
222 }
223
224 m_pBuffer[ length ] = 0;
225
226 if ( allocated && Length() != 0 )
227 {
228 m_pAllocator->Free( oldBuffer );
229 }
230}

◆ UndoForceSetData()

void TString16::UndoForceSetData ( )
inline

Definition at line 30 of file TString16.h.

30{ Reset(); }

◆ VFormat()

TString16 & TString16::VFormat ( const TWCHAR * a_pcFormat,
va_list a_vargs )

Definition at line 159 of file TString16.cpp.

160{
161 TWCHAR buffer[ 0x400 ];
162
163 TINT iResult = _vsnwprintf( buffer, sizeof( buffer ), a_pcFormat, a_vargs );
164 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" );
165 Copy( buffer, -1 );
166
167 return *this;
168}

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