开发者

ZeroCopyOutputStream into a streambuf

开发者 https://www.devze.com 2023-01-31 12:34 出处:网络
I would like to write a class that inherites from streambuf and adapts a ZeroCopyOutputStream (开发者_如何学Cgoogle/protobuf/io/) into a streambuf.

I would like to write a class that inherites from streambuf and adapts a ZeroCopyOutputStream (开发者_如何学Cgoogle/protobuf/io/) into a streambuf.

any ideas?


  1. write a proto description file and compile it to c++ code using protoc
  2. the generated c++ class has functions to read/write to stream: SerializeToOstream(ostream* stream) and ParseFromIstream(istream* stream)

You may need to create iostream from streambuf by yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号