Class CodeGeneratorRequest (3.27.1)

public sealed class CodeGeneratorRequest : IMessage<CodeGeneratorRequest>, IEquatable<CodeGeneratorRequest>, IDeepCloneable<CodeGeneratorRequest>, IBufferMessage, IMessage

An encoded CodeGeneratorRequest is written to the plugin's stdin.

Inheritance

object > CodeGeneratorRequest

Namespace

Google.Protobuf.Compiler

Assembly

Google.Protobuf.dll

Constructors

CodeGeneratorRequest()

public CodeGeneratorRequest()

CodeGeneratorRequest(CodeGeneratorRequest)

public CodeGeneratorRequest(CodeGeneratorRequest other)
Parameter
Name Description
other CodeGeneratorRequest

Fields

CompilerVersionFieldNumber

public const int CompilerVersionFieldNumber = 3

Field number for the "compiler_version" field.

Field Value
Type Description
int

FileToGenerateFieldNumber

public const int FileToGenerateFieldNumber = 1

Field number for the "file_to_generate" field.

Field Value
Type Description
int

ParameterFieldNumber

public const int ParameterFieldNumber = 2

Field number for the "parameter" field.

Field Value
Type Description
int

ProtoFileFieldNumber

public const int ProtoFileFieldNumber = 15

Field number for the "proto_file" field.

Field Value
Type Description
int

SourceFileDescriptorsFieldNumber

public const int SourceFileDescriptorsFieldNumber = 17

Field number for the "source_file_descriptors" field.

Field Value
Type Description
int

Properties

CompilerVersion

public Version CompilerVersion { get; set; }

The version number of protocol compiler.

Property Value
Type Description
Version

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

FileToGenerate

public RepeatedField<string> FileToGenerate { get; }

The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.

Property Value
Type Description
RepeatedFieldstring

HasParameter

public bool HasParameter { get; }

Gets whether the "parameter" field is set

Property Value
Type Description
bool

Parameter

public string Parameter { get; set; }

The generator parameter passed on the command-line.

Property Value
Type Description
string

Parser

public static MessageParser<CodeGeneratorRequest> Parser { get; }
Property Value
Type Description
MessageParserCodeGeneratorRequest

ProtoFile

public RepeatedField<FileDescriptorProto> ProtoFile { get; }

FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it.

Note: the files listed in files_to_generate will include runtime-retention options only, but all other files will include source-retention options. The source_file_descriptors field below is available in case you need source-retention options for files_to_generate.

protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin.

Type names of fields and extensions in the FileDescriptorProto are always fully qualified.

Property Value
Type Description
RepeatedFieldFileDescriptorProto

SourceFileDescriptors

public RepeatedField<FileDescriptorProto> SourceFileDescriptors { get; }

File descriptors with all options, including source-retention options. These descriptors are only provided for the files listed in files_to_generate.

Property Value
Type Description
RepeatedFieldFileDescriptorProto

Methods

CalculateSize()

public int CalculateSize()

Calculates the size of this message in Protocol Buffer wire format, in bytes.

Returns
Type Description
int

The number of bytes required to write this message to a coded output stream.

ClearParameter()

public void ClearParameter()

Clears the value of the "parameter" field

Clone()

public CodeGeneratorRequest Clone()

Creates a deep clone of this object.

Returns
Type Description
CodeGeneratorRequest

A deep clone of this object.

Equals(CodeGeneratorRequest)

public bool Equals(CodeGeneratorRequest other)
Parameter
Name Description
other CodeGeneratorRequest
Returns
Type Description
bool

Equals(object)

public override bool Equals(object other)
Parameter
Name Description
other object
Returns
Type Description
bool
Overrides

GetHashCode()

public override int GetHashCode()
Returns
Type Description
int
Overrides

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)

Merges the data from the specified coded input stream with the current message.

Parameter
Name Description
input CodedInputStream
Remarks

See the user guide for precise merge semantics.

MergeFrom(CodeGeneratorRequest)

public void MergeFrom(CodeGeneratorRequest other)

Merges the given message into this one.

Parameter
Name Description
other CodeGeneratorRequest
Remarks

See the user guide for precise merge semantics.

ToString()

public override string ToString()
Returns
Type Description
string
Overrides

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)

Writes the data to the given coded output stream.

Parameter
Name Description
output CodedOutputStream

Coded output stream to write the data to. Must not be null.

Extension Methods