summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/ErrorHandler.h
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2002-02-14 01:56:06 +0000
committerMatthew Newhook <matthew@zeroc.com>2002-02-14 01:56:06 +0000
commita8511e4b58199bbc2602c28cccfbe09215218f53 (patch)
tree980debb574cf0d8f298d8a226c683073c330fdcd /cpp/src/Freeze/ErrorHandler.h
parent... (diff)
downloadice-a8511e4b58199bbc2602c28cccfbe09215218f53.tar.bz2
ice-a8511e4b58199bbc2602c28cccfbe09215218f53.tar.xz
ice-a8511e4b58199bbc2602c28cccfbe09215218f53.zip
This code isn't ready to commit. However I'm going on vacation and don't
want to chance losing it.
Diffstat (limited to 'cpp/src/Freeze/ErrorHandler.h')
-rw-r--r--cpp/src/Freeze/ErrorHandler.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/cpp/src/Freeze/ErrorHandler.h b/cpp/src/Freeze/ErrorHandler.h
new file mode 100644
index 00000000000..5f169670029
--- /dev/null
+++ b/cpp/src/Freeze/ErrorHandler.h
@@ -0,0 +1,56 @@
+#ifndef ERROR_HANDLER_H
+#define ERROR_HANDLER_H
+
+#include <sax/ErrorHandler.hpp>
+#include <sax/SAXParseException.hpp>
+
+#include <Freeze/Print.h>
+
+class DOMTreeErrorReporter : public ErrorHandler
+{
+public:
+ DOMTreeErrorReporter() :
+ _sawErrors(false)
+ {
+ }
+
+ void
+ warning(const SAXParseException& toCatch)
+ {
+ ::std::cerr << "Warning at file \"" << DOMString(toCatch.getSystemId())
+ << "\", line " << toCatch.getLineNumber()
+ << ", column " << toCatch.getColumnNumber()
+ << "\n Message: " << DOMString(toCatch.getMessage()) << ::std::endl;
+ }
+
+ void
+ error(const SAXParseException& toCatch)
+ {
+ _sawErrors = true;
+ ::std::cerr << "Error at file \"" << DOMString(toCatch.getSystemId())
+ << "\", line " << toCatch.getLineNumber()
+ << ", column " << toCatch.getColumnNumber()
+ << "\n Message: " << DOMString(toCatch.getMessage()) << ::std::endl;
+
+ }
+
+ void
+ fatalError(const SAXParseException& toCatch)
+ {
+ _sawErrors = true;
+ ::std::cerr << "Fatal at file \"" << DOMString(toCatch.getSystemId())
+ << "\", line " << toCatch.getLineNumber()
+ << ", column " << toCatch.getColumnNumber()
+ << "\n Message: " << DOMString(toCatch.getMessage()) << ::std::endl;
+ }
+
+ void resetErrors()
+ {
+ }
+
+ bool getSawErrors() const { return _sawErrors; }
+
+ bool _sawErrors;
+};
+
+#endif