Yate: XmlParent Class Reference

Yate

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, XmlSaxParser::Error *code=0)
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()

XmlParent | ( |  | ) |
| inline

Constructor

Referenced by XmlFragment::copy(), XmlElement::getParent(), XmlElement::setParent(), and XmlElement::XmlElement().

## ◆ ~XmlParent()

virtual ~XmlParent | ( |  | ) |
| inlinevirtual

Destructor

## Member Function Documentation

## ◆ addChild()

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 XmlDocument, XmlElement, and XmlFragment.

Referenced by addChildSafe().

## ◆ addChildSafe()

XmlChild * addChildSafe | ( | XmlChild * | child,
|  | XmlSaxParser::Error * | code = 0 )
| inline

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

Parameters

  child | The child to append
  code | Optional pointr to error code to be filled on failure

Returns
  The child on success, 0 on failure

References addChild().

Referenced by XmlElement::addChild().

## ◆ clearChildren()

virtual void clearChildren | ( |  | ) |
| inlinevirtual

Clear this xml parent children. Default implementation does nothing

Reimplemented in XmlElement, and XmlFragment.

## ◆ document()

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

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

Returns
  0

Reimplemented in XmlDocument.

## ◆ element()

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

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

Returns
  0

Reimplemented in XmlElement.

## ◆ fragment()

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

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

Returns
  0

Reimplemented in XmlFragment.

## ◆ getChildren()

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 hasChildren().

## ◆ hasChildren()

bool hasChildren | ( |  | ) | const
| inline

Check if at least one child element exists

Returns
  True if this parent has at least one child

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

## ◆ removeChild()

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 XmlDocument, XmlElement, and XmlFragment.

## ◆ reset()

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