Rename exception macros to avoid conflicts, correct some of the decls.
authorScott Cantor <cantor.2@osu.edu>
Tue, 19 Dec 2006 03:28:14 +0000 (03:28 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 19 Dec 2006 03:28:14 +0000 (03:28 +0000)
xmltooling/XMLToolingConfig.cpp
xmltooling/exceptions.h

index 45168c5..55bcfd5 100644 (file)
@@ -23,7 +23,7 @@
 #include "internal.h"
 #include "exceptions.h"
 #include "XMLToolingConfig.h"
-#include "encryption/Encryption.h"
+#include "encryption/Encrypter.h"
 #include "impl/UnknownElement.h"
 #include "security/TrustEngine.h"
 #include "security/OpenSSLCryptoX509CRL.h"
@@ -58,19 +58,20 @@ using namespace xmltooling;
 using namespace log4cpp;
 using namespace std;
 
-DECL_EXCEPTION_FACTORY(XMLParserException,xmltooling);
-DECL_EXCEPTION_FACTORY(XMLObjectException,xmltooling);
-DECL_EXCEPTION_FACTORY(MarshallingException,xmltooling);
-DECL_EXCEPTION_FACTORY(UnmarshallingException,xmltooling);
-DECL_EXCEPTION_FACTORY(UnknownElementException,xmltooling);
-DECL_EXCEPTION_FACTORY(UnknownAttributeException,xmltooling);
-DECL_EXCEPTION_FACTORY(UnknownExtensionException,xmltooling);
-DECL_EXCEPTION_FACTORY(ValidationException,xmltooling);
-DECL_EXCEPTION_FACTORY(XMLSecurityException,xmltooling);
-DECL_EXCEPTION_FACTORY(IOException,xmltooling);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(XMLParserException,xmltooling);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(XMLObjectException,xmltooling);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(MarshallingException,xmltooling);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(UnmarshallingException,xmltooling);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(UnknownElementException,xmltooling);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(UnknownAttributeException,xmltooling);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(UnknownExtensionException,xmltooling);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(ValidationException,xmltooling);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(IOException,xmltooling);
 
 #ifndef XMLTOOLING_NO_XMLSEC
-    DECL_EXCEPTION_FACTORY(SignatureException,xmlsignature);
+    DECL_XMLTOOLING_EXCEPTION_FACTORY(XMLSecurityException,xmltooling);
+    DECL_XMLTOOLING_EXCEPTION_FACTORY(SignatureException,xmlsignature);
+    DECL_XMLTOOLING_EXCEPTION_FACTORY(EncryptionException,xmlencryption);
 #endif
 
 namespace xmltooling {
@@ -203,19 +204,20 @@ bool XMLToolingInternalConfig::init()
         registerEncryptionClasses();
         registerSOAPClasses();
         
-        REGISTER_EXCEPTION_FACTORY(XMLParserException,xmltooling);
-        REGISTER_EXCEPTION_FACTORY(XMLObjectException,xmltooling);
-        REGISTER_EXCEPTION_FACTORY(MarshallingException,xmltooling);
-        REGISTER_EXCEPTION_FACTORY(UnmarshallingException,xmltooling);
-        REGISTER_EXCEPTION_FACTORY(UnknownElementException,xmltooling);
-        REGISTER_EXCEPTION_FACTORY(UnknownAttributeException,xmltooling);
-        REGISTER_EXCEPTION_FACTORY(ValidationException,xmltooling);
-        REGISTER_EXCEPTION_FACTORY(XMLSecurityException,xmltooling);
-        REGISTER_EXCEPTION_FACTORY(IOException,xmltooling);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(XMLParserException,xmltooling);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(XMLObjectException,xmltooling);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(MarshallingException,xmltooling);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(UnmarshallingException,xmltooling);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(UnknownElementException,xmltooling);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(UnknownAttributeException,xmltooling);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ValidationException,xmltooling);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(IOException,xmltooling);
         
 #ifndef XMLTOOLING_NO_XMLSEC
         XMLObjectBuilder::registerBuilder(QName(xmlconstants::XMLSIG_NS,Signature::LOCAL_NAME),new SignatureBuilder());
-        REGISTER_EXCEPTION_FACTORY(SignatureException,xmlsignature);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(XMLSecurityException,xmltooling);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(SignatureException,xmlsignature);
+        REGISTER_XMLTOOLING_EXCEPTION_FACTORY(EncryptionException,xmlencryption);
         registerKeyResolvers();
         registerCredentialResolvers();
         registerTrustEngines();
index 55f8208..a58c24f 100644 (file)
@@ -61,7 +61,7 @@
  * @param name  the exception class name
  * @param ns    the exception class C++ namespace
  */
-#define DECL_EXCEPTION_FACTORY(name,ns) \
+#define DECL_XMLTOOLING_EXCEPTION_FACTORY(name,ns) \
     xmltooling::XMLToolingException* name##Factory() \
     { \
         return new ns::name(); \
@@ -73,7 +73,7 @@
  * @param name      the exception class name
  * @param ns        the exception class C++ namespace
  */
-#define REGISTER_EXCEPTION_FACTORY(name,ns) XMLToolingException::registerFactory(#ns"::"#name,name##Factory)
+#define REGISTER_XMLTOOLING_EXCEPTION_FACTORY(name,ns) XMLToolingException::registerFactory(#ns"::"#name,name##Factory)
 
 #if defined (_MSC_VER)
     #pragma warning( push )
@@ -350,9 +350,11 @@ namespace xmltooling {
     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);
-    DECL_XMLTOOLING_EXCEPTION(XMLSecurityException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions related to the XML security layer);
     DECL_XMLTOOLING_EXCEPTION(IOException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions related to physical input/output errors);
 
+#ifndef XMLTOOLING_NO_XMLSEC
+    DECL_XMLTOOLING_EXCEPTION(XMLSecurityException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmltooling,XMLToolingException,Exceptions related to the XML security layer);
+#endif
 };
 
 #if defined (_MSC_VER)