#ifndef GRID_SERIALISATION_TEXT_READER_H #define GRID_SERIALISATION_TEXT_READER_H #include #include #include #include #include #include #include namespace Grid { class TextWriter : public Writer { private: std::ofstream file; int level; void indent(void) { for(int i=0;i void writeInternal( const std::string& s,const T output ){ indent(); file << std::boolalpha << output< void read( const std::string& s, std::vector &output ) { push(s); uint64_t n; read("N",n); // skip the vector length T tmp; output.resize(0); for(int i=0;i void readInternal( const std::string& path, T &output ){ std::string asString; read(path,asString); convert(asString,output); } template void convert(const std::string &asString,T &output) { std::istringstream is(asString); is.exceptions(std::ios::failbit); try { is >> std::boolalpha >> output; } catch(std::istringstream::failure e) { std::cerr << "XML read failure on "<<" "<