#include <fixst128.h>
Inheritance diagram for String_128:
Public Member Functions | |
String_128 (const TCHAR *psz=TEXT("")) | |
Constructs a string of the appropriate maximum length. | |
String_128 (const StringBase &other) | |
String_128 (const String_128 &other) | |
String_128 (UINT32 resID, UINT32 hinst=0) | |
Loads the string resource into this String. | |
String_128 (const wxString &wxs) | |
Constructs a string of the appropriate maximum length. | |
virtual | ~String_128 () |
Destroys this fixed-length string. | |
virtual BOOL | Alloc (INT32 nSize) |
Fixes Alloc() for fixed-length strings, which CAN be safely changed# to use a buffer on the heap. Scope: Public. | |
Private Member Functions | |
void | CopyConstruct (const StringBase &other) |
Constructs a string of the appropriate maximum length. Duplicates the text of the other string. | |
Private Attributes | |
TCHAR | fixedbuf [(((128)+1)*2)] |
Static Private Attributes | |
static const INT32 | FIX_LEN_BUFSIZE |
class String_128 : public StringBase
Definition at line 115 of file fixst128.h.
|
Constructs a string of the appropriate maximum length.
Definition at line 117 of file fixst128.cpp. 00118 { 00119 *(text = fixedbuf) = 0; 00120 length = FIX_LEN_BUFSIZE; 00121 if (psz != 0) 00122 { 00123 ERROR3IF(camStrlen(psz) >= length, "String_128::String_128 overflow"); 00124 camStrcpy(text, psz); 00125 } 00126 }
|
|
Definition at line 127 of file fixst128.h. 00127 { CopyConstruct( other ); }
|
|
Definition at line 128 of file fixst128.h. 00128 { CopyConstruct( other ); }
|
|
Loads the string resource into this String.
Definition at line 198 of file fixst128.cpp. 00199 { 00200 *(text = fixedbuf) = 0; 00201 length = FIX_LEN_BUFSIZE; 00202 if (!Load(resID, hinst)) 00203 { 00204 ERROR3("String resource failed to load"); 00205 TCHAR buf[128]; 00206 camSnprintf(buf, 128, TEXT("<%X:%X>"), (INT32) resID, (INT32) hinst); 00207 camStrcpy(text, (camStrlen(buf) <= 128) ? buf : TEXT("!")); 00208 } 00209 }
|
|
Constructs a string of the appropriate maximum length.
Definition at line 225 of file fixst128.cpp. 00226 { 00227 *(text = fixedbuf) = 0; 00228 length = FIX_LEN_BUFSIZE; 00229 ERROR3IF(wxs.Len() >= length, "String_128::String_128 overflow"); 00230 camStrcpy(text, (LPCTSTR)wxs); 00231 }
|
|
Destroys this fixed-length string.
Definition at line 150 of file fixst128.h. 00151 { 00152 // If the string is using the fixed-length buffer then make sure the 00153 // base class doesn't try to delete[] it. 00154 if (text == fixedbuf) text = 0; 00155 }
|
|
Fixes Alloc() for fixed-length strings, which CAN be safely changed# to use a buffer on the heap. Scope: Public.
Reimplemented from StringBase. Definition at line 246 of file fixst128.cpp. 00247 { 00248 if (text == fixedbuf) text = 0; 00249 return StringBase::Alloc(nSize); 00250 }
|
|
Constructs a string of the appropriate maximum length. Duplicates the text of the other string.
Definition at line 169 of file fixst128.cpp. 00170 { 00171 *(text = fixedbuf) = 0; 00172 length = FIX_LEN_BUFSIZE; 00173 ERROR3IF((const TCHAR*) other == 0, "StringBase to be copied has not been ALLOCated"); 00174 ERROR3IF(camStrlen((const TCHAR*) other) >= length, 00175 "Constructed String_128 not large enough to hold StringBase copy"); 00176 camStrcpy(text, (const TCHAR*) other); 00177 }
|
|
Definition at line 117 of file fixst128.h. |
|
Definition at line 136 of file fixst128.h. |