1 /* Copyright 2005 Sun Microsystems, Inc. */
3 #include "FileLoggerImpl.hxx"
11 FileLoggerImpl::FileLoggerImpl(const string
& fileName
) :
12 file_(fileName
.c_str())
15 throw "Cannot open file";
18 void FileLoggerImpl::beginTree()
20 file_
<< "digraph {" << endl
;
23 void FileLoggerImpl::endTree()
28 void FileLoggerImpl::beginNode(const std::string
& nodeId
, const std::string
& value
, const std::string
& refersToNodeId
, bool inUse
)
30 if (!nodeStack_
.empty())
33 file_
<< nodeId
<< " [ label=\"(" << value
<< ")\", shape=box, color=grey, style=filled ];"<< endl
;
35 file_
<< nodeId
<< " [ label=\"(" << value
<< ")\" ];"<< endl
;
37 file_
<< nodeStack_
.top() << " -> " << nodeId
<< ";" << endl
;
39 if (!refersToNodeId
.empty())
40 file_
<< nodeId
<< " -> " << refersToNodeId
<< " [ color=grey, weight=0 ];" << endl
;
44 file_
<< nodeId
<< " [ label=\"(" << value
<< ")\", shape=diamond ];"<< endl
;
46 nodeStack_
.push(nodeId
);
49 void FileLoggerImpl::endNode(const std::string
& nodeId
)