ReaderErrorReporter.cc
Go to the documentation of this file.
1 #include <utl/ReaderErrorReporter.h>
2 #include <utl/ErrorLogger.h>
3 #include <utl/XercesUtil.h>
4 
5 using namespace std;
6 using namespace xercesc;
7 
8 
9 namespace utl {
10 
11  void
12  ReaderErrorReporter::warning(const SAXParseException&)
13  {
14  // Ignore all warnings.
15  }
16 
17 
19 
23  void
24  ReaderErrorReporter::error(const SAXParseException& toCatch)
25  {
26  fSawErrors = true;
27  fMessages
28  << "Error at file \"" << AsString(toCatch.getSystemId())
29  << "\", line " << toCatch.getLineNumber()
30  << ", column " << toCatch.getColumnNumber()
31  << ": " << AsString(toCatch.getMessage()) << "\n";
32  }
33 
34 
35  void
36  ReaderErrorReporter::fatalError(const SAXParseException& toCatch)
37  {
38  fSawErrors = true;
39  ostringstream msg;
40  msg << "Fatal Error at file \"" << AsString(toCatch.getSystemId())
41  << "\", line " << toCatch.getLineNumber()
42  << ", column " << toCatch.getColumnNumber()
43  << ": " << AsString(toCatch.getMessage()) << "\n";
44  ERROR(msg);
45  throw;
46  }
47 
48 
49  void
50  ReaderErrorReporter::resetErrors()
51  {
52  fSawErrors = false;
53  fMessages.str("");
54  }
55 
56 }
string AsString(DOMNode &n)
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165

, generated on Tue Sep 26 2023.