ADTF
3.18.2
|
Class for resolving macros inside a string. More...
Public Member Functions | |
cMacroResolver () | |
Constructor that initializes an empty cMacroResolver object. | |
virtual | ~cMacroResolver () |
Destructor. | |
tResult | SetValues (const cStringMap &mapValues) |
Set string map to be used for macro replacement. More... | |
tResult | SetValue (const cString &strKey, const cString &strValue) |
Set specific macro value. More... | |
cString | GetValue (const cString &strKey) const |
Get specific macro value. More... | |
cString | Resolve (const cString &strSource) const |
Resolve macros. More... | |
Protected Attributes | |
cStringMap | m_mapValues |
Internally used string map. | |
Class for resolving macros inside a string.
This class implements basic macro resolving functionality.
Macros can be defined as "$(MACRO)" or $MACRO$.
This implementation tries to resolve environment variables while the Macro is not one of the above mentioned or within your user specific setttings (SetValues or SetValue).
Definition at line 29 of file macroresolver.h.
Get specific macro value.
strKey | [in] Name of macro value. |
Resolve macros.
This method resolves all macros inside a string. Macros can be specified as or $name$. The $ can be escaped by a double $ ($$). If a macro cannot be resolved, the macro string is removed. See class description for a list of standard macros.
strSource | [in] String map containing all macro values. |
Set specific macro value.
strKey | [in] Name of macro value. |
strValue | [in] Value of macro. |
tResult SetValues | ( | const cStringMap & | mapValues | ) |
Set string map to be used for macro replacement.
This method defines a list of macro values to be used for macro replacement. In addition to these values, system or user environment variables are used as macro values.
mapValues | [in] String map containing all macro values. |