AbstractXMLObject mixin that implements a simple string-based content model. More...
#include <xmltooling/AbstractSimpleElement.h>
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 | |
AbstractSimpleElement (const AbstractSimpleElement &src) | |
Copy constructor. |
AbstractXMLObject mixin that implements a simple string-based content model.
Inherit from this class to support string-based element content.
xmltooling::AbstractSimpleElement::AbstractSimpleElement | ( | const AbstractSimpleElement & | src | ) | [protected] |
Copy constructor.
const std::list<XMLObject*>& xmltooling::AbstractSimpleElement::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.
Implements xmltooling::XMLObject.
const XMLCh* xmltooling::AbstractSimpleElement::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.
position | the relative child element position of the text |
Implements xmltooling::XMLObject.
bool xmltooling::AbstractSimpleElement::hasChildren | ( | ) | const [virtual] |
Checks if this XMLObject has children.
Implements xmltooling::XMLObject.
void xmltooling::AbstractSimpleElement::setTextContent | ( | const XMLCh * | value, | |
unsigned int | position = 0 | |||
) | [virtual] |
Sets (or clears) text content relative to a child element's position.
value | value to set, or nullptr to clear | |
position | position relative to child element |
Implements xmltooling::XMLObject.