Yate: XmlParent Class Reference

Yate

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
XmlParent Class Referenceabstract

Xml Parent. More...

`#include <yatexml.h>`

Inheritance diagram for XmlParent:

## Public Member Functions
| XmlParent ()
virtual | ~XmlParent ()
virtual XmlDocument * | document ()
virtual XmlFragment * | fragment ()
virtual XmlElement * | element ()
virtual XmlSaxParser::Error | addChild (XmlChild *child)=0
XmlChild * | addChildSafe (XmlChild *child)
virtual XmlChild * | removeChild (XmlChild *child, bool delObj=true)=0
virtual void | reset ()
virtual const ObjList & | getChildren () const
virtual void | clearChildren ()
bool | hasChildren () const

## Detailed Description

Xml Parent.

Xml Parent for a Xml child

## Constructor & Destructor Documentation

XmlParent | ( |  | ) |
| inline

Constructor

virtual ~XmlParent | ( |  | ) |
| inlinevirtual

Destructor

## Member Function Documentation

virtual XmlSaxParser::Error addChild | ( | XmlChild * | child | ) |
| pure virtual

Append a new child to this XmlParent

Parameters

  child | The child to append

Returns
  NoError if the child was successfully added

Implemented in XmlElement, XmlDocument, and XmlFragment.

Referenced by XmlParent::addChildSafe().

XmlChild* addChildSafe | ( | XmlChild * | child | ) |
| inline

Append a new child of this XmlParent, release the object on failure

Parameters

  child | The child to append

Returns
  The child on success, 0 on failure

References XmlParent::addChild(), and TelEngine::destruct().

virtual void clearChildren | ( |  | ) |
| inlinevirtual

Clear this xml parent children. Default implementation does nothing

Reimplemented in XmlElement, and XmlFragment.

virtual XmlDocument* document | ( |  | ) |
| inlinevirtual

Get an XmlDocument object from this XmlParent. Default implementation return 0

Returns
  0

Reimplemented in XmlDocument.

Referenced by XmlDomParser::document().

virtual XmlElement* element | ( |  | ) |
| inlinevirtual

Get an XmlElement object from this XmlParent. Default implementation return 0

Returns
  0

Reimplemented in XmlElement.

Referenced by XmlElement::parent().

virtual XmlFragment* fragment | ( |  | ) |
| inlinevirtual

Get an XmlFragment object from this XmlParent. Default implementation return 0

Returns
  0

Reimplemented in XmlFragment.

Referenced by XmlDomParser::fragment().

virtual const ObjList& getChildren | ( |  | ) | const
| inlinevirtual

Obtain this xml parent children. Default implementation returns an empty list

Returns
  The list of children

Reimplemented in XmlElement, and XmlFragment.

References ObjList::empty().

Referenced by XmlParent::hasChildren().

bool hasChildren | ( |  | ) | const
| inline

Check if at least one child element exists

Returns
  True if this parent has at least one child

References XmlParent::getChildren(), and ObjList::skipNull().

virtual XmlChild* removeChild | ( | XmlChild * | child,
|  | bool | delObj = `true`
| ) |  |
| pure virtual

Remove a child

Parameters

  child | The child to remove
  delObj | True to delete the object

Returns
  XmlChild pointer if found and not deleted

Implemented in XmlElement, XmlDocument, and XmlFragment.

virtual void reset | ( |  | ) |
| inlinevirtual

Reset this xml parent. Default implementation does nothing

Reimplemented in XmlDocument, and XmlFragment.

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

- yatexml.h