4
The Protobuf Compiler
Now that we know the Protobuf syntax and the text format, we can finally get our hands dirty and play with the Protobuf compiler. In this section, we are going to generate code from .proto files, get binary from Protobuf text format, and get text from Protobuf serialized data (binary files).
In this chapter, we’re going to cover the following main topics:
- Downloading and installing protoc
- Transpiling .proto files
- Specifying import paths
- Encoding data to type with --encode
- Decoding data to type with --decode
- Decoding data to type, without .proto files, with --decode_raw
- What about the other flags?
By the end of this chapter, you will know how to use protoc’s main flags. You will know how to generate C++ (or any other ...
Get Protocol Buffers Handbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.