5 #include "Operations.h" 17 bool Load_TGF(std::istream& in,Graph<std::string,std::string>& G);
22 void Save_TGF(std::ostream& o,
const Graph<std::string,std::string>& G);
27 template <
class N,
class E>
31 for(
size_t i=0;i<G.nodes.size();i++) {
34 Gs.nodes[i] = ss.str();
41 template <
class N,
class E>
45 for(
size_t i=0;i<G.nodes.size();i++) {
46 std::stringstream ss(Gs.nodes[i]);
48 if(ss.bad())
return false;
56 template <
class N,
class E>
60 for(
size_t i=0;i<G.nodes.size();i++) {
63 Gs.nodes[i] = ss.str();
65 for(
size_t i=0;i<G.nodes.size();i++) {
83 template <
class N,
class E>
87 for(
size_t i=0;i<G.nodes.size();i++) {
88 std::stringstream ss(Gs.nodes[i]);
90 if(ss.bad())
return false;
92 for(
size_t i=0;i<G.nodes.size();i++) {
98 std::stringstream ss(*es);
100 if(ss.bad())
return false;
void NodesToStrings(const Graph< N, E > &G, Graph< std::string, std::string > &Gs)
Serializes the graph's nodes using the ostream << operator.
Definition: graph/IO.h:28
void NodesEdgesToStrings(const Graph< N, E > &G, Graph< std::string, std::string > &Gs)
Serializes the graph's nodes and edges using the ostream << operator.
Definition: graph/IO.h:57
bool Load_TGF(std::istream &in, Graph< std::string, std::string > &G)
Loads a graph from the Trivial Graph Format.
Definition: graph/IO.cpp:6
void CopyStructure(const Graph< N1, E1 > &G1, Graph< N2, E2 > &G2)
Copies the edge structure of G1 to G2 without setting its data.
Definition: Operations.h:14
void Save_TGF(std::ostream &o, const Graph< std::string, std::string > &G)
Saves a graph to the Trivial Graph Format.
Definition: graph/IO.cpp:55
bool NodesEdgesFromStrings(const Graph< std::string, std::string > &Gs, Graph< N, E > &G)
De-serializes the graph's nodes and edges using the istream >> operator.
Definition: graph/IO.h:84
bool NodesFromStrings(const Graph< std::string, std::string > &Gs, Graph< N, E > &G)
De-serializes the graph's nodes using the istream >> operator.
Definition: graph/IO.h:42
Namespace for all classes and functions in the Graph subdirectory.
Definition: ApproximateShortestPaths.h:7
Utilities for string manipulation.
Basic template graph structure.
Definition: Graph.h:47