0ad/source/gui/XercesErrorHandler.cpp
Gee da6d6c60a9 Updates making CGUI a singleton
This was SVN commit r38.
2003-11-06 11:54:46 +00:00

62 lines
1.5 KiB
C++
Executable File

/*
Xerces Error Handler for Prometheus (and the GUI)
by Gustav Larsson
gee@pyro.nu
*/
// ---------------------------------------------------------------------------
// Includes
// ---------------------------------------------------------------------------
#include <xercesc/sax/SAXParseException.hpp>
#include "XercesErrorHandler.h"
#include <iostream>
#include <stdlib.h>
#include <string.h>
// Use namespace
XERCES_CPP_NAMESPACE_USE
void CXercesErrorHandler::warning(const SAXParseException&)
{
//
// Ignore all warnings.
//
}
void CXercesErrorHandler::error(const SAXParseException& toCatch)
{
char * buf = XMLString::transcode(toCatch.getMessage());
fSawErrors = true;
XMLString::release(&buf);
/* cerr << "Error at file \"" << StrX(toCatch.getSystemId())
<< "\", line " << toCatch.getLineNumber()
<< ", column " << toCatch.getColumnNumber()
<< "\n Message: " << StrX(toCatch.getMessage()) << endl;
*/
/// g_nemLog(" Error: %s", XMLString::transcode(toCatch.getMessage()));
}
void CXercesErrorHandler::fatalError(const SAXParseException& toCatch)
{
char * buf = XMLString::transcode(toCatch.getMessage());
fSawErrors = true;
XMLString::release(&buf);
/* cerr << "Fatal Error at file \"" << StrX(toCatch.getSystemId())
<< "\", line " << toCatch.getLineNumber()
<< ", column " << toCatch.getColumnNumber()
<< "\n Message: " << StrX(toCatch.getMessage()) << endl;
*/
/// g_nemLog(" Error: %s", XMLString::transcode(toCatch.getMessage()));
}
void CXercesErrorHandler::resetErrors()
{
fSawErrors = false;
}