public sealed class CodeGeneratorResponse : IMessage<CodeGeneratorResponse>, IEquatable<CodeGeneratorResponse>, IDeepCloneable<CodeGeneratorResponse>, IBufferMessage, IMessage
The plugin writes an encoded CodeGeneratorResponse to stdout.
Implements
IMessageCodeGeneratorResponse, IEquatableCodeGeneratorResponse, IDeepCloneableCodeGeneratorResponse, IBufferMessage, IMessageNamespace
Google.Protobuf.CompilerAssembly
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 |
MaximumEditionFieldNumber
public const int MaximumEditionFieldNumber = 4
Field number for the "maximum_edition" field.
Field Value | |
---|---|
Type | Description |
int |
MinimumEditionFieldNumber
public const int MinimumEditionFieldNumber = 3
Field number for the "minimum_edition" 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 |
HasMaximumEdition
public bool HasMaximumEdition { get; }
Gets whether the "maximum_edition" field is set
Property Value | |
---|---|
Type | Description |
bool |
HasMinimumEdition
public bool HasMinimumEdition { get; }
Gets whether the "minimum_edition" 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 |
MaximumEdition
public int MaximumEdition { get; set; }
The maximum edition this plugin supports. This will be treated as an Edition enum, but we want to allow unknown values. It should be specified according the edition enum value, not the edition number. Only takes effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
Property Value | |
---|---|
Type | Description |
int |
MinimumEdition
public int MinimumEdition { get; set; }
The minimum edition this plugin supports. This will be treated as an Edition enum, but we want to allow unknown values. It should be specified according the edition enum value, not the edition number. Only takes effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
Property Value | |
---|---|
Type | Description |
int |
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
ClearMaximumEdition()
public void ClearMaximumEdition()
Clears the value of the "maximum_edition" field
ClearMinimumEdition()
public void ClearMinimumEdition()
Clears the value of the "minimum_edition" 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 |
GetHashCode()
public override int GetHashCode()
Returns | |
---|---|
Type | Description |
int |
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 |
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 |
See the user guide for precise merge semantics.
ToString()
public override string ToString()
Returns | |
---|---|
Type | Description |
string |
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. |