// file      : xsd/cxx/xml/dom/error-handler.hxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2005 Code Synthesis Tools CC
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef XSD_CXX_XML_DOM_ERROR_HANDLER_HXX
#define XSD_CXX_XML_DOM_ERROR_HANDLER_HXX

#include <xercesc/dom/DOMErrorHandler.hpp>

namespace xsd
{
  namespace cxx
  {
    namespace xml
    {
      namespace dom
      {
        template <typename C>
        class error_handler: public  xercesc::DOMErrorHandler
        {
        public:
          error_handler (xercesc::DOMErrorHandler* eh = 0)
              : failed_ (false), eh_ (eh)
          {
          }

          virtual bool
          handleError (xercesc::DOMError const& e);

          bool
          failed () const
          {
            return failed_;
          }

        private:
          bool failed_;
          xercesc::DOMErrorHandler* eh_;
        };
      }
    }
  }
}

#endif  // XSD_CXX_XML_DOM_ERROR_HANDLER_HXX

#include <xsd/cxx/xml/dom/error-handler.ixx>
