mbxmlutils  1.3.0
Multi-Body XML Utils
MBXMLUtils::DOMEvalException Class Reference

#include <dom.h>

Inheritance diagram for MBXMLUtils::DOMEvalException:
[legend]

Public Member Functions

 DOMEvalException (const std::string &errorMsg_, const xercesc::DOMNode *n)
 
 DOMEvalException (const std::string &errorMsg_, const xercesc::DOMLocator &loc)
 
 DOMEvalException (const DOMEvalException &src)
 
DOMEvalException & operator= (const DOMEvalException &src)
 
void appendContext (const xercesc::DOMNode *n, int lineNr=0)
 
const std::string & getMessage () const
 
void setMessage (const std::string &errorMsg_)
 
void setSubsequentError (bool sse)
 
const char * what () const noexcept override
 

Static Private Member Functions

static std::string convertToString (const EmbedDOMLocator &loc, const std::string &message, bool subsequentError=false)
 

Private Attributes

bool subsequentError {false}
 
std::string errorMsg
 
std::vector< EmbedDOMLocator > locationStack
 
std::string whatStr
 

Friends

class DOMParser
 

Detailed Description

Exception during evaluation of the DOM tree including a location stack. The location stack is generated by the context node n passed to the ctor.

Member Function Documentation

◆ convertToString()

string MBXMLUtils::DOMEvalException::convertToString ( const EmbedDOMLocator &  loc,
const std::string &  message,
bool  subsequentError = false 
)
staticprivate

Convert a error location and error message for outputting it to the console. The behaviour of this function can be adapted by the environment variable MBXMLUTILS_ERROROUTPUT. For each error the value of this variable is printed, where the value is interpreted as a "Boost-Extended Format String Syntax", where the following named sub-expressions are recognized:

named sub-expr value of the named sub-expression
msg the error message
file the filename where the error occured
line the line number in the file where the error occured
xpath the XPath expression from the root element of the file to the element in the file where the error occured
ecount the embed count number where the error occured
sse undefined value but only defined if this is a subsequent error

All these named sub-expressions may not be defined (see "Boost-Extended Format Syntax Syntax" on how to handle this). If the environment variable MBXMLUTILS_ERROROUTPUT is not set then the default GCC is used.

The following values for MBXMLUTILS_ERROROUTPUT are interpreted as an internally defined expression: GCC: use gcc style output HTMLFILELINE: use HTML like output with a link with filename and line number HTMLXPATH: use HTML like output with a link with filename and xpath expression


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