Class CodeGeneratorRequest (3.23.0)

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
NameDescription
otherCodeGeneratorRequest

Fields

CompilerVersionFieldNumber

public const int CompilerVersionFieldNumber = 3

Field number for the "compiler_version" field.

Field Value
TypeDescription
int

FileToGenerateFieldNumber

public const int FileToGenerateFieldNumber = 1

Field number for the "file_to_generate" field.

Field Value
TypeDescription
int

ParameterFieldNumber

public const int ParameterFieldNumber = 2

Field number for the "parameter" field.

Field Value
TypeDescription
int

ProtoFileFieldNumber

public const int ProtoFileFieldNumber = 15

Field number for the "proto_file" field.

Field Value
TypeDescription
int

Properties

CompilerVersion

public Version CompilerVersion { get; set; }

The version number of protocol compiler.

Property Value
TypeDescription
Version

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
TypeDescription
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
TypeDescription
RepeatedFieldstring

HasParameter

public bool HasParameter { get; }

Gets whether the "parameter" field is set

Property Value
TypeDescription
bool

Parameter

public string Parameter { get; set; }

The generator parameter passed on the command-line.

Property Value
TypeDescription
string

Parser

public static MessageParser<CodeGeneratorRequest> Parser { get; }
Property Value
TypeDescription
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.

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
TypeDescription
RepeatedFieldFileDescriptorProto

Methods

CalculateSize()

public int CalculateSize()

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

Returns
TypeDescription
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
TypeDescription
CodeGeneratorRequest

A deep clone of this object.

Equals(CodeGeneratorRequest)

public bool Equals(CodeGeneratorRequest other)
Parameter
NameDescription
otherCodeGeneratorRequest
Returns
TypeDescription
bool

Equals(object)

public override bool Equals(object other)
Parameter
NameDescription
otherobject
Returns
TypeDescription
bool
Overrides

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
int
Overrides

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)

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

Parameter
NameDescription
inputCodedInputStream
Remarks

See the user guide for precise merge semantics.

MergeFrom(CodeGeneratorRequest)

public void MergeFrom(CodeGeneratorRequest other)

Merges the given message into this one.

Parameter
NameDescription
otherCodeGeneratorRequest
Remarks

See the user guide for precise merge semantics.

ToString()

public override string ToString()
Returns
TypeDescription
string
Overrides

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)

Writes the data to the given coded output stream.

Parameter
NameDescription
outputCodedOutputStream

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

Extension Methods