using System; using System.Diagnostics; using Google.Protobuf.Collections; namespace Google.Protobuf.Reflection { // Token: 0x02000046 RID: 70 internal sealed class EnumDescriptorProto : IMessage, IMessage, IEquatable, IDeepCloneable { // Token: 0x170000F8 RID: 248 // (get) Token: 0x06000410 RID: 1040 RVA: 0x0000FCF8 File Offset: 0x0000DEF8 [DebuggerNonUserCode] public static MessageParser Parser { get { return EnumDescriptorProto._parser; } } // Token: 0x170000F9 RID: 249 // (get) Token: 0x06000411 RID: 1041 RVA: 0x0000FCFF File Offset: 0x0000DEFF [DebuggerNonUserCode] public static MessageDescriptor Descriptor { get { return DescriptorReflection.Descriptor.MessageTypes[5]; } } // Token: 0x170000FA RID: 250 // (get) Token: 0x06000412 RID: 1042 RVA: 0x0000FD11 File Offset: 0x0000DF11 [DebuggerNonUserCode] MessageDescriptor IMessage.Descriptor { get { return EnumDescriptorProto.Descriptor; } } // Token: 0x06000413 RID: 1043 RVA: 0x0000FD18 File Offset: 0x0000DF18 [DebuggerNonUserCode] public EnumDescriptorProto() { } // Token: 0x06000414 RID: 1044 RVA: 0x0000FD38 File Offset: 0x0000DF38 [DebuggerNonUserCode] public EnumDescriptorProto(EnumDescriptorProto other) : this() { this.name_ = other.name_; this.value_ = other.value_.Clone(); this.Options = ((other.options_ != null) ? other.Options.Clone() : null); } // Token: 0x06000415 RID: 1045 RVA: 0x0000FD84 File Offset: 0x0000DF84 [DebuggerNonUserCode] public EnumDescriptorProto Clone() { return new EnumDescriptorProto(this); } // Token: 0x170000FB RID: 251 // (get) Token: 0x06000416 RID: 1046 RVA: 0x0000FD8C File Offset: 0x0000DF8C // (set) Token: 0x06000417 RID: 1047 RVA: 0x0000FD94 File Offset: 0x0000DF94 [DebuggerNonUserCode] public string Name { get { return this.name_; } set { this.name_ = ProtoPreconditions.CheckNotNull(value, "value"); } } // Token: 0x170000FC RID: 252 // (get) Token: 0x06000418 RID: 1048 RVA: 0x0000FDA7 File Offset: 0x0000DFA7 [DebuggerNonUserCode] public RepeatedField Value { get { return this.value_; } } // Token: 0x170000FD RID: 253 // (get) Token: 0x06000419 RID: 1049 RVA: 0x0000FDAF File Offset: 0x0000DFAF // (set) Token: 0x0600041A RID: 1050 RVA: 0x0000FDB7 File Offset: 0x0000DFB7 [DebuggerNonUserCode] public EnumOptions Options { get { return this.options_; } set { this.options_ = value; } } // Token: 0x0600041B RID: 1051 RVA: 0x0000FDC0 File Offset: 0x0000DFC0 [DebuggerNonUserCode] public override bool Equals(object other) { return this.Equals(other as EnumDescriptorProto); } // Token: 0x0600041C RID: 1052 RVA: 0x0000FDD0 File Offset: 0x0000DFD0 [DebuggerNonUserCode] public bool Equals(EnumDescriptorProto other) { return other != null && (other == this || (!(this.Name != other.Name) && this.value_.Equals(other.value_) && object.Equals(this.Options, other.Options))); } // Token: 0x0600041D RID: 1053 RVA: 0x0000FE28 File Offset: 0x0000E028 [DebuggerNonUserCode] public override int GetHashCode() { int num = 1; if (this.Name.Length != 0) { num ^= this.Name.GetHashCode(); } num ^= this.value_.GetHashCode(); if (this.options_ != null) { num ^= this.Options.GetHashCode(); } return num; } // Token: 0x0600041E RID: 1054 RVA: 0x00007C02 File Offset: 0x00005E02 [DebuggerNonUserCode] public override string ToString() { return JsonFormatter.ToDiagnosticString(this); } // Token: 0x0600041F RID: 1055 RVA: 0x0000FE78 File Offset: 0x0000E078 [DebuggerNonUserCode] public void WriteTo(CodedOutputStream output) { if (this.Name.Length != 0) { output.WriteRawTag(10); output.WriteString(this.Name); } this.value_.WriteTo(output, EnumDescriptorProto._repeated_value_codec); if (this.options_ != null) { output.WriteRawTag(26); output.WriteMessage(this.Options); } } // Token: 0x06000420 RID: 1056 RVA: 0x0000FED4 File Offset: 0x0000E0D4 [DebuggerNonUserCode] public int CalculateSize() { int num = 0; if (this.Name.Length != 0) { num += 1 + CodedOutputStream.ComputeStringSize(this.Name); } num += this.value_.CalculateSize(EnumDescriptorProto._repeated_value_codec); if (this.options_ != null) { num += 1 + CodedOutputStream.ComputeMessageSize(this.Options); } return num; } // Token: 0x06000421 RID: 1057 RVA: 0x0000FF2C File Offset: 0x0000E12C [DebuggerNonUserCode] public void MergeFrom(EnumDescriptorProto other) { if (other == null) { return; } if (other.Name.Length != 0) { this.Name = other.Name; } this.value_.Add(other.value_); if (other.options_ != null) { if (this.options_ == null) { this.options_ = new EnumOptions(); } this.Options.MergeFrom(other.Options); } } // Token: 0x06000422 RID: 1058 RVA: 0x0000FF94 File Offset: 0x0000E194 [DebuggerNonUserCode] public void MergeFrom(CodedInputStream input) { uint num; while ((num = input.ReadTag()) != 0U) { if (num != 10U) { if (num != 18U) { if (num != 26U) { input.SkipLastField(); } else { if (this.options_ == null) { this.options_ = new EnumOptions(); } input.ReadMessage(this.options_); } } else { this.value_.AddEntriesFrom(input, EnumDescriptorProto._repeated_value_codec); } } else { this.Name = input.ReadString(); } } } // Token: 0x04000170 RID: 368 private static readonly MessageParser _parser = new MessageParser(() => new EnumDescriptorProto()); // Token: 0x04000171 RID: 369 public const int NameFieldNumber = 1; // Token: 0x04000172 RID: 370 private string name_ = ""; // Token: 0x04000173 RID: 371 public const int ValueFieldNumber = 2; // Token: 0x04000174 RID: 372 private static readonly FieldCodec _repeated_value_codec = FieldCodec.ForMessage(18U, EnumValueDescriptorProto.Parser); // Token: 0x04000175 RID: 373 private readonly RepeatedField value_ = new RepeatedField(); // Token: 0x04000176 RID: 374 public const int OptionsFieldNumber = 3; // Token: 0x04000177 RID: 375 private EnumOptions options_; } }