| 149 | |
| 150 | template <typename T> |
| 151 | struct 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 | |
| 169 | template <typename T> |
| 170 | struct DiffHexFixedWidth : public DiffBase<T> { |
no outgoing calls
no test coverage detected