Commit 236dafb8 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

* fix bug with --save


git-svn-id: https://svn.forked.de/graph-tool/trunk@48 d4600afd-f417-0410-95de-beed9576f240
parent 999db6d6
......@@ -310,12 +310,11 @@ void GraphInterface::WriteToFile(string file)
void GraphInterface::WriteToFile(string file, string format)
{
bool graphviz = false;
if (format == "dot")
graphviz = true;
else if (format != "xml")
throw GraphException("error writing to file '" + file + "': requested invalid format '" + format + "'");
bool graphviz = false;
if (format == "dot")
graphviz = true;
else if (format != "xml")
throw GraphException("error writing to file '" + file + "': requested invalid format '" + format + "'");
try
{
boost::iostreams::filtering_stream<boost::iostreams::output> stream;
......@@ -381,15 +380,16 @@ void GraphInterface::WriteToFile(string file, string format)
if (GetDirected())
{
check_filter(*this,bind<void>(write_to_file(),var(stream),_1,_vertex_index,var(dp),graphviz),
reverse_check(),always_directed());
check_filter(*this,bind<void>(write_to_file(), var(stream), _1, _vertex_index, var(dp), graphviz),
reverse_check(), always_directed());
}
else
{
check_filter(*this,bind<void>(write_to_file_fake_undir(),var(stream),_1,_vertex_index,var(dp),graphviz),
check_filter(*this,bind<void>(write_to_file_fake_undir(), var(stream), _1, _vertex_index, var(dp), graphviz),
never_reversed(), always_undirected());
}
}
stream.reset();
}
catch (ios_base::failure &e)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment