src/lemon/graph_writer.h
changeset 1355 57936f15055b
parent 1333 2640cf6547ff
child 1359 1581f961cfaa
equal deleted inserted replaced
9:c8bbf2f05176 10:a9a4f8ce6ebd
   380 
   380 
   381     }
   381     }
   382 
   382 
   383     void writeEdgeSet(WriterBase<Node>* nodeWriter, 
   383     void writeEdgeSet(WriterBase<Node>* nodeWriter, 
   384 		      WriterBase<Edge>* & edgeWriter) {
   384 		      WriterBase<Edge>* & edgeWriter) {
       
   385       if (edge_map_writers.size() == 0) return;
   385       if (nodeWriter == 0) {
   386       if (nodeWriter == 0) {
   386 	throw DataFormatError("Cannot find node id map");
   387 	throw DataFormatError("Cannot find node id map");
   387       }
   388       }
   388       os << "@edgeset" << std::endl;
   389       os << "@edgeset" << std::endl;
   389       os << "\t\t";
   390       os << "\t\t";
   404 	os << std::endl;
   405 	os << std::endl;
   405       }
   406       }
   406     }
   407     }
   407 
   408 
   408     void writeNodes(WriterBase<Node>* nodeWriter) {
   409     void writeNodes(WriterBase<Node>* nodeWriter) {
       
   410       if (node_writers.size() == 0) return;
   409       if (nodeWriter == 0) {
   411       if (nodeWriter == 0) {
   410 	throw DataFormatError("Cannot find node id map");
   412 	throw DataFormatError("Cannot find node id map");
   411       }
   413       }
   412       os << "@nodes" << std::endl;
   414       os << "@nodes" << std::endl;
   413       for (int i = 0; i < (int)node_writers.size(); ++i) {
   415       for (int i = 0; i < (int)node_writers.size(); ++i) {
   416 	os << std::endl;
   418 	os << std::endl;
   417       } 
   419       } 
   418     }
   420     }
   419 
   421 
   420     void writeEdges(WriterBase<Edge>* edgeWriter) {
   422     void writeEdges(WriterBase<Edge>* edgeWriter) {
       
   423       if (edge_writers.size() == 0) return;
   421       if (edgeWriter == 0) {
   424       if (edgeWriter == 0) {
   422 	throw DataFormatError("Cannot find node id map");
   425 	throw DataFormatError("Cannot find node id map");
   423       }
   426       }
   424       os << "@edges" << std::endl;
   427       os << "@edges" << std::endl;
   425       for (int i = 0; i < (int)edge_writers.size(); ++i) {
   428       for (int i = 0; i < (int)edge_writers.size(); ++i) {