version 1.74, 2003/03/12 21:02:53
|
version 1.74.6.2, 2003/08/13 19:39:50
|
|
|
#include <Pegasus/Common/Char16.h> | #include <Pegasus/Common/Char16.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
| |
|
const char STRING_FLAG_ASCII[] = "ASCII"; |
|
const char STRING_FLAG_UTF8[] = "UTF8"; |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class String; | class String; |
|
|
String(const Char16* str, Uint32 n); | String(const Char16* str, Uint32 n); |
| |
/// Initialize from a plain old C-String: | /// Initialize from a plain old C-String: |
|
String(const char* str, const char*); |
String(const char* str); | String(const char* str); |
| |
/// Initialize from the first n characters of a plain old C-String: | /// Initialize from the first n characters of a plain old C-String: |
|
|
<pre> | <pre> |
String test = "abc"; | String test = "abc"; |
printf("test = %s\n", (const char*)test.getCString()); | printf("test = %s\n", (const char*)test.getCString()); |
|
|
|
NOTE: Do not do the following: |
|
const char * p = (const char *)test.getCString(); |
|
The pointer p will be invalid. This is because |
|
the CString object is destructed, which deletes |
|
the heap space for p. |
</pre> | </pre> |
*/ | */ |
CString getCString() const; | CString getCString() const; |
|
|
*/ | */ |
static Boolean equalNoCase(const String& str1, const String& str2); | static Boolean equalNoCase(const String& str1, const String& str2); |
| |
|
// UTF8 specific code: |
|
String& assignUTF8(const char* str); |
|
CString getCStringUTF8() const; |
|
static Boolean isUTF8(const char*); |
|
|
|
|
private: | private: |
| |
StringRep* _rep; | StringRep* _rep; |