.TH "KMacroExpanderBase" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KMacroExpanderBase \- Abstract base class for the worker classes behind the \fBKMacroExpander\fP namespace.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kmacroexpander.h>\fP
.PP
Inherited by KMacroMapExpander< KT, VT >, KMacroMapExpander< QChar, VT >, and KMacroMapExpander< QString, VT >.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKMacroExpanderBase\fP (\fBQChar\fP c= '%')"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "virtual \fB~KMacroExpanderBase\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "void \fBexpandMacros\fP (\fBQString\fP &str)"
.br
.RI "\fIPerform safe macro expansion (substitution) on a string. \fP"
.ti -1c
.RI "bool \fBexpandMacrosShellQuote\fP (\fBQString\fP &str, uint &pos)"
.br
.ti -1c
.RI "bool \fBexpandMacrosShellQuote\fP (\fBQString\fP &str)"
.br
.RI "\fISame as above, but always starts at position 0, and unmatched closing parens and braces are treated as errors. \fP"
.ti -1c
.RI "void \fBsetEscapeChar\fP (\fBQChar\fP c)"
.br
.RI "\fISet the macro escape character. \fP"
.ti -1c
.RI "\fBQChar\fP \fBescapeChar\fP () const "
.br
.RI "\fIObtain the macro escape character. \fP"
.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
.RI "\fIThis function is called for every single char within the string if the escape char is QChar::null. \fP"
.ti -1c
.RI "virtual int \fBexpandEscapedMacro\fP (const  \fBQString\fP &str, uint pos, \fBQStringList\fP &ret)"
.br
.RI "\fIThis function is called every time the escape char is found if it is not QChar::null. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Abstract base class for the worker classes behind the \fBKMacroExpander\fP namespace. Definition at line 36 of file kmacroexpander.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KMacroExpanderBase::KMacroExpanderBase (\fBQChar\fP c = '%')"
.PP
Constructor. \fBParameters:\fP
.RS 4
\fIc\fP escape char indicating start of macros, or QChar::null for none 
.RE
.PP
Definition at line 28 of file kmacroexpander.cpp.
.SS "KMacroExpanderBase::~\fBKMacroExpanderBase\fP ()\fC [virtual]\fP"
.PP
Destructor. Definition at line 33 of file kmacroexpander.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KMacroExpanderBase::expandMacros (\fBQString\fP & str)"
.PP
Perform safe macro expansion (substitution) on a string. \fBParameters:\fP
.RS 4
\fIstr\fP the string in which macros are expanded in-place 
.RE
.PP
Definition at line 49 of file kmacroexpander.cpp.
.PP
References expandEscapedMacro(), expandPlainMacro(), QStringList::join(), QString::length(), QString::replace(), and QString::unicode().
.SS "bool KMacroExpanderBase::expandMacrosShellQuote (\fBQString\fP & str)"
.PP
Same as above, but always starts at position 0, and unmatched closing parens and braces are treated as errors. Definition at line 280 of file kmacroexpander.cpp.
.PP
References QString::length().
.SS "void KMacroExpanderBase::setEscapeChar (\fBQChar\fP c)"
.PP
Set the macro escape character. \fBParameters:\fP
.RS 4
\fIc\fP escape char indicating start of macros, or QChar::null if none 
.RE
.PP
Definition at line 38 of file kmacroexpander.cpp.
.SS "\fBQChar\fP KMacroExpanderBase::escapeChar () const"
.PP
Obtain the macro escape character. \fBReturns:\fP
.RS 4
escape char indicating start of macros, or QChar::null if none 
.RE
.PP
Definition at line 44 of file kmacroexpander.cpp.
.SS "int KMacroExpanderBase::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. 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
Definition at line 286 of file kmacroexpander.cpp.
.PP
Referenced by expandMacros().
.SS "int KMacroExpanderBase::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. 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 occurence 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
Definition at line 289 of file kmacroexpander.cpp.
.PP
Referenced by expandMacros().

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