Google协议缓冲区:C ++的parseDelimitedFrom和writeDelimitedTo [英] Google Protocol Buffers: parseDelimitedFrom and writeDelimitedTo for C++
问题描述
很抱歉再次问到这个问题,但是我们能不能一劳永逸地在这里发布一些与Java函数匹配的C ++函数?谷歌似乎没有添加它们,而且自己编写它们是很痛苦的.在下面的答案中使用了 this和此.
Sorry to ask this again, but could we please once and for all post some C++ functions that match the Java ones here? They don't seem to be getting added by google, and it is a quite a pain to write them yourself. Below answer using some of this and this.
推荐答案
我知道已经回答了这个问题,但是现在这个问题已经过时了,此后对protobuf代码存储库进行了更新.
I know this question has been answered, but the question is super old now, and updates have been made to the protobuf code repository since then.
Protobuf现在在以下头文件下具有以下功能:
Protobuf now has these functions under the header file here:
#include <google/protobuf/util/delimited_message_util.h>
您可以在git仓库中检出关联的 cpp
文件此处.我已经使用boost插座试用了这些功能,它们按预期工作.
You can check out the associated cpp
file on the git repo here.
I have tried out the functions with a boost socket and they work as expected.
这篇关于Google协议缓冲区:C ++的parseDelimitedFrom和writeDelimitedTo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!