Ticket #3027: t.cpp

File t.cpp, 584 bytes (added by Dmitry <dmitry@…>, 13 years ago)
Line 
1#include <cassert>
2#include <iostream>
3#include <boost/graph/adjacency_list.hpp>
4#include <boost/graph/graphviz.hpp>
5#include <boost/graph/graph_utility.hpp>
6
7using namespace boost;
8
9typedef adjacency_list<vecS, vecS, directedS, property<vertex_name_t, std::string> > graph_t;
10
11int main()
12{
13 std::ifstream ifs("a.dot");
14 assert(ifs.good());
15 dynamic_properties p;
16 graph_t g;
17 p.property("id", get(vertex_name, g));
18 read_graphviz(ifs, g, p, "id");
19 assert(num_vertices(g) == 2);
20 print_graph(g, get(vertex_name, g));
21 write_graphviz(std::cout, g, p, std::string("id"));
22 return 0;
23}