This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
+278
View File
@@ -0,0 +1,278 @@
using System;
using System.Diagnostics;
using Google.Protobuf.Reflection;
namespace Google.Protobuf.WellKnownTypes
{
// Token: 0x0200001A RID: 26
public sealed class Any : IMessage<Any>, IMessage, IEquatable<Any>, IDeepCloneable<Any>
{
// Token: 0x1700002A RID: 42
// (get) Token: 0x06000154 RID: 340 RVA: 0x00007AD9 File Offset: 0x00005CD9
[DebuggerNonUserCode]
public static MessageParser<Any> Parser
{
get
{
return Any._parser;
}
}
// Token: 0x1700002B RID: 43
// (get) Token: 0x06000155 RID: 341 RVA: 0x00007AE0 File Offset: 0x00005CE0
[DebuggerNonUserCode]
public static MessageDescriptor Descriptor
{
get
{
return AnyReflection.Descriptor.MessageTypes[0];
}
}
// Token: 0x1700002C RID: 44
// (get) Token: 0x06000156 RID: 342 RVA: 0x00007AF2 File Offset: 0x00005CF2
[DebuggerNonUserCode]
MessageDescriptor IMessage.Descriptor
{
get
{
return Any.Descriptor;
}
}
// Token: 0x06000157 RID: 343 RVA: 0x00007AF9 File Offset: 0x00005CF9
[DebuggerNonUserCode]
public Any()
{
}
// Token: 0x06000158 RID: 344 RVA: 0x00007B17 File Offset: 0x00005D17
[DebuggerNonUserCode]
public Any(Any other)
: this()
{
this.typeUrl_ = other.typeUrl_;
this.value_ = other.value_;
}
// Token: 0x06000159 RID: 345 RVA: 0x00007B37 File Offset: 0x00005D37
[DebuggerNonUserCode]
public Any Clone()
{
return new Any(this);
}
// Token: 0x1700002D RID: 45
// (get) Token: 0x0600015A RID: 346 RVA: 0x00007B3F File Offset: 0x00005D3F
// (set) Token: 0x0600015B RID: 347 RVA: 0x00007B47 File Offset: 0x00005D47
[DebuggerNonUserCode]
public string TypeUrl
{
get
{
return this.typeUrl_;
}
set
{
this.typeUrl_ = ProtoPreconditions.CheckNotNull<string>(value, "value");
}
}
// Token: 0x1700002E RID: 46
// (get) Token: 0x0600015C RID: 348 RVA: 0x00007B5A File Offset: 0x00005D5A
// (set) Token: 0x0600015D RID: 349 RVA: 0x00007B62 File Offset: 0x00005D62
[DebuggerNonUserCode]
public ByteString Value
{
get
{
return this.value_;
}
set
{
this.value_ = ProtoPreconditions.CheckNotNull<ByteString>(value, "value");
}
}
// Token: 0x0600015E RID: 350 RVA: 0x00007B75 File Offset: 0x00005D75
[DebuggerNonUserCode]
public override bool Equals(object other)
{
return this.Equals(other as Any);
}
// Token: 0x0600015F RID: 351 RVA: 0x00007B83 File Offset: 0x00005D83
[DebuggerNonUserCode]
public bool Equals(Any other)
{
return other != null && (other == this || (!(this.TypeUrl != other.TypeUrl) && !(this.Value != other.Value)));
}
// Token: 0x06000160 RID: 352 RVA: 0x00007BBC File Offset: 0x00005DBC
[DebuggerNonUserCode]
public override int GetHashCode()
{
int num = 1;
if (this.TypeUrl.Length != 0)
{
num ^= this.TypeUrl.GetHashCode();
}
if (this.Value.Length != 0)
{
num ^= this.Value.GetHashCode();
}
return num;
}
// Token: 0x06000161 RID: 353 RVA: 0x00007C02 File Offset: 0x00005E02
[DebuggerNonUserCode]
public override string ToString()
{
return JsonFormatter.ToDiagnosticString(this);
}
// Token: 0x06000162 RID: 354 RVA: 0x00007C0C File Offset: 0x00005E0C
[DebuggerNonUserCode]
public void WriteTo(CodedOutputStream output)
{
if (this.TypeUrl.Length != 0)
{
output.WriteRawTag(10);
output.WriteString(this.TypeUrl);
}
if (this.Value.Length != 0)
{
output.WriteRawTag(18);
output.WriteBytes(this.Value);
}
}
// Token: 0x06000163 RID: 355 RVA: 0x00007C5C File Offset: 0x00005E5C
[DebuggerNonUserCode]
public int CalculateSize()
{
int num = 0;
if (this.TypeUrl.Length != 0)
{
num += 1 + CodedOutputStream.ComputeStringSize(this.TypeUrl);
}
if (this.Value.Length != 0)
{
num += 1 + CodedOutputStream.ComputeBytesSize(this.Value);
}
return num;
}
// Token: 0x06000164 RID: 356 RVA: 0x00007CA6 File Offset: 0x00005EA6
[DebuggerNonUserCode]
public void MergeFrom(Any other)
{
if (other == null)
{
return;
}
if (other.TypeUrl.Length != 0)
{
this.TypeUrl = other.TypeUrl;
}
if (other.Value.Length != 0)
{
this.Value = other.Value;
}
}
// Token: 0x06000165 RID: 357 RVA: 0x00007CE0 File Offset: 0x00005EE0
[DebuggerNonUserCode]
public void MergeFrom(CodedInputStream input)
{
uint num;
while ((num = input.ReadTag()) != 0U)
{
if (num != 10U)
{
if (num != 18U)
{
input.SkipLastField();
}
else
{
this.Value = input.ReadBytes();
}
}
else
{
this.TypeUrl = input.ReadString();
}
}
}
// Token: 0x06000166 RID: 358 RVA: 0x00007D25 File Offset: 0x00005F25
private static string GetTypeUrl(MessageDescriptor descriptor, string prefix)
{
if (!prefix.EndsWith("/"))
{
return prefix + "/" + descriptor.FullName;
}
return prefix + descriptor.FullName;
}
// Token: 0x06000167 RID: 359 RVA: 0x00007D54 File Offset: 0x00005F54
internal static string GetTypeName(string typeUrl)
{
int num = typeUrl.LastIndexOf('/');
if (num != -1)
{
return typeUrl.Substring(num + 1);
}
return "";
}
// Token: 0x06000168 RID: 360 RVA: 0x00007D80 File Offset: 0x00005F80
public T Unpack<T>() where T : IMessage, new()
{
T t = new T();
if (Any.GetTypeName(this.TypeUrl) != t.Descriptor.FullName)
{
throw new InvalidProtocolBufferException(string.Format("Full type name for {0} is {1}; Any message's type url is {2}", t.Descriptor.Name, t.Descriptor.FullName, this.TypeUrl));
}
t.MergeFrom(this.Value);
return t;
}
// Token: 0x06000169 RID: 361 RVA: 0x00007E03 File Offset: 0x00006003
public static Any Pack(IMessage message)
{
return Any.Pack(message, "type.googleapis.com");
}
// Token: 0x0600016A RID: 362 RVA: 0x00007E10 File Offset: 0x00006010
public static Any Pack(IMessage message, string typeUrlPrefix)
{
ProtoPreconditions.CheckNotNull<IMessage>(message, "message");
ProtoPreconditions.CheckNotNull<string>(typeUrlPrefix, "typeUrlPrefix");
return new Any
{
TypeUrl = Any.GetTypeUrl(message.Descriptor, typeUrlPrefix),
Value = message.ToByteString()
};
}
// Token: 0x0400004F RID: 79
private static readonly MessageParser<Any> _parser = new MessageParser<Any>(() => new Any());
// Token: 0x04000050 RID: 80
public const int TypeUrlFieldNumber = 1;
// Token: 0x04000051 RID: 81
private string typeUrl_ = "";
// Token: 0x04000052 RID: 82
public const int ValueFieldNumber = 2;
// Token: 0x04000053 RID: 83
private ByteString value_ = ByteString.Empty;
// Token: 0x04000054 RID: 84
private const string DefaultPrefix = "type.googleapis.com";
}
}