\section{KChar\-Macro\-Expander Class Reference}
\label{classKCharMacroExpander}\index{KCharMacroExpander@{KCharMacroExpander}}
Abstract base class for single char macro substitutors.  


{\tt \#include $<$kmacroexpander.h$>$}

Inheritance diagram for KChar\-Macro\-Expander:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=76pt]{classKCharMacroExpander__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KChar\-Macro\-Expander:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=76pt]{classKCharMacroExpander__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KChar\-Macro\-Expander} ({\bf QChar} c= '\%')
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual int {\bf expand\-Plain\-Macro} (const {\bf QString} \&str, uint pos, {\bf QString\-List} \&ret)
\item 
virtual int {\bf expand\-Escaped\-Macro} (const {\bf QString} \&str, uint pos, {\bf QString\-List} \&ret)
\item 
virtual bool {\bf expand\-Macro} ({\bf QChar} chr, {\bf QString\-List} \&ret)=0
\end{CompactItemize}


\subsection{Detailed Description}
Abstract base class for single char macro substitutors. 

Use this instead of the functions in the {\bf KMacro\-Expander}{\rm (p.\,\pageref{namespaceKMacroExpander})} namespace if speculatively pre-filling the substitution map would be too expensive.

See {\bf KWord\-Macro\-Expander}{\rm (p.\,\pageref{classKWordMacroExpander})} for a sample application.

\begin{Desc}
\item[Since:]3.3 \end{Desc}
\begin{Desc}
\item[Author:]Oswald Buddenhagen $<${\tt ossi@kde.org}$>$ \end{Desc}




Definition at line 224 of file kmacroexpander.h.

\subsection{Constructor \& Destructor Documentation}
\index{KCharMacroExpander@{KChar\-Macro\-Expander}!KCharMacroExpander@{KCharMacroExpander}}
\index{KCharMacroExpander@{KCharMacroExpander}!KCharMacroExpander@{KChar\-Macro\-Expander}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KChar\-Macro\-Expander::KChar\-Macro\-Expander ({\bf QChar} {\em c} = {\tt '\%'})\hspace{0.3cm}{\tt  [inline]}}\label{classKCharMacroExpander_a0}


Constructor. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em c}]escape char indicating start of macros, or QChar::null for none \end{description}
\end{Desc}


Definition at line 231 of file kmacroexpander.h.

\subsection{Member Function Documentation}
\index{KCharMacroExpander@{KChar\-Macro\-Expander}!expandPlainMacro@{expandPlainMacro}}
\index{expandPlainMacro@{expandPlainMacro}!KCharMacroExpander@{KChar\-Macro\-Expander}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KChar\-Macro\-Expander::expand\-Plain\-Macro (const {\bf QString} \& {\em str}, uint {\em pos}, {\bf QString\-List} \& {\em ret})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKCharMacroExpander_b0}


This function is called for every single char within the string if the escape char is QChar::null. 

It should determine whether the string starting at {\tt pos} within {\tt str} is a valid macro and return the substitution value for it if so. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em str}]the input string \item[{\em pos}]the offset within {\tt str} \item[{\em ret}]return value: the string to substitute for the macro \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]if greater than zero, the number of chars at {\tt pos} in {\tt str} to substitute with {\tt ret} (i.e., a valid macro was found). if less than zero, subtract this value from {\tt pos} (to skip a macro, i.e., substitute it with itself). zero requests no special action. \end{Desc}


Reimplemented from {\bf KMacro\-Expander\-Base} {\rm (p.\,\pageref{classKMacroExpanderBase_b0})}.

Definition at line 434 of file kmacroexpander.cpp.

References expand\-Macro().\index{KCharMacroExpander@{KChar\-Macro\-Expander}!expandEscapedMacro@{expandEscapedMacro}}
\index{expandEscapedMacro@{expandEscapedMacro}!KCharMacroExpander@{KChar\-Macro\-Expander}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KChar\-Macro\-Expander::expand\-Escaped\-Macro (const {\bf QString} \& {\em str}, uint {\em pos}, {\bf QString\-List} \& {\em ret})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKCharMacroExpander_b1}


This function is called every time the escape char is found if it is not QChar::null. 

It should determine whether the string starting at {\tt pos} witin {\tt str} is a valid macro and return the substitution value for it if so. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em str}]the input string \item[{\em pos}]the offset within {\tt str}. Note that this is the position of the occurrence of the escape char \item[{\em ret}]return value: the string to substitute for the macro \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]if greater than zero, the number of chars at {\tt pos} in {\tt str} to substitute with {\tt ret} (i.e., a valid macro was found). if less than zero, subtract this value from {\tt pos} (to skip a macro, i.e., substitute it with itself). zero requests no special action. \end{Desc}


Reimplemented from {\bf KMacro\-Expander\-Base} {\rm (p.\,\pageref{classKMacroExpanderBase_b1})}.

Definition at line 442 of file kmacroexpander.cpp.

References KMacro\-Expander\-Base::escape\-Char(), and expand\-Macro().\index{KCharMacroExpander@{KChar\-Macro\-Expander}!expandMacro@{expandMacro}}
\index{expandMacro@{expandMacro}!KCharMacroExpander@{KChar\-Macro\-Expander}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KChar\-Macro\-Expander::expand\-Macro ({\bf QChar} {\em chr}, {\bf QString\-List} \& {\em ret})\hspace{0.3cm}{\tt  [protected, pure virtual]}}\label{classKCharMacroExpander_b2}


Return substitution list {\tt ret} for single-character macro {\tt chr}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em chr}]the macro to expand \item[{\em ret}]return variable reference. It is guaranteed to be empty when expand\-Macro is entered. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]{\tt true} iff {\tt chr} was a recognized macro name \end{Desc}


Referenced by expand\-Escaped\-Macro(), and expand\-Plain\-Macro().

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