All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Valuable::ArchiveElementImpl Class Referenceabstract

Interface for classes that want to implement ArchiveElement API ArchiveElement has a name, list of children, map of (name -> value) -pairs, and the content string. More...

#include <Valuable/Archive.hpp>

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

Public Member Functions

virtual void add (ArchiveElementImpl &element)=0
 Adds a new child element to this element. More...
 
virtual void add (const QString &name, const QString &value)=0
 Writes a new named attribute. More...
 
virtual ArchiveIterator children () const =0
 Access all child elements. More...
 
virtual QString get (const QString &name) const =0
 Reads a named attribute from the element. More...
 
virtual QString get () const =0
 Reads the element contents. More...
 
virtual QString name () const =0
 Reads the element name. More...
 
virtual void set (const QString &s)=0
 Writes the element contents. More...
 
virtual void setName (const QString &name)=0
 Sets the element name. More...
 
virtual ~ArchiveElementImpl ()
 Virtual destructor.
 

Detailed Description

Interface for classes that want to implement ArchiveElement API ArchiveElement has a name, list of children, map of (name -> value) -pairs, and the content string.

Every serialization format must provide a implementation of this class and use that to make new instances of ArchiveElement. All functions are called from ArchiveElement.

Member Function Documentation

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

Adds a new child element to this element.

Parameters
elementNew child element to be added

Implemented in Valuable::XMLArchiveElement.

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

Writes a new named attribute.

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

Implemented in Valuable::XMLArchiveElement.

virtual ArchiveIterator Valuable::ArchiveElementImpl::children ( ) const
pure virtual

Access all child elements.

Returns
The child iterator for all child elements.

Implemented in Valuable::XMLArchiveElement.

virtual QString Valuable::ArchiveElementImpl::get ( const QString &  name) const
pure 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.

Implemented in Valuable::XMLArchiveElement.

virtual QString Valuable::ArchiveElementImpl::get ( ) const
pure virtual

Reads the element contents.

Returns
The contents of the element

Implemented in Valuable::XMLArchiveElement.

virtual QString Valuable::ArchiveElementImpl::name ( ) const
pure virtual

Reads the element name.

Returns
The name of the element

Implemented in Valuable::XMLArchiveElement.

virtual void Valuable::ArchiveElementImpl::set ( const QString &  s)
pure virtual

Writes the element contents.

Parameters
sNew contents of the element

Implemented in Valuable::XMLArchiveElement.

virtual void Valuable::ArchiveElementImpl::setName ( const QString &  name)
pure virtual

Sets the element name.

Parameters
nameThe new name of the element

Implemented in Valuable::XMLArchiveElement.