arabica/include/SAX/SAXException.hpp

69 lines
1.6 KiB
C++
Raw Normal View History

2003-09-11 12:26:53 +02:00
#ifndef ARABICA_SAXEXCEPTION_H
#define ARABICA_SAXEXCEPTION_H
2002-06-21 13:16:28 +02:00
// SAXParseException.h
// $Id$
#include <stdexcept>
2007-09-05 00:55:47 +02:00
#include <SAX/ArabicaConfig.hpp>
2003-09-09 13:14:48 +02:00
2007-09-05 11:49:18 +02:00
namespace Arabica
{
2002-06-21 13:16:28 +02:00
namespace SAX
{
/**
* Encapsulate a general SAX error or warning.
*
* <p>This class can contain basic error or warning information from
* either the XML parser or the application: a parser writer or
* application writer can subclass it to provide additional
* functionality. SAX handlers may throw this exception or
* any exception subclassed from it.</p>
*
* <p>If the parser or application needs to include information about a
* specific location in an XML document, it should use the
* {@link SAXParseException SAXParseException} subclass.</p>
2002-06-21 13:16:28 +02:00
*
* @since SAX 1.0
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see SAXParseException
2002-06-21 13:16:28 +02:00
*/
class SAXException : public std::runtime_error
{
public:
2003-08-27 16:28:01 +02:00
SAXException() : std::runtime_error("Unspecified SAX Exception")
2002-06-21 13:16:28 +02:00
{
} // SAXException
SAXException(const std::string& message) :
std::runtime_error(message)
{
} // SAXException
SAXException(const SAXException& rhs) :
std::runtime_error(rhs.what())
{
} // SAXException
virtual ~SAXException() throw() { }
SAXException& operator=(const SAXException& rhs)
{
std::runtime_error* re = static_cast<std::runtime_error*>(this);
*re = rhs;
return *this;
} // operator=
private:
bool operator==(const SAXException&);
}; // class SAXException
2007-09-05 11:49:18 +02:00
} // namespace SAX
} // namespace Arabica
2002-06-21 13:16:28 +02:00
#endif // SAXExceptionH