为多个 json 文件创建单个平面缓冲区或连接从 json 创建的多个平面缓冲区
Create single flatbuffer for multiple json files or concatenate the multiple flatbuffers created from the jsons
我正在尝试从我的多个 json
文件创建一个单一的 flatbuffer,使用 flatc
编译器,我们可以从一个json 文件,如示例 Json with flatbuffers.
#json file example.
{
pos: {
x: 1,
y: 2,
z: 3
},
hp: 300,
name: "Orc"
}
#from the command line
$./../flatc -b monster.fbs monsterdata.json
我看过 documentation given by google on flatbuffers and cannot figure out how to make a single flatbuffer. I also checked out the following google-groups link but couldn't comprehend much, and also to this github link
如果有人能帮我从我的多个 json 文件中创建一个 flatbuffer 就太好了,flatbuffer 也是为单个 [=12= 创建的] 对象或 奇异数据 ?
您不能自动执行此操作。您需要准确指定这些多个缓冲区应该如何在架构中表示,例如
table Monsters { monsters:[Monster]; }
root_type Monsters;
其中 Monster
只是您的 JSON 文件之一的类型。然后连接所有 JSON 文件,前缀为 { monsters: [
,后缀为 ] }
,中间为 ,
。
我正在尝试从我的多个 json
文件创建一个单一的 flatbuffer,使用 flatc
编译器,我们可以从一个json 文件,如示例 Json with flatbuffers.
#json file example.
{
pos: {
x: 1,
y: 2,
z: 3
},
hp: 300,
name: "Orc"
}
#from the command line
$./../flatc -b monster.fbs monsterdata.json
我看过 documentation given by google on flatbuffers and cannot figure out how to make a single flatbuffer. I also checked out the following google-groups link but couldn't comprehend much, and also to this github link
如果有人能帮我从我的多个 json 文件中创建一个 flatbuffer 就太好了,flatbuffer 也是为单个 [=12= 创建的] 对象或 奇异数据 ?
您不能自动执行此操作。您需要准确指定这些多个缓冲区应该如何在架构中表示,例如
table Monsters { monsters:[Monster]; }
root_type Monsters;
其中 Monster
只是您的 JSON 文件之一的类型。然后连接所有 JSON 文件,前缀为 { monsters: [
,后缀为 ] }
,中间为 ,
。