C++ Reference

This section contains reference documentation for working with protocol buffer classes in C++.

Packages

Auxiliary classes used for I/O.
Utility classes.
Implementation of the Protocol Buffer compiler.

google::protobuf

Files

This file defines an Arena allocator for better allocation performance.
This file contains classes which describe a type of protocol message.
Protocol buffer representations of descriptors.
Interface for manipulating databases of descriptors.
Defines an implementation of Message which can emulate types which are not known at compile-time.
This file defines the map container and its helpers to support protobuf maps.
Defines Message, the abstract interface implemented by non-lite protocol message objects.
Defines MessageLite, the abstract interface implemented by all (lite and non-lite) protocol message objects.
RepeatedField and RepeatedPtrField are used by generated protocol message classes to manipulate repeated fields.
DEPRECATED: This module declares the abstract interfaces underlying proto2 RPC services.
Utilities for printing and parsing protocol messages in a human-readable, text-based format.
Contains classes used to keep track of unrecognized fields seen while parsing a protocol message.

google::protobuf::io

Auxiliary classes used for I/O.

The Protocol Buffer library uses the classes in this package to deal with I/O and encoding/decoding raw bytes. Most users will not need to deal with this package. However, users who want to adapt the system to work with their own I/O abstractions – e.g., to allow Protocol Buffers to be read from a different kind of input stream without the need for a temporary buffer – should take a closer look.

Files

This file contains the CodedInputStream and CodedOutputStream classes, which wrap a ZeroCopyInputStream or ZeroCopyOutputStream, respectively, and allow you to read or write individual pieces of data in various formats.
Utility class for writing text to a ZeroCopyOutputStream.
Class for parsing tokenized text from a ZeroCopyInputStream.
This file contains the ZeroCopyInputStream and ZeroCopyOutputStream interfaces, which represent abstract I/O streams to and from which protocol buffers can be read and written.
This file contains common implementations of the interfaces defined in zero_copy_stream.h which are only included in the full (non-lite) protobuf library.
This file contains common implementations of the interfaces defined in zero_copy_stream.h which are included in the "lite" protobuf library.

google::protobuf::util

Utility classes.

This package contains various utilities for message comparison, JSON conversion, well known types, etc.

Files

Defines classes for field comparison.
Defines utilities for the FieldMask well known type.
Utility functions to convert between protobuf binary format and proto3 JSON format.
This file defines static methods and classes for comparing Protocol Messages.
Defines utilities for the Timestamp and Duration well known types.
Defines a TypeResolver for the Any message.
Defines utilities for the TypeResolver.

google::protobuf::compiler

Implementation of the Protocol Buffer compiler.

This package contains code for parsing .proto files and generating code based on them. There are two reasons you might be interested in this package:

  • You want to parse .proto files at runtime. In this case, you should look at importer.h. Since this functionality is widely useful, it is included in the libprotobuf base library; you do not have to link against libprotoc.
  • You want to write a custom protocol compiler which generates different kinds of code, e.g. code in a different language which is not supported by the official compiler. For this purpose, command_line_interface.h provides you with a complete compiler front-end, so all you need to do is write a custom implementation of CodeGenerator and a trivial main() function. You can even make your compiler support the official languages in addition to your own. Since this functionality is only useful to those writing custom compilers, it is in a separate library called "libprotoc" which you will have to link against.

Files

Defines the abstract interface implemented by each of the language-specific code generators.
Implements the Protocol Compiler front-end such that it may be reused by custom compilers written to support other languages.
This file is the public interface to the .proto file parser.
Implements parsing of .proto files to FileDescriptorProtos.
Front-end for protoc code generator plugins written in C++.
API for protoc plugins.
Generates C++ code for a given .proto file.
Generates C# code for a given .proto file.
Provides a mechanism for mapping a descriptor to the fully-qualified name of the corresponding C# class.
Generates Java code for a given .proto file.
Provides a mechanism for mapping a descriptor to the fully-qualified name of the corresponding Java class.
Generates JavaScript code for a given .proto file.
Generates ObjectiveC code for a given .proto file.
Helper functions for generating ObjectiveC code.
Generates Python code for a given .proto file.
Generates Ruby code for a given .proto file.

arena.h

This section contains reference documentation for working with protocol buffer classes in C++.

common.h

This section contains reference documentation for working with protocol buffer classes in C++.

code_generator.h

This section contains reference documentation for working with protocol buffer classes in C++.

command_line_interface.h

This section contains reference documentation for working with protocol buffer classes in C++.

cpp_generator.h

This section contains reference documentation for working with protocol buffer classes in C++.

csharp_generator.h

This section contains reference documentation for working with protocol buffer classes in C++.

csharp_names.h

This section contains reference documentation for working with protocol buffer classes in C++.

importer.h

This section contains reference documentation for working with protocol buffer classes in C++.

java_generator.h

This section contains reference documentation for working with protocol buffer classes in C++.

java_names.h

This section contains reference documentation for working with protocol buffer classes in C++.

javanano_generator.h

This section contains reference documentation for working with protocol buffer classes in C++.

js_generator.h

This section contains reference documentation for working with protocol buffer classes in C++.

objectivec_generator.h

This section contains reference documentation for working with protocol buffer classes in C++.

objectivec_helpers.h

This section contains reference documentation for working with protocol buffer classes in C++.

parser.h

This section contains reference documentation for working with protocol buffer classes in C++.

plugin.h

This section contains reference documentation for working with protocol buffer classes in C++.

plugin.pb.h

This section contains reference documentation for working with protocol buffer classes in C++.

python_generator.h

This section contains reference documentation for working with protocol buffer classes in C++.

ruby_generator.h

This section contains reference documentation for working with protocol buffer classes in C++.

descriptor.h

This section contains reference documentation for working with protocol buffer classes in C++.

descriptor.pb.h

This section contains reference documentation for working with protocol buffer classes in C++.

descriptor_database.h

This section contains reference documentation for working with protocol buffer classes in C++.

dynamic_message.h

This section contains reference documentation for working with protocol buffer classes in C++.

coded_stream.h

This section contains reference documentation for working with protocol buffer classes in C++.

gzip_stream.h

This section contains reference documentation for working with protocol buffer classes in C++.

printer.h

This section contains reference documentation for working with protocol buffer classes in C++.

tokenizer.h

This section contains reference documentation for working with protocol buffer classes in C++.

zero_copy_stream.h

This section contains reference documentation for working with protocol buffer classes in C++.

zero_copy_stream_impl.h

This section contains reference documentation for working with protocol buffer classes in C++.

zero_copy_stream_iml_lite.h

This section contains reference documentation for working with protocol buffer classes in C++.

map.h

This section contains reference documentation for working with protocol buffer classes in C++.

message.h

This section contains reference documentation for working with protocol buffer classes in C++.

message_lite.h

This section contains reference documentation for working with protocol buffer classes in C++.

repeated_field.h

This section contains reference documentation for working with protocol buffer classes in C++.

service.h

This section contains reference documentation for working with protocol buffer classes in C++.

text_format.h

This section contains reference documentation for working with protocol buffer classes in C++.

unknown_field_set.h

This section contains reference documentation for working with protocol buffer classes in C++.

field_comparator.h

This section contains reference documentation for working with protocol buffer classes in C++.

field_mask_util.h

This section contains reference documentation for working with protocol buffer classes in C++.

json_util.h

This section contains reference documentation for working with protocol buffer classes in C++.

message_differencer.h

This section contains reference documentation for working with protocol buffer classes in C++.

time_util.h

This section contains reference documentation for working with protocol buffer classes in C++.

type_resolver.h

This section contains reference documentation for working with protocol buffer classes in C++.

type_resolver_util.h

This section contains reference documentation for working with protocol buffer classes in C++.