clang-format
This commit is contained in:
parent
6f53e1bdc1
commit
03eadbd6bb
@ -2792,7 +2792,8 @@ FMT_CONSTEXPR auto check_cstring_type_spec(presentation_type type,
|
|||||||
template <typename ErrorHandler = error_handler>
|
template <typename ErrorHandler = error_handler>
|
||||||
FMT_CONSTEXPR void check_string_type_spec(presentation_type type,
|
FMT_CONSTEXPR void check_string_type_spec(presentation_type type,
|
||||||
ErrorHandler&& eh = {}) {
|
ErrorHandler&& eh = {}) {
|
||||||
if (type != presentation_type::none && type != presentation_type::string && type != presentation_type::debug)
|
if (type != presentation_type::none && type != presentation_type::string &&
|
||||||
|
type != presentation_type::debug)
|
||||||
eh.on_error("invalid type specifier");
|
eh.on_error("invalid type specifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1567,11 +1567,10 @@ template <typename Char> struct find_escape_result {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
using make_unsigned_char = typename conditional_t<
|
using make_unsigned_char =
|
||||||
std::is_integral<Char>::value,
|
typename conditional_t<std::is_integral<Char>::value,
|
||||||
std::make_unsigned<Char>,
|
std::make_unsigned<Char>,
|
||||||
type_identity<uint32_t>
|
type_identity<uint32_t>>::type;
|
||||||
>::type;
|
|
||||||
|
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
auto find_escape(const Char* begin, const Char* end)
|
auto find_escape(const Char* begin, const Char* end)
|
||||||
@ -1600,7 +1599,8 @@ inline auto find_escape(const char* begin, const char* end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Char, typename OutputIt>
|
template <typename Char, typename OutputIt>
|
||||||
auto write_escaped_string(OutputIt out, basic_string_view<Char> str, Char bracket = '"') -> OutputIt {
|
auto write_escaped_string(OutputIt out, basic_string_view<Char> str,
|
||||||
|
Char bracket = '"') -> OutputIt {
|
||||||
*out++ = bracket;
|
*out++ = bracket;
|
||||||
auto begin = str.begin(), end = str.end();
|
auto begin = str.begin(), end = str.end();
|
||||||
do {
|
do {
|
||||||
@ -1644,9 +1644,8 @@ auto write_escaped_string(OutputIt out, basic_string_view<Char> str, Char bracke
|
|||||||
}
|
}
|
||||||
for (Char escape_char : basic_string_view<Char>(
|
for (Char escape_char : basic_string_view<Char>(
|
||||||
escape.begin, to_unsigned(escape.end - escape.begin))) {
|
escape.begin, to_unsigned(escape.end - escape.begin))) {
|
||||||
out = format_to(
|
out = format_to(out, "\\x{:02x}",
|
||||||
out, "\\x{:02x}",
|
static_cast<make_unsigned_char<Char>>(escape_char));
|
||||||
static_cast<make_unsigned_char<Char>>(escape_char));
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user