# HG changeset patch # User Alpar Juttner # Date 1223642180 -3600 # Node ID f227a74db59da11ec58e106a3c2898ac9c6a923a # Parent 3a44a2bb6da81824b1a4ae178adab279b571116f Update to compile with the latest LEMON (version 1.0 or [5e12d7734036]) diff -r 3a44a2bb6da8 -r f227a74db59d io_helper.cc --- a/io_helper.cc Wed Aug 13 17:24:25 2008 +0100 +++ b/io_helper.cc Fri Oct 10 13:36:20 2008 +0100 @@ -27,7 +27,7 @@ } else { - throw DataFormatError("Bad format"); + throw FormatError("Bad format"); } } } diff -r 3a44a2bb6da8 -r f227a74db59d mapstorage.cc --- a/mapstorage.cc Wed Aug 13 17:24:25 2008 +0100 +++ b/mapstorage.cc Fri Oct 10 13:36:20 2008 +0100 @@ -722,7 +722,7 @@ // write .lgf file { - DigraphWriter gwriter(filename, digraph); + DigraphWriter gwriter(digraph, filename); gwriter.nodeMap("label", node_label); gwriter.arcMap("label", arc_label); @@ -826,7 +826,7 @@ // write .conf file if (gui_sect_save_dest == CONF_FILE) { - DigraphWriter lwriter(filename + ".conf", digraph); + DigraphWriter lwriter(digraph, filename + ".conf"); GuiWriter gui_writer(this); gui_writer.write(lwriter.ostream()); lwriter.run(); @@ -1337,7 +1337,7 @@ using std::map; using std::string; - DigraphReader greader(filename, digraph); + DigraphReader greader(digraph, filename); // read the label maps greader.nodeMap("label", node_label); @@ -1460,7 +1460,10 @@ { if(active_nodemaps[N_RADIUS]!="") { - _nodeSizes=getNumericNodeMap(active_nodemaps[N_RADIUS]); + const Digraph::NodeMap &temp = + getNumericNodeMap(active_nodemaps[N_RADIUS]); + for(NodeIt n(digraph);n!=INVALID;++n) + _nodeSizes[n]= temp[n]; } if(active_nodemaps[N_COLOR]!="") { @@ -1483,7 +1486,10 @@ { if(active_arcmaps[E_WIDTH]!="") { - _arcWidths=getNumericArcMap(active_arcmaps[E_WIDTH]); + const Digraph::ArcMap &temp = + getNumericArcMap(active_arcmaps[E_WIDTH]); + for(ArcIt a(digraph);a!=INVALID;++a) + _arcWidths[a]=temp[a]; } if(active_arcmaps[E_COLOR]!="") { diff -r 3a44a2bb6da8 -r f227a74db59d xml.h --- a/xml.h Wed Aug 13 17:24:25 2008 +0100 +++ b/xml.h Fri Oct 10 13:36:20 2008 +0100 @@ -25,6 +25,7 @@ #include #include #include +#include #include namespace lemon { @@ -74,7 +75,7 @@ if(write()) if(level>=0) indent(level); else level=0; - else throw LogicError(); + else LEMON_ASSERT(true, "Invalid indentation."); } ///Read/write a tag @@ -159,7 +160,7 @@ void skipWhiteSpaces() { - if(write()) throw LogicError(); + if(write()) LEMON_ASSERT(true, "Can't skip whitespaces in write mode."); { char c; while (is.get(c) && std::isspace(c,is.getloc())) @@ -180,7 +181,7 @@ /// void useTag(const std::string &_tag) { if(nextTag()==_tag) useTag(); - else throw DataFormatError("",line_number,"Unexpected token name"); + else throw FormatError("Unexpected token name","",line_number); } public: ///Return the next tag (if a tag follows on the stream). @@ -189,16 +190,16 @@ /// const std::string &nextTag() { - if(write()) throw LogicError(); + if(write()) LEMON_ASSERT(true,"Don't use nextTag() in write mode"); else if(next_tag.empty()) { char c; skipWhiteSpaces(); if(!is.get(c) || c!='<') - throw DataFormatError("",line_number,"Bad format"); + throw FormatError("Bad format","",line_number); next_tag.clear(); while (is.get(c) && c!='>') next_tag.push_back(c); if(c!='>') - throw DataFormatError("",line_number,"Bad format"); + throw FormatError("Bad format","",line_number); } return next_tag; } @@ -229,7 +230,7 @@ else { skipWhiteSpaces(); if(!(is >> const_cast(v))) - throw DataFormatError("",line_number,"Not an 'int'"); + throw FormatError("Not an 'int'","",line_number); } return *this; } @@ -239,7 +240,7 @@ else { skipWhiteSpaces(); if(!(is >> const_cast(v))) - throw DataFormatError("",line_number,"Not an 'double'"); + throw FormatError("Not an 'double'","",line_number); } return *this; } @@ -271,7 +272,7 @@ while (is.get(c) && c!='<') if(c=='\\') if(!is.get(c)) - throw DataFormatError("",line_number,"Bad string"); + throw FormatError("Bad string","",line_number); else switch(c) { case 'n': w.push_back('\n'); @@ -285,7 +286,7 @@ w.push_back(c); } if(c!='<') - throw DataFormatError("",line_number,"Unexpected eof"); + throw FormatError("Unexpected eof","",line_number); is.unget(); } return *this; @@ -425,7 +426,7 @@ ///\relates XmlIo /// template - void xml(XmlIo &x,lemon::dim2::BoundingBox &v) + void xml(XmlIo &x,lemon::dim2::Box &v) { if(x.write()) { if(!v.empty()) {