9template <OutputSink Sink>
21 Executor(Sink& sink,
const uint8_t* codes,
const uint8_t* args);
32 template <FormatProfile Profile>
33 [[nodiscard]] ErrorCode
Run();
38 [[nodiscard]] ErrorCode
WriteRaw(std::string_view text);
39 [[nodiscard]] ErrorCode
WritePadding(
char fill,
size_t count);
40 [[nodiscard]] ErrorCode
WriteTextField(std::string_view text,
const Spec& spec);
41 [[nodiscard]] ErrorCode
WriteIntegerField(
char sign_char, std::string_view prefix,
42 std::string_view digits,
const Spec& spec);
43 [[nodiscard]] ErrorCode
WriteFloatField(
char sign_char, std::string_view text,
46 template <std::
signed_
integral Int>
49#if LIBXR_PRINT_ENABLE_FLOAT
51 [[nodiscard]]
static char ResolveFloatSignChar(T value,
const Spec& spec);
54 template <std::
signed_
integral Int>
55 [[nodiscard]] ErrorCode
WriteSigned(
const Spec& spec, Int value);
57 template <FormatType Type, std::
unsigned_
integral UInt>
76 template <uint8_t Base,
bool UpperCase =
false,
bool PrependOctalZero =
false,
77 std::unsigned_integral UInt>
80 [[nodiscard]] ErrorCode
WritePointer(
const Spec& spec, uintptr_t value);
82 [[nodiscard]] ErrorCode
WriteString(
const Spec& spec, std::string_view text);
84#if LIBXR_PRINT_ENABLE_FLOAT
86 [[nodiscard]] ErrorCode WriteFloat(FormatType type,
const Spec& spec, T value);
93 [[nodiscard]] ErrorCode
WriteU32Dec(uint32_t value);
105 template <u
int8_t Base,
bool UpperCase = false>
129 template <std::
signed_
integral Int>
132 template <FormatType Type, std::
unsigned_
integral UInt>
135#if LIBXR_PRINT_ENABLE_FLOAT
136 template <FormatType Type,
typename Float>
137 [[nodiscard]] ErrorCode DispatchFloatField();
155 template <FormatProfile Profile>
167 template <FormatProfile Profile>
168 [[nodiscard]] ErrorCode
DispatchOp(FormatOp op);
177#include "writer_executor_field.hpp"
178#include "writer_executor_value.hpp"
179#include "writer_executor_generic.hpp"
180#include "writer_executor_opcode.hpp"
运行期参数字节块的顺序读取器 / Sequential reader for the packed runtime argument byte blob
编译后记录流的顺序读取器 / Sequential reader for the compiled record stream
按输出端共享重后端、按调用点 profile 裁剪操作码分发的字节码执行器 / Per-sink bytecode executor with shared heavy backends and per...
ErrorCode WriteI32Dec(int32_t value)
单个原始 int32_t 十进制字段的快路径。 / Fast path for one raw int32_t decimal field.
ErrorCode WriteUnsignedDigits(std::string_view prefix, const Spec &spec, UInt value)
按编译期进制/大小写/八进制备用格式参数复用无符号数字载荷写出逻辑 / Reuse the unsigned-digit payload writer with compile-time radix,...
static char ResolveSignChar(Int value, const Spec &spec)
执行器的具体运行期数值写出函数 / Concrete runtime value writers for the executor
ErrorCode DispatchSignedField()
运行期执行器中 GenericField 的分发桥接函数 / GenericField dispatch bridges for the runtime executor
ErrorCode WriteStringRaw(std::string_view text)
单个原始字符串参数的快路径。 / Fast path for one raw string argument.
ErrorCode Run()
持续执行记录流,直到遇到 FormatOp::End / Run until the compiled record stream reaches FormatOp::End
ErrorCode WriteRaw(std::string_view text)
运行期执行器共享的字段写出原语,供所有操作码路径复用 / Executor-side field-writing primitives shared by all runtime opcodes
ErrorCode WriteU32Base(uint32_t value)
单个原始 uint32_t 非十进制字段的快路径。 / Fast path for one raw uint32_t non-decimal field.
ErrorCode DispatchPointerField()
读取一个指针载荷并走指针字段写出路径 / Read one pointer payload and write it through the pointer field path
ErrorCode DispatchStringField()
读取一个字符串载荷并走字符串字段写出路径 / Read one string payload and write it through the string field path
ErrorCode DispatchOp(FormatOp op)
将一个运行期操作码分发到选中的特化路径 / Dispatch one runtime opcode to the selected specialized path
ErrorCode WritePadding(char fill, size_t count)
向输出端写入重复填充字符 / Write repeated fill characters into the sink
Executor(Sink &sink, const uint8_t *codes, const uint8_t *args)
将一个输出端、一份编译字节块和一份参数字节块绑定起来 / Bind one sink with one compiled byte blob and one packed argument blob
ErrorCode DispatchGenericField(FormatType type)
将一个 GenericField 载荷分发到对应的宽回退路径 / Dispatch one GenericField payload to the corresponding wide fallback
ErrorCode WritePointer(const Spec &spec, uintptr_t value)
按规范指针字段策略写出一个指针值 / Write one pointer value using the canonical pointer field policy
ErrorCode WriteString(const Spec &spec, std::string_view text)
写出一个字符串字段值,并在需要时应用精度截断 / Write one string field value, including precision truncation when present
ErrorCode WriteIntegerField(char sign_char, std::string_view prefix, std::string_view digits, const Spec &spec)
按符号、前缀、精度与填充策略写出一个整数载荷 / Write one integer payload with sign, prefix, precision, and padding policy a...
ErrorCode DispatchUnsigned(const Spec &spec, UInt value)
通过共享整数字段路径写出一个无符号整数语义值 / Write one unsigned integer semantic value through the shared integer-field p...
ErrorCode WriteU32Dec(uint32_t value)
单个原始 uint32_t 十进制字段的快路径。 / Fast path for one raw uint32_t decimal field.
ErrorCode WriteCharacterRaw(char ch)
单个原始字符参数的快路径。 / Fast path for one raw character argument.
ErrorCode WriteCharacter(const Spec &spec, char ch)
写出一个字符字段值 / Write one character field value
ErrorCode DispatchUnsignedField()
读取一个无符号载荷并转发给选定的整数语义写出路径 / Read one unsigned payload and forward it to the selected integer semantic ...
ErrorCode DispatchCharacterField()
读取一个字符载荷并走字符字段写出路径 / Read one character payload and write it through the character field path
ErrorCode WriteSigned(const Spec &spec, Int value)
通过共享整数字段路径写出一个有符号整数值 / Write one signed integer value through the shared integer-field path
ErrorCode WriteTextField(std::string_view text, const Spec &spec)
按宽度与对齐策略写出一个文本字段 / Write one text field with width/alignment policy applied
ErrorCode WriteFloatField(char sign_char, std::string_view text, const Spec &spec)
按符号与字段填充策略写出一个浮点文本载荷 / Write one float text payload with sign and field padding applied
ErrorCode WriteU32ZeroPadWidth(uint8_t width, uint32_t value)
单个零填充 uint32_t 十进制字段的快路径。 / Fast path for one zero-padded uint32_t decimal field.