KHTML
DOM::DOMString Class Reference
This class implements the basic string we use in the DOM. More...
#include <dom_string.h>
Public Member Functions | |
DOMString | copy () const |
DOMString (const DOMString &str) | |
DOMString (DOMStringImpl *i) | |
DOMString (const char *str) | |
DOMString (const QString &) | |
DOMString (const QChar *str, uint len) | |
DOMString () | |
int | find (const QChar c, int start=0) const |
DOMStringImpl * | implementation () const |
void | insert (DOMString str, uint pos) |
bool | isEmpty () const |
bool | isNull () const |
uint | length () const |
DOMString | lower () const |
DOMString | operator+ (const DOMString &str) |
DOMString & | operator+= (const DOMString &str) |
DOMString & | operator= (const DOMString &str) |
const QChar & | operator[] (unsigned int i) const |
bool | percentage (int &_percentage) const |
void | remove (unsigned int pos, int len=1) |
DOMString | split (unsigned int pos) |
QString | string () const |
int | toInt () const |
void | truncate (unsigned int len) |
QChar * | unicode () const |
DOMString | upper () const |
virtual | ~DOMString () |
Protected Attributes | |
DOMStringImpl * | impl |
Friends | |
KHTML_EXPORT bool | operator== (const DOMString &a, const char *b) |
Detailed Description
This class implements the basic string we use in the DOM.We do not use QString for 2 reasons: Memory overhead, and the missing explicit sharing of strings we need for the DOM.
All DOMStrings are explicitly shared (they behave like pointers), meaning that modifications to one instance will also modify all others. If you wish to get a DOMString that is independent, use copy().
Definition at line 43 of file dom_string.h.
Constructor & Destructor Documentation
DOM::DOMString::DOMString | ( | ) | [inline] |
Definition at line 29 of file dom_string.cpp.
DOMString::DOMString | ( | const QString & | str | ) |
Definition at line 35 of file dom_string.cpp.
DOMString::DOMString | ( | const char * | str | ) |
Definition at line 46 of file dom_string.cpp.
DOMString::DOMString | ( | DOMStringImpl * | i | ) |
Definition at line 57 of file dom_string.cpp.
DOMString::~DOMString | ( | ) | [virtual] |
Definition at line 69 of file dom_string.cpp.
DOMString::DOMString | ( | const DOMString & | str | ) |
Definition at line 63 of file dom_string.cpp.
Member Function Documentation
DOMString DOMString::copy | ( | ) | const |
Definition at line 216 of file dom_string.cpp.
Definition at line 139 of file dom_string.cpp.
DOMStringImpl* DOM::DOMString::implementation | ( | ) | const [inline] |
For internal use only.
get a handle to the imlementation of the DOMString Use at own risk!!!
Definition at line 115 of file dom_string.h.
Definition at line 118 of file dom_string.cpp.
bool DOMString::isEmpty | ( | ) | const |
Definition at line 255 of file dom_string.cpp.
bool DOM::DOMString::isNull | ( | ) | const [inline] |
Definition at line 108 of file dom_string.h.
uint DOMString::length | ( | ) | const |
Definition at line 151 of file dom_string.cpp.
DOMString DOMString::lower | ( | ) | const |
Definition at line 74 of file dom_string.cpp.
The character at position i of the DOMString.
If i >= length(), the character returned will be 0.
Definition at line 130 of file dom_string.cpp.
Definition at line 185 of file dom_string.cpp.
Definition at line 162 of file dom_string.cpp.
Splits the string into two.
The original string gets truncated to pos, and the rest is returned.
Definition at line 167 of file dom_string.cpp.
QString DOMString::string | ( | ) | const |
Definition at line 202 of file dom_string.cpp.
int DOMString::toInt | ( | ) | const |
Definition at line 209 of file dom_string.cpp.
void DOMString::truncate | ( | unsigned int | len | ) |
Definition at line 157 of file dom_string.cpp.
QChar * DOMString::unicode | ( | ) | const |
Definition at line 196 of file dom_string.cpp.
DOMString DOMString::upper | ( | ) | const |
Friends And Related Function Documentation
Member Data Documentation
DOMStringImpl* DOM::DOMString::impl [protected] |
Definition at line 118 of file dom_string.h.
The documentation for this class was generated from the following files: