wex v24.04.0
Public Member Functions | Static Public Member Functions | List of all members
wex::variable Class Reference

Offers variable support to be used in macros. More...

#include <wex/ex/variable.h>

Public Member Functions

 variable (const std::string &name=std::string())
 Default constructor.
 
 variable (const pugi::xml_node &node)
 Constructor that sets members using specified xml node.
 
bool expand (ex *ex)
 Expands variable to ex component.
 
bool expand (std::string &value, ex *ex=nullptr) const
 Expands variable to value text.
 
const auto & get_name () const
 Returns variable name.
 
const auto & get_value () const
 Returns variable value.
 
bool is_builtin () const
 Returns true if this variable is a built in.
 
bool is_input () const
 Returns true if this is an input template.
 
bool is_template () const
 Returns true if this variable is a template.
 
void save (pugi::xml_node &node, const std::string *value=nullptr)
 Save in xml node.
 
void set_ask_for_input (bool value=true)
 Sets the ask for input member, if appropriate for type.
 

Static Public Member Functions

static void set_argument (const std::string &val)
 Sets argument (for a PROCESS variable).
 

Detailed Description

Offers variable support to be used in macros.

Variables are assigned from an xml node, and you can expand them on an ex component.

Member Function Documentation

◆ expand() [1/2]

bool wex::variable::expand ( ex * ex)

Expands variable to ex component.

This might update the internal value. Returns true if variable could be expanded.

◆ expand() [2/2]

bool wex::variable::expand ( std::string & value,
ex * ex = nullptr ) const

Expands variable to value text.

Returns true if variable could be expanded.