KDE 4.6 PyKDE API Reference

- KDE's Python API

# 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, QString str, long len)
| __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)
| 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)
int | reverseFind (self, QChar c, int start=-1)
DOM.DOMString | split (self, long pos)
bool | startsWith (self, DOM.DOMString str)
QString | string (self)
DOM.DOMString | substring (self, unsigned pos, unsigned len=UINT_MAX)
float, bool ok | toFloat (self)
int, bool ok | toInt (self)
| truncate (self, long len)
QChar | unicode (self)
DOM.DOMString | upper (self)

## Static Methods

DOM.DOMString | format (QString format, ... a1)
DOM.DOMString | number (float f)

## Method Documentation

__init__ | ( |  | self ) |

default constructor. Gives an empty DOMString

__init__ | ( | self, |
|  | QChar | str,
|  | long | len
| ) |  |  |

Since:
  4.2

__init__ | ( | self, |
|  | QString | a0
| ) |  |  |

default constructor. Gives an empty DOMString

__init__ | ( | self, |
|  | QString | str
| ) |  |  |

__init__ | ( | self, |
|  | QString | str,
|  | long | len
| ) |  |  |

Since:
  4.2

__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
| ) |  |  |

insert | ( | self, |
|  | DOM.DOMString | str,
|  | long | pos
| ) |  |  |

bool isEmpty | ( |  | self ) |

bool isNull | ( |  | self ) |

long length | ( |  | self ) |

DOM.DOMString lower | ( |  | self ) |

Returns a lowercase version of the string

DOM.DOMString operator + | ( | self, |
|  | DOM.DOMString | str
| ) |  |  |

add two DOMString's

DOM.DOMString operator += | ( | self, |
|  | DOM.DOMString | str
| ) |  |  |

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
| ) |  |  |

int reverseFind | ( | self, |
|  | QChar | c,
|  | int | start=-1
| ) |  |  |

DOM.DOMString split | ( | self, |
|  | long | pos
| ) |  |  |

Splits the string into two. The original string gets truncated to pos, and the rest is returned.

bool startsWith | ( | self, |
|  | DOM.DOMString | str
| ) |  |  |

QString string | ( |  | self ) |

DOM.DOMString substring | ( | self, |
|  | unsigned | pos,
|  | unsigned | len=UINT_MAX
| ) |  |  |

float, bool ok toFloat | ( |  | self ) |

int, bool ok toInt | ( |  | self ) |

truncate | ( | self, |
|  | long | len
| ) |  |  |

QChar unicode | ( |  | self ) |

DOM.DOMString upper | ( |  | self ) |

Returns an uppercase version of the string

## Static Method Documentation

DOM.DOMString format | ( | QString | format,
|  | ... | a1
| ) |  |  |

DOM.DOMString number | ( | float | f
| ) |  |  |