Class CodeGeneratorResponse (3.23.0)

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

The plugin writes an encoded CodeGeneratorResponse to stdout.

Inheritance

object > CodeGeneratorResponse

Namespace

Google.Protobuf.Compiler

Assembly

Google.Protobuf.dll

Constructors

CodeGeneratorResponse()

public CodeGeneratorResponse()

CodeGeneratorResponse(CodeGeneratorResponse)

public CodeGeneratorResponse(CodeGeneratorResponse other)
Parameter
NameDescription
otherCodeGeneratorResponse

Fields

ErrorFieldNumber

public const int ErrorFieldNumber = 1

Field number for the "error" field.

Field Value
TypeDescription
int

FileFieldNumber

public const int FileFieldNumber = 15

Field number for the "file" field.

Field Value
TypeDescription
int

SupportedFeaturesFieldNumber

public const int SupportedFeaturesFieldNumber = 2

Field number for the "supported_features" field.

Field Value
TypeDescription
int

Properties

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
TypeDescription
MessageDescriptor

Error

public string Error { get; set; }

Error message. If non-empty, code generation failed. The plugin process should exit with status code zero even if it reports an error in this way.

This should be used to indicate errors in .proto files which prevent the code generator from generating correct code. Errors which indicate a problem in protoc itself -- such as the input CodeGeneratorRequest being unparseable -- should be reported by writing a message to stderr and exiting with a non-zero status code.

Property Value
TypeDescription
string

File

public RepeatedField<CodeGeneratorResponse.Types.File> File { get; }
Property Value
TypeDescription
RepeatedFieldCodeGeneratorResponseTypesFile

HasError

public bool HasError { get; }

Gets whether the "error" field is set

Property Value
TypeDescription
bool

HasSupportedFeatures

public bool HasSupportedFeatures { get; }

Gets whether the "supported_features" field is set

Property Value
TypeDescription
bool

Parser

public static MessageParser<CodeGeneratorResponse> Parser { get; }
Property Value
TypeDescription
MessageParserCodeGeneratorResponse

SupportedFeatures

public ulong SupportedFeatures { get; set; }

A bitmask of supported features that the code generator supports. This is a bitwise "or" of values from the Feature enum.

Property Value
TypeDescription
ulong

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.

ClearError()

public void ClearError()

Clears the value of the "error" field

ClearSupportedFeatures()

public void ClearSupportedFeatures()

Clears the value of the "supported_features" field

Clone()

public CodeGeneratorResponse Clone()

Creates a deep clone of this object.

Returns
TypeDescription
CodeGeneratorResponse

A deep clone of this object.

Equals(CodeGeneratorResponse)

public bool Equals(CodeGeneratorResponse other)
Parameter
NameDescription
otherCodeGeneratorResponse
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(CodeGeneratorResponse)

public void MergeFrom(CodeGeneratorResponse other)

Merges the given message into this one.

Parameter
NameDescription
otherCodeGeneratorResponse
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