From f0510d2f90467de8e8f260b47d79a9baaf9bef17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2009 07:15:29 +0200 Subject: Start tracking XSD with git --- .../xsd/cxx/xml/sax/bits/error-handler-proxy.hxx | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.hxx (limited to 'libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.hxx') diff --git a/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.hxx b/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.hxx new file mode 100644 index 0000000..7eca35b --- /dev/null +++ b/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.hxx @@ -0,0 +1,81 @@ +// file : xsd/cxx/xml/sax/bits/error-handler-proxy.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_XML_SAX_ERROR_HANDLER_PROXY_HXX +#define XSD_CXX_XML_SAX_ERROR_HANDLER_PROXY_HXX + +#include +#include + +#include + +namespace xsd +{ + namespace cxx + { + namespace xml + { + namespace sax + { + namespace bits + { + template + class error_handler_proxy: public xercesc::ErrorHandler + { + public: + error_handler_proxy (error_handler& eh) + : failed_ (false), eh_ (&eh), native_eh_ (0) + { + } + + error_handler_proxy (xercesc::ErrorHandler& eh) + : failed_ (false), eh_ (0), native_eh_ (&eh) + { + } + + public: + virtual void + warning (const xercesc::SAXParseException& e); + + virtual void + error (const xercesc::SAXParseException& e); + + virtual void + fatalError (const xercesc::SAXParseException& e); + + public: + bool + failed () const + { + return failed_; + } + + virtual void + resetErrors() + { + failed_ = false; + } + + private: + typedef typename error_handler::severity severity; + + void + handle (const xercesc::SAXParseException&, severity); + + private: + bool failed_; + error_handler* eh_; + xercesc::ErrorHandler* native_eh_; + }; + } + } + } + } +} + +#include + +#endif // XSD_CXX_XML_SAX_ERROR_HANDLER_PROXY_HXX + -- cgit v1.1