Template Struct eval

Struct Documentation

template<typename ScopeT, typename ContextT>
struct udho::view::parsing::attrs::eval

udho::eval:NAME = EXPR will add an attribute named NAME with value retrieved by evaluating the expression EXPR. It can have a conditional form too where the condition expr is first evaluated and if expr is true then the attribute is added, otherwise not

<input type="text" udho:eval:value="count(books)"></input>
<input type="text" udho:eval:title="expr ? count(books)"></input>
is transformed to
<input type="text" value="2"></input>
<input type="text" value="2"></input>

Public Types

typedef ScopeT table_type
typedef parsing::expression<ScopeT> evaluator_type

Public Functions

eval(parsing::xml<ContextT> &ctrl, table_type &table)
bool operator()(pugi::xml_node node, pugi::xml_node, pugi::xml_attribute attr, const ContextT &ctx)
std::string prefix() const

Public Members

parsing::xml<ContextT> &_ctrl
table_type &_table
evaluator_type _evaluator