#include <fixst256.h>
Inheritance diagram for String_256:
Public Member Functions | |
String_256 (const TCHAR *psz=TEXT("")) | |
Constructs a string of the appropriate maximum length. | |
String_256 (const StringBase &other) | |
String_256 (const String_256 &other) | |
String_256 (UINT32 resID, UINT32 hinst=0) | |
Loads the string resource into this String. | |
String_256 (const wxString &wxs) | |
Constructs a string of the appropriate maximum length. | |
virtual | ~String_256 () |
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 [(((256)+1)*2)] |
Static Private Attributes | |
static const INT32 | FIX_LEN_BUFSIZE |
class String_256 : public StringBase
Definition at line 116 of file fixst256.h.
|
Constructs a string of the appropriate maximum length.
Definition at line 118 of file fixst256.cpp. 00119 { 00120 *(text = fixedbuf) = 0; 00121 length = FIX_LEN_BUFSIZE; 00122 if (psz != 0) 00123 { 00124 ERROR3IF(camStrlen(psz) >= length, "String_256::String_256 overflow"); 00125 camStrcpy(text, psz); 00126 } 00127 }
|
|
Definition at line 128 of file fixst256.h. 00128 { CopyConstruct( other ); }
|
|
Definition at line 129 of file fixst256.h. 00129 { CopyConstruct( other ); }
|
|
Loads the string resource into this String.
Definition at line 199 of file fixst256.cpp. 00200 { 00201 *(text = fixedbuf) = 0; 00202 length = FIX_LEN_BUFSIZE; 00203 if (!Load(resID, hinst)) 00204 { 00205 ERROR3("String resource failed to load"); 00206 TCHAR buf[128]; 00207 camSnprintf(buf, 128, TEXT("<%X:%X>"), (INT32) resID, (INT32) hinst); 00208 camStrcpy(text, (camStrlen(buf) <= 256) ? buf : TEXT("!")); 00209 } 00210 }
|
|
Constructs a string of the appropriate maximum length.
Definition at line 226 of file fixst256.cpp. 00227 { 00228 *(text = fixedbuf) = 0; 00229 length = FIX_LEN_BUFSIZE; 00230 ERROR3IF(wxs.Len() >= length, "String_256::String_256 overflow"); 00231 camStrcpy(text, (LPCTSTR)wxs); 00232 }
|
|
Destroys this fixed-length string.
Definition at line 151 of file fixst256.h. 00152 { 00153 // If the string is using the fixed-length buffer then make sure the 00154 // base class doesn't try to delete[] it. 00155 if (text == fixedbuf) text = 0; 00156 }
|
|
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 247 of file fixst256.cpp. 00248 { 00249 if (text == fixedbuf) text = 0; 00250 return StringBase::Alloc(nSize); 00251 }
|
|
Constructs a string of the appropriate maximum length. Duplicates the text of the other string.
Definition at line 170 of file fixst256.cpp. 00171 { 00172 *(text = fixedbuf) = 0; 00173 length = FIX_LEN_BUFSIZE; 00174 ERROR3IF((const TCHAR*) other == 0, "StringBase to be copied has not been ALLOCated"); 00175 ERROR3IF(camStrlen((const TCHAR*) other) >= length, 00176 "Constructed String_256 not large enough to hold StringBase copy"); 00177 camStrcpy(text, (const TCHAR*) other); 00178 }
|
|
Definition at line 118 of file fixst256.h. |
|
Definition at line 137 of file fixst256.h. |