Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::XMLElement Class Reference

#include </home/clem/local/src/opie/noncore/unsupported/libopie/xmltree.h>

Collaboration diagram for Opie::XMLElement:

Collaboration graph
[legend]
List of all members.

Public Types

typedef QMap< QString, QStringAttributeMap

Public Member Functions

 XMLElement ()
 ~XMLElement ()
void appendChild (XMLElement *child)
void insertAfter (XMLElement *newChild, XMLElement *refChild)
void insertBefore (XMLElement *newChild, XMLElement *refChild)
void removeChild (XMLElement *child)
XMLElementparent () const
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

static XMLElementload (const QString &fileName)

Private Member Functions

 XMLElement (const XMLElement &rhs)
XMLElementoperator= (const XMLElement &rhs)

Private Attributes

QString m_tag
QString m_value
AttributeMap m_attributes
XMLElementm_parent
XMLElementm_next
XMLElementm_prev
XMLElementm_first
XMLElementm_last
Private * d

Detailed Description

A small xml lib written by Simon Hausmann.

Definition at line 34 of file xmltree.h.


Member Typedef Documentation

typedef QMap<QString, QString> Opie::XMLElement::AttributeMap
 

Definition at line 37 of file xmltree.h.


Constructor & Destructor Documentation

XMLElement::XMLElement  ) 
 

The constructor of XMLElement

Definition at line 29 of file xmltree.cc.

XMLElement::~XMLElement  ) 
 

Definition at line 34 of file xmltree.cc.

References m_first, and m_next.

Opie::XMLElement::XMLElement const XMLElement rhs  )  [private]
 


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_first, and m_last.

Referenced by clone(), and insertAfter().

QString XMLElement::attribute const QString  )  const
 

Definition at line 94 of file xmltree.cc.

References QString::data(), QMap< Key, T >::end(), QMap< Key, T >::find(), m_attributes, and QString::null.

AttributeMap& Opie::XMLElement::attributes  )  [inline]
 

Definition at line 88 of file xmltree.h.

References m_attributes.

AttributeMap Opie::XMLElement::attributes  )  const [inline]
 

Definition at line 87 of file xmltree.h.

References m_attributes.

Referenced by OContactAccessBackend_XML::load(), and Opie::OPimContactAccessBackend_XML::load().

XMLElement * XMLElement::clone  )  const
 

Definition at line 287 of file xmltree.cc.

References appendChild(), clone(), m_attributes, m_first, m_next, m_tag, m_value, setAttributes(), setTagName(), and setValue().

Referenced by clone().

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

Definition at line 75 of file xmltree.h.

References m_first.

Referenced by OContactAccessBackend_XML::load(), and Opie::OPimContactAccessBackend_XML::load().

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(), assert, m_last, m_next, m_parent, and m_prev.

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 assert, m_first, m_next, m_parent, and m_prev.

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

Definition at line 78 of file xmltree.h.

References m_last.

XMLElement * XMLElement::load const QString fileName  )  [static]
 

Definition at line 302 of file xmltree.cc.

References f, handler, IO_ReadOnly, QFile::open(), QTextStream::setEncoding(), stream, and QTextStream::UnicodeUTF8.

Referenced by OContactAccessBackend_XML::load(), and Opie::OPimContactAccessBackend_XML::load().

XMLElement * XMLElement::namedItem const QString name  ) 
 

Definition at line 276 of file xmltree.cc.

References m_first, nextChild(), and tagName().

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

Definition at line 76 of file xmltree.h.

References m_next.

Referenced by OContactAccessBackend_XML::load(), Opie::OPimContactAccessBackend_XML::load(), and namedItem().

XMLElement& Opie::XMLElement::operator= const XMLElement rhs  )  [private]
 

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.

References m_parent.

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

Definition at line 77 of file xmltree.h.

References m_prev.

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_first, m_last, m_next, and m_prev.

void XMLElement::save QTextStream stream,
uint  indent = 0
 

Definition at line 155 of file xmltree.cc.

References QMap< Key, T >::begin(), QMap< Key, T >::end(), end, Opie::Core::endl(), Qtopia::escapeString(), i, QMap< Key, T >::isEmpty(), QString::isEmpty(), m_attributes, m_first, m_last, m_parent, m_tag, m_value, and value().

void XMLElement::setAttribute const QString attr,
const QString value
 

Definition at line 102 of file xmltree.cc.

References m_attributes, and QMap< Key, T >::replace().

void Opie::XMLElement::setAttributes const AttributeMap attrs  )  [inline]
 

Definition at line 86 of file xmltree.h.

References m_attributes.

Referenced by clone().

void Opie::XMLElement::setTagName const QString tag  )  [inline]
 

Definition at line 80 of file xmltree.h.

References m_tag.

Referenced by clone().

void Opie::XMLElement::setValue const QString val  )  [inline]
 

Definition at line 83 of file xmltree.h.

References m_value.

Referenced by clone().

QString Opie::XMLElement::tagName  )  const [inline]
 

Definition at line 81 of file xmltree.h.

References m_tag.

Referenced by OContactAccessBackend_XML::load(), Opie::OPimContactAccessBackend_XML::load(), and namedItem().

QString Opie::XMLElement::value  )  const [inline]
 

Definition at line 84 of file xmltree.h.

References m_value.

Referenced by save().


Member Data Documentation

Private* Opie::XMLElement::d [private]
 

Definition at line 113 of file xmltree.h.

AttributeMap Opie::XMLElement::m_attributes [private]
 

Definition at line 103 of file xmltree.h.

Referenced by attribute(), attributes(), clone(), save(), setAttribute(), and setAttributes().

XMLElement* Opie::XMLElement::m_first [private]
 

Definition at line 108 of file xmltree.h.

Referenced by appendChild(), clone(), firstChild(), insertBefore(), namedItem(), removeChild(), save(), and ~XMLElement().

XMLElement* Opie::XMLElement::m_last [private]
 

Definition at line 109 of file xmltree.h.

Referenced by appendChild(), insertAfter(), lastChild(), removeChild(), and save().

XMLElement* Opie::XMLElement::m_next [private]
 

Definition at line 106 of file xmltree.h.

Referenced by clone(), insertAfter(), insertBefore(), nextChild(), removeChild(), and ~XMLElement().

XMLElement* Opie::XMLElement::m_parent [private]
 

Definition at line 105 of file xmltree.h.

Referenced by insertAfter(), insertBefore(), parent(), and save().

XMLElement* Opie::XMLElement::m_prev [private]
 

Definition at line 107 of file xmltree.h.

Referenced by insertAfter(), insertBefore(), prevChild(), and removeChild().

QString Opie::XMLElement::m_tag [private]
 

Definition at line 101 of file xmltree.h.

Referenced by clone(), save(), setTagName(), and tagName().

QString Opie::XMLElement::m_value [private]
 

Definition at line 102 of file xmltree.h.

Referenced by clone(), save(), setValue(), and value().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:00:21 2005 for OPIE by  doxygen 1.4.2