KJS::UString Class Reference
#include <ustring.h>
Detailed Description
Unicode string class.
Definition at line 189 of file ustring.h.
Public Member Functions | |
UString () | |
UString (char c) | |
UString (const char *c) | |
UString (const UChar *c, int length) | |
UString (UChar *c, int length, bool copy) | |
UString (const UString &s) | |
UString (const QString &) | |
UString (const DOM::DOMString &) | |
UString (const UString &, const UString &) | |
~UString () | |
UString & | append (const UString &) |
CString | cstring () const |
char * | ascii () const |
DOM::DOMString | string () const |
QString | qstring () const |
QConstString | qconststring () const |
UString & | operator= (const char *c) |
UString & | operator= (const UString &) |
UString & | operator+= (const UString &s) |
const UChar * | data () const |
bool | isNull () const |
bool | isEmpty () const |
bool | is8Bit () const |
int | size () const |
UChar | operator[] (int pos) const |
UCharReference | operator[] (int pos) |
double | toDouble (bool tolerateTrailingJunk, bool tolerateEmptyString) const |
double | toDouble (bool tolerateTrailingJunk) const |
double | toDouble () const |
unsigned long | toULong (bool *ok, bool tolerateEmptyString) const |
unsigned long | toULong (bool *ok=0) const |
unsigned int | toUInt32 (bool *ok=0) const |
unsigned int | toStrictUInt32 (bool *ok=0) const |
unsigned | toArrayIndex (bool *ok=0) const |
UString | toLower () const |
UString | toUpper () const |
int | find (const UString &f, int pos=0) const |
int | find (UChar, int pos=0) const |
int | rfind (const UString &f, int pos) const |
int | rfind (UChar, int pos) const |
UString | substr (int pos=0, int len=-1) const |
Static Public Member Functions | |
static UString | from (int i) |
static UString | from (unsigned int u) |
static UString | from (long l) |
static UString | from (double d) |
Static Public Attributes | |
static UString | null |
Friends | |
class | UCharReference |
class | Identifier |
class | PropertyMap |
class | PropertyMapHashTableEntry |
bool | operator== (const UString &, const UString &) |
Constructor & Destructor Documentation
|
Constructs a null string.
Definition at line 264 of file ustring.cpp. |
|
Constructs a string from the single character c.
Definition at line 270 of file ustring.cpp. |
|
Constructs a string from a classical zero determined char string.
Definition at line 277 of file ustring.cpp. |
|
Constructs a string from an array of Unicode characters of the specified length.
Definition at line 294 of file ustring.cpp. |
|
If copy is false the string data will be adopted. That means that the data will NOT be copied and the pointer will be deleted when the UString object is modified or destroyed. Behaviour defaults to a deep copy if copy is true. Definition at line 305 of file ustring.cpp. |
|
Copy constructor. Makes a shallow copy only. |
|
Convenience declaration only ! You'll be on your own to write the implementation for a construction from QString. Note: feel free to contact me if you want to see a dummy header for your favorite FooString class here ! |
|
Convenience declaration only ! See UString(const QString&).
|
|
Concatenation constructor. Makes operator+ more efficient. Definition at line 320 of file ustring.cpp. |
|
Destructor. If this handle was the only one holding a reference to the string the data will be freed. |
Member Function Documentation
|
Append another string.
Definition at line 452 of file ustring.cpp. |
|
Convert the Unicode string to plain ASCII chars chopping of any higher bytes. This method should only be used for *debugging* purposes as it is neither Unicode safe nor free from side effects. In order not to waste any memory the char buffer is static and *shared* by all UString instances. Definition at line 480 of file ustring.cpp. |
|
Definition at line 475 of file ustring.cpp. |
|
|
|
Definition at line 793 of file ustring.cpp. |
|
Constructs a string from a double.
Definition at line 384 of file ustring.cpp. |
|
Constructs a string from a long.
Definition at line 358 of file ustring.cpp. |
|
Constructs a string from an unsigned int.
Definition at line 340 of file ustring.cpp. |
|
Constructs a string from an int.
Definition at line 335 of file ustring.cpp. |
|
Use this if you want to make sure that this string is a plain ASCII string. For example, if you don't want to lose any information when using cstring() or ascii().
Definition at line 544 of file ustring.cpp. |
|
|
|
|
|
Appends the specified string.
|
|
Assignment operator.
Definition at line 517 of file ustring.cpp. |
|
Writable reference to character at specified position.
Definition at line 565 of file ustring.cpp. |
|
Const character at specified position.
Definition at line 557 of file ustring.cpp. |
|
|
|
|
|
Definition at line 827 of file ustring.cpp. |
|
|
|
|
|
Definition at line 863 of file ustring.cpp. |
|
Attempts an conversion to an array index. The "ok" boolean will be set to true if it is a valid array index according to the rule from ECMA 15.2 about what an array index is. It must exactly match the string form of an unsigned integer, and be less than 2^32 - 1. Definition at line 785 of file ustring.cpp. |
|
Attempts an conversion to a number. Apart from floating point numbers, the algorithm will recognize hexadecimal representations (as indicated by a 0x or 0X prefix) and +/- Infinity. Returns NaN if the conversion failed.
Definition at line 602 of file ustring.cpp. |
|
Returns this string converted to lower case characters.
Definition at line 701 of file ustring.cpp. |
|
Attempts an conversion to an unsigned long integer. ok will be set according to the success. @param ok make this point to a bool in case you need to know whether the conversion succeeded.
Definition at line 680 of file ustring.cpp. |
|
Returns this string converted to upper case characters.
Definition at line 709 of file ustring.cpp. |
Member Data Documentation
|
Static instance of a null string.
|
The documentation for this class was generated from the following files: