Class FileDescriptorProto (3.23.0)

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

Describes a complete .proto file.

Inheritance

object > FileDescriptorProto

Namespace

Google.Protobuf.Reflection

Assembly

Google.Protobuf.dll

Constructors

FileDescriptorProto()

public FileDescriptorProto()

FileDescriptorProto(FileDescriptorProto)

public FileDescriptorProto(FileDescriptorProto other)
Parameter
NameDescription
otherFileDescriptorProto

Fields

DependencyFieldNumber

public const int DependencyFieldNumber = 3

Field number for the "dependency" field.

Field Value
TypeDescription
int

EditionFieldNumber

public const int EditionFieldNumber = 13

Field number for the "edition" field.

Field Value
TypeDescription
int

EnumTypeFieldNumber

public const int EnumTypeFieldNumber = 5

Field number for the "enum_type" field.

Field Value
TypeDescription
int

ExtensionFieldNumber

public const int ExtensionFieldNumber = 7

Field number for the "extension" field.

Field Value
TypeDescription
int

MessageTypeFieldNumber

public const int MessageTypeFieldNumber = 4

Field number for the "message_type" field.

Field Value
TypeDescription
int

NameFieldNumber

public const int NameFieldNumber = 1

Field number for the "name" field.

Field Value
TypeDescription
int

OptionsFieldNumber

public const int OptionsFieldNumber = 8

Field number for the "options" field.

Field Value
TypeDescription
int

PackageFieldNumber

public const int PackageFieldNumber = 2

Field number for the "package" field.

Field Value
TypeDescription
int

PublicDependencyFieldNumber

public const int PublicDependencyFieldNumber = 10

Field number for the "public_dependency" field.

Field Value
TypeDescription
int

ServiceFieldNumber

public const int ServiceFieldNumber = 6

Field number for the "service" field.

Field Value
TypeDescription
int

SourceCodeInfoFieldNumber

public const int SourceCodeInfoFieldNumber = 9

Field number for the "source_code_info" field.

Field Value
TypeDescription
int

SyntaxFieldNumber

public const int SyntaxFieldNumber = 12

Field number for the "syntax" field.

Field Value
TypeDescription
int

WeakDependencyFieldNumber

public const int WeakDependencyFieldNumber = 11

Field number for the "weak_dependency" field.

Field Value
TypeDescription
int

Properties

Dependency

public RepeatedField<string> Dependency { get; }

Names of files imported by this file.

Property Value
TypeDescription
RepeatedFieldstring

Descriptor

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

Edition

public string Edition { get; set; }

The edition of the proto file, which is an opaque string.

Property Value
TypeDescription
string

EnumType

public RepeatedField<EnumDescriptorProto> EnumType { get; }
Property Value
TypeDescription
RepeatedFieldEnumDescriptorProto

Extension

public RepeatedField<FieldDescriptorProto> Extension { get; }
Property Value
TypeDescription
RepeatedFieldFieldDescriptorProto

HasEdition

public bool HasEdition { get; }

Gets whether the "edition" field is set

Property Value
TypeDescription
bool

HasName

public bool HasName { get; }

Gets whether the "name" field is set

Property Value
TypeDescription
bool

HasPackage

public bool HasPackage { get; }

Gets whether the "package" field is set

Property Value
TypeDescription
bool

HasSyntax

public bool HasSyntax { get; }

Gets whether the "syntax" field is set

Property Value
TypeDescription
bool

MessageType

public RepeatedField<DescriptorProto> MessageType { get; }

All top-level definitions in this file.

Property Value
TypeDescription
RepeatedFieldDescriptorProto

Name

public string Name { get; set; }

file name, relative to root of source tree

Property Value
TypeDescription
string

Options

public FileOptions Options { get; set; }
Property Value
TypeDescription
FileOptions

Package

public string Package { get; set; }

e.g. "foo", "foo.bar", etc.

Property Value
TypeDescription
string

Parser

public static MessageParser<FileDescriptorProto> Parser { get; }
Property Value
TypeDescription
MessageParserFileDescriptorProto

PublicDependency

public RepeatedField<int> PublicDependency { get; }

Indexes of the public imported files in the dependency list above.

Property Value
TypeDescription
RepeatedFieldint

Service

public RepeatedField<ServiceDescriptorProto> Service { get; }
Property Value
TypeDescription
RepeatedFieldServiceDescriptorProto

SourceCodeInfo

public SourceCodeInfo SourceCodeInfo { get; set; }

This field contains optional information about the original source code. You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by development tools.

Property Value
TypeDescription
SourceCodeInfo

Syntax

public string Syntax { get; set; }

The syntax of the proto file. The supported values are "proto2", "proto3", and "editions".

If edition is present, this value must be "editions".

Property Value
TypeDescription
string

WeakDependency

public RepeatedField<int> WeakDependency { get; }

Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use.

Property Value
TypeDescription
RepeatedFieldint

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.

ClearEdition()

public void ClearEdition()

Clears the value of the "edition" field

ClearName()

public void ClearName()

Clears the value of the "name" field

ClearPackage()

public void ClearPackage()

Clears the value of the "package" field

ClearSyntax()

public void ClearSyntax()

Clears the value of the "syntax" field

Clone()

public FileDescriptorProto Clone()

Creates a deep clone of this object.

Returns
TypeDescription
FileDescriptorProto

A deep clone of this object.

Equals(FileDescriptorProto)

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

public void MergeFrom(FileDescriptorProto other)

Merges the given message into this one.

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