\section{DOM::DOMString Class Reference}
\label{classDOM_1_1DOMString}\index{DOM::DOMString@{DOM::DOMString}}
This class implements the basic string we use in the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}.  


{\tt \#include $<$dom\_\-string.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf DOMString} ()
\item 
{\bf DOMString} (const {\bf QChar} $\ast$str, uint len)\label{classDOM_1_1DOMString_a1}

\item 
{\bf DOMString} (const {\bf QString} \&)\label{classDOM_1_1DOMString_a2}

\item 
{\bf DOMString} (const char $\ast$str)\label{classDOM_1_1DOMString_a3}

\item 
{\bf DOMString} (DOMString\-Impl $\ast$i)\label{classDOM_1_1DOMString_a4}

\item 
{\bf DOMString} (const {\bf DOMString} \&str)\label{classDOM_1_1DOMString_a6}

\item 
{\bf DOMString} \& {\bf operator=} (const {\bf DOMString} \&str)\label{classDOM_1_1DOMString_a7}

\item 
{\bf DOMString} \& {\bf operator+=} (const {\bf DOMString} \&str)
\item 
{\bf DOMString} {\bf operator+} (const {\bf DOMString} \&str)
\item 
void {\bf insert} ({\bf DOMString} str, uint pos)\label{classDOM_1_1DOMString_a10}

\item 
const {\bf QChar} \& {\bf operator[$\,$]} (unsigned int i) const 
\item 
int {\bf find} (const {\bf QChar} c, int start=0) const \label{classDOM_1_1DOMString_a12}

\item 
uint {\bf length} () const \label{classDOM_1_1DOMString_a13}

\item 
void {\bf truncate} (unsigned int len)\label{classDOM_1_1DOMString_a14}

\item 
void {\bf remove} (unsigned int pos, int len=1)\label{classDOM_1_1DOMString_a15}

\item 
{\bf DOMString} {\bf split} (unsigned int pos)
\item 
{\bf DOMString} {\bf lower} () const 
\item 
{\bf DOMString} {\bf upper} () const 
\item 
{\bf QChar} $\ast$ {\bf unicode} () const \label{classDOM_1_1DOMString_a19}

\item 
{\bf QString} {\bf string} () const \label{classDOM_1_1DOMString_a20}

\item 
int {\bf to\-Int} () const \label{classDOM_1_1DOMString_a21}

\item 
bool {\bf percentage} (int \&\_\-percentage) const \label{classDOM_1_1DOMString_a22}

\item 
{\bf DOMString} {\bf copy} () const \label{classDOM_1_1DOMString_a23}

\item 
bool {\bf is\-Null} () const \label{classDOM_1_1DOMString_a24}

\item 
bool {\bf is\-Empty} () const \label{classDOM_1_1DOMString_a25}

\item 
DOMString\-Impl $\ast$ {\bf implementation} () const \label{classDOM_1_1DOMString_a26}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
DOMString\-Impl $\ast$ {\bf impl}\label{classDOM_1_1DOMString_p0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Character\-Data\-Impl}\label{classDOM_1_1DOMString_n0}

\item 
bool {\bf operator==} (const {\bf DOMString} \&a, const char $\ast$b)\label{classDOM_1_1DOMString_n1}

\end{CompactItemize}


\subsection{Detailed Description}
This class implements the basic string we use in the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}. 

We do not use {\bf QString} for 2 reasons: Memory overhead, and the missing explicit sharing of strings we need for the {\bf DOM}{\rm (p.\,\pageref{namespaceDOM})}.

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 {\bf DOMString}{\rm (p.\,\pageref{classDOM_1_1DOMString})} that is independent, use copy(). 



Definition at line 43 of file dom\_\-string.h.

\subsection{Constructor \& Destructor Documentation}
\index{DOM::DOMString@{DOM::DOMString}!DOMString@{DOMString}}
\index{DOMString@{DOMString}!DOM::DOMString@{DOM::DOMString}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}DOM::DOMString::DOMString ()\hspace{0.3cm}{\tt  [inline]}}\label{classDOM_1_1DOMString_a0}


default constructor. 

Gives an empty {\bf DOMString}{\rm (p.\,\pageref{classDOM_1_1DOMString})} 

Definition at line 51 of file dom\_\-string.h.

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

\subsection{Member Function Documentation}
\index{DOM::DOMString@{DOM::DOMString}!operator+=@{operator+=}}
\index{operator+=@{operator+=}!DOM::DOMString@{DOM::DOMString}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} \& DOMString::operator+= (const {\bf DOMString} \& {\em str})}\label{classDOM_1_1DOMString_a8}


append str to this string 



Definition at line 84 of file dom\_\-string.cpp.

References copy(), and impl.\index{DOM::DOMString@{DOM::DOMString}!operator+@{operator+}}
\index{operator+@{operator+}!DOM::DOMString@{DOM::DOMString}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} DOMString::operator+ (const {\bf DOMString} \& {\em str})}\label{classDOM_1_1DOMString_a9}


add two DOMString's 



Definition at line 105 of file dom\_\-string.cpp.

References copy().\index{DOM::DOMString@{DOM::DOMString}!operator[]@{operator[]}}
\index{operator[]@{operator[]}!DOM::DOMString@{DOM::DOMString}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QChar} \& DOMString::operator[$\,$] (unsigned int {\em i}) const}\label{classDOM_1_1DOMString_a11}


The character at position i of the {\bf DOMString}{\rm (p.\,\pageref{classDOM_1_1DOMString})}. 

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

Definition at line 130 of file dom\_\-string.cpp.\index{DOM::DOMString@{DOM::DOMString}!split@{split}}
\index{split@{split}!DOM::DOMString@{DOM::DOMString}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} DOMString::split (unsigned int {\em pos})}\label{classDOM_1_1DOMString_a16}


Splits the string into two. 

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

Definition at line 167 of file dom\_\-string.cpp.

References DOMString().\index{DOM::DOMString@{DOM::DOMString}!lower@{lower}}
\index{lower@{lower}!DOM::DOMString@{DOM::DOMString}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} DOMString::lower () const}\label{classDOM_1_1DOMString_a17}


Returns a lowercase version of the string. 



Definition at line 173 of file dom\_\-string.cpp.

References DOMString().\index{DOM::DOMString@{DOM::DOMString}!upper@{upper}}
\index{upper@{upper}!DOM::DOMString@{DOM::DOMString}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf DOMString} DOMString::upper () const}\label{classDOM_1_1DOMString_a18}


Returns an uppercase version of the string. 



Definition at line 179 of file dom\_\-string.cpp.

References DOMString().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
dom\_\-string.h\item 
dom\_\-string.cpp\end{CompactItemize}
