1 /************************************************************************
3 ** Copyright (C) 2010 Strahinja Markovic
5 ** This file is part of FlightCrew.
7 ** FlightCrew is free software: you can redistribute it and/or modify
8 ** it under the terms of the GNU Lesser General Public License as published
9 ** by the Free Software Foundation, either version 3 of the License, or
10 ** (at your option) any later version.
12 ** FlightCrew is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ** GNU Lesser General Public License for more details.
17 ** You should have received a copy of the GNU Lesser General Public License
18 ** along with FlightCrew. If not, see <http://www.gnu.org/licenses/>.
20 *************************************************************************/
23 #ifndef ERRORRESULTCOLLECTOR_H
24 #define ERRORRESULTCOLLECTOR_H
27 #include <xercesc/sax/ErrorHandler.hpp>
28 namespace XERCES_CPP_NAMESPACE
29 { class SAXParseException; class SAXException; class DOMException; }
30 namespace xc = XERCES_CPP_NAMESPACE;
37 class ErrorResultCollector : public xc::ErrorHandler
41 void warning( const xc::SAXParseException &exception );
43 void error( const xc::SAXParseException &exception );
45 void fatalError( const xc::SAXParseException &exception );
49 std::vector< Result > GetResults();
51 void AddNewExceptionAsResult( const xc::SAXParseException &exception,
52 bool xml_error = false );
54 void AddNewExceptionAsResult( const xc::SAXException &exception );
56 void AddNewExceptionAsResult( const xc::XMLException &exception );
58 void AddNewExceptionAsResult( const xc::DOMException &exception );
62 std::vector< Result > m_Results;
65 } // namespace FlightCrew
67 #endif // ERRORRESULTCOLLECTOR_H