Util: Add char to integral presentation types

This commit is contained in:
Riyyi
2022-08-04 23:44:55 +02:00
parent 7a98f8e79f
commit b07b9d92d4
+8
View File
@@ -92,6 +92,14 @@ struct Formatter<T> {
void format(Builder& builder, T value) const
{
if (specifier.type == PresentationType::Character) {
assert(value >= 0 && value <= 127);
Formatter<std::string_view> formatter { specifier };
formatter.specifier.type = PresentationType::String;
return formatter.format(builder, { reinterpret_cast<const char*>(&value), 1 });
}
uint8_t base = 0;
bool uppercase = false;
switch (specifier.type) {