\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} ()
\begin{CompactList}\small\item\em default constructor. \item\end{CompactList}\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)
\begin{CompactList}\small\item\em append str to this string \item\end{CompactList}\item 
{\bf DOMString} {\bf operator+} (const  {\bf DOMString} \&str)
\begin{CompactList}\small\item\em add two DOMString's \item\end{CompactList}\item 
void {\bf insert} ({\bf DOMString} str, uint pos)\label{classDOM_1_1DOMString_a10}

\item 
const  {\bf QChar} \& {\bf operator[$\,$]} (unsigned int i) const 
\begin{CompactList}\small\item\em The character at position i of the {\bf DOMString}{\rm (p.\,\pageref{classDOM_1_1DOMString})}. \item\end{CompactList}\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)
\begin{CompactList}\small\item\em Splits the string into two. \item\end{CompactList}\item 
{\bf DOMString} {\bf lower} () const 
\begin{CompactList}\small\item\em Returns a lowercase version of the string. \item\end{CompactList}\item 
{\bf DOMString} {\bf upper} () const 
\begin{CompactList}\small\item\em Returns an uppercase version of the string. \item\end{CompactList}\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 41 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}DOMString::DOMString ()}\label{classDOM_1_1DOMString_a0}


default constructor. 

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

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

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 89 of file dom\_\-string.cpp.

References 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 109 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}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 134 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 171 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 177 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 183 of file dom\_\-string.cpp.

References DOMString().

Referenced by DOM::Node::is\-Supported().

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