80 Code(
string const& c) :
string{c} { }
81 Code(
string && c) :
string{move(c)}{ }
88 std::vector<string> lines;
95 operator+= (
Code const& code)
97 lines.emplace_back(code);
110 :
Code{
"N"+toString(
id)}
114 addAttrib (
string def)
130 return addAttrib (
"label=\""+text+
"\"");
134 style (
Code const& code)
147 :
Code{
"{ /*"+toString(
id)+
"*/ }"}
151 add (
Code const& code)
159 rank (
string rankSetting)
161 return add(
Code{
"rank="+rankSetting});
165 inline Node node (
size_t id) {
return Node(
id); }
166 inline Scope scope (
size_t id) {
return Scope(
id); }
179 std::ostringstream buff_;
181 static uint
const IDENT_STEP = 2;
184 putLine (
string line, uint indent=0)
187 buff_ << string(indent,
' ');
193 put (
Code const& code)
201 for (
string const& line : sect.lines)
202 putLine (line, IDENT_STEP);
205 template<
class P,
class...PS>
207 put (
P const& part, PS
const& ...parts)
215 operator string()
const 226 template<
class...COD>
231 script.putLine (
Code{
"digraph {"});
232 script.put (parts...);
233 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.