janwas
9269be9ee3
(see http://www.wildfiregames.com/forum/index.php?showtopic=11450&hl= ) clean up debug module . no longer include platform-dependent header (-> less rebuilds) . DISPLAY_ERROR -> DEBUG_DISPLAY_ERROR . parts of config.h that don't affect all files moved to config.2 (-> fewer full rebuilds) . remove creaky symbol cache (no longer needed for mmgr) . remove TLS thread naming stuff (can use debugger's thread window instead; no need for platform independence there) wdbg: remove thread suspension and breakpoint APIs (not needed) acpi: fix: u64 -> uintptr_t wutil: fix WinScopedLock, use that instead of direct lock() functions misc: . get rid of SAFE_STRCPY, replace with strcpy_s . remove _getcwd (shouldn't be used) This was SVN commit r5563.
65 lines
1.6 KiB
C++
65 lines
1.6 KiB
C++
/*
|
|
Xerces Error Handler for Pyrogenesis (and the GUI)
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Includes
|
|
// ---------------------------------------------------------------------------
|
|
|
|
#include "precompiled.h"
|
|
|
|
#include "XercesErrorHandler.h"
|
|
#include <iostream>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include "ps/Pyrogenesis.h"
|
|
#include "ps/CLogger.h"
|
|
|
|
#define LOG_CATEGORY "xml"
|
|
|
|
// Use namespace
|
|
XERCES_CPP_NAMESPACE_USE
|
|
|
|
void CXercesErrorHandler::warning(const SAXParseException &toCatch)
|
|
{
|
|
CStr systemId=XMLTranscode(toCatch.getSystemId());
|
|
CStr message=XMLTranscode(toCatch.getMessage());
|
|
|
|
LOG(CLogger::Warning, LOG_CATEGORY, "XML Parse Warning: %s:%d:%d: %s",
|
|
systemId.c_str(),
|
|
toCatch.getLineNumber(),
|
|
toCatch.getColumnNumber(),
|
|
message.c_str());
|
|
}
|
|
|
|
void CXercesErrorHandler::error(const SAXParseException& toCatch)
|
|
{
|
|
CStr systemId=XMLTranscode(toCatch.getSystemId());
|
|
CStr message=XMLTranscode(toCatch.getMessage());
|
|
fSawErrors = true;
|
|
|
|
LOG(CLogger::Error, LOG_CATEGORY, "XML Parse Error: %s:%d:%d: %s",
|
|
systemId.c_str(),
|
|
toCatch.getLineNumber(),
|
|
toCatch.getColumnNumber(),
|
|
message.c_str());
|
|
}
|
|
|
|
void CXercesErrorHandler::fatalError(const SAXParseException& toCatch)
|
|
{
|
|
CStr systemId=XMLTranscode(toCatch.getSystemId());
|
|
CStr message=XMLTranscode(toCatch.getMessage());
|
|
fSawErrors = true;
|
|
|
|
LOG(CLogger::Error, LOG_CATEGORY, "XML Parse Error (Fatal): %s:%d:%d: %s",
|
|
systemId.c_str(),
|
|
toCatch.getLineNumber(),
|
|
toCatch.getColumnNumber(),
|
|
message.c_str());
|
|
}
|
|
|
|
void CXercesErrorHandler::resetErrors()
|
|
{
|
|
fSawErrors = false;
|
|
}
|