ZeroCopyOutputStream 到streambuf中

发布于 2024-10-08 11:30:33 字数 258 浏览 0 评论 0 原文

我想编写一个继承自streambuf并适应ZeroCopyOutputStream (google/protobuf/io/) 到streambuf中。

有什么想法吗?

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

any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

百变从容 2024-10-15 11:30:33
  1. 编写一个proto描述文件并使用protoc将其编译为c++代码
  2. 生成的c++类具有读/写流的函数:SerializeToOstream(ostream*stream)和ParseFromIstream(istream*stream)

您可能需要自己从streambuf创建iostream。

  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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文