diff options
author | Alyssa Milburn | 2012-08-15 00:15:29 +0200 |
---|---|---|
committer | Alyssa Milburn | 2012-08-15 00:15:29 +0200 |
commit | b5a63d6709e87005c9b02fa02d4ae8802b7ce915 (patch) | |
tree | 4039d8ec3ee26aca40f6e3894d84e82052a3d312 /common | |
parent | c9f3d83c9eed2134b89e59cf32f2489a99e4139f (diff) | |
download | scummvm-rg350-b5a63d6709e87005c9b02fa02d4ae8802b7ce915.tar.gz scummvm-rg350-b5a63d6709e87005c9b02fa02d4ae8802b7ce915.tar.bz2 scummvm-rg350-b5a63d6709e87005c9b02fa02d4ae8802b7ce915.zip |
COMMON: Remove fprintf/stderr usage from xmlparser.
Diffstat (limited to 'common')
-rw-r--r-- | common/xmlparser.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp index ea3d44cf87..f0b7f1cc81 100644 --- a/common/xmlparser.cpp +++ b/common/xmlparser.cpp @@ -20,15 +20,11 @@ * */ -// FIXME: Avoid using fprintf -#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf -#define FORBIDDEN_SYMBOL_EXCEPTION_stderr - - #include "common/xmlparser.h" #include "common/archive.h" #include "common/fs.h" #include "common/memstream.h" +#include "common/system.h" namespace Common { @@ -123,17 +119,19 @@ bool XMLParser::parserError(const String &errStr) { keyClosing = currentPosition; } - fprintf(stderr, "\n File <%s>, line %d:\n", _fileName.c_str(), lineCount); + Common::String errorMessage = Common::String::format("\n File <%s>, line %d:\n", _fileName.c_str(), lineCount); currentPosition = (keyClosing - keyOpening); _stream->seek(keyOpening, SEEK_SET); while (currentPosition--) - fprintf(stderr, "%c", _stream->readByte()); + errorMessage += (char)_stream->readByte(); + + errorMessage += "\n\nParser error: "; + errorMessage += errStr; + errorMessage += "\n\n"; - fprintf(stderr, "\n\nParser error: "); - fprintf(stderr, "%s", errStr.c_str()); - fprintf(stderr, "\n\n"); + g_system->logMessage(LogMessageType::kError, errorMessage.c_str()); return false; } |