.TH "KCharMacroExpander" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCharMacroExpander \- Abstract base class for single char macro substitutors.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kmacroexpander.h>\fP
.PP
Inherits \fBKMacroExpanderBase\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKCharMacroExpander\fP (\fBQChar\fP c= '%')"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual int \fBexpandPlainMacro\fP (const \fBQString\fP &str, uint pos, \fBQStringList\fP &ret)"
.br
.ti -1c
.RI "virtual int \fBexpandEscapedMacro\fP (const \fBQString\fP &str, uint pos, \fBQStringList\fP &ret)"
.br
.ti -1c
.RI "virtual bool \fBexpandMacro\fP (\fBQChar\fP chr, \fBQStringList\fP &ret)=0"
.br
.in -1c
.SH "Detailed Description"
.PP 
Abstract base class for single char macro substitutors. 

Use this instead of the functions in the \fBKMacroExpander\fP namespace if speculatively pre-filling the substitution map would be too expensive.
.PP
See \fBKWordMacroExpander\fP for a sample application.
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP
\fBAuthor:\fP
.RS 4
Oswald Buddenhagen <ossi@kde.org> 
.RE
.PP

.PP
Definition at line 224 of file kmacroexpander.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KCharMacroExpander::KCharMacroExpander (\fBQChar\fP c = \fC'%'\fP)\fC [inline]\fP"
.PP
Constructor. 
.PP
\fBParameters:\fP
.RS 4
\fIc\fP escape char indicating start of macros, or QChar::null for none 
.RE
.PP

.PP
Definition at line 231 of file kmacroexpander.h.
.SH "Member Function Documentation"
.PP 
.SS "int KCharMacroExpander::expandPlainMacro (const \fBQString\fP & str, uint pos, \fBQStringList\fP & ret)\fC [protected, virtual]\fP"
.PP
This function is called for every single char within the string if the escape char is QChar::null. 
.PP
It should determine whether the string starting at \fCpos\fP within \fCstr\fP is a valid macro and return the substitution value for it if so. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the input string 
.br
\fIpos\fP the offset within \fCstr\fP 
.br
\fIret\fP return value: the string to substitute for the macro 
.RE
.PP
\fBReturns:\fP
.RS 4
if greater than zero, the number of chars at \fCpos\fP in \fCstr\fP to substitute with \fCret\fP (i.e., a valid macro was found). if less than zero, subtract this value from \fCpos\fP (to skip a macro, i.e., substitute it with itself). zero requests no special action. 
.RE
.PP

.PP
Reimplemented from \fBKMacroExpanderBase\fP.
.PP
Definition at line 434 of file kmacroexpander.cpp.
.PP
References expandMacro().
.SS "int KCharMacroExpander::expandEscapedMacro (const \fBQString\fP & str, uint pos, \fBQStringList\fP & ret)\fC [protected, virtual]\fP"
.PP
This function is called every time the escape char is found if it is not QChar::null. 
.PP
It should determine whether the string starting at \fCpos\fP witin \fCstr\fP is a valid macro and return the substitution value for it if so. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the input string 
.br
\fIpos\fP the offset within \fCstr\fP. Note that this is the position of the occurrence of the escape char 
.br
\fIret\fP return value: the string to substitute for the macro 
.RE
.PP
\fBReturns:\fP
.RS 4
if greater than zero, the number of chars at \fCpos\fP in \fCstr\fP to substitute with \fCret\fP (i.e., a valid macro was found). if less than zero, subtract this value from \fCpos\fP (to skip a macro, i.e., substitute it with itself). zero requests no special action. 
.RE
.PP

.PP
Reimplemented from \fBKMacroExpanderBase\fP.
.PP
Definition at line 442 of file kmacroexpander.cpp.
.PP
References KMacroExpanderBase::escapeChar(), and expandMacro().
.SS "virtual bool KCharMacroExpander::expandMacro (\fBQChar\fP chr, \fBQStringList\fP & ret)\fC [protected, pure virtual]\fP"
.PP
Return substitution list \fCret\fP for single-character macro \fCchr\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIchr\fP the macro to expand 
.br
\fIret\fP return variable reference. It is guaranteed to be empty when expandMacro is entered. 
.RE
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP iff \fCchr\fP was a recognized macro name 
.RE
.PP

.PP
Referenced by expandEscapedMacro(), and expandPlainMacro().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
