DOMString Class Reference
from PyKDE4.khtml import *
Namespace: DOM
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().
Methods |
| __init__ (self) |
| __init__ (self, QChar str, long len) |
| __init__ (self, QString a0) |
| __init__ (self, QString str) |
| __init__ (self, DOMStringImpl i) |
| __init__ (self, DOM.DOMString str) |
QChar | characters (self) |
DOM.DOMString | copy (self) |
bool | endsWith (self, DOM.DOMString str) |
int | find (self, QChar c, int start=0) |
DOMStringImpl | implementation (self) |
| insert (self, DOM.DOMString str, long pos) |
bool | isEmpty (self) |
bool | isNull (self) |
long | length (self) |
DOM.DOMString | lower (self) |
DOM.DOMString | operator + (self, DOM.DOMString str) |
DOM.DOMString | operator += (self, DOM.DOMString str) |
QChar | operator [] (self, long i) |
bool, int (_percentage) | percentage (self, ) |
| remove (self, long pos, int len=1) |
DOM.DOMString | split (self, long pos) |
QString | string (self) |
float | toFloat (self, bool ok=0) |
int | toInt (self) |
int | toInt (self, bool ok) |
| truncate (self, long len) |
QChar | unicode (self) |
DOM.DOMString | upper (self) |
Static Methods |
DOM.DOMString | number (float f) |
Method Documentation
default constructor. Gives an empty DOMString
__init__ |
( |
self, |
|
|
|
QChar |
str, |
|
|
long |
len |
|
) |
|
|
|
__init__ |
( |
self, |
|
|
|
DOMStringImpl |
i |
|
) |
|
|
|
QChar characters |
( |
|
self ) |
|
int find |
( |
self, |
|
|
|
QChar |
c, |
|
|
int |
start=0 |
|
) |
|
|
|
DOMStringImpl implementation |
( |
|
self ) |
|
- Internal:
- get a handle to the imlementation of the DOMString
Use at own risk!!!
Returns a lowercase version of the string
append str to this string
QChar operator [] |
( |
self, |
|
|
|
long |
i |
|
) |
|
|
|
The character at position i of the DOMString. If i >= length(), the
character returned will be 0.
bool, int (_percentage) percentage |
( |
self, |
|
|
) |
|
|
|
remove |
( |
self, |
|
|
|
long |
pos, |
|
|
int |
len=1 |
|
) |
|
|
|
Splits the string into two. The original string gets truncated to pos, and the rest is returned.
float toFloat |
( |
self, |
|
|
|
bool |
ok=0 |
|
) |
|
|
|
int toInt |
( |
self, |
|
|
|
bool |
ok |
|
) |
|
|
|
truncate |
( |
self, |
|
|
|
long |
len |
|
) |
|
|
|
Returns an uppercase version of the string