xmltooling::AbstractComplexElement Class Reference

AbstractXMLObject mixin that implements children. More...

#include <xmltooling/AbstractComplexElement.h>

Inheritance diagram for xmltooling::AbstractComplexElement:
xmltooling::AbstractXMLObject xmltooling::XMLObject

List of all members.

Public Member Functions

bool hasChildren () const
 Checks if this XMLObject has children.
const std::list< XMLObject * > & getOrderedChildren () const
 Returns an unmodifiable list of child objects in the order that they should appear in the serialized representation.
void removeChild (XMLObject *child)
const XMLCh * getTextContent (unsigned int position=0) const
 Returns the text content at the specified position relative to any child elements.
void setTextContent (const XMLCh *value, unsigned int position=0)
 Sets (or clears) text content relative to a child element's position.

Protected Member Functions

 AbstractComplexElement (const AbstractComplexElement &src)
 Copy constructor.

Protected Attributes

std::list< XMLObject * > m_children
 Underlying list of child objects.
std::vector< XMLCh * > m_text
 Interstitial text nodes.

Detailed Description

AbstractXMLObject mixin that implements children.

Inherit from this class to implement an element with child objects and mixed content.


Constructor & Destructor Documentation

xmltooling::AbstractComplexElement::AbstractComplexElement ( const AbstractComplexElement src  )  [protected]

Copy constructor.


Member Function Documentation

const std::list<XMLObject*>& xmltooling::AbstractComplexElement::getOrderedChildren (  )  const [virtual]

Returns an unmodifiable list of child objects in the order that they should appear in the serialized representation.

The validity of the returned list is not maintained if any non-const operations are performed on the parent object.

Returns:
the list of children

Implements xmltooling::XMLObject.

const XMLCh* xmltooling::AbstractComplexElement::getTextContent ( unsigned int  position = 0  )  const [virtual]

Returns the text content at the specified position relative to any child elements.

A zero represents leading text, 1 comes after the first child, and so forth.

Parameters:
position the relative child element position of the text
Returns:
the designated text value

Implements xmltooling::XMLObject.

bool xmltooling::AbstractComplexElement::hasChildren (  )  const [virtual]

Checks if this XMLObject has children.

Returns:
true if this XMLObject has children, false if not

Implements xmltooling::XMLObject.

void xmltooling::AbstractComplexElement::setTextContent ( const XMLCh *  value,
unsigned int  position = 0 
) [virtual]

Sets (or clears) text content relative to a child element's position.

Parameters:
value value to set, or nullptr to clear
position position relative to child element

Implements xmltooling::XMLObject.


Member Data Documentation

Underlying list of child objects.

Manages the lifetime of the children.

std::vector<XMLCh*> xmltooling::AbstractComplexElement::m_text [protected]

Interstitial text nodes.

Needed to support mixed content, and preserve DOM whitespace across rebuilds.


The documentation for this class was generated from the following file:

Generated on 24 Jan 2020 for xmltooling by  doxygen 1.6.1