Moved DOM methods up the tree, add copy c'tors, KeyInfo sample
[shibboleth/xmltooling.git] / xmltooling / exceptions.h
index 4d343e5..6e82e1e 100644 (file)
@@ -20,7 +20,7 @@
  * Exception classes\r
  */\r
  \r
-#if !defined(__xmltooling_exceptions_h__)\r
+#ifndef __xmltooling_exceptions_h__\r
 #define __xmltooling_exceptions_h__\r
 \r
 #include <map>\r
  * \r
  * @param name  the exception class\r
  * @param base  the base class\r
+ * @param desc\r
  */\r
-#define DECL_XMLTOOLING_EXCEPTION(name,base) \\r
+#define DECL_XMLTOOLING_EXCEPTION(name,base,desc) \\r
+    /##** desc */ \\r
     class XMLTOOL_EXCEPTIONAPI(XMLTOOL_API) name : public xmltooling::base { \\r
     public: \\r
+        /##** base##::##base(const char*,const xmltooling::params&) */ \\r
         name(const char* msg=NULL, const xmltooling::params& p=xmltooling::params()) \\r
             : xmltooling::base(msg,p) {} \\r
+        /##** base##::##base(const char*,const xmltooling::namedparams&) */ \\r
         name(const char* msg, const xmltooling::namedparams& p) \\r
             : xmltooling::base(msg,p) {} \\r
+        /##** base##::##base(const std::string&,const xmltooling::params&) */ \\r
         name(const std::string& msg, const xmltooling::params& p=xmltooling::params()) \\r
             : xmltooling::base(msg,p) {} \\r
+        /##** base##::##base(const std::string&,const xmltooling::namedparams&) */ \\r
         name(const std::string& msg, const xmltooling::namedparams& p) \\r
             : xmltooling::base(msg,p) {} \\r
         virtual ~name() {} \\r
@@ -102,6 +108,7 @@ namespace xmltooling {
         const std::vector<const char*>& get() const {return v;}\r
         \r
     protected:\r
+        /** Contains the parameters being passed. */\r
         std::vector<const char*> v;\r
     };\r
     \r
@@ -124,14 +131,16 @@ namespace xmltooling {
         namedparams(int count,...);\r
     };\r
 \r
+    class XMLTOOL_EXCEPTIONAPI(XMLTOOL_API) XMLToolingException;\r
+    \r
+    /** A factory function that returns an empty exception object of a given type. */\r
+    typedef XMLToolingException* ExceptionFactory();\r
+    \r
     /**\r
      * Base exception class, supports parametrized messages and XML serialization.\r
      * Parameters are prefixed with a dollar sign ($) and can be positional ($1)\r
      * or named ($info).\r
      */\r
-    class XMLTOOL_EXCEPTIONAPI(XMLTOOL_API) XMLToolingException;\r
-    typedef XMLToolingException* ExceptionFactory();\r
-    \r
     class XMLTOOL_EXCEPTIONAPI(XMLTOOL_API) XMLToolingException\r
     {\r
     public:\r
@@ -326,14 +335,14 @@ namespace xmltooling {
         static ExceptionFactoryMap m_factoryMap;\r
     };\r
 \r
-    DECL_XMLTOOLING_EXCEPTION(XMLParserException,XMLToolingException);\r
-    DECL_XMLTOOLING_EXCEPTION(XMLObjectException,XMLToolingException);\r
-    DECL_XMLTOOLING_EXCEPTION(MarshallingException,XMLToolingException);\r
-    DECL_XMLTOOLING_EXCEPTION(UnmarshallingException,XMLToolingException);\r
-    DECL_XMLTOOLING_EXCEPTION(UnknownElementException,XMLToolingException);\r
-    DECL_XMLTOOLING_EXCEPTION(UnknownAttributeException,XMLToolingException);\r
-    DECL_XMLTOOLING_EXCEPTION(ValidationException,XMLToolingException);\r
-    DECL_XMLTOOLING_EXCEPTION(SignatureException,XMLToolingException);\r
+    DECL_XMLTOOLING_EXCEPTION(XMLParserException,XMLToolingException,Exceptions related to XML parsing);\r
+    DECL_XMLTOOLING_EXCEPTION(XMLObjectException,XMLToolingException,Exceptions in basic object usage);\r
+    DECL_XMLTOOLING_EXCEPTION(MarshallingException,XMLToolingException,Exceptions during object marshalling);\r
+    DECL_XMLTOOLING_EXCEPTION(UnmarshallingException,XMLToolingException,Exceptions during object unmarshalling);\r
+    DECL_XMLTOOLING_EXCEPTION(UnknownElementException,XMLToolingException,Exceptions due to processing of unknown element content);\r
+    DECL_XMLTOOLING_EXCEPTION(UnknownAttributeException,XMLToolingException,Exceptions due to processing of unknown attributes);\r
+    DECL_XMLTOOLING_EXCEPTION(ValidationException,XMLToolingException,Exceptions during object validation);\r
+    DECL_XMLTOOLING_EXCEPTION(SignatureException,XMLToolingException,Exceptions in signature processing);\r
 \r
 };\r
 \r