Public Member Functions | |
XmlErrorHandler (std::ostream &errOut=std::cerr) | |
~XmlErrorHandler () | |
void | warning (const SAXParseException &exception) |
void | error (const SAXParseException &exception) |
void | fatalError (const SAXParseException &exception) |
void | resetErrors () |
int | getWarningCount () const |
int | getErrorCount () const |
int | getFatalCount () const |
Private Attributes | |
int | m_nWarning |
int | m_nError |
int | m_nFatal |
std::ostream & | m_errOut |
Definition at line 18 of file entity_test.cxx.
XmlErrorHandler::XmlErrorHandler | ( | std::ostream & | errOut = std::cerr |
) | [inline] |
Definition at line 20 of file entity_test.cxx.
References resetErrors().
00020 : m_errOut(errOut) 00021 {resetErrors();}
XmlErrorHandler::~XmlErrorHandler | ( | ) | [inline] |
void XmlErrorHandler::error | ( | const SAXParseException & | exception | ) |
Definition at line 166 of file entity_test.cxx.
References m_nError, release, and deljobs::string.
00166 { 00167 char* charSyst = XMLString::transcode(toCatch.getSystemId()); 00168 std::string systemId(charSyst); 00169 XMLString::release(&charSyst); 00170 char* charMsg = XMLString::transcode(toCatch.getMessage()); 00171 std::string msg(charMsg); 00172 XMLString::release(&charMsg); 00173 m_nError++; 00174 std::cerr << "Error at file \"" << systemId 00175 << "\", line " << toCatch.getLineNumber() 00176 << ", column " << toCatch.getColumnNumber() 00177 << "\n Message: " << msg << "\n\n"; 00178 }
void XmlErrorHandler::fatalError | ( | const SAXParseException & | exception | ) |
Definition at line 180 of file entity_test.cxx.
References m_nFatal, release, and deljobs::string.
00180 { 00181 00182 // getMessage returns type XMLCh* 00183 char* charMsg = XMLString::transcode(toCatch.getMessage()); 00184 std::string msg(charMsg); 00185 XMLString::release(&charMsg); 00186 m_nFatal++; 00187 if (!(toCatch.getSystemId()) ) { 00188 std::cerr << "Fatal XML parse error: no such file " 00189 << "\n Message: " << msg << "\n\n"; 00190 } 00191 else { 00192 char* charSyst = XMLString::transcode(toCatch.getSystemId()); 00193 std::string systemId(charSyst); 00194 XMLString::release(&charSyst); 00195 std::cerr << "Fatal error at file \"" 00196 << systemId 00197 << "\", line " << toCatch.getLineNumber() 00198 << ", column " << toCatch.getColumnNumber() 00199 << "\n Message: " << msg << "\n\n"; 00200 } 00201 }
int XmlErrorHandler::getErrorCount | ( | ) | const [inline] |
int XmlErrorHandler::getFatalCount | ( | ) | const [inline] |
int XmlErrorHandler::getWarningCount | ( | ) | const [inline] |
void XmlErrorHandler::resetErrors | ( | ) |
Definition at line 202 of file entity_test.cxx.
References m_nError, m_nFatal, and m_nWarning.
Referenced by XmlErrorHandler().
00202 { 00203 m_nWarning = m_nError = m_nFatal = 0; 00204 }
void XmlErrorHandler::warning | ( | const SAXParseException & | exception | ) |
Definition at line 162 of file entity_test.cxx.
References m_nWarning.
00162 { 00163 m_nWarning++; 00164 }
std::ostream& XmlErrorHandler::m_errOut [private] |
Definition at line 34 of file entity_test.cxx.
int XmlErrorHandler::m_nError [private] |
Definition at line 33 of file entity_test.cxx.
Referenced by xmlBase::XmlErrorHandler::error(), error(), getErrorCount(), xmlBase::XmlErrorHandler::resetErrors(), and resetErrors().
int XmlErrorHandler::m_nFatal [private] |
Definition at line 33 of file entity_test.cxx.
Referenced by xmlBase::XmlErrorHandler::fatalError(), fatalError(), getFatalCount(), xmlBase::XmlErrorHandler::resetErrors(), and resetErrors().
int XmlErrorHandler::m_nWarning [private] |
Definition at line 33 of file entity_test.cxx.
Referenced by getWarningCount(), xmlBase::XmlErrorHandler::resetErrors(), resetErrors(), xmlBase::XmlErrorHandler::warning(), and warning().