ALBA
mmuDOMTreeErrorReporter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: mmuDOMTreeErrorReporter
5 Authors: Marco Petrone
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16#ifndef __mmuDOMTreeErrorReporter_h__
17#define __mmuDOMTreeErrorReporter_h__
18
19//------------------------------------------------------------------------------
20// Include:
21//------------------------------------------------------------------------------
22#include <xercesc/sax/ErrorHandler.hpp>
23#include <xercesc/sax/SAXParseException.hpp>
24
25
31class ALBA_EXPORT mmuDOMTreeErrorReporter : public XERCES_CPP_NAMESPACE_QUALIFIER ErrorHandler
32{
33public:
35 mmuDOMTreeErrorReporter() : m_SawErrors(false), m_TestFlag(false) {}
38
40 void warning(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException& toCatch);
42 void error(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException& toCatch);
44 void fatalError(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException& toCatch);
47
49 bool GetSawErrors() const {return m_SawErrors;}
51 void SetTestMode(bool enable){m_TestFlag = enable;}
52
53private:
54 bool m_SawErrors;
55 bool m_TestFlag;
56};
57#endif // _mmuDOMTreeErrorReporter_h_
class name: mmuDOMTreeErrorReporter Utility class to catch XML error rised while parsing XML
void resetErrors()
reset error flag
void warning(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException &toCatch)
Implementation of the warning handler interface.
void SetTestMode(bool enable)
set test modality in order to skip, problematic log messages
bool GetSawErrors() const
retrieve error flag
void fatalError(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException &toCatch)
Implementation of the fatal error handler interface.
void error(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException &toCatch)
Implementation of the error handler interface.