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

Class DiffHex

tools/ktx/command_compare.cpp:151–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149
150template <typename T>
151struct DiffHex : public DiffBase<T> {
152 DiffHex(const std::string_view textHeaderIn, const std::string_view jsonPathIn,
153 const std::optional<T>& value1, const std::optional<T>& value2)
154 : DiffBase<T>(textHeaderIn, jsonPathIn, value1, value2) {}
155
156 DiffHex(const std::string_view textHeaderIn, const std::string_view jsonPathIn,
157 const T& value1, const T& value2)
158 : DiffBase<T>(textHeaderIn, jsonPathIn, value1, value2) {}
159
160 virtual std::string value(std::size_t index, OutputFormat format) const override {
161 if (format == OutputFormat::text) {
162 return fmt::format("0x{:x}", DiffBase<T>::rawValue(index));
163 } else {
164 return fmt::format("{}", DiffBase<T>::rawValue(index));
165 }
166 }
167};
168
169template <typename T>
170struct DiffHexFixedWidth : public DiffBase<T> {

Callers 2

compareHeaderMethod · 0.85
compareLevelIndexMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected