//$Header: /home/ben/Mapper/include/RCS/MapperErrorHandler.h,v 6.3 2002/07/09 22:50:56 ben Exp $
#ifndef MAPPERERRORHANDLER_H
#define MAPPERERRORHANDLER_H
// Copyright Benedict Adamson 2002.
// This file is part of Mapper.
// Mapper is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// Mapper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Mapper; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <string>
#include <sax/ErrorHandler.hpp>
#include "error.h"
class DOM_DOMException;
class DOM_Document;
class DOM_Element;
class SAXParseException;
class XMLException;
class MapperErrorHandler
:public ErrorHandler
{
public: //constructors and destructor
MapperErrorHandler(
const char *name
);
virtual ~MapperErrorHandler(void);
public: //attributes
unsigned errors;
const char *my_name;
public: //messages
virtual void fatalError(
const SAXParseException &exception
);
virtual void error(
const SAXParseException &exception
);
virtual void warning(
const SAXParseException &exception
);
virtual void resetErrors(void);
void error(
const error::element_error &e
);
void fatalError(
const DOM_DOMException &exception
);
void fatalError(
const XMLException &exception
);
void unexpectedError(void);
void badOptionArgument(
const char option,
const char *optarg
);
void error(
const char *description
);
void warning(
const char *description
);
void report(
const string entity,
const unsigned line,
const unsigned column,
const string &severity,
const string &message
) const;
void report(
const SAXParseException &ex,
const string &severity
) const;
void report(
const DOM_DOMException &ex,
const string &severity
) const;
};
#endif