I currently use C++ to do some graph related computation using boost::graph. boost::graph can output its graph as a dot file and I use a std::stringstream to capture the output dot file. Thus the contents of the dot file resides in memory.
I want to use the dot file to visualize the graph (as fast as possible). Thus I want to generate the dot file, generate an svg file and print it onto some canvas. I want to avoid using temporary files for this, as the graphs shall be small and memory is available anyway.
However graphviz libgraph has only the function extern Agraph_t *agread(FILE *);
the only way I can imagine to make this working is to hack around in the filehandle struct __FILE
which is really not portable.
How would you let a library read you memory contents as a file in Unix/linux?
I just found out that libcgraph from GraphViz allows to enter a overloaded version here, but so far the documentation doesn't point me to some usefull place.