17 explicit CodeReader(
const uint8_t* codes) : pos_(codes), base_(codes)
25 [[nodiscard]] FormatOp
ReadOp() {
return static_cast<FormatOp
>(*pos_++); }
36 std::memcpy(&value, pos_,
sizeof(T));
45 [[nodiscard]] FormatType
ReadFormatType() {
return static_cast<FormatType
>(*pos_++); }
58 return Spec{.flags = *pos_++,
59 .fill =
static_cast<char>(*pos_++),
61 .precision = *pos_++};
70 auto text =
reinterpret_cast<const char*
>(pos_);
71 size_t size = std::strlen(text);
73 return std::string_view(text, size);
87 auto text =
reinterpret_cast<const char*
>(base_ + offset);
88 return std::string_view(text, size);
92 const uint8_t* pos_ =
nullptr;
93 const uint8_t* base_ =
nullptr;
113 template <
typename T>
117 std::memcpy(&value, pos_,
sizeof(T));
123 const uint8_t* pos_ =
nullptr;
运行期参数字节块的顺序读取器 / Sequential reader for the packed runtime argument byte blob
ArgumentReader(const uint8_t *data)
从单个运行期参数打包字节块构造读取器 / Create a reader over one packed runtime argument blob
T Read()
以无对齐要求的方式读取一个已打包参数值 / Read one packed argument value without requiring alignment
编译后记录流的顺序读取器 / Sequential reader for the compiled record stream
std::string_view ReadInlineText()
读取内嵌在记录流中的短文本 / Read a null-terminated short text payload embedded in the record stream
std::string_view ReadTextRef()
读取指向尾部文本池的偏移和长度 / Read an offset-size pair pointing into the trailing text pool
CodeReader(const uint8_t *codes)
从单个编译字节块起点构造读取器 / Create a reader over the beginning of one compiled byte blob
T Read()
读取编译期发射器按本机字节序写入的 POD 值 / Read a native-endian POD value emitted by the compile-time emitter
FormatOp ReadOp()
读取下一条运行期操作码 / Read the next runtime opcode
Spec ReadSpec()
读取紧跟在 GenericField 类型字节后的 4 字节字段载荷 / Read the 4-byte field payload that follows one GenericField type...
FormatType ReadFormatType()
读取 GenericField 载荷中的语义类型字节 / Read the semantic type byte carried by one GenericField payload