• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KHTML

DOM::DOMString

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 Member Functions

QChar * characters () const
DOMString copy () const
 DOMString (const DOMString &str)
 DOMString (DOMStringImpl *i)
 DOMString (const char *str, uint len)
 DOMString (const char *str)
 DOMString (const QString &)
 DOMString (const QChar *str, uint len)
 DOMString ()
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
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 (bool *ok) const
int toInt () const
void truncate (unsigned int len)
QChar * unicode () const
DOMString upper () const
virtual ~DOMString ()

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

DOM::DOMString::DOMString (  )  [inline]

default constructor.

Gives an empty DOMString

Definition at line 51 of file dom_string.h.

DOMString::DOMString ( const QChar *  str,
uint  len 
)

Definition at line 30 of file dom_string.cpp.

DOMString::DOMString ( const QString &  str  ) 

Definition at line 36 of file dom_string.cpp.

DOMString::DOMString ( const char *  str  ) 

Definition at line 47 of file dom_string.cpp.

DOMString::DOMString ( const char *  str,
uint  len 
)

Since:
4.2

Definition at line 58 of file dom_string.cpp.

DOMString::DOMString ( DOMStringImpl *  i  ) 

Definition at line 68 of file dom_string.cpp.

DOMString::~DOMString (  )  [virtual]

Definition at line 80 of file dom_string.cpp.

DOMString::DOMString ( const DOMString &  str  ) 

Definition at line 74 of file dom_string.cpp.


Member Function Documentation

QChar* DOM::DOMString::characters (  )  const [inline]

Definition at line 109 of file dom_string.h.

DOMString DOMString::copy (  )  const

Definition at line 271 of file dom_string.cpp.

bool DOMString::endsWith ( const DOMString &  str  )  const

Definition at line 277 of file dom_string.cpp.

int DOMString::find ( const QChar  c,
int  start = 0 
) const

Definition at line 150 of file dom_string.cpp.

DOMString DOMString::format ( const char *  format,
  ... 
) [static]

Definition at line 316 of file dom_string.cpp.

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

For internal use only.

get a handle to the imlementation of the DOMString Use at own risk!!!

Definition at line 131 of file dom_string.h.

void DOMString::insert ( DOMString  str,
uint  pos 
)

Definition at line 129 of file dom_string.cpp.

bool DOMString::isEmpty (  )  const

Definition at line 311 of file dom_string.cpp.

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

Definition at line 121 of file dom_string.h.

uint DOMString::length (  )  const

Definition at line 181 of file dom_string.cpp.

DOMString DOMString::lower (  )  const

Returns a lowercase version of the string.

Definition at line 203 of file dom_string.cpp.

DOMString DOMString::number ( float  f  )  [static]

Definition at line 266 of file dom_string.cpp.

DOMString DOMString::operator+ ( const DOMString &  str  ) 

add two DOMString's

Definition at line 116 of file dom_string.cpp.

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

append str to this string

Definition at line 95 of file dom_string.cpp.

DOMString & DOMString::operator= ( const DOMString &  str  ) 

Definition at line 85 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 141 of file dom_string.cpp.

bool DOMString::percentage ( int &  _percentage  )  const

Definition at line 215 of file dom_string.cpp.

void DOMString::remove ( unsigned int  pos,
int  len = 1 
)

Definition at line 192 of file dom_string.cpp.

int DOMString::reverseFind ( const QChar  c,
int  start = -1 
) const

Definition at line 162 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 197 of file dom_string.cpp.

bool DOMString::startsWith ( const DOMString &  str  )  const

Definition at line 283 of file dom_string.cpp.

QString DOMString::string (  )  const

Definition at line 232 of file dom_string.cpp.

DOMString DOMString::substring ( unsigned  pos,
unsigned  len = UINT_MAX 
) const

Definition at line 176 of file dom_string.cpp.

float DOMString::toFloat ( bool *  ok = 0  )  const

Definition at line 256 of file dom_string.cpp.

int DOMString::toInt ( bool *  ok  )  const

Definition at line 246 of file dom_string.cpp.

int DOMString::toInt (  )  const

Definition at line 239 of file dom_string.cpp.

void DOMString::truncate ( unsigned int  len  ) 

Definition at line 187 of file dom_string.cpp.

QChar * DOMString::unicode (  )  const

Definition at line 226 of file dom_string.cpp.

DOMString DOMString::upper (  )  const

Returns an uppercase version of the string.

Definition at line 209 of file dom_string.cpp.


Friends And Related Function Documentation

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


Member Data Documentation

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

Definition at line 136 of file dom_string.h.


The documentation for this class was generated from the following files:
  • dom_string.h
  • dom_string.cpp

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal