libopie API Documentation

Opie::XMLElement Class Reference

A small xml lib written by Simon Hausmann. More...

#include <xmltree.h>

Collaboration diagram for Opie::XMLElement:

Collaboration graph
[legend]
List of all members.

Public Types

typedef QMap< QString, QStringAttributeMap

Public Member Functions

 XMLElement ()
 The constructor of XMLElement.

void appendChild (XMLElement *child)
 appendChild appends a child to the XMLElement behind the last element.

void insertAfter (XMLElement *newChild, XMLElement *refChild)
 inserts newChild after refChild.

void insertBefore (XMLElement *newChild, XMLElement *refChild)
 same as insertAfter but the element get's inserted before refChild.

void removeChild (XMLElement *child)
 removeChild removes the child from the XMLElement.

XMLElementparent () const
 parent() returns the parent of this XMLElement If there is no parent 0l gets returned

XMLElementfirstChild () const
XMLElementnextChild () const
XMLElementprevChild () const
XMLElementlastChild () const
void setTagName (const QString &tag)
QString tagName () const
void setValue (const QString &val)
QString value () const
void setAttributes (const AttributeMap &attrs)
AttributeMap attributes () const
AttributeMapattributes ()
QString attribute (const QString &) const
void setAttribute (const QString &attr, const QString &value)
void save (QTextStream &stream, uint indent=0)
XMLElementnamedItem (const QString &name)
XMLElementclone () const

Static Public Member Functions

XMLElementload (const QString &fileName)

Detailed Description

A small xml lib written by Simon Hausmann.

Definition at line 34 of file xmltree.h.


Constructor & Destructor Documentation

XMLElement::XMLElement  ) 
 

The constructor of XMLElement.

Definition at line 29 of file xmltree.cc.


Member Function Documentation

void XMLElement::appendChild XMLElement child  ) 
 

appendChild appends a child to the XMLElement behind the last element.

The ownership of the child get's transfered to the this XMLElement. If child is already the child of another parent it's get removed from the other parent first.

Definition at line 46 of file xmltree.cc.

References m_next, m_parent, m_prev, and removeChild().

Referenced by insertAfter().

void XMLElement::insertAfter XMLElement newChild,
XMLElement refChild
 

inserts newChild after refChild.

If newChild is the child of another parent the child will get removed. The ownership of child gets transfered.

Definition at line 64 of file xmltree.cc.

References appendChild(), m_next, m_parent, m_prev, and removeChild().

void XMLElement::insertBefore XMLElement newChild,
XMLElement refChild
 

same as insertAfter but the element get's inserted before refChild.

Definition at line 107 of file xmltree.cc.

References m_next, m_parent, m_prev, and removeChild().

void XMLElement::removeChild XMLElement child  ) 
 

removeChild removes the child from the XMLElement.

The ownership gets dropped. You need to delete the child yourself.

Definition at line 133 of file xmltree.cc.

References m_next, m_parent, and m_prev.

Referenced by appendChild(), insertAfter(), and insertBefore().

XMLElement* Opie::XMLElement::parent  )  const [inline]
 

parent() returns the parent of this XMLElement If there is no parent 0l gets returned

Definition at line 74 of file xmltree.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:25:08 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001