66 case FormatOp::TextInline:
67 return WriteRaw(codes_.ReadInlineText());
68 case FormatOp::TextRef:
69 return WriteRaw(codes_.ReadTextRef());
70 case FormatOp::TextSpace:
72 case FormatOp::U32Dec:
73 if constexpr (!HasProfile(Profile, FormatProfile::NarrowInt) ||
74 !Config::enable_integer)
76 return ErrorCode::STATE_ERR;
78 return WriteU32Dec(args_.Read<uint32_t>());
79 case FormatOp::I32Dec:
80 if constexpr (!HasProfile(Profile, FormatProfile::NarrowInt) ||
81 !Config::enable_integer)
83 return ErrorCode::STATE_ERR;
85 return WriteI32Dec(args_.Read<int32_t>());
86 case FormatOp::U32ZeroPadWidth:
87 if constexpr (!HasProfile(Profile, FormatProfile::NarrowInt) ||
88 !Config::enable_integer)
90 return ErrorCode::STATE_ERR;
92 return WriteU32ZeroPadWidth(codes_.Read<uint8_t>(), args_.Read<uint32_t>());
93 case FormatOp::U32Binary:
94 if constexpr (!HasProfile(Profile, FormatProfile::NarrowInt) ||
95 !Config::enable_integer || !Config::enable_integer_base8_16)
97 return ErrorCode::STATE_ERR;
99 return WriteU32Base<2>(args_.Read<uint32_t>());
100 case FormatOp::U32Octal:
101 if constexpr (!HasProfile(Profile, FormatProfile::NarrowInt) ||
102 !Config::enable_integer || !Config::enable_integer_base8_16)
104 return ErrorCode::STATE_ERR;
106 return WriteU32Base<8>(args_.Read<uint32_t>());
107 case FormatOp::U32HexLower:
108 if constexpr (!HasProfile(Profile, FormatProfile::NarrowInt) ||
109 !Config::enable_integer || !Config::enable_integer_base8_16)
111 return ErrorCode::STATE_ERR;
113 return WriteU32Base<16>(args_.Read<uint32_t>());
114 case FormatOp::U32HexUpper:
115 if constexpr (!HasProfile(Profile, FormatProfile::NarrowInt) ||
116 !Config::enable_integer || !Config::enable_integer_base8_16)
118 return ErrorCode::STATE_ERR;
120 return WriteU32Base<16, true>(args_.Read<uint32_t>());
121 case FormatOp::StringRaw:
122 if constexpr (!HasProfile(Profile, FormatProfile::TextArg) || !Config::enable_text)
124 return ErrorCode::STATE_ERR;
126 return WriteStringRaw(args_.Read<std::string_view>());
127 case FormatOp::CharacterRaw:
128 if constexpr (!HasProfile(Profile, FormatProfile::TextArg) || !Config::enable_text)
130 return ErrorCode::STATE_ERR;
132 return WriteCharacterRaw(args_.Read<
char>());
133 case FormatOp::GenericField:
134 if constexpr (!HasProfile(Profile, FormatProfile::Generic))
136 return ErrorCode::STATE_ERR;
138 return DispatchGenericField<Profile>(codes_.ReadFormatType());
141 return ErrorCode::STATE_ERR;