KHTML
#include <dom_string.h>
Public Member Functions | |
DOMString () | |
DOMString (const QChar *str, uint len) | |
DOMString (const QString &) | |
DOMString (const char *str) | |
DOMString (const char *str, uint len) | |
DOMString (DOMStringImpl *i) | |
DOMString (const DOMString &str) | |
virtual | ~DOMString () |
QChar * | characters () const |
DOMString | copy () const |
bool | endsWith (const DOMString &str) const |
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 |
DOMString | parsedUrl () const |
bool | percentage (int &_percentage) const |
void | remove (unsigned int pos, int len=1) |
int | reverseFind (const QChar c, int start=-1) const |
DOMString | split (unsigned int pos) |
bool | startsWith (const DOMString &str) const |
QString | string () const |
DOMString | substring (unsigned pos, unsigned len=UINT_MAX) const |
float | toFloat (bool *ok=0) const |
int | toInt () const |
int | toInt (bool *ok) const |
DOMString | trimSpaces () const |
void | truncate (unsigned int len) |
QChar * | unicode () const |
DOMString | upper () const |
Static Public Member Functions | |
static DOMString | format (const char *format,...) |
static DOMString | number (float f) |
Protected Attributes | |
DOMStringImpl * | impl |
Friends | |
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
|
inline |
DOMString::DOMString | ( | const QChar * | str, |
uint | len | ||
) |
Definition at line 30 of file dom_string.cpp.
DOMString::DOMString | ( | const QString & | str | ) |
Definition at line 40 of file dom_string.cpp.
DOMString::DOMString | ( | const char * | str | ) |
Definition at line 51 of file dom_string.cpp.
DOMString::DOMString | ( | const char * | str, |
uint | len | ||
) |
- Since
- 4.2
Definition at line 62 of file dom_string.cpp.
DOMString::DOMString | ( | DOMStringImpl * | i | ) |
Definition at line 72 of file dom_string.cpp.
|
virtual |
Definition at line 84 of file dom_string.cpp.
DOMString::DOMString | ( | const DOMString & | str | ) |
Definition at line 78 of file dom_string.cpp.
Member Function Documentation
|
inline |
Definition at line 109 of file dom_string.h.
DOMString DOMString::copy | ( | ) | const |
Definition at line 275 of file dom_string.cpp.
Definition at line 281 of file dom_string.cpp.
int DOMString::find | ( | const QChar | c, |
int | start = 0 |
||
) | const |
Definition at line 154 of file dom_string.cpp.
|
static |
Definition at line 373 of file dom_string.cpp.
|
inline |
get a handle to the imlementation of the DOMString Use at own risk!!!
Definition at line 147 of file dom_string.h.
void DOMString::insert | ( | DOMString | str, |
uint | pos | ||
) |
Definition at line 133 of file dom_string.cpp.
bool DOMString::isEmpty | ( | ) | const |
Definition at line 368 of file dom_string.cpp.
|
inline |
Definition at line 121 of file dom_string.h.
uint DOMString::length | ( | ) | const |
Definition at line 185 of file dom_string.cpp.
DOMString DOMString::lower | ( | ) | const |
Returns a lowercase version of the string.
Definition at line 207 of file dom_string.cpp.
|
static |
Definition at line 270 of file dom_string.cpp.
add two DOMString's
Definition at line 120 of file dom_string.cpp.
append str to this string
Definition at line 99 of file dom_string.cpp.
Definition at line 89 of file dom_string.cpp.
const QChar & DOMString::operator[] | ( | unsigned int | i | ) | const |
The character at position i of the DOMString.
If i >= length(), the character returned will be 0.
Definition at line 145 of file dom_string.cpp.
DOMString DOMString::parsedUrl | ( | ) | const |
Return a parsed url.
Used to parse SRC url attribute, see http://www.w3.org/TR/html/infrastructure.html#urls
- Since
- 4.14.6
Definition at line 300 of file dom_string.cpp.
bool DOMString::percentage | ( | int & | _percentage | ) | const |
Definition at line 219 of file dom_string.cpp.
void DOMString::remove | ( | unsigned int | pos, |
int | len = 1 |
||
) |
Definition at line 196 of file dom_string.cpp.
int DOMString::reverseFind | ( | const QChar | c, |
int | start = -1 |
||
) | const |
Definition at line 166 of file dom_string.cpp.
DOMString DOMString::split | ( | unsigned int | pos | ) |
Splits the string into two.
The original string gets truncated to pos, and the rest is returned.
Definition at line 201 of file dom_string.cpp.
Definition at line 287 of file dom_string.cpp.
QString DOMString::string | ( | ) | const |
Definition at line 236 of file dom_string.cpp.
DOMString DOMString::substring | ( | unsigned | pos, |
unsigned | len = UINT_MAX |
||
) | const |
Definition at line 180 of file dom_string.cpp.
float DOMString::toFloat | ( | bool * | ok = 0 | ) | const |
Definition at line 260 of file dom_string.cpp.
int DOMString::toInt | ( | ) | const |
Definition at line 243 of file dom_string.cpp.
int DOMString::toInt | ( | bool * | ok | ) | const |
Definition at line 250 of file dom_string.cpp.
DOMString DOMString::trimSpaces | ( | ) | const |
- Deprecated:
- , use parsedUrl()
Definition at line 340 of file dom_string.cpp.
void DOMString::truncate | ( | unsigned int | len | ) |
Definition at line 191 of file dom_string.cpp.
QChar * DOMString::unicode | ( | ) | const |
Definition at line 230 of file dom_string.cpp.
DOMString DOMString::upper | ( | ) | const |
Returns an uppercase version of the string.
Definition at line 213 of file dom_string.cpp.
Friends And Related Function Documentation
Member Data Documentation
|
protected |
Definition at line 156 of file dom_string.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.