+#define DECL_INHERITED_STRING_ATTRIB(proper,upcased) \
+ DECL_INHERITED_XMLOBJECT_ATTRIB(proper,upcased,XMLCh)
+
+/**
+ * Declares abstract get/set methods for a string XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_STRING_ATTRIB(proper,upcased) \
+ DECL_XMLOBJECT_ATTRIB(proper,upcased,XMLCh)
+
+/**
+ * Declares abstract set method for a DateTime XML attribute.
+ * The get method is omitted.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_INHERITED_DATETIME_ATTRIB(proper,upcased) \
+ DECL_INHERITED_XMLOBJECT_ATTRIB(proper,upcased,xmltooling::DateTime); \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(time_t proper)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(const XMLCh* proper)=0
+
+/**
+ * Declares abstract get/set methods for a DateTime XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_DATETIME_ATTRIB(proper,upcased) \
+ DECL_XMLOBJECT_ATTRIB(proper,upcased,xmltooling::DateTime); \
+ XMLTOOLING_DOXYGEN(Returns the proper attribute in epoch form.) \
+ virtual time_t get##proper##Epoch() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(time_t proper)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(const XMLCh* proper)=0
+
+/**
+ * Declares abstract set method for an integer XML attribute.
+ * The get method is omitted.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_INHERITED_INTEGER_ATTRIB(proper,upcased) \
+ public: \
+ XMLTOOLING_DOXYGEN(proper attribute name) \
+ static const XMLCh upcased##_ATTRIB_NAME[]; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute using a string value.) \
+ virtual void set##proper(const XMLCh* proper)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(int proper)=0
+
+/**
+ * Declares abstract get/set methods for an integer XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_INTEGER_ATTRIB(proper,upcased) \
+ public: \
+ XMLTOOLING_DOXYGEN(proper attribute name) \
+ static const XMLCh upcased##_ATTRIB_NAME[]; \
+ XMLTOOLING_DOXYGEN(Returns the proper attribute after a NULL indicator.) \
+ virtual std::pair<bool,int> get##proper() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute using a string value.) \
+ virtual void set##proper(const XMLCh* proper)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(int proper)=0
+
+/**
+ * Declares abstract get/set methods for a boolean XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ * @param def the default/presumed value, if no explicit value has been set
+ */
+#define DECL_BOOLEAN_ATTRIB(proper,upcased,def) \
+ public: \
+ XMLTOOLING_DOXYGEN(proper attribute name) \
+ static const XMLCh upcased##_ATTRIB_NAME[]; \
+ XMLTOOLING_DOXYGEN(Returns the proper attribute or def if not set.) \
+ bool proper() const { \
+ switch (get##proper()) { \
+ case xmlconstants::XML_BOOL_TRUE: \
+ case xmlconstants::XML_BOOL_ONE: \
+ return true; \
+ case xmlconstants::XML_BOOL_FALSE: \
+ case xmlconstants::XML_BOOL_ZERO: \
+ return false; \
+ default: \
+ return def; \
+ } \
+ } \
+ XMLTOOLING_DOXYGEN(Returns the proper attribute as an explicit enumerated value.) \
+ virtual xmlconstants::xmltooling_bool_t get##proper() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute using an enumerated value.) \
+ virtual void proper(xmlconstants::xmltooling_bool_t value)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ void proper(bool value) { \
+ proper(value ? xmlconstants::XML_BOOL_ONE : xmlconstants::XML_BOOL_ZERO); \
+ } \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute using a string constant.) \
+ void set##proper(const XMLCh* value) { \
+ if (value) { \
+ switch (*value) { \
+ case xercesc::chLatin_t: \
+ proper(xmlconstants::XML_BOOL_TRUE); \
+ break; \
+ case xercesc::chLatin_f: \
+ proper(xmlconstants::XML_BOOL_FALSE); \
+ break; \
+ case xercesc::chDigit_1: \
+ proper(xmlconstants::XML_BOOL_ONE); \
+ break; \
+ case xercesc::chDigit_0: \
+ proper(xmlconstants::XML_BOOL_ZERO); \
+ break; \
+ default: \
+ proper(xmlconstants::XML_BOOL_NULL); \
+ } \
+ } \
+ else \
+ proper(xmlconstants::XML_BOOL_NULL); \
+ }
+
+/**
+ * Implements get/set methods and a private member for a typed XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param type the attribute's data type
+ */
+#define IMPL_XMLOBJECT_ATTRIB(proper,type) \
+ protected: \
+ type* m_##proper; \
+ public: \
+ const type* get##proper() const { \
+ return m_##proper; \
+ } \
+ void set##proper(const type* proper) { \
+ m_##proper = prepareForAssignment(m_##proper,proper); \
+ }
+
+/**
+ * Implements get/set methods and a private member for a string XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ */
+#define IMPL_STRING_ATTRIB(proper) \
+ IMPL_XMLOBJECT_ATTRIB(proper,XMLCh)
+
+/**
+ * Implements get/set methods and a private member for a string XML attribute,
+ * plus a getXMLID override.
+ *
+ * @param proper the proper name of the attribute
+ */
+#define IMPL_ID_ATTRIB(proper) \
+ IMPL_XMLOBJECT_ATTRIB(proper,XMLCh) \
+ const XMLCh* getXMLID() const { \
+ return m_##proper; \
+ }
+
+/**
+ * Implements get/set methods and a private member for a string XML attribute,
+ * plus a getXMLID override and attribute node clearance when DOM is dropped.
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define IMPL_ID_ATTRIB_EX(proper, ucase, namespaceURI) \
+ IMPL_XMLOBJECT_ATTRIB(proper,XMLCh) \
+ const XMLCh* getXMLID() const { \
+ return m_##proper; \
+ } \
+ void releaseDOM() const { \
+ if (getDOM()) \
+ getDOM()->removeAttributeNS(namespaceURI, ucase##_ATTRIB_NAME); \
+ AbstractDOMCachingXMLObject::releaseDOM(); \
+ }
+
+/**
+ * Implements get/set methods and a private member for a DateTime XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param fallback epoch to return when attribute is NULL
+ */
+#define IMPL_DATETIME_ATTRIB(proper,fallback) \
+ IMPL_DATETIME_ATTRIB_EX(proper,fallback,false)
+
+/**
+ * Implements get/set methods and a private member for a duration-valued DateTime XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param fallback epoch to return when attribute is NULL
+ */
+#define IMPL_DURATION_ATTRIB(proper,fallback) \
+ IMPL_DATETIME_ATTRIB_EX(proper,fallback,true)
+
+/**
+ * Implements get/set methods and a private member for a DateTime XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param fallback epoch to return when attribute is NULL
+ * @param duration true iff the attribute should be handled as a duration
+ */
+#define IMPL_DATETIME_ATTRIB_EX(proper,fallback,duration) \
+ protected: \
+ DateTime* m_##proper; \
+ time_t m_##proper##Epoch; \