我在C#中有一个列表对象列表
List<List<string>> matrix = new List<List<string>>();注意:列表中的数字元素在运行时中更改,我想使用protobuf序列化
稍后,我需要使用protocolBuffer作为vector<vector<string>>使用C++中的数据反序列化
这能办到吗?想知道如何定义.proto文件吗?
发布于 2013-05-29 20:22:59
要在.proto中这样做,您需要添加一个层:
message Outer {
repeated Inner items = 1;
}
message Inner {
repeated string items = 1;
}由于底层protobuf规范的结构方面,protobuf-net目前不支持直接嵌套/交错列表/数组,但在我的路线图中,通过欺骗protobuf-net中的上述布局来支持这一点。
https://stackoverflow.com/questions/16822389
复制相似问题