JEMRIS  2.8.1
open-source MRI simulations
DOMTreeErrorReporter.h
Go to the documentation of this file.
1 
5 /*
6  * JEMRIS Copyright (C)
7  * 2006-2015 Tony Stoecker
8  * 2007-2015 Kaveh Vahedipour
9  * 2009-2015 Daniel Pflugfelder
10  *
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  */
26 
27 #ifndef DOMTREEERRORREPORTER_H_
28 #define DOMTREEERRORREPORTER_H_
29 
30 #include <xercesc/util/XercesDefs.hpp>
31 #include <xercesc/sax/ErrorHandler.hpp>
32 #include <xercesc/util/XMLString.hpp>
33 
34 #include "StrX.h"
35 
36 #if defined(XERCES_NEW_IOSTREAMS)
37  #include <iostream>
38 #else
39  #include <iostream.h>
40 #endif
41 
42 XERCES_CPP_NAMESPACE_USE
43 
45 
46 class DOMTreeErrorReporter : public ErrorHandler {
47 
48  public:
52  DOMTreeErrorReporter() : fSawErrors(false) {
53  }
54 
55 
59  ~DOMTreeErrorReporter() {
60  }
61 
67  void warning(const SAXParseException& toCatch);
68 
74  void error(const SAXParseException& toCatch);
75 
81  void fatalError(const SAXParseException& toCatch);
82 
86  void resetErrors();
87 
91  bool GetSawErrors() const;
92 
98  bool fSawErrors;
99 
100 };
101 
102 
103 inline XERCES_STD_QUALIFIER ostream& operator <<
104  (XERCES_STD_QUALIFIER ostream& target, const StrX& toDump) {
105  target << toDump.localForm();
106  return target;
107 }
108 
109 #endif /*DOMTREEERRORREPORTER_H_*/
Implementation of JEMRIS StrX.
Simple class for transcoding sax errors to the machines locale.
Definition: StrX.h:37

-- last change 17.06.2016 | Tony Stoecker | Imprint --