class KMacroExpanderBase |
|
Abstract base class for the worker classes behind the KMacroExpander namespace
and the KCharMacroExpander and KWordMacroExpander classes.
Author Oswald Buddenhagen |
|
Constructor.
c - escape char indicating start of macros, or QChar.null for none |
|
Obtain the macro escape character. Returns escape char indicating start of macros, or QChar.null if none |
|
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 pos witin str is a valid macro and return
the substitution value for it if so.
str - the input string pos - the offset within str. Note that this is the position of the occurrence of the escape char ret - return value: the string to substitute for the macro Returns if greater than zero, the number of chars at pos in str to substitute with ret (i.e., a valid macro was found). if less than zero, subtract this value from pos (to skip a macro, i.e., substitute it with itself). zero requests no special action. |
|
Perform safe macro expansion (substitution) on a string.
str - the string in which macros are expanded in-place |
|
|
Same as above, but always starts at position 0, and unmatched closing parens and braces are treated as errors. |
|
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 pos within str is a valid macro and return
the substitution value for it if so.
str - the input string pos - the offset within str ret - return value: the string to substitute for the macro Returns if greater than zero, the number of chars at pos in str to substitute with ret (i.e., a valid macro was found). if less than zero, subtract this value from pos (to skip a macro, i.e., substitute it with itself). zero requests no special action. |
|
Set the macro escape character.
c - escape char indicating start of macros, or QChar.null if none |