47 #ifndef _MIRA_XMLDOMPREPROCESSOR_H_ 48 #define _MIRA_XMLDOMPREPROCESSOR_H_ 53 #include <boost/function.hpp> 68 template<
typename Reflector>
70 r.property(
"value",
value,
"Variable value");
71 r.property(
"annotation",
annotation,
"Source annotation");
81 operator std::string()
const {
return value; }
109 typedef boost::function<std::string (const std::string&)>
Callback;
114 variables(iVariables) {}
117 void registerXMLVariableCallback(
const std::string& pattern, Callback&& callback);
123 std::string resolveXMLVariables(
const std::string& pattern,
const std::string& var);
124 std::string resolveContent(std::string content);
A STL conform DOM reader/writer for XML.
boost::function< std::string(const std::string &)> Callback
Definition: XMLDomPreprocessor.h:109
A STL conform wrapper for libxml2 to read XML files as DOM.
Definition: XMLDom.h:73
std::string annotation
Definition: XMLDomPreprocessor.h:86
bool operator!=(const std::string &s) const
Definition: XMLDomPreprocessor.h:77
std::string value
Definition: XMLDomPreprocessor.h:85
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
std::ostream & operator<<(std::ostream &s, const LibraryVersion &version)
bool operator==(const char *s) const
Definition: XMLDomPreprocessor.h:78
std::list< Path > IncludePathStack
Definition: XMLDomPreprocessor.h:110
std::map< std::string, XMLVariableValue > XMLVariablesMap
Definition: XMLDomPreprocessor.h:91
XMLDomPreprocessor(const XMLVariablesMap &iVariables)
Definition: XMLDomPreprocessor.h:113
friend std::ostream & operator<<(std::ostream &s, const XMLVariableValue &x)
XMLVariablesMap variables
Definition: XMLDomPreprocessor.h:119
Iterator for iterating over xml nodes that have the same parent (sibligs)
Definition: XMLDom.h:758
bool operator==(const std::string &s) const
Definition: XMLDomPreprocessor.h:76
void reflect(Reflector &r)
Definition: XMLDomPreprocessor.h:69
bool operator!=(const char *s) const
Definition: XMLDomPreprocessor.h:79
Preprocesses XML documents and resolves all special tags like , <if>, <warning> and so on...
Definition: XMLDomPreprocessor.h:106
Variables defined in xml documents.
Definition: XMLDomPreprocessor.h:63
XMLDomPreprocessor()
Definition: XMLDomPreprocessor.h:112
std::map< std::string, Callback > mCallbacks
Definition: XMLDomPreprocessor.h:141
void MIRA_BASE_EXPORT preprocessXML(XMLDom &ioXml, XMLVariablesMap &ioVariables)
Shortcut for processing a XML document without creating a XMLDomPreprocessor yourself.
bool mAddedInfoToException
Definition: XMLDomPreprocessor.h:143
XMLVariableValue(const std::string &v="", const std::string &a="")
Definition: XMLDomPreprocessor.h:65
XMLVariableValue & operator=(const char *s)
Definition: XMLDomPreprocessor.h:74