341 lines
8.3 KiB
C#
341 lines
8.3 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using Google.Protobuf.Collections;
|
|
using Google.Protobuf.Reflection;
|
|
|
|
namespace Google.Protobuf.WellKnownTypes
|
|
{
|
|
// Token: 0x02000033 RID: 51
|
|
public sealed class Enum : IMessage<Enum>, IMessage, IEquatable<Enum>, IDeepCloneable<Enum>
|
|
{
|
|
// Token: 0x1700008D RID: 141
|
|
// (get) Token: 0x060002B3 RID: 691 RVA: 0x0000BAA8 File Offset: 0x00009CA8
|
|
[DebuggerNonUserCode]
|
|
public static MessageParser<Enum> Parser
|
|
{
|
|
get
|
|
{
|
|
return Enum._parser;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700008E RID: 142
|
|
// (get) Token: 0x060002B4 RID: 692 RVA: 0x0000BAAF File Offset: 0x00009CAF
|
|
[DebuggerNonUserCode]
|
|
public static MessageDescriptor Descriptor
|
|
{
|
|
get
|
|
{
|
|
return TypeReflection.Descriptor.MessageTypes[2];
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700008F RID: 143
|
|
// (get) Token: 0x060002B5 RID: 693 RVA: 0x0000BAC1 File Offset: 0x00009CC1
|
|
[DebuggerNonUserCode]
|
|
MessageDescriptor IMessage.Descriptor
|
|
{
|
|
get
|
|
{
|
|
return Enum.Descriptor;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060002B6 RID: 694 RVA: 0x0000BAC8 File Offset: 0x00009CC8
|
|
[DebuggerNonUserCode]
|
|
public Enum()
|
|
{
|
|
}
|
|
|
|
// Token: 0x060002B7 RID: 695 RVA: 0x0000BAF4 File Offset: 0x00009CF4
|
|
[DebuggerNonUserCode]
|
|
public Enum(Enum other)
|
|
: this()
|
|
{
|
|
this.name_ = other.name_;
|
|
this.enumvalue_ = other.enumvalue_.Clone();
|
|
this.options_ = other.options_.Clone();
|
|
this.SourceContext = ((other.sourceContext_ != null) ? other.SourceContext.Clone() : null);
|
|
this.syntax_ = other.syntax_;
|
|
}
|
|
|
|
// Token: 0x060002B8 RID: 696 RVA: 0x0000BB5D File Offset: 0x00009D5D
|
|
[DebuggerNonUserCode]
|
|
public Enum Clone()
|
|
{
|
|
return new Enum(this);
|
|
}
|
|
|
|
// Token: 0x17000090 RID: 144
|
|
// (get) Token: 0x060002B9 RID: 697 RVA: 0x0000BB65 File Offset: 0x00009D65
|
|
// (set) Token: 0x060002BA RID: 698 RVA: 0x0000BB6D File Offset: 0x00009D6D
|
|
[DebuggerNonUserCode]
|
|
public string Name
|
|
{
|
|
get
|
|
{
|
|
return this.name_;
|
|
}
|
|
set
|
|
{
|
|
this.name_ = ProtoPreconditions.CheckNotNull<string>(value, "value");
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000091 RID: 145
|
|
// (get) Token: 0x060002BB RID: 699 RVA: 0x0000BB80 File Offset: 0x00009D80
|
|
[DebuggerNonUserCode]
|
|
public RepeatedField<EnumValue> Enumvalue
|
|
{
|
|
get
|
|
{
|
|
return this.enumvalue_;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000092 RID: 146
|
|
// (get) Token: 0x060002BC RID: 700 RVA: 0x0000BB88 File Offset: 0x00009D88
|
|
[DebuggerNonUserCode]
|
|
public RepeatedField<Option> Options
|
|
{
|
|
get
|
|
{
|
|
return this.options_;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000093 RID: 147
|
|
// (get) Token: 0x060002BD RID: 701 RVA: 0x0000BB90 File Offset: 0x00009D90
|
|
// (set) Token: 0x060002BE RID: 702 RVA: 0x0000BB98 File Offset: 0x00009D98
|
|
[DebuggerNonUserCode]
|
|
public SourceContext SourceContext
|
|
{
|
|
get
|
|
{
|
|
return this.sourceContext_;
|
|
}
|
|
set
|
|
{
|
|
this.sourceContext_ = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000094 RID: 148
|
|
// (get) Token: 0x060002BF RID: 703 RVA: 0x0000BBA1 File Offset: 0x00009DA1
|
|
// (set) Token: 0x060002C0 RID: 704 RVA: 0x0000BBA9 File Offset: 0x00009DA9
|
|
[DebuggerNonUserCode]
|
|
public Syntax Syntax
|
|
{
|
|
get
|
|
{
|
|
return this.syntax_;
|
|
}
|
|
set
|
|
{
|
|
this.syntax_ = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060002C1 RID: 705 RVA: 0x0000BBB2 File Offset: 0x00009DB2
|
|
[DebuggerNonUserCode]
|
|
public override bool Equals(object other)
|
|
{
|
|
return this.Equals(other as Enum);
|
|
}
|
|
|
|
// Token: 0x060002C2 RID: 706 RVA: 0x0000BBC0 File Offset: 0x00009DC0
|
|
[DebuggerNonUserCode]
|
|
public bool Equals(Enum other)
|
|
{
|
|
return other != null && (other == this || (!(this.Name != other.Name) && this.enumvalue_.Equals(other.enumvalue_) && this.options_.Equals(other.options_) && object.Equals(this.SourceContext, other.SourceContext) && this.Syntax == other.Syntax));
|
|
}
|
|
|
|
// Token: 0x060002C3 RID: 707 RVA: 0x0000BC40 File Offset: 0x00009E40
|
|
[DebuggerNonUserCode]
|
|
public override int GetHashCode()
|
|
{
|
|
int num = 1;
|
|
if (this.Name.Length != 0)
|
|
{
|
|
num ^= this.Name.GetHashCode();
|
|
}
|
|
num ^= this.enumvalue_.GetHashCode();
|
|
num ^= this.options_.GetHashCode();
|
|
if (this.sourceContext_ != null)
|
|
{
|
|
num ^= this.SourceContext.GetHashCode();
|
|
}
|
|
if (this.Syntax != Syntax.Proto2)
|
|
{
|
|
num ^= this.Syntax.GetHashCode();
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x060002C4 RID: 708 RVA: 0x00007C02 File Offset: 0x00005E02
|
|
[DebuggerNonUserCode]
|
|
public override string ToString()
|
|
{
|
|
return JsonFormatter.ToDiagnosticString(this);
|
|
}
|
|
|
|
// Token: 0x060002C5 RID: 709 RVA: 0x0000BCBC File Offset: 0x00009EBC
|
|
[DebuggerNonUserCode]
|
|
public void WriteTo(CodedOutputStream output)
|
|
{
|
|
if (this.Name.Length != 0)
|
|
{
|
|
output.WriteRawTag(10);
|
|
output.WriteString(this.Name);
|
|
}
|
|
this.enumvalue_.WriteTo(output, Enum._repeated_enumvalue_codec);
|
|
this.options_.WriteTo(output, Enum._repeated_options_codec);
|
|
if (this.sourceContext_ != null)
|
|
{
|
|
output.WriteRawTag(34);
|
|
output.WriteMessage(this.SourceContext);
|
|
}
|
|
if (this.Syntax != Syntax.Proto2)
|
|
{
|
|
output.WriteRawTag(40);
|
|
output.WriteEnum((int)this.Syntax);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060002C6 RID: 710 RVA: 0x0000BD44 File Offset: 0x00009F44
|
|
[DebuggerNonUserCode]
|
|
public int CalculateSize()
|
|
{
|
|
int num = 0;
|
|
if (this.Name.Length != 0)
|
|
{
|
|
num += 1 + CodedOutputStream.ComputeStringSize(this.Name);
|
|
}
|
|
num += this.enumvalue_.CalculateSize(Enum._repeated_enumvalue_codec);
|
|
num += this.options_.CalculateSize(Enum._repeated_options_codec);
|
|
if (this.sourceContext_ != null)
|
|
{
|
|
num += 1 + CodedOutputStream.ComputeMessageSize(this.SourceContext);
|
|
}
|
|
if (this.Syntax != Syntax.Proto2)
|
|
{
|
|
num += 1 + CodedOutputStream.ComputeEnumSize((int)this.Syntax);
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x060002C7 RID: 711 RVA: 0x0000BDC8 File Offset: 0x00009FC8
|
|
[DebuggerNonUserCode]
|
|
public void MergeFrom(Enum other)
|
|
{
|
|
if (other == null)
|
|
{
|
|
return;
|
|
}
|
|
if (other.Name.Length != 0)
|
|
{
|
|
this.Name = other.Name;
|
|
}
|
|
this.enumvalue_.Add(other.enumvalue_);
|
|
this.options_.Add(other.options_);
|
|
if (other.sourceContext_ != null)
|
|
{
|
|
if (this.sourceContext_ == null)
|
|
{
|
|
this.sourceContext_ = new SourceContext();
|
|
}
|
|
this.SourceContext.MergeFrom(other.SourceContext);
|
|
}
|
|
if (other.Syntax != Syntax.Proto2)
|
|
{
|
|
this.Syntax = other.Syntax;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060002C8 RID: 712 RVA: 0x0000BE54 File Offset: 0x0000A054
|
|
[DebuggerNonUserCode]
|
|
public void MergeFrom(CodedInputStream input)
|
|
{
|
|
uint num;
|
|
while ((num = input.ReadTag()) != 0U)
|
|
{
|
|
if (num <= 18U)
|
|
{
|
|
if (num == 10U)
|
|
{
|
|
this.Name = input.ReadString();
|
|
continue;
|
|
}
|
|
if (num == 18U)
|
|
{
|
|
this.enumvalue_.AddEntriesFrom(input, Enum._repeated_enumvalue_codec);
|
|
continue;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (num == 26U)
|
|
{
|
|
this.options_.AddEntriesFrom(input, Enum._repeated_options_codec);
|
|
continue;
|
|
}
|
|
if (num == 34U)
|
|
{
|
|
if (this.sourceContext_ == null)
|
|
{
|
|
this.sourceContext_ = new SourceContext();
|
|
}
|
|
input.ReadMessage(this.sourceContext_);
|
|
continue;
|
|
}
|
|
if (num == 40U)
|
|
{
|
|
this.syntax_ = (Syntax)input.ReadEnum();
|
|
continue;
|
|
}
|
|
}
|
|
input.SkipLastField();
|
|
}
|
|
}
|
|
|
|
// Token: 0x040000DD RID: 221
|
|
private static readonly MessageParser<Enum> _parser = new MessageParser<Enum>(() => new Enum());
|
|
|
|
// Token: 0x040000DE RID: 222
|
|
public const int NameFieldNumber = 1;
|
|
|
|
// Token: 0x040000DF RID: 223
|
|
private string name_ = "";
|
|
|
|
// Token: 0x040000E0 RID: 224
|
|
public const int EnumvalueFieldNumber = 2;
|
|
|
|
// Token: 0x040000E1 RID: 225
|
|
private static readonly FieldCodec<EnumValue> _repeated_enumvalue_codec = FieldCodec.ForMessage<EnumValue>(18U, EnumValue.Parser);
|
|
|
|
// Token: 0x040000E2 RID: 226
|
|
private readonly RepeatedField<EnumValue> enumvalue_ = new RepeatedField<EnumValue>();
|
|
|
|
// Token: 0x040000E3 RID: 227
|
|
public const int OptionsFieldNumber = 3;
|
|
|
|
// Token: 0x040000E4 RID: 228
|
|
private static readonly FieldCodec<Option> _repeated_options_codec = FieldCodec.ForMessage<Option>(26U, Option.Parser);
|
|
|
|
// Token: 0x040000E5 RID: 229
|
|
private readonly RepeatedField<Option> options_ = new RepeatedField<Option>();
|
|
|
|
// Token: 0x040000E6 RID: 230
|
|
public const int SourceContextFieldNumber = 4;
|
|
|
|
// Token: 0x040000E7 RID: 231
|
|
private SourceContext sourceContext_;
|
|
|
|
// Token: 0x040000E8 RID: 232
|
|
public const int SyntaxFieldNumber = 5;
|
|
|
|
// Token: 0x040000E9 RID: 233
|
|
private Syntax syntax_;
|
|
}
|
|
}
|