RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
XMLErrorHandler Class Reference

Error handler for XML parsing using boost spirit. More...

#include <XMLErrorHandler.hpp>

Classes

struct  XMLError
 XML error object. More...
 

Public Types

enum  XMLErrors {
  xml_att_unexpected , xml_att_expected , xml_children_expected , xml_end_expected ,
  xml_bad_end_elem , xml_missing_brack , xml_starttag_end_exp , xml_bad_child
}
 XML Error codes.
 

Public Member Functions

template<typename ScannerT , typename ErrorT >
boost::spirit::classic::error_status operator() (ScannerT const &scan, ErrorT const &error) const
 Exception handling callbak. More...
 

Static Public Member Functions

static boost::spirit::classic::assertion< XMLErrorBadEndElem (const std::string &elemname)
 Asserts if the element name of the endtag does not match the element name of the starttag. More...
 
static boost::spirit::classic::assertion< XMLErrorMissingBrac (const std::string &elemname)
 
static boost::spirit::classic::assertion< XMLErrorAttExpected (const std::string &elemname)
 
static boost::spirit::classic::assertion< XMLErrorStartEndExpected (const std::string &elemname)
 
static boost::spirit::classic::assertion< XMLErrorBadChild (const std::string &elemname)
 

Static Public Attributes

static boost::spirit::classic::guard< XMLErrorXMLErrorGuard
 a static instance of a spirit guard, guarding trown XLErrors
 

Detailed Description

Error handler for XML parsing using boost spirit.

* starttag >> *element >> endtag
*
* example:
* <elemname>
*  <elemname2></elemname2>
* </elemname>
*

Member Function Documentation

◆ AttExpected()

static boost::spirit::classic::assertion<XMLError> AttExpected ( const std::string &  elemname)
inlinestatic
Parameters
elemname[in] name of the element that is being parsed
Returns
spirit assertion object of XMLError type

◆ BadChild()

static boost::spirit::classic::assertion<XMLError> BadChild ( const std::string &  elemname)
inlinestatic
Parameters
elemname[in] name of the element that is being parsed
Returns
spirit assertion object of XMLError type

◆ BadEndElem()

static boost::spirit::classic::assertion<XMLError> BadEndElem ( const std::string &  elemname)
inlinestatic

Asserts if the element name of the endtag does not match the element name of the starttag.

Parameters
elemname[in] name of the element that is being parsed
Returns
spirit assertion object of XMLError type

◆ MissingBrac()

static boost::spirit::classic::assertion<XMLError> MissingBrac ( const std::string &  elemname)
inlinestatic
Parameters
elemname[in] name of the element that is being parsed
Returns
spirit assertion object of XMLError type

◆ operator()()

boost::spirit::classic::error_status operator() ( ScannerT const &  scan,
ErrorT const &  error 
) const
inline

Exception handling callbak.

Parameters
scan
error
Returns

◆ StartEndExpected()

static boost::spirit::classic::assertion<XMLError> StartEndExpected ( const std::string &  elemname)
inlinestatic
Parameters
elemname[in] name of the element that is being parsed
Returns
spirit assertion object of XMLError type

The documentation for this class was generated from the following file: