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
Name Description
other CodeGeneratorResponse

Fields

ErrorFieldNumber

public const int ErrorFieldNumber = 1

Field number for the "error" field.

Field Value
Type Description
int

FileFieldNumber

public const int FileFieldNumber = 15

Field number for the "file" field.

Field Value
Type Description
int

SupportedFeaturesFieldNumber

public const int SupportedFeaturesFieldNumber = 2

Field number for the "supported_features" field.

Field Value
Type Description
int

Properties

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
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
Type Description
string

File

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

HasError

public bool HasError { get; }

Gets whether the "error" field is set

Property Value
Type Description
bool

HasSupportedFeatures

public bool HasSupportedFeatures { get; }

Gets whether the "supported_features" field is set

Property Value
Type Description
bool

Parser

public static MessageParser<CodeGeneratorResponse> Parser { get; }
Property Value
Type Description
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
Type Description
ulong

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.

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
Type Description
CodeGeneratorResponse

A deep clone of this object.

Equals(CodeGeneratorResponse)

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

public void MergeFrom(CodeGeneratorResponse other)

Merges the given message into this one.

Parameter
Name Description
other CodeGeneratorResponse
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