diff -r 0e4f009eab8b -r 67188bd752db io_helper.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/io_helper.cc Mon Jul 07 08:10:39 2008 -0500 @@ -0,0 +1,34 @@ +#include "io_helper.h" + +namespace lemon { + void xml(XmlIo &x, MapValue::Type& v) + { + if(x.write()) { + switch (v) + { + case MapValue::NUMERIC: + { x("type", std::string("numeric")); } + break; + case MapValue::STRING: + { x("type", std::string("string")); } + break; + } + } + else { + std::string type; + { x("type", type); } + if (type == "numeric") + { + v = MapValue::NUMERIC; + } + else if (type == "string") + { + v = MapValue::STRING; + } + else + { + throw DataFormatError("Bad format"); + } + } + } +};