Skip to Main Content
Protocol Buffers Handbook
book

Protocol Buffers Handbook

by Clément Jean
April 2024
Intermediate to advanced content levelIntermediate to advanced
226 pages
4h 24m
English
Packt Publishing
Content preview from Protocol Buffers Handbook

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Complete Introduction to Protocol Buffers 3

Complete Introduction to Protocol Buffers 3

Stéphane Maarek
Linux Kernel Programming

Linux Kernel Programming

Kaiwan N. Billimoria

Publisher Resources

ISBN: 9781805124672Supplemental Content