15#include "../format_argument.hpp"
16#include "../format_compile.hpp"
17#include "../printf.hpp"
135#include "format_frontend_source.hpp"
137#include "format_frontend_binding_base.hpp"
138#include "format_frontend_binding_integer.hpp"
139#include "format_frontend_binding_float.hpp"
150template <Text Source>
153 return SourceSyntax::Analyze<Source>();
168template <
Text Source,
typename... Args>
171 struct ResolvingVisitor
173 decltype(visitor)& inner;
175 [[nodiscard]]
consteval Error Text(
size_t offset,
size_t text_size)
177 return inner.
Text(offset, text_size);
183 if (resolved.error != Error::None)
185 return resolved.error;
187 return inner.Field(resolved.field);
191 ResolvingVisitor resolving{visitor};
192 return SourceSyntax::WalkSource(std::string_view(Source.
Data(), Source.
Size()),
203template <
Text Source,
typename... Args>
214 [[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