lemon/lgf_reader.h
changeset 218 0d6511647639
parent 210 81cfc04531e8
child 220 a5d8c039f218
equal deleted inserted replaced
23:352739603cdd 24:f4c81a24ed9a
   144       Value& _value;
   144       Value& _value;
   145       Converter _converter;
   145       Converter _converter;
   146 
   146 
   147     public:
   147     public:
   148       ValueStorage(Value& value, const Converter& converter = Converter())
   148       ValueStorage(Value& value, const Converter& converter = Converter())
   149          : _value(value), _converter(converter) {}
   149         : _value(value), _converter(converter) {}
   150 
   150 
   151       virtual void set(const std::string& value) {
   151       virtual void set(const std::string& value) {
   152         _value = _converter(value);
   152         _value = _converter(value);
   153       }
   153       }
   154     };
   154     };
   508     ///
   508     ///
   509     /// Construct a directed graph reader, which reads from the given
   509     /// Construct a directed graph reader, which reads from the given
   510     /// file.
   510     /// file.
   511     DigraphReader(const std::string& fn, Digraph& digraph)
   511     DigraphReader(const std::string& fn, Digraph& digraph)
   512       : _is(new std::ifstream(fn.c_str())), local_is(true), _digraph(digraph),
   512       : _is(new std::ifstream(fn.c_str())), local_is(true), _digraph(digraph),
   513             _use_nodes(false), _use_arcs(false),
   513         _use_nodes(false), _use_arcs(false),
   514         _skip_nodes(false), _skip_arcs(false) {}
   514         _skip_nodes(false), _skip_arcs(false) {}
   515 
   515 
   516     /// \brief Constructor
   516     /// \brief Constructor
   517     ///
   517     ///
   518     /// Construct a directed graph reader, which reads from the given
   518     /// Construct a directed graph reader, which reads from the given
   519     /// file.
   519     /// file.
   520     DigraphReader(const char* fn, Digraph& digraph)
   520     DigraphReader(const char* fn, Digraph& digraph)
   521       : _is(new std::ifstream(fn)), local_is(true), _digraph(digraph),
   521       : _is(new std::ifstream(fn)), local_is(true), _digraph(digraph),
   522             _use_nodes(false), _use_arcs(false),
   522         _use_nodes(false), _use_arcs(false),
   523         _skip_nodes(false), _skip_arcs(false) {}
   523         _skip_nodes(false), _skip_arcs(false) {}
   524 
   524 
   525     /// \brief Destructor
   525     /// \brief Destructor
   526     ~DigraphReader() {
   526     ~DigraphReader() {
   527       for (typename NodeMaps::iterator it = _node_maps.begin();
   527       for (typename NodeMaps::iterator it = _node_maps.begin();
  1292     ///
  1292     ///
  1293     /// Construct an undirected graph reader, which reads from the given
  1293     /// Construct an undirected graph reader, which reads from the given
  1294     /// file.
  1294     /// file.
  1295     GraphReader(const std::string& fn, Graph& graph)
  1295     GraphReader(const std::string& fn, Graph& graph)
  1296       : _is(new std::ifstream(fn.c_str())), local_is(true), _graph(graph),
  1296       : _is(new std::ifstream(fn.c_str())), local_is(true), _graph(graph),
  1297             _use_nodes(false), _use_edges(false),
  1297         _use_nodes(false), _use_edges(false),
  1298         _skip_nodes(false), _skip_edges(false) {}
  1298         _skip_nodes(false), _skip_edges(false) {}
  1299 
  1299 
  1300     /// \brief Constructor
  1300     /// \brief Constructor
  1301     ///
  1301     ///
  1302     /// Construct an undirected graph reader, which reads from the given
  1302     /// Construct an undirected graph reader, which reads from the given
  1303     /// file.
  1303     /// file.
  1304     GraphReader(const char* fn, Graph& graph)
  1304     GraphReader(const char* fn, Graph& graph)
  1305       : _is(new std::ifstream(fn)), local_is(true), _graph(graph),
  1305       : _is(new std::ifstream(fn)), local_is(true), _graph(graph),
  1306             _use_nodes(false), _use_edges(false),
  1306         _use_nodes(false), _use_edges(false),
  1307         _skip_nodes(false), _skip_edges(false) {}
  1307         _skip_nodes(false), _skip_edges(false) {}
  1308 
  1308 
  1309     /// \brief Destructor
  1309     /// \brief Destructor
  1310     ~GraphReader() {
  1310     ~GraphReader() {
  1311       for (typename NodeMaps::iterator it = _node_maps.begin();
  1311       for (typename NodeMaps::iterator it = _node_maps.begin();