0

I would like to write a class that inherites from streambuf and adapts a ZeroCopyOutputStream (google/protobuf/io/) into a streambuf.

any ideas?

JWWalker
  • 22,385
  • 6
  • 55
  • 76
user515766
  • 349
  • 2
  • 5
  • 7

1 Answers1

0
  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.

Mason Zhang
  • 3,423
  • 24
  • 35