MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / operator<<

Method operator<<

tools/ktx/command_compare.cpp:558–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556
557 template <typename T>
558 void operator<<(const DiffBase<T>& diff) {
559 if (!diff.isDifferent()) return;
560 different = true;
561
562 const auto space = outputFormat != OutputFormat::json_mini ? " " : "";
563 const auto nl = outputFormat != OutputFormat::json_mini ? "\n" : "";
564
565 if (outputFormat == OutputFormat::text) {
566 printContext();
567 if (diff.hasValue(0))
568 printIndent(0, "-{}: {}\n", diff.textHeader, diff.value(0, outputFormat));
569 if (diff.hasValue(1))
570 printIndent(0, "+{}: {}\n", diff.textHeader, diff.value(1, outputFormat));
571 } else {
572 beginJsonOutput();
573 printIndent(2, "\"{}\":{}[{}", diff.jsonPath, space, nl);
574 if (diff.hasValue(0))
575 printIndent(3, "{},{}", diff.value(0, outputFormat), nl);
576 else
577 printIndent(3, "null,{}", nl);
578 if (diff.hasValue(1))
579 printIndent(3, "{}{}", diff.value(1, outputFormat), nl);
580 else
581 printIndent(3, "null{}", nl);
582 printIndent(2, "]");
583 }
584 }
585
586 template <typename T>
587 void operator<<(const DiffComplex<T>& diff) {

Callers

nothing calls this directly

Calls 15

assertFunction · 0.85
isnanFunction · 0.85
hasTextMethod · 0.80
getPixelLocationMethod · 0.80
formatFunction · 0.50
printFunction · 0.50
absFunction · 0.50
stringClass · 0.50
isDifferentMethod · 0.45
hasValueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected