Multi-line svn commit, see body.
[shibboleth/cpp-xmltooling.git] / xmltooling / AbstractComplexElement.h
index 9f71657..ba8b862 100644 (file)
@@ -15,7 +15,7 @@
  */\r
 \r
 /**\r
- * @file AbstractComplexElement.h\r
+ * @file xmltooling/AbstractComplexElement.h\r
  * \r
  * AbstractXMLObject mixin that implements children\r
  */\r
@@ -34,8 +34,7 @@ namespace xmltooling {
 \r
     /**\r
      * AbstractXMLObject mixin that implements children.\r
-     * Inherit from this class to implement an element with child objects.\r
-     * No unprotected access to them is supplied here.\r
+     * Inherit from this class to implement an element with child objects and mixed content.\r
      */\r
     class XMLTOOL_API AbstractComplexElement : public virtual AbstractXMLObject\r
     {\r
@@ -52,17 +51,29 @@ namespace xmltooling {
 \r
         void removeChild(XMLObject* child);\r
 \r
+        const XMLCh* getTextContent(unsigned int position=0) const {\r
+            return (m_text.size() > position) ? m_text[position] : NULL; \r
+        }\r
+        \r
+        void setTextContent(const XMLCh* value, unsigned int position=0);\r
+\r
     protected:\r
         AbstractComplexElement() {}\r
         \r
         /** Copy constructor. */\r
-        AbstractComplexElement(const AbstractComplexElement& src) {}\r
+        AbstractComplexElement(const AbstractComplexElement& src);\r
 \r
         /**\r
          * Underlying list of child objects.\r
          * Manages the lifetime of the children.\r
          */\r
         std::list<XMLObject*> m_children;\r
+        \r
+        /**\r
+         * Interstitial text nodes.\r
+         * Needed to support mixed content, and preserve DOM whitespace across rebuilds.\r
+         */\r
+        std::vector<XMLCh*> m_text;\r
     };\r
     \r
 };\r