98 case FormatType::Signed32:
99 if constexpr (HasProfile(Profile, FormatProfile::GenericSigned32) &&
100 Config::enable_integer)
102 return DispatchSignedField<int32_t>();
104 return ErrorCode::STATE_ERR;
105 case FormatType::Signed64:
106 if constexpr (HasProfile(Profile, FormatProfile::GenericSigned64) &&
107 Config::enable_integer && Config::enable_integer_64bit)
109 return DispatchSignedField<int64_t>();
111 return ErrorCode::STATE_ERR;
112 case FormatType::Unsigned32:
113 if constexpr (HasProfile(Profile, FormatProfile::GenericUnsigned32) &&
114 Config::enable_integer)
116 return DispatchUnsignedField<FormatType::Unsigned32, uint32_t>();
118 return ErrorCode::STATE_ERR;
119 case FormatType::Unsigned64:
120 if constexpr (HasProfile(Profile, FormatProfile::GenericUnsigned64) &&
121 Config::enable_integer && Config::enable_integer_64bit)
123 return DispatchUnsignedField<FormatType::Unsigned64, uint64_t>();
125 return ErrorCode::STATE_ERR;
126 case FormatType::Binary32:
127 if constexpr (HasProfile(Profile, FormatProfile::GenericBinary32) &&
128 Config::enable_integer && Config::enable_integer_base8_16)
130 return DispatchUnsignedField<FormatType::Binary32, uint32_t>();
132 return ErrorCode::STATE_ERR;
133 case FormatType::Binary64:
134 if constexpr (HasProfile(Profile, FormatProfile::GenericBinary64) &&
135 Config::enable_integer && Config::enable_integer_base8_16 &&
136 Config::enable_integer_64bit)
138 return DispatchUnsignedField<FormatType::Binary64, uint64_t>();
140 return ErrorCode::STATE_ERR;
141 case FormatType::Octal32:
142 if constexpr (HasProfile(Profile, FormatProfile::GenericOctal32) &&
143 Config::enable_integer && Config::enable_integer_base8_16)
145 return DispatchUnsignedField<FormatType::Octal32, uint32_t>();
147 return ErrorCode::STATE_ERR;
148 case FormatType::Octal64:
149 if constexpr (HasProfile(Profile, FormatProfile::GenericOctal64) &&
150 Config::enable_integer && Config::enable_integer_base8_16 &&
151 Config::enable_integer_64bit)
153 return DispatchUnsignedField<FormatType::Octal64, uint64_t>();
155 return ErrorCode::STATE_ERR;
156 case FormatType::HexLower32:
157 if constexpr (HasProfile(Profile, FormatProfile::GenericHexLower32) &&
158 Config::enable_integer && Config::enable_integer_base8_16)
160 return DispatchUnsignedField<FormatType::HexLower32, uint32_t>();
162 return ErrorCode::STATE_ERR;
163 case FormatType::HexLower64:
164 if constexpr (HasProfile(Profile, FormatProfile::GenericHexLower64) &&
165 Config::enable_integer && Config::enable_integer_base8_16 &&
166 Config::enable_integer_64bit)
168 return DispatchUnsignedField<FormatType::HexLower64, uint64_t>();
170 return ErrorCode::STATE_ERR;
171 case FormatType::HexUpper32:
172 if constexpr (HasProfile(Profile, FormatProfile::GenericHexUpper32) &&
173 Config::enable_integer && Config::enable_integer_base8_16)
175 return DispatchUnsignedField<FormatType::HexUpper32, uint32_t>();
177 return ErrorCode::STATE_ERR;
178 case FormatType::HexUpper64:
179 if constexpr (HasProfile(Profile, FormatProfile::GenericHexUpper64) &&
180 Config::enable_integer && Config::enable_integer_base8_16 &&
181 Config::enable_integer_64bit)
183 return DispatchUnsignedField<FormatType::HexUpper64, uint64_t>();
185 return ErrorCode::STATE_ERR;
186 case FormatType::Pointer:
187 if constexpr (HasProfile(Profile, FormatProfile::GenericPointer) &&
188 Config::enable_pointer)
190 return DispatchPointerField();
192 return ErrorCode::STATE_ERR;
193 case FormatType::Character:
194 if constexpr (HasProfile(Profile, FormatProfile::GenericCharacter) &&
197 return DispatchCharacterField();
199 return ErrorCode::STATE_ERR;
200 case FormatType::String:
201 if constexpr (HasProfile(Profile, FormatProfile::GenericString) &&
204 return DispatchStringField();
206 return ErrorCode::STATE_ERR;
207#if LIBXR_PRINT_ENABLE_FLOAT
208 case FormatType::FloatFixed:
209 if constexpr (HasProfile(Profile, FormatProfile::GenericFloatFixed) &&
210 FloatEnabled(FormatType::FloatFixed))
212 return DispatchFloatField<FormatType::FloatFixed, float>();
214 return ErrorCode::STATE_ERR;
215 case FormatType::DoubleFixed:
216 if constexpr (HasProfile(Profile, FormatProfile::GenericDoubleFixed) &&
217 FloatEnabled(FormatType::DoubleFixed))
219 return DispatchFloatField<FormatType::DoubleFixed, double>();
221 return ErrorCode::STATE_ERR;
222 case FormatType::FloatScientific:
223 if constexpr (HasProfile(Profile, FormatProfile::GenericFloatScientific) &&
224 FloatEnabled(FormatType::FloatScientific))
226 return DispatchFloatField<FormatType::FloatScientific, float>();
228 return ErrorCode::STATE_ERR;
229 case FormatType::DoubleScientific:
230 if constexpr (HasProfile(Profile, FormatProfile::GenericDoubleScientific) &&
231 FloatEnabled(FormatType::DoubleScientific))
233 return DispatchFloatField<FormatType::DoubleScientific, double>();
235 return ErrorCode::STATE_ERR;
236 case FormatType::FloatGeneral:
237 if constexpr (HasProfile(Profile, FormatProfile::GenericFloatGeneral) &&
238 FloatEnabled(FormatType::FloatGeneral))
240 return DispatchFloatField<FormatType::FloatGeneral, float>();
242 return ErrorCode::STATE_ERR;
243 case FormatType::DoubleGeneral:
244 if constexpr (HasProfile(Profile, FormatProfile::GenericDoubleGeneral) &&
245 FloatEnabled(FormatType::DoubleGeneral))
247 return DispatchFloatField<FormatType::DoubleGeneral, double>();
249 return ErrorCode::STATE_ERR;
250 case FormatType::LongDoubleFixed:
251 if constexpr (HasProfile(Profile, FormatProfile::GenericLongDoubleFixed) &&
252 FloatEnabled(FormatType::LongDoubleFixed))
254 return DispatchFloatField<FormatType::LongDoubleFixed, long double>();
256 return ErrorCode::STATE_ERR;
257 case FormatType::LongDoubleScientific:
258 if constexpr (HasProfile(Profile, FormatProfile::GenericLongDoubleScientific) &&
259 FloatEnabled(FormatType::LongDoubleScientific))
261 return DispatchFloatField<FormatType::LongDoubleScientific, long double>();
263 return ErrorCode::STATE_ERR;
264 case FormatType::LongDoubleGeneral:
265 if constexpr (HasProfile(Profile, FormatProfile::GenericLongDoubleGeneral) &&
266 FloatEnabled(FormatType::LongDoubleGeneral))
268 return DispatchFloatField<FormatType::LongDoubleGeneral, long double>();
270 return ErrorCode::STATE_ERR;
272 case FormatType::TextInline:
273 case FormatType::TextRef:
274 case FormatType::TextSpace:
275 case FormatType::End:
277 return ErrorCode::STATE_ERR;