From 170d7ebb826ebd04b922b456a366c2767972e015 Mon Sep 17 00:00:00 2001 From: cantor Date: Tue, 2 May 2006 23:28:23 +0000 Subject: [PATCH 1/1] Generalize exception macro. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@88 de75baf8-a10c-0410-a50a-987c0e22f00f --- xmltooling/exceptions.h | 21 +++++++++++---------- xmltooling/signature/Signature.h | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/xmltooling/exceptions.h b/xmltooling/exceptions.h index f281470..2291a9c 100644 --- a/xmltooling/exceptions.h +++ b/xmltooling/exceptions.h @@ -33,13 +33,14 @@ * Declares a derived exception class * * @param name the exception class + * @param linkage linkage specification for class * @param ns the exception class C++ namespace * @param base the base class * @param desc documentation comment for class */ -#define DECL_XMLTOOLING_EXCEPTION(name,ns,base,desc) \ +#define DECL_XMLTOOLING_EXCEPTION(name,linkage,ns,base,desc) \ XMLTOOLING_DOXYGEN(desc) \ - class XMLTOOL_EXCEPTIONAPI(XMLTOOL_API) name : public base { \ + class linkage name : public base { \ public: \ XMLTOOLING_DOXYGEN(Constructor) \ name(const char* msg=NULL, const xmltooling::params& p=xmltooling::params()) : base(msg,p) {} \ @@ -341,14 +342,14 @@ namespace xmltooling { static ExceptionFactoryMap m_factoryMap; }; - DECL_XMLTOOLING_EXCEPTION(XMLParserException,xmltooling,XMLToolingException,Exceptions related to XML parsing); - DECL_XMLTOOLING_EXCEPTION(XMLObjectException,xmltooling,XMLToolingException,Exceptions in basic object usage); - DECL_XMLTOOLING_EXCEPTION(MarshallingException,xmltooling,XMLToolingException,Exceptions during object marshalling); - DECL_XMLTOOLING_EXCEPTION(UnmarshallingException,xmltooling,XMLToolingException,Exceptions during object unmarshalling); - DECL_XMLTOOLING_EXCEPTION(UnknownElementException,xmltooling,XMLToolingException,Exceptions due to processing of unknown element content); - DECL_XMLTOOLING_EXCEPTION(UnknownAttributeException,xmltooling,XMLToolingException,Exceptions due to processing of unknown attributes); - DECL_XMLTOOLING_EXCEPTION(UnknownExtensionException,xmltooling,XMLToolingException,Exceptions from use of an unrecognized extension/plugin); - DECL_XMLTOOLING_EXCEPTION(ValidationException,xmltooling,XMLToolingException,Exceptions during object validation); + DECL_XMLTOOLING_EXCEPTION(XMLParserException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions related to XML parsing); + DECL_XMLTOOLING_EXCEPTION(XMLObjectException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions in basic object usage); + DECL_XMLTOOLING_EXCEPTION(MarshallingException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions during object marshalling); + DECL_XMLTOOLING_EXCEPTION(UnmarshallingException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions during object unmarshalling); + DECL_XMLTOOLING_EXCEPTION(UnknownElementException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions due to processing of unknown element content); + DECL_XMLTOOLING_EXCEPTION(UnknownAttributeException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions due to processing of unknown attributes); + DECL_XMLTOOLING_EXCEPTION(UnknownExtensionException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions from use of an unrecognized extension/plugin); + DECL_XMLTOOLING_EXCEPTION(ValidationException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions during object validation); }; diff --git a/xmltooling/signature/Signature.h b/xmltooling/signature/Signature.h index b4b6c3c..82b0c5b 100644 --- a/xmltooling/signature/Signature.h +++ b/xmltooling/signature/Signature.h @@ -111,7 +111,7 @@ namespace xmlsignature { } }; - DECL_XMLTOOLING_EXCEPTION(SignatureException,xmlsignature,xmltooling::XMLToolingException,Exceptions in signature processing); + DECL_XMLTOOLING_EXCEPTION(SignatureException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmlsignature,xmltooling::XMLToolingException,Exceptions in signature processing); }; -- 2.1.4