Began to implement collection handling.
[shibboleth/cpp-xmltooling.git] / xmltooling / AbstractDOMCachingXMLObject.h
index 9622d1c..862f925 100644 (file)
@@ -35,6 +35,7 @@ namespace xmltooling {
 \r
     /**\r
      * Extension of AbstractXMLObject that implements a DOMCachingXMLObject.\r
+     * This is the primary base class for XMLObject implementation classes to use.\r
      */\r
     class XMLTOOL_API AbstractDOMCachingXMLObject : public AbstractXMLObject, public DOMCachingXMLObject\r
     {\r
@@ -97,8 +98,30 @@ namespace xmltooling {
             }\r
         }\r
     \r
+        /**\r
+         * @see XMLObject::clone()\r
+         */\r
+        XMLObject* clone() const;\r
+\r
      protected:\r
         /**\r
+         * Constructor\r
+         * \r
+         * @param namespaceURI the namespace the element is in\r
+         * @param elementLocalName the local name of the XML element this Object represents\r
+         */\r
+        AbstractDOMCachingXMLObject(const XMLCh* namespaceURI=NULL, const XMLCh* elementLocalName=NULL, const XMLCh* namespacePrefix=NULL)\r
+            : AbstractXMLObject(namespaceURI,elementLocalName, namespacePrefix), m_dom(NULL), m_document(NULL) {}\r
+\r
+        /**\r
+         * If a DOM representation exists, this clones it into a new document.\r
+         * \r
+         * @param doc   the document to clone into, or NULL, in which case a new document is created\r
+         * @return  the cloned DOM\r
+         */\r
+        DOMElement* cloneDOM(DOMDocument* doc=NULL) const;\r
+\r
+        /**\r
          * A helper function for derived classes.\r
          * This 'normalizes' newString and then if it is different from oldString\r
          * invalidates the DOM. It returns the normalized value.\r
@@ -132,15 +155,6 @@ namespace xmltooling {
          */\r
         XMLObject* prepareForAssignment(const XMLObject* oldValue, XMLObject* newValue);\r
 \r
-        /**\r
-         * Constructor\r
-         * \r
-         * @param namespaceURI the namespace the element is in\r
-         * @param elementLocalName the local name of the XML element this Object represents\r
-         */\r
-        AbstractDOMCachingXMLObject(const XMLCh* namespaceURI=NULL, const XMLCh* elementLocalName=NULL, const XMLCh* namespacePrefix=NULL)\r
-            : AbstractXMLObject(namespaceURI,elementLocalName, namespacePrefix), m_dom(NULL), m_document(NULL) {}\r
-\r
     private:\r
         DOMElement* m_dom;\r
         DOMDocument* m_document;\r