# HG changeset patch # User deba # Date 1175264248 0 # Node ID 261b4701405d42284633f813b8ad1a586bb4f011 # Parent ef13597d249a04e45956ec6c4d9f7551565235a6 Small improvments diff -r ef13597d249a -r 261b4701405d demo/reader_writer_demo.cc --- a/demo/reader_writer_demo.cc Tue Mar 27 09:23:33 2007 +0000 +++ b/demo/reader_writer_demo.cc Fri Mar 30 14:17:28 2007 +0000 @@ -39,9 +39,11 @@ try { std::string filename="sample.lgf"; + std::string name; GraphReader reader(filename,graph); SmartGraph::EdgeMap cap(graph); reader.readEdgeMap("capacity",cap); + reader.readAttribute("name",name); reader.run(); std::cout << "Hello! We have read a graph from file " << filename<< @@ -51,6 +53,7 @@ GraphWriter writer(std::cout, graph); writer.writeEdgeMap("multiplicity", cap); + writer.writeAttribute("name",name); writer.run(); } catch (DataFormatError& error) { diff -r ef13597d249a -r 261b4701405d demo/sample.lgf --- a/demo/sample.lgf Tue Mar 27 09:23:33 2007 +0000 +++ b/demo/sample.lgf Fri Mar 30 14:17:28 2007 +0000 @@ -20,6 +20,7 @@ source 0 target 5 @edges -@attributes +@attributes +name "Simple Sample Graph" author "Attila BERNATH" @end diff -r ef13597d249a -r 261b4701405d lemon/lemon_reader.h --- a/lemon/lemon_reader.h Tue Mar 27 09:23:33 2007 +0000 +++ b/lemon/lemon_reader.h Fri Mar 30 14:17:28 2007 +0000 @@ -1951,16 +1951,16 @@ /// /// Add an attribute reader command for the reader. template - AttributeReader& readAttribute(const std::string& id, Value& value) { + AttributeReader& readAttribute(const std::string& label, Value& value) { return readAttribute > - (id, value); + (label, value); } /// \brief Add an attribute reader command for the reader. /// /// Add an attribute reader command for the reader. template - AttributeReader& readAttribute(std::string label, Value& value, + AttributeReader& readAttribute(const std::string& label, Value& value, const ItemReader& ir = ItemReader()) { checkConcept<_reader_bits::ItemReader, ItemReader>(); if (readers.find(label) != readers.end()) { @@ -2012,7 +2012,7 @@ } } } - + virtual void missing() { if (readers.empty()) return; ErrorMessage msg;