Multi-line svn commit, see body.
[shibboleth/cpp-xmltooling.git] / xmltooling / XMLObject.h
index ed750ce..1fb26d6 100644 (file)
@@ -62,6 +62,18 @@ namespace xmltooling {
         virtual XMLObject* clone() const=0;\r
         \r
         /**\r
+         * Specialized function for detaching a child object from its parent\r
+         * <strong>while disposing of the parent</strong>.\r
+         *\r
+         * This is not a generic way of detaching any child object, but only of\r
+         * pruning a single child from the root of an XMLObject tree. If the\r
+         * detached XMLObject's parent is itself a child, an exception will be\r
+         * thrown. It's mainly useful for turning a child into the new root of\r
+         * the tree without having to clone the child.\r
+         */\r
+        virtual void detach()=0;\r
+\r
+        /**\r
          * Gets the QName for this element.  This QName <strong>MUST</strong> \r
          * contain the namespace URI, namespace prefix, and local element name.\r
          * \r
@@ -104,6 +116,13 @@ namespace xmltooling {
         virtual const QName* getSchemaType() const=0;\r
         \r
         /**\r
+         * Gets the value of the ID attribute set on this object, if any.\r
+         * \r
+         * @return an ID value or NULL \r
+         */\r
+        virtual const XMLCh* getXMLID() const=0;\r
+        \r
+        /**\r
          * Checks to see if this object has a parent.\r
          * \r
          * @return true if the object has a parent, false if not\r
@@ -143,6 +162,33 @@ namespace xmltooling {
         virtual const std::list<XMLObject*>& getOrderedChildren() const=0;\r
 \r
         /**\r
+         * Used by a child's detach method to isolate the child from\r
+         * this parent object in preparation for destroying the parent\r
+         * (this object).\r
+         * \r
+         * @param child the child object to remove\r
+         */\r
+        virtual void removeChild(XMLObject* child)=0;\r
+\r
+        /**\r
+         * Returns the text content at the specified position relative to\r
+         * any child elements. A zero represents leading text, 1 comes after\r
+         * the first child, and so forth.\r
+         *\r
+         * @param position  the relative child element position of the text  \r
+         * @return the designated text value\r
+         */\r
+        virtual const XMLCh* getTextContent(unsigned int position=0) const=0;\r
+\r
+        /**\r
+         * Sets (or clears) text content relative to a child element's position. \r
+         * \r
+         * @param value         value to set, or NULL to clear\r
+         * @param position      position relative to child element \r
+         */\r
+        virtual void setTextContent(const XMLCh* value, unsigned int position=0)=0;\r
+\r
+        /**\r
          * Gets the DOM representation of this XMLObject, if one exists.\r
          * \r
          * @return the DOM representation of this XMLObject\r