89 Code(
string const& c) :
string{c} { }
90 Code(
string && c) :
string{move(c)}{ }
97 std::vector<string> lines;
104 operator+= (
Code const& code)
106 lines.emplace_back(code);
119 :
Code{
"N"+toString(
id)}
123 addAttrib (
string def)
139 return addAttrib (
"label=\""+text+
"\"");
143 style (
Code const& code)
156 :
Code{
"{ /*"+toString(
id)+
"*/ }"}
160 add (
Code const& code)
168 rank (
string rankSetting)
170 return add(
Code{
"rank="+rankSetting});
174 inline Node node (
size_t id) {
return Node(
id); }
175 inline Scope scope (
size_t id) {
return Scope(
id); }
188 std::ostringstream buff_;
190 static uint
const IDENT_STEP = 2;
193 putLine (
string line, uint indent=0)
196 buff_ << string(indent,
' ');
202 put (
Code const& code)
210 for (
string const& line : sect.lines)
211 putLine (line, IDENT_STEP);
214 template<
class P,
class...PS>
216 put (
P const& part, PS
const& ...parts)
224 operator string()
const 235 template<
class...COD>
240 script.putLine (
Code{
"digraph {"});
241 script.put (parts...);
242 script.putLine (
Code{
"}"});
generate a Node name or a node_statement defining attributes of that node.
Accumulator to collect lines of DOT code.
Code connect(size_t src, size_t dest)
generate a directed node connectivity clause
Implementation namespace for support and library code.
markup to generate a piece of code
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
accumulator to collect nodes grouped into a scope
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Helper to collect DOT-Graphviz code for output.
DotOut digraph(COD ...parts)
Entrance-point: generate a graph spec in DOT-Language.