All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Valuable::XMLArchiveElement Class Reference

Wrapper for DOMElement that implements the ArchiveElementImpl interface. More...

#include <Valuable/XMLArchive.hpp>

Inheritance diagram for Valuable::XMLArchiveElement:
Valuable::ArchiveElementImpl

Classes

class  XMLIterator
 Iterator for XMLArchiveElement children. More...
 

Public Member Functions

virtual void add (ArchiveElementImpl &element)
 Adds a new child element to this element. More...
 
virtual void add (const QString &name, const QString &value)
 Writes a new named attribute. More...
 
virtual ArchiveIterator children () const
 Access all child elements. More...
 
virtual QString get (const QString &name) const
 Reads a named attribute from the element. More...
 
virtual QString get () const
 Reads the element contents. More...
 
virtual QString name () const
 Reads the element name. More...
 
virtual void set (const QString &s)
 Writes the element contents. More...
 
virtual void setName (const QString &name)
 Sets the element name. More...
 
const DOMElementxml () const
 Returns a pointer to the wrapped DOMElement. More...
 
 XMLArchiveElement (DOMElement element)
 Creates a new wrapper object for given DOMElement object. More...
 
- Public Member Functions inherited from Valuable::ArchiveElementImpl
virtual ~ArchiveElementImpl ()
 Virtual destructor.
 

Static Public Member Functions

static ArchiveElement create (const DOMElement &element)
 Wraps the given DOMElement to XMLArchiveElement. More...
 

Detailed Description

Wrapper for DOMElement that implements the ArchiveElementImpl interface.

This and XMLArchive implement XML serialization.

Constructor & Destructor Documentation

Valuable::XMLArchiveElement::XMLArchiveElement ( DOMElement  element)

Creates a new wrapper object for given DOMElement object.

Parameters
elementDOMElement to wrap

Member Function Documentation

virtual void Valuable::XMLArchiveElement::add ( ArchiveElementImpl element)
virtual

Adds a new child element to this element.

Parameters
elementNew child element to be added

Implements Valuable::ArchiveElementImpl.

virtual void Valuable::XMLArchiveElement::add ( const QString &  name,
const QString &  value 
)
virtual

Writes a new named attribute.

Parameters
nameNew unique (along this object) name for the attribute
valueAttribute value

Implements Valuable::ArchiveElementImpl.

virtual ArchiveIterator Valuable::XMLArchiveElement::children ( ) const
virtual

Access all child elements.

Returns
The child iterator for all child elements.

Implements Valuable::ArchiveElementImpl.

static ArchiveElement Valuable::XMLArchiveElement::create ( const DOMElement element)
static

Wraps the given DOMElement to XMLArchiveElement.

Parameters
elementDOMElement to wrap
Returns
New Element with XMLArchiveElement implementation
virtual QString Valuable::XMLArchiveElement::get ( const QString &  name) const
virtual

Reads a named attribute from the element.

Parameters
nameName of the attribute to retrieve
Returns
Attribute contents as a string, or empty string if the attribute was not found.

Implements Valuable::ArchiveElementImpl.

virtual QString Valuable::XMLArchiveElement::get ( ) const
virtual

Reads the element contents.

Returns
The contents of the element

Implements Valuable::ArchiveElementImpl.

virtual QString Valuable::XMLArchiveElement::name ( ) const
virtual

Reads the element name.

Returns
The name of the element

Implements Valuable::ArchiveElementImpl.

virtual void Valuable::XMLArchiveElement::set ( const QString &  s)
virtual

Writes the element contents.

Parameters
sNew contents of the element

Implements Valuable::ArchiveElementImpl.

virtual void Valuable::XMLArchiveElement::setName ( const QString &  name)
virtual

Sets the element name.

Parameters
nameThe new name of the element

Implements Valuable::ArchiveElementImpl.

const DOMElement* Valuable::XMLArchiveElement::xml ( ) const

Returns a pointer to the wrapped DOMElement.

Returns
The wrapped DOMElement