python_generator.h

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

#include <google/protobuf/compiler/python/python_generator.h>
namespace google::protobuf::compiler::python

Generates Python code for a given .proto file.

Classes in this file

CodeGenerator implementation for generated Python protocol buffer classes.

class Generator: public CodeGenerator

#include <google/protobuf/compiler/python/python_generator.h>
namespace google::protobuf::compiler::python

CodeGenerator implementation for generated Python protocol buffer classes.

If you create your own protocol compiler binary and you want it to support Python output, you can do so by registering an instance of this CodeGenerator with the CommandLineInterface in your main() function.

Members

Generator()
virtual
~Generator()
virtual bool
Generate(const FileDescriptor * file, const std::string & parameter, GeneratorContext * generator_context, std::string * error) const
CodeGenerator methods.
virtual uint64_t
GetSupportedFeatures() const
Implement this to indicate what features this code generator supports. more...

virtual uint64_t Generator::GetSupportedFeatures() const

Implement this to indicate what features this code generator supports.

This should be a bitwise OR of features from the Features enum in plugin.proto.