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 146 of file XmlParser.hpp.
| uhal::Rule< R >::Rule | ( | ) |
Default constructor.
Definition at line 81 of file XmlParser.hxx.
|
virtual |
| std::string uhal::Rule< R >::description | ( | ) | const |
A function to return a string description of the rule.
Definition at line 135 of file XmlParser.hxx.
References uhal::Rule< R >::mForbidden, uhal::Rule< R >::mOptional, uhal::Rule< R >::mRequired, and uhal::Rule< R >::mRuleId.
Referenced by uhal::Parser< uhal::Node * >::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 114 of file XmlParser.hxx.
References uhal::Rule< R >::mForbidden, uhal::Rule< R >::mRequired, 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 207 of file XmlParser.hxx.
References uhal::Rule< R >::mFuncPtr.
| 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 128 of file XmlParser.hxx.
References uhal::Rule< R >::mOptional.
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 100 of file XmlParser.hxx.
References uhal::Rule< R >::mForbidden, uhal::Rule< R >::mRequired, and uhal::Quote().
Referenced by uhal::NodeTreeBuilder::NodeTreeBuilder().
|
friend |
Make the Parser a friend of the Rule.
Definition at line 149 of file XmlParser.hpp.
|
private |
The forbidden attributes for this rule.
Definition at line 202 of file XmlParser.hpp.
Referenced by uhal::Rule< R >::description(), uhal::Rule< R >::forbid(), and uhal::Rule< R >::require().
|
private |
The hash for forbidden attributes.
Definition at line 211 of file XmlParser.hpp.
|
private |
An object wrapping the function pointer for the function to be called when the rule conditions are met.
Definition at line 214 of file XmlParser.hpp.
Referenced by uhal::Rule< R >::operator()(), and uhal::Rule< R >::~Rule().
|
private |
The optional attributes for this rule.
Definition at line 204 of file XmlParser.hpp.
Referenced by uhal::Rule< R >::description(), and uhal::Rule< R >::optional().
|
private |
The required attributes for this rule.
Definition at line 200 of file XmlParser.hpp.
Referenced by uhal::Rule< R >::description(), uhal::Rule< R >::forbid(), uhal::Parser< uhal::Node * >::operator()(), and uhal::Rule< R >::require().
|
private |
The hash for required attributes.
Definition at line 209 of file XmlParser.hpp.
|
private |
The ID of the rule.
Definition at line 207 of file XmlParser.hpp.
Referenced by uhal::Rule< R >::description().
1.8.13