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

AttributeReader Class Template Reference
[Input Output]

#include <lemon/lemon_reader.h>

Inherits CommonSectionReaderBase.

Inheritance diagram for AttributeReader:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename _Traits = DefaultReaderTraits>
class lemon::AttributeReader< _Traits >

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

The attributeset section contains several lines. Each of them starts with an attribute and then a the value for the id.


Public Member Functions

 AttributeReader (LemonReader &_reader, const std::string &_id=std::string())
 Constructor.
virtual ~AttributeReader ()
 Destructor.
template<typename Value>
AttributeReaderreadAttribute (const std::string &id, Value &value)
 Add an attribute reader command for the reader.
template<typename Reader, typename Value>
AttributeReaderreadAttribute (const std::string &name, Value &value, const Reader &reader=Reader())
 Add an attribute reader command for the reader.

Protected Member Functions

bool header (const std::string &line)
 Gives back true when the SectionReader can process the section with the given header line.
void read (std::istream &is)
 Reader function of the section.


Constructor & Destructor Documentation

AttributeReader LemonReader _reader,
const std::string _id = std::string()
[inline]
 

Constructor for AttributeReader. It creates the AttributeReader and attach it into the given LemonReader. The reader process a section only if the section_id and the _id are the same.

virtual ~AttributeReader  )  [inline, virtual]
 

Destructor for AttributeReader.


Member Function Documentation

AttributeReader& readAttribute const std::string id,
Value &  value
[inline]
 

Add an attribute reader command for the reader.

AttributeReader& readAttribute const std::string name,
Value &  value,
const Reader &  reader = Reader()
[inline]
 

Add an attribute reader command for the reader.

bool header const std::string line  )  [inline, protected, virtual]
 

It gives back true when the header line start with @attributes, and the header line's id and the attributeset's id are the same.

Implements LemonReader::SectionReader.

void read std::istream is  )  [inline, protected, virtual]
 

It reads the content of the section.

Implements LemonReader::SectionReader.


The documentation for this class was generated from the following file:
Generated on Sat Aug 27 14:15:48 2005 for LEMON by  doxygen 1.4.4