mirror of
https://github.com/fumiama/simple-protobuf.git
synced 2026-06-13 05:31:09 +08:00
更改README
This commit is contained in:
12
README_ZH.md
12
README_ZH.md
@@ -11,7 +11,7 @@ Google ProtoBuf的简化变体。
|
||||
[struct_len] + n*[[type][data_len][data]]
|
||||
```
|
||||
|
||||
1. `type` 指明该项的类型,亦即其在结构体中实际占用的空间的对数。
|
||||
1. `type` 是一个小于 2^57^ 的变长数字,指明该项的类型,亦即其在结构体中对齐后实际占用的空间。
|
||||
2. `*_len` 是一个小于 2^57^ 的变长数字。
|
||||
3. `data` 是 `data_len` 长度的数据。
|
||||
|
||||
@@ -19,15 +19,11 @@ Google ProtoBuf的简化变体。
|
||||
比较简单,详见`test.c`。
|
||||
|
||||
## 保存结构体
|
||||
### 1. 创建 items_type 数组
|
||||
### 1. 调用 align_struct 创建 items_len 数组
|
||||
|
||||
是结构体所有项的`type`组成的数组。
|
||||
该数组由结构体所有项的`type`组成。
|
||||
|
||||
### 2. 类型对齐
|
||||
|
||||
接下来需要用`align_struct`进行对齐。如果您已经将数组对齐或结构体本身是对齐的,则无需此步骤。
|
||||
|
||||
### 3. 调用 set_pb 保存
|
||||
### 2. 调用 set_pb 保存
|
||||
|
||||
|
||||
## 读入结构体
|
||||
|
||||
Reference in New Issue
Block a user