AttributeReader< _Traits > Class Template Reference
[Section readers and writers]


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_name, but the attributeset_name may be empty.

The attributeset section contains several lines. Each of them starts with an attribute and then a the value for the id. #include <lemon/lemon_reader.h>

Inheritance diagram for AttributeReader< _Traits >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 AttributeReader (LemonReader &_reader, const std::string &_name=std::string())
 Constructor.
virtual ~AttributeReader ()
 Destructor.
template<typename Value >
AttributeReaderreadAttribute (const std::string &label, Value &value)
template<typename ItemReader , typename Value >
AttributeReaderreadAttribute (const std::string &label, Value &value, const ItemReader &ir=ItemReader())

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 &  _name = 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_name and the _name are the same.

virtual ~AttributeReader (  )  [inline, virtual]

Destructor for AttributeReader.


Member Function Documentation

AttributeReader& readAttribute ( const std::string &  label,
Value &  value 
) [inline]

Add an attribute reader command for the reader.

AttributeReader& readAttribute ( const std::string &  label,
Value &  value,
const ItemReader &  ir = ItemReader() 
) [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 SectionReader.

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

It reads the content of the section.

Implements SectionReader.


Generated on Thu Jun 4 04:05:07 2009 for LEMON by  doxygen 1.5.9