ADTF  3.18.2
IMacroResolverabstract

The IMacroResolver interface provides methods for resolving macros in strings. More...

Inheritance diagram for IMacroResolver:
[legend]

Public Types

enum  tMacroResolverFlags { MRF_None = 0x00 , MRF_Overwrite = 0x01 }
 Enumerations used for the Macro Resolver (see RegisterMacro function). More...
 

Public Member Functions

 ADTF_IID (IMacroResolver, "macroresolver.ant.base.adtf.iid")
 defintion of interace id
 
virtual tResult ResolveMacros (const char *strSource, base::IString &&strResolvedString)=0
 Resolve macros. More...
 
virtual tResult RegisterMacro (const char *strMacro, const char *strMacroSol, uint32_t ui32Flags=0)=0
 Register a new macro. More...
 
virtual tResult UnregisterMacro (const char *strMacro)=0
 Unregisters an existing macro. More...
 
virtual void Clear ()=0
 Clears all registered macros. More...
 
- Public Member Functions inherited from IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 Marks the IObject to be castable with the ucom_cast() More...
 

Additional Inherited Members

- Protected Member Functions inherited from IObject
 ~IObject ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 

Detailed Description

The IMacroResolver interface provides methods for resolving macros in strings.

Macros must have following layout:

  • $MACRO$
See also
adtf_resolve_macros, adtf_register_macro.
Macros.

Definition at line 73 of file macroresolver_intf.h.

Member Enumeration Documentation

◆ tMacroResolverFlags

Enumerations used for the Macro Resolver (see RegisterMacro function).

Enumerator
MRF_None 

no flag

MRF_Overwrite 

overwrites an existing macro

Definition at line 84 of file macroresolver_intf.h.

Member Function Documentation

◆ Clear()

virtual void Clear ( )
pure virtual

Clears all registered macros.

Returns
void

◆ RegisterMacro()

virtual tResult RegisterMacro ( const char *  strMacro,
const char *  strMacroSol,
uint32_t  ui32Flags = 0 
)
pure virtual

Register a new macro.

Parameters
[in]strMacronew macro expression
[in]strMacroSolcomplete expression
[in]ui32FlagsFlags to adjust the behavior (see tMacroResolverFlags)
Return values
OKmacro is now registered

◆ ResolveMacros()

virtual tResult ResolveMacros ( const char *  strSource,
base::IString &&  strResolvedString 
)
pure virtual

Resolve macros.

The method resolves the internal macros to real values. If the resolved Macro string is an existing filesystem path, it will be parsed for regular expressions

Note
the regular expresseion will only be parsed, if the path exists and is absolute
a path string may only contain a regex for a filename
Parameters
strSource[in] String using macro expressions.
strResolvedString[in] String where to copy the string with resolved macro expressions.
Returns
Standard Result Code

◆ UnregisterMacro()

virtual tResult UnregisterMacro ( const char *  strMacro)
pure virtual

Unregisters an existing macro.

Parameters
[in]strMacromacro to be unregistered
Return values
OKmacro is now unregistered