ATLAS Offline Software
XincludeErrHandler.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "XincludeErrHandler.h"
6 #include "xmlUtilities.h"
7 #include <iostream>
8 
10 }
11 
13 
14 bool
15 XIncludeErrHandler::handleError(const xercesc::DOMError& domError) {
16  bool continueParsing = true;
17 
18  if (domError.getSeverity() == xercesc::DOMError::DOM_SEVERITY_WARNING) {
19  std::cout << "\nWarning at file ";
20  } else if (domError.getSeverity() == xercesc::DOMError::DOM_SEVERITY_ERROR) {
21  std::cout << "\nError at file ";
22  m_errors = true;
23  } else {
24  std::cout << "\nFatal Error at file ";
25  continueParsing = false;
26  m_errors = true;
27  }
28 
29  std::cout << toNative(domError.getLocation()->getURI())
30  << ", line " << domError.getLocation()->getLineNumber()
31  << ", char " << domError.getLocation()->getColumnNumber()
32  << "\n Message: " << toNative(domError.getMessage()) << std::endl;
33 
34  return continueParsing;
35 }
36 
37 void
39  m_errors = false;
40 }
XincludeErrHandler.h
toNative
std::string toNative(const XMLCh *str)
Definition: xmlUtilities.h:50
XIncludeErrHandler::~XIncludeErrHandler
~XIncludeErrHandler()
XIncludeErrHandler::resetErrors
void resetErrors()
Definition: XincludeErrHandler.cxx:38
XIncludeErrHandler::XIncludeErrHandler
XIncludeErrHandler()
Definition: XincludeErrHandler.cxx:9
XIncludeErrHandler::handleError
bool handleError(const xercesc::DOMError &domError)
Definition: XincludeErrHandler.cxx:15
XIncludeErrHandler::m_errors
bool m_errors
Definition: XincludeErrHandler.h:27
xmlUtilities.h