AttributeWriter Class Template Reference
[Section readers and writers]

#include <lemon/lemon_writer.h>

Inherits LemonWriter::SectionWriter.

Inheritance diagram for AttributeWriter:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename _Traits = DefaultWriterTraits>
class lemon::AttributeWriter< _Traits >

The lemon format can store multiple attribute set. Each set has the header line @attributes attributes_name, but the attributeset_name may be empty.

The attributeset section contains several lines. Each of them starts with the name of attribute and then the value.


Public Member Functions

 AttributeWriter (LemonWriter &_writer, const std::string &_name=std::string())
 Constructor.
virtual ~AttributeWriter ()
 Destructor.
template<typename Value>
AttributeWriterwriteAttribute (const std::string &name, const Value &value)
 Add an attribute writer command for the writer.
template<typename Writer, typename Value>
AttributeWriterwriteAttribute (const std::string &name, const Value &value, const Writer &writer=Writer())
 Add an attribute writer command for the writer.

Protected Member Functions

std::string header ()
 The header of section.
void write (std::ostream &os)
 Writer function of the section.
virtual bool valid ()
 Gives back true when the section should be written.


Constructor & Destructor Documentation

AttributeWriter ( LemonWriter _writer,
const std::string &  _name = std::string() 
) [inline]

Constructor for AttributeWriter. It creates the AttributeWriter and attach it into the given LemonWriter.

virtual ~AttributeWriter (  )  [inline, virtual]

Destructor for AttributeWriter.


Member Function Documentation

AttributeWriter& writeAttribute ( const std::string &  name,
const Value &  value 
) [inline]

Add an attribute writer command for the writer.

AttributeWriter& writeAttribute ( const std::string &  name,
const Value &  value,
const Writer &  writer = Writer() 
) [inline]

Add an attribute writer command for the writer.

std::string header (  )  [inline, protected, virtual]

It gives back the header of the section.

Implements LemonWriter::SectionWriter.

void write ( std::ostream &  os  )  [inline, protected, virtual]

Write the content of the section.

Implements LemonWriter::SectionWriter.

virtual bool valid (  )  [inline, protected, virtual]

Gives back true when the section should be written.

Reimplemented from LemonWriter::SectionWriter.


The documentation for this class was generated from the following file:
Generated on Tue Oct 31 09:51:01 2006 for LEMON by  doxygen 1.5.1