52 template<
typename Container>
55 static_assert(
sizeof(
typename Container::value_type) == 1,
"sizeof(Container::value_type) != 1");
56 using Iter =
typename Container::const_iterator;
74 const std::size_t line_size = 100;
75 const char delimiter =
' ';
77 bool put_newlines =
true;
78 bool put_delimiters =
true;
79 bool use_uppercase =
false;
80 bool put_positions =
true;
83 template<
typename ParseContext>
84 auto parse(ParseContext &ctx) -> decltype(ctx.begin())
86 auto it = ctx.begin();
87 while (*it && *it !=
'}')
95 put_delimiters =
false;
98 put_positions =
false;
101 put_newlines =
false;
111 template<
typename FormatContext,
typename Container>
116 const char *hex_chars = use_uppercase ? hex_upper : hex_lower;
119 std::size_t column = line_size;
120 auto inserter = ctx.begin();
122 for (
auto &item : the_range)
124 auto ch = static_cast<unsigned char>(item);
127 if (put_newlines && column >= line_size)
129 column = put_newline(inserter, pos);
132 *inserter++ = hex_chars[(ch >> 4) & 0x0f];
133 *inserter++ = hex_chars[ch & 0x0f];
140 *inserter++ = delimiter;
144 *inserter++ = hex_chars[(ch >> 4) & 0x0f];
145 *inserter++ = hex_chars[ch & 0x0f];
153 template<
typename It>