From: Scott Cantor Date: Sun, 19 Feb 2006 05:29:54 +0000 (+0000) Subject: Replace reference to std::exception X-Git-Tag: 1.0-alpha1~336 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=commitdiff_plain;h=089c18bfbe06ac06f98b6f8252c712104cfe883c Replace reference to std::exception --- diff --git a/xmltooling/exceptions.h b/xmltooling/exceptions.h index ed9343a..a5d7727 100644 --- a/xmltooling/exceptions.h +++ b/xmltooling/exceptions.h @@ -24,19 +24,35 @@ #define __xmltooling_exceptions_h__ #include -#include #include #define DECL_XMLTOOLING_EXCEPTION(type) \ - class XMLTOOL_EXCEPTIONAPI(XMLTOOL_API) type : public std::exception { \ + class XMLTOOL_EXCEPTIONAPI(XMLTOOL_API) type : public XMLToolingException { \ public: \ - type(const char* msg) : std::exception(msg) {} \ - type(std::string& msg) : std::exception(msg.c_str()) {} \ + type(const char* msg) : XMLToolingException(msg) {} \ + type(std::string& msg) : XMLToolingException(msg) {} \ virtual ~type() {} \ } namespace xmltooling { + /** + * Base exception class. + * std::exception seems to be inconsistently defined, so this is just + * a substitute base class. + */ + class XMLTOOL_EXCEPTIONAPI(XMLTOOL_API) XMLToolingException + { + public: + XMLToolingException() {} + virtual ~XMLToolingException() {} + XMLToolingException(const char* const msg) : m_msg(msg) {} + XMLToolingException(const std::string& msg) : m_msg(msg) {} + virtual const char* what() const { return m_msg.c_str(); } + private: + std::string m_msg; + }; + DECL_XMLTOOLING_EXCEPTION(XMLParserException); };