khtml Library API Documentation

DOM::DOMString Class Reference

This class implements the basic string we use in the DOM. More...

#include <dom_string.h>

List of all members.

Public Methods

 DOMString ()
 default constructor.

DOMString & operator+= (const DOMString &str)
 append str to this string

DOMString operator+ (const DOMString &str)
 add two DOMString's

const QCharoperator[] (unsigned int i) const
 The character at position i of the DOMString.

DOMString split (unsigned int pos)
 Splits the string into two.

DOMString lower () const
 Returns a lowercase version of the string.

DOMString upper () const
 Returns an uppercase version of the string.


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 41 of file dom_string.h.


Constructor & Destructor Documentation

DOMString::DOMString  
 

default constructor.

Gives an empty DOMString

Definition at line 29 of file dom_string.cpp.

Referenced by lower(), split(), and upper().


Member Function Documentation

DOMString & DOMString::operator+= const DOMString &    str
 

append str to this string

Definition at line 89 of file dom_string.cpp.

References impl.

DOMString DOMString::operator+ const DOMString &    str
 

add two DOMString's

Definition at line 109 of file dom_string.cpp.

References copy(), and impl.

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 134 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 171 of file dom_string.cpp.

References DOMString().

DOMString DOMString::lower  
 

Returns a lowercase version of the string.

Definition at line 177 of file dom_string.cpp.

References DOMString().

DOMString DOMString::upper  
 

Returns an uppercase version of the string.

Definition at line 183 of file dom_string.cpp.

References DOMString().

Referenced by DOM::Node::isSupported().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:22:45 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001