Iros
 
Loading...
Searching...
No Matches
char.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace di::format {
7template<concepts::Encoding Enc, concepts::OneOf<char, c32> T>
9 bool debug) {
10 return parse<detail::CharacterFormat>(parse_context.current_format_string()) % [debug](
12 return [=](concepts::FormatContext auto& context, T value) -> Result<void> {
13 auto type = format.type.value_or(debug ? detail::CharacterType::Debug : detail::CharacterType::Character);
14 auto do_debug = false;
15 if (type == detail::CharacterType::Debug) {
16 do_debug = true;
18 }
19 auto width = format.width.transform(&detail::Width::value);
20 return detail::present_integer_to<Enc>(context, format.fill_and_align, format.sign, format.hash_tag,
21 format.zero, width, static_cast<detail::IntegerType>(type), do_debug,
22 value);
23 };
24 };
25}
26}
Definition format_parse_context.h:14
constexpr auto current_format_string() const -> View
Definition format_parse_context.h:191
Definition format_context.h:9
constexpr usize width
Definition gfx_test.cpp:21
IntegerType
Definition base.h:121
@ Character
Definition base.h:148
@ Debug
Definition base.h:148
constexpr auto present_integer_to(concepts::FormatContext auto &context, Optional< FillAndAlign > fill_and_align, Sign sign, HashTag hash_tag, Zero zero, Optional< size_t > width, IntegerType type, bool debug, T value) -> Result< void >
Definition base.h:436
Definition bounded_format_context.h:7
di::meta::Decay< decltype(T)> Tag
Definition tag_invoke.h:28
Expected< T, Error > Result
Definition result.h:8
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22
constexpr auto parse
Definition parse.h:23
size_t value
Definition base.h:84
Definition in_place_type.h:5