Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

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 ()
 DOMString (const QChar *str, uint len)
 DOMString (const QString &)
 DOMString (const char *str)
 DOMString (DOMStringImpl *i)
virtual ~DOMString ()
 DOMString (const DOMString &str)
DOMString & operator= (const DOMString &str)
DOMString & operator+= (const DOMString &str)
DOMString operator+ (const DOMString &str)
void insert (DOMString str, uint pos)
const QChar & operator[] (unsigned int i) const
int find (const QChar c, int start=0) const
uint length () const
void truncate (unsigned int len)
void remove (unsigned int pos, int len=1)
DOMString split (unsigned int pos)
DOMString lower () const
DOMString upper () const
QChar * unicode () const
QString string () const
int toInt () const
bool percentage (int &_percentage) const
DOMString copy () const
bool isNull () const
bool isEmpty () const
DOMStringImpl * implementation () const

Protected Attributes

DOMStringImpl * impl

Friends

class CharacterDataImpl
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().


Constructor & Destructor Documentation

DOM::DOMString::DOMString   [inline]
 

default constructor.

Gives an empty DOMString

DOM::DOMString::DOMString const QChar *    str,
uint    len
 

DOM::DOMString::DOMString const QString &   
 

DOM::DOMString::DOMString const char *    str
 

DOM::DOMString::DOMString DOMStringImpl *    i
 

virtual DOM::DOMString::~DOMString   [virtual]
 

DOM::DOMString::DOMString const DOMString &    str
 


Member Function Documentation

DOMString& DOM::DOMString::operator= const DOMString &    str
 

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

append str to this string

DOMString DOM::DOMString::operator+ const DOMString &    str
 

add two DOMString's

void DOM::DOMString::insert DOMString    str,
uint    pos
 

const QChar& DOM::DOMString::operator[] unsigned int    i const
 

The character at position i of the DOMString.

If i >= length(), the character returned will be 0.

int DOM::DOMString::find const QChar    c,
int    start = 0
const
 

uint DOM::DOMString::length  
 

void DOM::DOMString::truncate unsigned int    len
 

void DOM::DOMString::remove unsigned int    pos,
int    len = 1
 

DOMString DOM::DOMString::split unsigned int    pos
 

Splits the string into two.

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

DOMString DOM::DOMString::lower  
 

Returns a lowercase version of the string.

DOMString DOM::DOMString::upper  
 

Returns an uppercase version of the string.

QChar* DOM::DOMString::unicode  
 

QString DOM::DOMString::string  
 

int DOM::DOMString::toInt  
 

bool DOM::DOMString::percentage int &    _percentage const
 

DOMString DOM::DOMString::copy  
 

bool DOM::DOMString::isNull   const [inline]
 

bool DOM::DOMString::isEmpty  
 

DOMStringImpl* DOM::DOMString::implementation   const [inline]
 


Friends And Related Function Documentation

friend class CharacterDataImpl [friend]
 

bool operator== const DOMString &    a,
const char *    b
[friend]
 


Member Data Documentation

DOMStringImpl* DOM::DOMString::impl [protected]
 


The documentation for this class was generated from the following file:
Generated on Sat Jan 31 23:28:26 2004 for XPath by doxygen1.2.18