MIRA
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
DefineMacro Class Reference

The "Define" macro. More...

#include <xml/macros/Builtins.h>

Inheritance diagram for DefineMacro:
Inheritance graph
[legend]

Public Member Functions

XMLNode expand (XMLMacroProcessor &processor, XMLNode node) final
 Expands the macro. More...
 
template<typename Reflector >
void reflect (Reflector &r)
 
virtual bool canCoerceToString () const
 
virtual void coerceToString (XMLMacroProcessor &, std::ostream &)
 
virtual std::optional< SourceInfogetSource () const
 

Static Public Member Functions

static bool isDefinition (const std::string &name)
 
static std::string extractName (XMLDom::const_iterator node)
 

Static Public Attributes

static constexpr const char * PREFIX = "Define_"
 

Detailed Description

The "Define" macro.

Allows to define new macros inside of XML files.

See also
UserDefinedMacro

Usage:

<macro:Define_MyMacro> <Parameters> <MyParameter> <MyParameterWithDefault>42</MyParameterWithDefault> </Parameters> <Body>


</Body> </macro:Define_MyMacro>

Member Function Documentation

◆ expand()

XMLNode expand ( XMLMacroProcessor ,
XMLNode  ioNode 
)
finalvirtual

Expands the macro.

Parameters
ioNodeNode to expand in-place.
Returns
an iterator to the next node to process.

Implements IMacro.

◆ isDefinition()

static bool isDefinition ( const std::string &  name)
inlinestatic

◆ extractName()

static std::string extractName ( XMLDom::const_iterator  node)
static

◆ reflect()

void reflect ( Reflector &  r)
inlineinherited

◆ canCoerceToString()

virtual bool canCoerceToString ( ) const
inlinevirtualinherited
Returns
true of toString is implemented.

Reimplemented in NothingMacro, XMLValueMacro, and UserDefinedMacro.

◆ coerceToString()

virtual void coerceToString ( XMLMacroProcessor ,
std::ostream &   
)
inlinevirtualinherited

Reimplemented in NothingMacro, XMLValueMacro, and UserDefinedMacro.

◆ getSource()

virtual std::optional<SourceInfo> getSource ( ) const
inlinevirtualinherited

Reimplemented in UserDefinedMacro.

Member Data Documentation

◆ PREFIX

constexpr const char* PREFIX = "Define_"
static

The documentation for this class was generated from the following file: