1.1 --- a/io_helper.cc Wed Aug 13 17:24:25 2008 +0100
1.2 +++ b/io_helper.cc Fri Oct 10 13:36:20 2008 +0100
1.3 @@ -27,7 +27,7 @@
1.4 }
1.5 else
1.6 {
1.7 - throw DataFormatError("Bad format");
1.8 + throw FormatError("Bad format");
1.9 }
1.10 }
1.11 }
2.1 --- a/mapstorage.cc Wed Aug 13 17:24:25 2008 +0100
2.2 +++ b/mapstorage.cc Fri Oct 10 13:36:20 2008 +0100
2.3 @@ -722,7 +722,7 @@
2.4
2.5 // write .lgf file
2.6 {
2.7 - DigraphWriter<Digraph> gwriter(filename, digraph);
2.8 + DigraphWriter<Digraph> gwriter(digraph, filename);
2.9
2.10 gwriter.nodeMap("label", node_label);
2.11 gwriter.arcMap("label", arc_label);
2.12 @@ -826,7 +826,7 @@
2.13 // write .conf file
2.14 if (gui_sect_save_dest == CONF_FILE)
2.15 {
2.16 - DigraphWriter<Digraph> lwriter(filename + ".conf", digraph);
2.17 + DigraphWriter<Digraph> lwriter(digraph, filename + ".conf");
2.18 GuiWriter gui_writer(this);
2.19 gui_writer.write(lwriter.ostream());
2.20 lwriter.run();
2.21 @@ -1337,7 +1337,7 @@
2.22 using std::map;
2.23 using std::string;
2.24
2.25 - DigraphReader<Digraph> greader(filename, digraph);
2.26 + DigraphReader<Digraph> greader(digraph, filename);
2.27
2.28 // read the label maps
2.29 greader.nodeMap("label", node_label);
2.30 @@ -1460,7 +1460,10 @@
2.31 {
2.32 if(active_nodemaps[N_RADIUS]!="")
2.33 {
2.34 - _nodeSizes=getNumericNodeMap(active_nodemaps[N_RADIUS]);
2.35 + const Digraph::NodeMap<double> &temp =
2.36 + getNumericNodeMap(active_nodemaps[N_RADIUS]);
2.37 + for(NodeIt n(digraph);n!=INVALID;++n)
2.38 + _nodeSizes[n]= temp[n];
2.39 }
2.40 if(active_nodemaps[N_COLOR]!="")
2.41 {
2.42 @@ -1483,7 +1486,10 @@
2.43 {
2.44 if(active_arcmaps[E_WIDTH]!="")
2.45 {
2.46 - _arcWidths=getNumericArcMap(active_arcmaps[E_WIDTH]);
2.47 + const Digraph::ArcMap<double> &temp =
2.48 + getNumericArcMap(active_arcmaps[E_WIDTH]);
2.49 + for(ArcIt a(digraph);a!=INVALID;++a)
2.50 + _arcWidths[a]=temp[a];
2.51 }
2.52 if(active_arcmaps[E_COLOR]!="")
2.53 {
3.1 --- a/xml.h Wed Aug 13 17:24:25 2008 +0100
3.2 +++ b/xml.h Fri Oct 10 13:36:20 2008 +0100
3.3 @@ -25,6 +25,7 @@
3.4 #include <list>
3.5 #include <map>
3.6 #include <lemon/error.h>
3.7 +#include <lemon/assert.h>
3.8 #include <lemon/dim2.h>
3.9
3.10 namespace lemon {
3.11 @@ -74,7 +75,7 @@
3.12 if(write())
3.13 if(level>=0) indent(level);
3.14 else level=0;
3.15 - else throw LogicError();
3.16 + else LEMON_ASSERT(true, "Invalid indentation.");
3.17 }
3.18
3.19 ///Read/write a tag
3.20 @@ -159,7 +160,7 @@
3.21
3.22 void skipWhiteSpaces()
3.23 {
3.24 - if(write()) throw LogicError();
3.25 + if(write()) LEMON_ASSERT(true, "Can't skip whitespaces in write mode.");
3.26 {
3.27 char c;
3.28 while (is.get(c) && std::isspace(c,is.getloc()))
3.29 @@ -180,7 +181,7 @@
3.30 ///
3.31 void useTag(const std::string &_tag) {
3.32 if(nextTag()==_tag) useTag();
3.33 - else throw DataFormatError("",line_number,"Unexpected token name");
3.34 + else throw FormatError("Unexpected token name","",line_number);
3.35 }
3.36 public:
3.37 ///Return the next tag (if a tag follows on the stream).
3.38 @@ -189,16 +190,16 @@
3.39 ///
3.40 const std::string &nextTag()
3.41 {
3.42 - if(write()) throw LogicError();
3.43 + if(write()) LEMON_ASSERT(true,"Don't use nextTag() in write mode");
3.44 else if(next_tag.empty()) {
3.45 char c;
3.46 skipWhiteSpaces();
3.47 if(!is.get(c) || c!='<')
3.48 - throw DataFormatError("",line_number,"Bad format");
3.49 + throw FormatError("Bad format","",line_number);
3.50 next_tag.clear();
3.51 while (is.get(c) && c!='>') next_tag.push_back(c);
3.52 if(c!='>')
3.53 - throw DataFormatError("",line_number,"Bad format");
3.54 + throw FormatError("Bad format","",line_number);
3.55 }
3.56 return next_tag;
3.57 }
3.58 @@ -229,7 +230,7 @@
3.59 else {
3.60 skipWhiteSpaces();
3.61 if(!(is >> const_cast<int &>(v)))
3.62 - throw DataFormatError("",line_number,"Not an 'int'");
3.63 + throw FormatError("Not an 'int'","",line_number);
3.64 }
3.65 return *this;
3.66 }
3.67 @@ -239,7 +240,7 @@
3.68 else {
3.69 skipWhiteSpaces();
3.70 if(!(is >> const_cast<double &>(v)))
3.71 - throw DataFormatError("",line_number,"Not an 'double'");
3.72 + throw FormatError("Not an 'double'","",line_number);
3.73 }
3.74 return *this;
3.75 }
3.76 @@ -271,7 +272,7 @@
3.77 while (is.get(c) && c!='<')
3.78 if(c=='\\')
3.79 if(!is.get(c))
3.80 - throw DataFormatError("",line_number,"Bad string");
3.81 + throw FormatError("Bad string","",line_number);
3.82 else switch(c) {
3.83 case 'n':
3.84 w.push_back('\n');
3.85 @@ -285,7 +286,7 @@
3.86 w.push_back(c);
3.87 }
3.88 if(c!='<')
3.89 - throw DataFormatError("",line_number,"Unexpected eof");
3.90 + throw FormatError("Unexpected eof","",line_number);
3.91 is.unget();
3.92 }
3.93 return *this;
3.94 @@ -425,7 +426,7 @@
3.95 ///\relates XmlIo
3.96 ///
3.97 template<class T>
3.98 - void xml(XmlIo &x,lemon::dim2::BoundingBox<T> &v)
3.99 + void xml(XmlIo &x,lemon::dim2::Box<T> &v)
3.100 {
3.101 if(x.write()) {
3.102 if(!v.empty()) {