15#include "../format_argument.hpp"
16#include "../format_compile.hpp"
17#include "../printf.hpp"
132#include "format_frontend_source.hpp"
134#include "format_frontend_binding_base.hpp"
135#include "format_frontend_binding_integer.hpp"
136#include "format_frontend_binding_float.hpp"
147template <Text Source>
150 return SourceSyntax::Analyze<Source>();
165template <
Text Source,
typename... Args>
168 struct ResolvingVisitor
170 decltype(visitor)& inner;
172 [[nodiscard]]
consteval Error Text(
size_t offset,
size_t text_size)
174 return inner.
Text(offset, text_size);
180 if (resolved.error != Error::None)
182 return resolved.error;
184 return inner.Field(resolved.field);
188 ResolvingVisitor resolving{visitor};
189 return SourceSyntax::WalkSource(std::string_view(Source.
Data(), Source.
Size()),
200template <
Text Source,
typename... Args>
204 using ErrorType =
Error;
211 [[nodiscard]]
static constexpr const char*
SourceData() {
return Source.
Data(); }
consteval ResolvedField ResolveField(const ParsedField &parsed)
先判断一个已解析 brace 字段指向哪类参数,再选择匹配的字段构造逻辑 / Check which argument family a parsed brace field points to,...
作为 printf 格式源的结构化字符串字面量包装 / Structural literal wrapper used as the NTTP source for printf formats
constexpr Text(const char(&text)[N])
将字符串字面量复制到结构化 NTTP 对象中 / Copy the string literal into the structural NTTP object
constexpr const char * Data() const
返回含结尾零字节的字面量指针 / Return the literal bytes including the terminating zero byte
constexpr size_t Size() const
返回不含结尾零字节的格式串长度 / Return the format length without the terminating zero byte