371 lines
9.2 KiB
C#
371 lines
9.2 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using Google.Protobuf.Collections;
|
|
using Google.Protobuf.Reflection;
|
|
|
|
namespace Google.Protobuf.WellKnownTypes
|
|
{
|
|
// Token: 0x02000031 RID: 49
|
|
public sealed class Type : IMessage<Type>, IMessage, IEquatable<Type>, IDeepCloneable<Type>
|
|
{
|
|
// Token: 0x17000077 RID: 119
|
|
// (get) Token: 0x06000279 RID: 633 RVA: 0x0000AD53 File Offset: 0x00008F53
|
|
[DebuggerNonUserCode]
|
|
public static MessageParser<Type> Parser
|
|
{
|
|
get
|
|
{
|
|
return Type._parser;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000078 RID: 120
|
|
// (get) Token: 0x0600027A RID: 634 RVA: 0x0000AD5A File Offset: 0x00008F5A
|
|
[DebuggerNonUserCode]
|
|
public static MessageDescriptor Descriptor
|
|
{
|
|
get
|
|
{
|
|
return TypeReflection.Descriptor.MessageTypes[0];
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000079 RID: 121
|
|
// (get) Token: 0x0600027B RID: 635 RVA: 0x0000AD6C File Offset: 0x00008F6C
|
|
[DebuggerNonUserCode]
|
|
MessageDescriptor IMessage.Descriptor
|
|
{
|
|
get
|
|
{
|
|
return Type.Descriptor;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600027C RID: 636 RVA: 0x0000AD73 File Offset: 0x00008F73
|
|
[DebuggerNonUserCode]
|
|
public Type()
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600027D RID: 637 RVA: 0x0000ADA8 File Offset: 0x00008FA8
|
|
[DebuggerNonUserCode]
|
|
public Type(Type other)
|
|
: this()
|
|
{
|
|
this.name_ = other.name_;
|
|
this.fields_ = other.fields_.Clone();
|
|
this.oneofs_ = other.oneofs_.Clone();
|
|
this.options_ = other.options_.Clone();
|
|
this.SourceContext = ((other.sourceContext_ != null) ? other.SourceContext.Clone() : null);
|
|
this.syntax_ = other.syntax_;
|
|
}
|
|
|
|
// Token: 0x0600027E RID: 638 RVA: 0x0000AE22 File Offset: 0x00009022
|
|
[DebuggerNonUserCode]
|
|
public Type Clone()
|
|
{
|
|
return new Type(this);
|
|
}
|
|
|
|
// Token: 0x1700007A RID: 122
|
|
// (get) Token: 0x0600027F RID: 639 RVA: 0x0000AE2A File Offset: 0x0000902A
|
|
// (set) Token: 0x06000280 RID: 640 RVA: 0x0000AE32 File Offset: 0x00009032
|
|
[DebuggerNonUserCode]
|
|
public string Name
|
|
{
|
|
get
|
|
{
|
|
return this.name_;
|
|
}
|
|
set
|
|
{
|
|
this.name_ = ProtoPreconditions.CheckNotNull<string>(value, "value");
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007B RID: 123
|
|
// (get) Token: 0x06000281 RID: 641 RVA: 0x0000AE45 File Offset: 0x00009045
|
|
[DebuggerNonUserCode]
|
|
public RepeatedField<Field> Fields
|
|
{
|
|
get
|
|
{
|
|
return this.fields_;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007C RID: 124
|
|
// (get) Token: 0x06000282 RID: 642 RVA: 0x0000AE4D File Offset: 0x0000904D
|
|
[DebuggerNonUserCode]
|
|
public RepeatedField<string> Oneofs
|
|
{
|
|
get
|
|
{
|
|
return this.oneofs_;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007D RID: 125
|
|
// (get) Token: 0x06000283 RID: 643 RVA: 0x0000AE55 File Offset: 0x00009055
|
|
[DebuggerNonUserCode]
|
|
public RepeatedField<Option> Options
|
|
{
|
|
get
|
|
{
|
|
return this.options_;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007E RID: 126
|
|
// (get) Token: 0x06000284 RID: 644 RVA: 0x0000AE5D File Offset: 0x0000905D
|
|
// (set) Token: 0x06000285 RID: 645 RVA: 0x0000AE65 File Offset: 0x00009065
|
|
[DebuggerNonUserCode]
|
|
public SourceContext SourceContext
|
|
{
|
|
get
|
|
{
|
|
return this.sourceContext_;
|
|
}
|
|
set
|
|
{
|
|
this.sourceContext_ = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007F RID: 127
|
|
// (get) Token: 0x06000286 RID: 646 RVA: 0x0000AE6E File Offset: 0x0000906E
|
|
// (set) Token: 0x06000287 RID: 647 RVA: 0x0000AE76 File Offset: 0x00009076
|
|
[DebuggerNonUserCode]
|
|
public Syntax Syntax
|
|
{
|
|
get
|
|
{
|
|
return this.syntax_;
|
|
}
|
|
set
|
|
{
|
|
this.syntax_ = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000288 RID: 648 RVA: 0x0000AE7F File Offset: 0x0000907F
|
|
[DebuggerNonUserCode]
|
|
public override bool Equals(object other)
|
|
{
|
|
return this.Equals(other as Type);
|
|
}
|
|
|
|
// Token: 0x06000289 RID: 649 RVA: 0x0000AE90 File Offset: 0x00009090
|
|
[DebuggerNonUserCode]
|
|
public bool Equals(Type other)
|
|
{
|
|
return other != null && (other == this || (!(this.Name != other.Name) && this.fields_.Equals(other.fields_) && this.oneofs_.Equals(other.oneofs_) && this.options_.Equals(other.options_) && object.Equals(this.SourceContext, other.SourceContext) && this.Syntax == other.Syntax));
|
|
}
|
|
|
|
// Token: 0x0600028A RID: 650 RVA: 0x0000AF24 File Offset: 0x00009124
|
|
[DebuggerNonUserCode]
|
|
public override int GetHashCode()
|
|
{
|
|
int num = 1;
|
|
if (this.Name.Length != 0)
|
|
{
|
|
num ^= this.Name.GetHashCode();
|
|
}
|
|
num ^= this.fields_.GetHashCode();
|
|
num ^= this.oneofs_.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: 0x0600028B RID: 651 RVA: 0x00007C02 File Offset: 0x00005E02
|
|
[DebuggerNonUserCode]
|
|
public override string ToString()
|
|
{
|
|
return JsonFormatter.ToDiagnosticString(this);
|
|
}
|
|
|
|
// Token: 0x0600028C RID: 652 RVA: 0x0000AFB0 File Offset: 0x000091B0
|
|
[DebuggerNonUserCode]
|
|
public void WriteTo(CodedOutputStream output)
|
|
{
|
|
if (this.Name.Length != 0)
|
|
{
|
|
output.WriteRawTag(10);
|
|
output.WriteString(this.Name);
|
|
}
|
|
this.fields_.WriteTo(output, Type._repeated_fields_codec);
|
|
this.oneofs_.WriteTo(output, Type._repeated_oneofs_codec);
|
|
this.options_.WriteTo(output, Type._repeated_options_codec);
|
|
if (this.sourceContext_ != null)
|
|
{
|
|
output.WriteRawTag(42);
|
|
output.WriteMessage(this.SourceContext);
|
|
}
|
|
if (this.Syntax != Syntax.Proto2)
|
|
{
|
|
output.WriteRawTag(48);
|
|
output.WriteEnum((int)this.Syntax);
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600028D RID: 653 RVA: 0x0000B04C File Offset: 0x0000924C
|
|
[DebuggerNonUserCode]
|
|
public int CalculateSize()
|
|
{
|
|
int num = 0;
|
|
if (this.Name.Length != 0)
|
|
{
|
|
num += 1 + CodedOutputStream.ComputeStringSize(this.Name);
|
|
}
|
|
num += this.fields_.CalculateSize(Type._repeated_fields_codec);
|
|
num += this.oneofs_.CalculateSize(Type._repeated_oneofs_codec);
|
|
num += this.options_.CalculateSize(Type._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: 0x0600028E RID: 654 RVA: 0x0000B0E4 File Offset: 0x000092E4
|
|
[DebuggerNonUserCode]
|
|
public void MergeFrom(Type other)
|
|
{
|
|
if (other == null)
|
|
{
|
|
return;
|
|
}
|
|
if (other.Name.Length != 0)
|
|
{
|
|
this.Name = other.Name;
|
|
}
|
|
this.fields_.Add(other.fields_);
|
|
this.oneofs_.Add(other.oneofs_);
|
|
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: 0x0600028F RID: 655 RVA: 0x0000B184 File Offset: 0x00009384
|
|
[DebuggerNonUserCode]
|
|
public void MergeFrom(CodedInputStream input)
|
|
{
|
|
uint num;
|
|
while ((num = input.ReadTag()) != 0U)
|
|
{
|
|
if (num <= 26U)
|
|
{
|
|
if (num == 10U)
|
|
{
|
|
this.Name = input.ReadString();
|
|
continue;
|
|
}
|
|
if (num == 18U)
|
|
{
|
|
this.fields_.AddEntriesFrom(input, Type._repeated_fields_codec);
|
|
continue;
|
|
}
|
|
if (num == 26U)
|
|
{
|
|
this.oneofs_.AddEntriesFrom(input, Type._repeated_oneofs_codec);
|
|
continue;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (num == 34U)
|
|
{
|
|
this.options_.AddEntriesFrom(input, Type._repeated_options_codec);
|
|
continue;
|
|
}
|
|
if (num == 42U)
|
|
{
|
|
if (this.sourceContext_ == null)
|
|
{
|
|
this.sourceContext_ = new SourceContext();
|
|
}
|
|
input.ReadMessage(this.sourceContext_);
|
|
continue;
|
|
}
|
|
if (num == 48U)
|
|
{
|
|
this.syntax_ = (Syntax)input.ReadEnum();
|
|
continue;
|
|
}
|
|
}
|
|
input.SkipLastField();
|
|
}
|
|
}
|
|
|
|
// Token: 0x040000B7 RID: 183
|
|
private static readonly MessageParser<Type> _parser = new MessageParser<Type>(() => new Type());
|
|
|
|
// Token: 0x040000B8 RID: 184
|
|
public const int NameFieldNumber = 1;
|
|
|
|
// Token: 0x040000B9 RID: 185
|
|
private string name_ = "";
|
|
|
|
// Token: 0x040000BA RID: 186
|
|
public const int FieldsFieldNumber = 2;
|
|
|
|
// Token: 0x040000BB RID: 187
|
|
private static readonly FieldCodec<Field> _repeated_fields_codec = FieldCodec.ForMessage<Field>(18U, Field.Parser);
|
|
|
|
// Token: 0x040000BC RID: 188
|
|
private readonly RepeatedField<Field> fields_ = new RepeatedField<Field>();
|
|
|
|
// Token: 0x040000BD RID: 189
|
|
public const int OneofsFieldNumber = 3;
|
|
|
|
// Token: 0x040000BE RID: 190
|
|
private static readonly FieldCodec<string> _repeated_oneofs_codec = FieldCodec.ForString(26U);
|
|
|
|
// Token: 0x040000BF RID: 191
|
|
private readonly RepeatedField<string> oneofs_ = new RepeatedField<string>();
|
|
|
|
// Token: 0x040000C0 RID: 192
|
|
public const int OptionsFieldNumber = 4;
|
|
|
|
// Token: 0x040000C1 RID: 193
|
|
private static readonly FieldCodec<Option> _repeated_options_codec = FieldCodec.ForMessage<Option>(34U, Option.Parser);
|
|
|
|
// Token: 0x040000C2 RID: 194
|
|
private readonly RepeatedField<Option> options_ = new RepeatedField<Option>();
|
|
|
|
// Token: 0x040000C3 RID: 195
|
|
public const int SourceContextFieldNumber = 5;
|
|
|
|
// Token: 0x040000C4 RID: 196
|
|
private SourceContext sourceContext_;
|
|
|
|
// Token: 0x040000C5 RID: 197
|
|
public const int SyntaxFieldNumber = 6;
|
|
|
|
// Token: 0x040000C6 RID: 198
|
|
private Syntax syntax_;
|
|
}
|
|
}
|