lemon/lgf_reader.h
changeset 315 c175e387da19
parent 295 7c796c1cf1b0
child 319 5e12d7734036
equal deleted inserted replaced
31:6065c702c94a 32:5e7cc05e56fe
   389   }
   389   }
   390 
   390 
   391   template <typename Digraph>
   391   template <typename Digraph>
   392   class DigraphReader;
   392   class DigraphReader;
   393 
   393 
       
   394   /// \brief Return a \ref DigraphReader class
       
   395   ///
       
   396   /// This function just returns a \ref DigraphReader class.
       
   397   /// \relates DigraphReader
   394   template <typename Digraph>
   398   template <typename Digraph>
   395   DigraphReader<Digraph> digraphReader(Digraph& digraph,
   399   DigraphReader<Digraph> digraphReader(Digraph& digraph,
   396                                        std::istream& is = std::cin);
   400                                        std::istream& is = std::cin) {
   397 
   401     DigraphReader<Digraph> tmp(digraph, is);
       
   402     return tmp;
       
   403   }
       
   404 
       
   405   /// \brief Return a \ref DigraphReader class
       
   406   ///
       
   407   /// This function just returns a \ref DigraphReader class.
       
   408   /// \relates DigraphReader
   398   template <typename Digraph>
   409   template <typename Digraph>
   399   DigraphReader<Digraph> digraphReader(Digraph& digraph, const std::string& fn);
   410   DigraphReader<Digraph> digraphReader(Digraph& digraph,
   400 
   411                                        const std::string& fn) {
       
   412     DigraphReader<Digraph> tmp(digraph, fn);
       
   413     return tmp;
       
   414   }
       
   415 
       
   416   /// \brief Return a \ref DigraphReader class
       
   417   ///
       
   418   /// This function just returns a \ref DigraphReader class.
       
   419   /// \relates DigraphReader
   401   template <typename Digraph>
   420   template <typename Digraph>
   402   DigraphReader<Digraph> digraphReader(Digraph& digraph, const char *fn);
   421   DigraphReader<Digraph> digraphReader(Digraph& digraph, const char* fn) {
       
   422     DigraphReader<Digraph> tmp(digraph, fn);
       
   423     return tmp;
       
   424   }
   403 
   425 
   404   /// \ingroup lemon_io
   426   /// \ingroup lemon_io
   405   ///
   427   ///
   406   /// \brief \ref lgf-format "LGF" reader for directed graphs
   428   /// \brief \ref lgf-format "LGF" reader for directed graphs
   407   ///
   429   ///
  1187 
  1209 
  1188     /// @}
  1210     /// @}
  1189 
  1211 
  1190   };
  1212   };
  1191 
  1213 
  1192   /// \brief Return a \ref DigraphReader class
  1214   template <typename Graph>
       
  1215   class GraphReader;
       
  1216 
       
  1217   /// \brief Return a \ref GraphReader class
  1193   ///
  1218   ///
  1194   /// This function just returns a \ref DigraphReader class.
  1219   /// This function just returns a \ref GraphReader class.
  1195   /// \relates DigraphReader
  1220   /// \relates GraphReader
  1196   template <typename Digraph>
  1221   template <typename Graph>
  1197   DigraphReader<Digraph> digraphReader(Digraph& digraph,
  1222   GraphReader<Graph> graphReader(Graph& graph, std::istream& is = std::cin) {
  1198                                        std::istream& is = std::cin) {
  1223     GraphReader<Graph> tmp(graph, is);
  1199     DigraphReader<Digraph> tmp(digraph, is);
       
  1200     return tmp;
  1224     return tmp;
  1201   }
  1225   }
  1202 
  1226 
  1203   /// \brief Return a \ref DigraphReader class
  1227   /// \brief Return a \ref GraphReader class
  1204   ///
  1228   ///
  1205   /// This function just returns a \ref DigraphReader class.
  1229   /// This function just returns a \ref GraphReader class.
  1206   /// \relates DigraphReader
  1230   /// \relates GraphReader
  1207   template <typename Digraph>
  1231   template <typename Graph>
  1208   DigraphReader<Digraph> digraphReader(Digraph& digraph,
  1232   GraphReader<Graph> graphReader(Graph& graph, const std::string& fn) {
  1209                                        const std::string& fn) {
  1233     GraphReader<Graph> tmp(graph, fn);
  1210     DigraphReader<Digraph> tmp(digraph, fn);
       
  1211     return tmp;
  1234     return tmp;
  1212   }
  1235   }
  1213 
  1236 
  1214   /// \brief Return a \ref DigraphReader class
  1237   /// \brief Return a \ref GraphReader class
  1215   ///
  1238   ///
  1216   /// This function just returns a \ref DigraphReader class.
  1239   /// This function just returns a \ref GraphReader class.
  1217   /// \relates DigraphReader
  1240   /// \relates GraphReader
  1218   template <typename Digraph>
  1241   template <typename Graph>
  1219   DigraphReader<Digraph> digraphReader(Digraph& digraph, const char* fn) {
  1242   GraphReader<Graph> graphReader(Graph& graph, const char* fn) {
  1220     DigraphReader<Digraph> tmp(digraph, fn);
  1243     GraphReader<Graph> tmp(graph, fn);
  1221     return tmp;
  1244     return tmp;
  1222   }
  1245   }
  1223 
       
  1224   template <typename Graph>
       
  1225   class GraphReader;
       
  1226 
       
  1227   template <typename Graph>
       
  1228   GraphReader<Graph> graphReader(Graph& graph,
       
  1229                                  std::istream& is = std::cin);
       
  1230 
       
  1231   template <typename Graph>
       
  1232   GraphReader<Graph> graphReader(Graph& graph, const std::string& fn);
       
  1233 
       
  1234   template <typename Graph>
       
  1235   GraphReader<Graph> graphReader(Graph& graph, const char *fn);
       
  1236 
  1246 
  1237   /// \ingroup lemon_io
  1247   /// \ingroup lemon_io
  1238   ///
  1248   ///
  1239   /// \brief \ref lgf-format "LGF" reader for undirected graphs
  1249   /// \brief \ref lgf-format "LGF" reader for undirected graphs
  1240   ///
  1250   ///
  2028     }
  2038     }
  2029 
  2039 
  2030     /// @}
  2040     /// @}
  2031 
  2041 
  2032   };
  2042   };
  2033 
       
  2034   /// \brief Return a \ref GraphReader class
       
  2035   ///
       
  2036   /// This function just returns a \ref GraphReader class.
       
  2037   /// \relates GraphReader
       
  2038   template <typename Graph>
       
  2039   GraphReader<Graph> graphReader(Graph& graph, std::istream& is = std::cin) {
       
  2040     GraphReader<Graph> tmp(graph, is);
       
  2041     return tmp;
       
  2042   }
       
  2043 
       
  2044   /// \brief Return a \ref GraphReader class
       
  2045   ///
       
  2046   /// This function just returns a \ref GraphReader class.
       
  2047   /// \relates GraphReader
       
  2048   template <typename Graph>
       
  2049   GraphReader<Graph> graphReader(Graph& graph, const std::string& fn) {
       
  2050     GraphReader<Graph> tmp(graph, fn);
       
  2051     return tmp;
       
  2052   }
       
  2053 
       
  2054   /// \brief Return a \ref GraphReader class
       
  2055   ///
       
  2056   /// This function just returns a \ref GraphReader class.
       
  2057   /// \relates GraphReader
       
  2058   template <typename Graph>
       
  2059   GraphReader<Graph> graphReader(Graph& graph, const char* fn) {
       
  2060     GraphReader<Graph> tmp(graph, fn);
       
  2061     return tmp;
       
  2062   }
       
  2063 
  2043 
  2064   class SectionReader;
  2044   class SectionReader;
  2065 
  2045 
  2066   SectionReader sectionReader(std::istream& is);
  2046   SectionReader sectionReader(std::istream& is);
  2067   SectionReader sectionReader(const std::string& fn);
  2047   SectionReader sectionReader(const std::string& fn);