\r
/**\r
* An abstract implementation of XMLObject.\r
+ * This is the primary concrete base class, and supplies basic namespace,\r
+ * type, and parent handling. Most implementation classes should not\r
+ * directly inherit from this class, but rather from the various mixins\r
+ * that supply the rest of the XMLObject interface, as required.\r
*/\r
class XMLTOOL_API AbstractXMLObject : public virtual XMLObject\r
{\r
public:\r
- virtual ~AbstractXMLObject();\r
+ virtual ~AbstractXMLObject() {\r
+ delete m_typeQname;\r
+ }\r
\r
const QName& getElementQName() const {\r
return m_elementQname;\r
m_parent = parent;\r
}\r
\r
- bool hasChildren() const {\r
- return !m_children.empty();\r
- }\r
-\r
- const std::list<XMLObject*>& getOrderedChildren() const {\r
- return m_children;\r
- }\r
-\r
protected:\r
/**\r
* Constructor\r
* \r
* @return the value that should be assigned\r
*/\r
- XMLCh* prepareForAssignment(XMLCh* oldValue, const XMLCh* newValue) {\r
- XMLCh* newString = XMLString::replicate(newValue);\r
- XMLString::trim(newString);\r
- if (!XMLString::equals(oldValue,newValue)) {\r
- releaseThisandParentDOM();\r
- XMLString::release(&oldValue);\r
- return newString;\r
- }\r
- XMLString::release(&newString);\r
- return oldValue; \r
- }\r
+ XMLCh* prepareForAssignment(XMLCh* oldValue, const XMLCh* newValue);\r
\r
/**\r
* A helper function for derived classes, for assignment of (singleton) XML objects.\r
XMLObject* prepareForAssignment(XMLObject* oldValue, XMLObject* newValue);\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
* Set of namespaces associated with the object.\r
*/\r
mutable std::set<Namespace> m_namespaces;\r