*/\r
\r
/**\r
- * @file AbstractComplexElement.h\r
+ * @file xmltooling/AbstractComplexElement.h\r
* \r
* AbstractXMLObject mixin that implements children\r
*/\r
\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
\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