25 if (std::holds_alternative<std::string>(m.
value())) {
26 out << std::get<std::string>(m.
value());
29 out << YAML::BeginMap;
30 out << YAML::Key <<
"r" << YAML::Value
31 << std::get<regex>(m.
value()).pattern;
40 if (std::holds_alternative<common::model::namespace_>(m.value())) {
41 out << std::get<common::model::namespace_>(m.value());
44 out << YAML::BeginMap;
45 out << YAML::Key <<
"r" << YAML::Value
46 << std::get<regex>(m.value()).pattern;
115 out << YAML::BeginMap;
116 out << YAML::Key <<
"match";
117 out << YAML::BeginMap;
118 out << YAML::Key <<
"radius" << YAML::Value << c.
radius;
119 out << YAML::Key <<
"pattern" << YAML::Value << c.
pattern;
128 out << YAML::BeginMap;
130 out << YAML::Key <<
"namespaces" << YAML::Value << f.
namespaces;
132 out << YAML::Key <<
"modules" << YAML::Value << f.
modules;
134 out << YAML::Key <<
"module_access" << YAML::Value << f.
module_access;
136 out << YAML::Key <<
"access" << YAML::Value << f.
access;
138 out << YAML::Key <<
"context" << YAML::Value << f.
context;
140 out << YAML::Key <<
"dependants" << YAML::Value << f.
dependants;
142 out << YAML::Key <<
"dependencies" << YAML::Value << f.
dependencies;
144 out << YAML::Key <<
"elements" << YAML::Value << f.
elements;
146 out << YAML::Key <<
"element_types" << YAML::Value << f.
element_types;
148 out << YAML::Key <<
"method_types" << YAML::Value << f.
method_types;
149 if (!f.
paths.empty())
150 out << YAML::Key <<
"paths" << YAML::Value << f.
paths;
152 out << YAML::Key <<
"relationships" << YAML::Value << f.
relationships;
154 out << YAML::Key <<
"specializations" << YAML::Value
157 out << YAML::Key <<
"subclasses" << YAML::Value << f.
subclasses;
159 out << YAML::Key <<
"parents" << YAML::Value << f.
parents;
161 out << YAML::Key <<
"callee_types" << YAML::Value << f.
callee_types;
173 out << YAML::BeginMap;
175 out << YAML::Key <<
"before" << YAML::Value << p.
before;
176 if (!p.
after.empty())
177 out << YAML::Key <<
"after" << YAML::Value << p.
after;
179 out << YAML::Key <<
"cmd" << YAML::Value << p.
cmd;
180 if (!p.
style.empty())
181 out << YAML::Key <<
"style" << YAML::Value << p.
style;
194 out << YAML::BeginMap;
196 out << YAML::Key <<
"before" << YAML::Value << p.
before;
197 if (!p.
after.empty())
198 out << YAML::Key <<
"after" << YAML::Value << p.
after;
200 out << YAML::Key <<
"cmd" << YAML::Value << p.
cmd;
213 out << YAML::BeginMap;
214 out << YAML::Key <<
"notes" << YAML::Value << p.
notes;
222 out << to_string(ma);
228 out << YAML::BeginMap;
229 out << YAML::Key <<
"link" << YAML::Value << glc.
link;
230 out << YAML::Key <<
"tooltip" << YAML::Value << glc.
tooltip;
237 out << YAML::BeginMap;
238 out << YAML::Key <<
"branch" << YAML::Value << gc.
branch;
239 out << YAML::Key <<
"revision" << YAML::Value << gc.
revision;
240 out << YAML::Key <<
"commit" << YAML::Value << gc.
commit;
241 out << YAML::Key <<
"toplevel" << YAML::Value << gc.
toplevel;
249 out << YAML::BeginMap;
250 out << YAML::Key <<
"default" << YAML::Value << rh.
default_hint;
252 out << YAML::Key << k << YAML::Value << v;
265 out << to_string(cp);
270YAML::Emitter &
operator<<(YAML::Emitter &out,
const std::filesystem::path &p)
277 YAML::Emitter &out,
const std::vector<std::filesystem::path> &paths)
279 out << YAML::BeginSeq;
280 for (
const auto &p : paths)
289 out << YAML::BeginMap;
291 out << YAML::Key << c.
hint << YAML::Value;
292 if (std::holds_alternative<std::string>(c.
entity))
293 out << std::get<std::string>(c.
entity);
294 else if (std::holds_alternative<std::vector<std::string>>(c.
entity))
295 out << std::get<std::vector<std::string>>(c.
entity);
303 out << YAML::BeginMap;
304 out << YAML::Key << to_string(sc.
location_type) << YAML::Value
312 out << YAML::BeginMap;
313 out << YAML::Key <<
"include" << YAML::Value << g.
include;
314 out << YAML::Key <<
"exclude" << YAML::Value << g.
exclude;
321 out << YAML::BeginMap;
322 out << YAML::Key <<
"type" << YAML::Value << dt.
type;
323 out << YAML::Key <<
"description" << YAML::Value << dt.
description;
324 out << YAML::Key <<
"template" << YAML::Literal << dt.
jinja_template;
330YAML::Emitter &
operator<<(YAML::Emitter &out,
const inja::json &j)
332 if (j.empty() || j.is_null()) {
335 else if (j.is_boolean()) {
336 out << j.get<
bool>();
338 else if (j.is_number_integer()) {
339 out << j.get<
long long>();
341 else if (j.is_number_unsigned()) {
342 out << j.get<
unsigned long long>();
344 else if (j.is_number_float()) {
345 out << j.get<
double>();
347 else if (j.is_string()) {
348 out << j.get<std::string>();
350 else if (j.is_array()) {
351 out << YAML::BeginSeq;
352 for (
const auto &element : j) {
357 else if (j.is_object()) {
358 out << YAML::BeginMap;
359 for (
auto it = j.begin(); it != j.end(); ++it) {
360 out << YAML::Key << it.key() << YAML::Value;
373 out << YAML::BeginMap;
382 out << dynamic_cast<const inheritable_diagram_options &>(c);
385 out << YAML::Key <<
"diagrams";
386 out << YAML::BeginMap;
388 for (
const auto &[k, v] : c.
diagrams) {
389 out << YAML::Key << k;
391 out << YAML::Value << dynamic_cast<class_diagram &>(*v);
394 out << YAML::Value << dynamic_cast<sequence_diagram &>(*v);
397 out << YAML::Value << dynamic_cast<include_diagram &>(*v);
400 out << YAML::Value << dynamic_cast<package_diagram &>(*v);
431 if (
const auto *cd =
dynamic_cast<const class_diagram *
>(&c);
439 out << YAML::Key <<
"relationship_hints" << YAML::Value
444 out << YAML::Key <<
"type_aliases" << YAML::Value
482 out << YAML::BeginMap;
483 out << YAML::Key <<
"type" << YAML::Value << c.
type();
485 out << dynamic_cast<const inheritable_diagram_options &>(c);
492 out << YAML::BeginMap;
493 out << YAML::Key <<
"type" << YAML::Value << c.
type();
497 out << dynamic_cast<const inheritable_diagram_options &>(c);
504 out << YAML::BeginMap;
505 out << YAML::Key <<
"type" << YAML::Value << c.
type();
507 out << dynamic_cast<const inheritable_diagram_options &>(c);
514 out << YAML::BeginMap;
515 out << YAML::Key <<
"type" << YAML::Value << c.
type();
517 out << dynamic_cast<const inheritable_diagram_options &>(c);
524 out << YAML::BeginMap;
525 out << YAML::Key <<
"type" << YAML::Value << to_string(ef.
type);
526 out << YAML::Key <<
"name" << YAML::Value << ef.
name;
532template <>
bool is_null(
const std::string &v) {
return v.empty(); }
552template <>
bool is_null(
const inja::json &v) {
return v.is_null(); }