Skip to content

Commit 8fe9063

Browse files
authored
Remove SchemaFrame operator<< overload from this repository (#1769)
This belongs to the CLI. Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 2aab682 commit 8fe9063

File tree

3 files changed

+0
-675
lines changed

3 files changed

+0
-675
lines changed

src/core/jsonschema/frame.cc

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -417,121 +417,6 @@ auto SchemaFrame::to_json() const -> JSON {
417417
return root;
418418
}
419419

420-
auto operator<<(std::ostream &stream, const SchemaFrame &frame)
421-
-> std::ostream & {
422-
if (frame.locations().empty()) {
423-
return stream;
424-
}
425-
426-
for (auto iterator = frame.locations().cbegin();
427-
iterator != frame.locations().cend(); iterator++) {
428-
const auto &location{*iterator};
429-
430-
switch (location.second.type) {
431-
case SchemaFrame::LocationType::Resource:
432-
stream << "(RESOURCE)";
433-
break;
434-
case SchemaFrame::LocationType::Anchor:
435-
stream << "(ANCHOR)";
436-
break;
437-
case SchemaFrame::LocationType::Pointer:
438-
stream << "(POINTER)";
439-
break;
440-
case SchemaFrame::LocationType::Subschema:
441-
stream << "(SUBSCHEMA)";
442-
break;
443-
default:
444-
assert(false);
445-
}
446-
447-
stream << " URI: " << location.first.second << "\n";
448-
449-
if (location.first.first == SchemaReferenceType::Static) {
450-
stream << " Type : Static\n";
451-
} else {
452-
stream << " Type : Dynamic\n";
453-
}
454-
455-
stream << " Root : "
456-
<< location.second.root.value_or("<ANONYMOUS>") << "\n";
457-
458-
if (location.second.pointer.empty()) {
459-
stream << " Pointer :\n";
460-
} else {
461-
stream << " Pointer : ";
462-
sourcemeta::core::stringify(location.second.pointer, stream);
463-
stream << "\n";
464-
}
465-
466-
stream << " Base : " << location.second.base << "\n";
467-
468-
if (location.second.relative_pointer.empty()) {
469-
stream << " Relative Pointer :\n";
470-
} else {
471-
stream << " Relative Pointer : ";
472-
sourcemeta::core::stringify(location.second.relative_pointer, stream);
473-
stream << "\n";
474-
}
475-
476-
stream << " Dialect : " << location.second.dialect << "\n";
477-
stream << " Base Dialect : " << location.second.base_dialect
478-
<< "\n";
479-
480-
if (location.second.parent.has_value()) {
481-
if (location.second.parent.value().empty()) {
482-
stream << " Parent :\n";
483-
} else {
484-
stream << " Parent : ";
485-
sourcemeta::core::stringify(location.second.parent.value(), stream);
486-
stream << "\n";
487-
}
488-
} else {
489-
stream << " Parent : <NONE>\n";
490-
}
491-
492-
const auto &instance_locations{frame.instance_locations(location.second)};
493-
if (!instance_locations.empty()) {
494-
for (const auto &instance_location : instance_locations) {
495-
if (instance_location.empty()) {
496-
stream << " Instance Location :\n";
497-
} else {
498-
stream << " Instance Location : ";
499-
sourcemeta::core::stringify(instance_location, stream);
500-
stream << "\n";
501-
}
502-
}
503-
}
504-
505-
if (std::next(iterator) != frame.locations().cend()) {
506-
stream << "\n";
507-
}
508-
}
509-
510-
for (auto iterator = frame.references().cbegin();
511-
iterator != frame.references().cend(); iterator++) {
512-
stream << "\n";
513-
const auto &reference{*iterator};
514-
stream << "(REFERENCE) ORIGIN: ";
515-
sourcemeta::core::stringify(reference.first.second, stream);
516-
stream << "\n";
517-
518-
if (reference.first.first == SchemaReferenceType::Static) {
519-
stream << " Type : Static\n";
520-
} else {
521-
stream << " Type : Dynamic\n";
522-
}
523-
524-
stream << " Destination : " << reference.second.destination
525-
<< "\n";
526-
stream << " - (w/o fragment) : "
527-
<< reference.second.base.value_or("<NONE>") << "\n";
528-
stream << " - (fragment) : "
529-
<< reference.second.fragment.value_or("<NONE>") << "\n";
530-
}
531-
532-
return stream;
533-
}
534-
535420
auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker,
536421
const SchemaResolver &resolver,
537422
const std::optional<JSON::String> &default_dialect,

src/core/jsonschema/include/sourcemeta/core/jsonschema_frame.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,6 @@ class SOURCEMETA_CORE_JSONSCHEMA_EXPORT SchemaFrame {
252252
#endif
253253
};
254254

255-
/// @ingroup jsonschema
256-
/// Pretty print the contents of a schema frame
257-
SOURCEMETA_CORE_JSONSCHEMA_EXPORT
258-
auto operator<<(std::ostream &stream, const SchemaFrame &frame)
259-
-> std::ostream &;
260-
261255
} // namespace sourcemeta::core
262256

263257
#endif

0 commit comments

Comments
 (0)