@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. #include <lemon/lemon_writer.h>
Public Member Functions | |
AttributeWriter (LemonWriter &_writer, const std::string &_name=std::string()) | |
Constructor. | |
virtual | ~AttributeWriter () |
Destructor. | |
template<typename Value > | |
AttributeWriter & | writeAttribute (std::string label, const Value &value) |
template<typename ItemWriter , typename Value > | |
AttributeWriter & | writeAttribute (std::string label, const Value &value, const ItemWriter &iw=ItemWriter()) |
Protected Member Functions | |
std::string | header () |
The header of section. | |
void | write (std::ostream &os) |
Writer function of the section. | |
virtual bool | valid () |
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.
AttributeWriter& writeAttribute | ( | std::string | label, | |
const Value & | value | |||
) | [inline] |
Add an attribute writer command for the writer.
AttributeWriter& writeAttribute | ( | std::string | label, | |
const Value & | value, | |||
const ItemWriter & | iw = ItemWriter() | |||
) | [inline] |
Add an attribute writer command for the writer.
std::string header | ( | ) | [inline, protected, virtual] |
It gives back the header of the section.
Implements SectionWriter.
void write | ( | std::ostream & | os | ) | [inline, protected, virtual] |
Write the content of the section.
Implements SectionWriter.
virtual bool valid | ( | ) | [inline, protected, virtual] |
Gives back true when the section should be written.
Reimplemented from SectionWriter.