Rule for matching XML attributes. More...
#include <uhal/XmlParser.hpp>
Public Member Functions | |
Rule () | |
Default constructor. More... | |
virtual | ~Rule () |
Destructor. More... | |
Rule< R > & | require (const std::string &aStr) |
Add a required attribute to the rule. More... | |
Rule< R > & | forbid (const std::string &aStr) |
Add an forbidden attribute to the rule. More... | |
Rule< R > & | optional (const std::string &aStr) |
Add an optional attribute to the rule. More... | |
std::string | description () const |
A function to return a string description of the rule. More... | |
Private Member Functions | |
R | operator() (const pugi::xml_node &aNode) |
Functor which converts an XML node to an object of template type R (Calls the function pointer, if it is not NULL) More... | |
Private Attributes | |
std::set< std::string > | mRequired |
The required attributes for this rule. More... | |
std::set< std::string > | mForbidden |
The forbidden attributes for this rule. More... | |
std::set< std::string > | mOptional |
The optional attributes for this rule. More... | |
uint32_t | mRuleId |
The ID of the rule. More... | |
uint64_t | mRequiredHash |
The hash for required attributes. More... | |
uint64_t | mForbiddenHash |
The hash for forbidden attributes. More... | |
BaseFunctionObject< R > * | mFuncPtr |
An object wrapping the function pointer for the function to be called when the rule conditions are met. More... | |
Friends | |
class | Parser< R > |
Make the Parser a friend of the Rule. More... | |
Rule for matching XML attributes.
Definition at line 144 of file XmlParser.hpp.
uhal::Rule< R >::Rule |
Default constructor.
Definition at line 89 of file XmlParser.hxx.
|
virtual |
Destructor.
Definition at line 99 of file XmlParser.hxx.
std::string uhal::Rule< R >::description |
A function to return a string description of the rule.
Definition at line 148 of file XmlParser.hxx.
Referenced by uhal::Parser< R >::operator()().
Rule< R > & uhal::Rule< R >::forbid | ( | const std::string & | aStr | ) |
Add an forbidden attribute to the rule.
aStr | an forbidden attribute to the rule |
Definition at line 125 of file XmlParser.hxx.
References uhal::log(), and uhal::Quote().
|
private |
Functor which converts an XML node to an object of template type R (Calls the function pointer, if it is not NULL)
aNode | an XML node for converting to an object |
Definition at line 221 of file XmlParser.hxx.
Rule< R > & uhal::Rule< R >::optional | ( | const std::string & | aStr | ) |
Add an optional attribute to the rule.
aStr | an optional attribute to the rule |
Definition at line 140 of file XmlParser.hxx.
Referenced by uhal::NodeTreeBuilder::NodeTreeBuilder().
Rule< R > & uhal::Rule< R >::require | ( | const std::string & | aStr | ) |
Add a required attribute to the rule.
aStr | a required attribute to the rule |
Definition at line 110 of file XmlParser.hxx.
References uhal::log(), and uhal::Quote().
Referenced by uhal::NodeTreeBuilder::NodeTreeBuilder().
|
friend |
Make the Parser a friend of the Rule.
Definition at line 137 of file XmlParser.hpp.
|
private |
The forbidden attributes for this rule.
Definition at line 196 of file XmlParser.hpp.
Referenced by uhal::Parser< R >::addRule().
|
private |
The hash for forbidden attributes.
Definition at line 205 of file XmlParser.hpp.
Referenced by uhal::Parser< R >::addRule().
|
private |
An object wrapping the function pointer for the function to be called when the rule conditions are met.
Definition at line 208 of file XmlParser.hpp.
Referenced by uhal::Parser< R >::addRule().
|
private |
The optional attributes for this rule.
Definition at line 198 of file XmlParser.hpp.
Referenced by uhal::Parser< R >::addRule().
|
private |
The required attributes for this rule.
Definition at line 194 of file XmlParser.hpp.
Referenced by uhal::Parser< R >::addRule(), and uhal::Parser< R >::operator()().
|
private |
The hash for required attributes.
Definition at line 203 of file XmlParser.hpp.
Referenced by uhal::Parser< R >::addRule().
|
private |
The ID of the rule.
Definition at line 201 of file XmlParser.hpp.
Referenced by uhal::Parser< R >::addRule().