using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using Google.Protobuf.Collections; using Google.Protobuf.Reflection; namespace Google.Protobuf.WellKnownTypes { // Token: 0x02000024 RID: 36 public sealed class FieldMask : IMessage, IMessage, IEquatable, IDeepCloneable, ICustomDiagnosticMessage { // Token: 0x17000054 RID: 84 // (get) Token: 0x060001E9 RID: 489 RVA: 0x0000958F File Offset: 0x0000778F [DebuggerNonUserCode] public static MessageParser Parser { get { return FieldMask._parser; } } // Token: 0x17000055 RID: 85 // (get) Token: 0x060001EA RID: 490 RVA: 0x00009596 File Offset: 0x00007796 [DebuggerNonUserCode] public static MessageDescriptor Descriptor { get { return FieldMaskReflection.Descriptor.MessageTypes[0]; } } // Token: 0x17000056 RID: 86 // (get) Token: 0x060001EB RID: 491 RVA: 0x000095A8 File Offset: 0x000077A8 [DebuggerNonUserCode] MessageDescriptor IMessage.Descriptor { get { return FieldMask.Descriptor; } } // Token: 0x060001EC RID: 492 RVA: 0x000095AF File Offset: 0x000077AF [DebuggerNonUserCode] public FieldMask() { } // Token: 0x060001ED RID: 493 RVA: 0x000095C2 File Offset: 0x000077C2 [DebuggerNonUserCode] public FieldMask(FieldMask other) : this() { this.paths_ = other.paths_.Clone(); } // Token: 0x060001EE RID: 494 RVA: 0x000095DB File Offset: 0x000077DB [DebuggerNonUserCode] public FieldMask Clone() { return new FieldMask(this); } // Token: 0x17000057 RID: 87 // (get) Token: 0x060001EF RID: 495 RVA: 0x000095E3 File Offset: 0x000077E3 [DebuggerNonUserCode] public RepeatedField Paths { get { return this.paths_; } } // Token: 0x060001F0 RID: 496 RVA: 0x000095EB File Offset: 0x000077EB [DebuggerNonUserCode] public override bool Equals(object other) { return this.Equals(other as FieldMask); } // Token: 0x060001F1 RID: 497 RVA: 0x000095F9 File Offset: 0x000077F9 [DebuggerNonUserCode] public bool Equals(FieldMask other) { return other != null && (other == this || this.paths_.Equals(other.paths_)); } // Token: 0x060001F2 RID: 498 RVA: 0x0000961C File Offset: 0x0000781C [DebuggerNonUserCode] public override int GetHashCode() { return 1 ^ this.paths_.GetHashCode(); } // Token: 0x060001F3 RID: 499 RVA: 0x00007C02 File Offset: 0x00005E02 [DebuggerNonUserCode] public override string ToString() { return JsonFormatter.ToDiagnosticString(this); } // Token: 0x060001F4 RID: 500 RVA: 0x0000962B File Offset: 0x0000782B [DebuggerNonUserCode] public void WriteTo(CodedOutputStream output) { this.paths_.WriteTo(output, FieldMask._repeated_paths_codec); } // Token: 0x060001F5 RID: 501 RVA: 0x0000963E File Offset: 0x0000783E [DebuggerNonUserCode] public int CalculateSize() { return 0 + this.paths_.CalculateSize(FieldMask._repeated_paths_codec); } // Token: 0x060001F6 RID: 502 RVA: 0x00009652 File Offset: 0x00007852 [DebuggerNonUserCode] public void MergeFrom(FieldMask other) { if (other == null) { return; } this.paths_.Add(other.paths_); } // Token: 0x060001F7 RID: 503 RVA: 0x0000966C File Offset: 0x0000786C [DebuggerNonUserCode] public void MergeFrom(CodedInputStream input) { uint num; while ((num = input.ReadTag()) != 0U) { if (num != 10U) { input.SkipLastField(); } else { this.paths_.AddEntriesFrom(input, FieldMask._repeated_paths_codec); } } } // Token: 0x060001F8 RID: 504 RVA: 0x000096A4 File Offset: 0x000078A4 internal static string ToJson(IList paths, bool diagnosticOnly) { string text = paths.FirstOrDefault((string p) => !FieldMask.ValidatePath(p)); if (text == null) { StringWriter stringWriter = new StringWriter(); IEnumerable enumerable = paths.Select(new Func(JsonFormatter.ToCamelCase)); JsonFormatter.WriteString(stringWriter, string.Join(",", enumerable.ToArray())); return stringWriter.ToString(); } if (diagnosticOnly) { StringWriter stringWriter2 = new StringWriter(); stringWriter2.Write("{ \"@warning\": \"Invalid FieldMask\", \"paths\": "); JsonFormatter.Default.WriteList(stringWriter2, (IList)paths); stringWriter2.Write(" }"); return stringWriter2.ToString(); } throw new InvalidOperationException(string.Format("Invalid field mask to be converted to JSON: {0}", text)); } // Token: 0x060001F9 RID: 505 RVA: 0x00009758 File Offset: 0x00007958 private static bool ValidatePath(string input) { for (int i = 0; i < input.Length; i++) { char c = input[i]; if (c >= 'A' && c <= 'Z') { return false; } if (c == '_' && i < input.Length - 1) { char c2 = input[i + 1]; if (c2 < 'a' || c2 > 'z') { return false; } } } return true; } // Token: 0x060001FA RID: 506 RVA: 0x000097B1 File Offset: 0x000079B1 public string ToDiagnosticString() { return FieldMask.ToJson(this.Paths, true); } // Token: 0x0400008C RID: 140 private static readonly MessageParser _parser = new MessageParser(() => new FieldMask()); // Token: 0x0400008D RID: 141 public const int PathsFieldNumber = 1; // Token: 0x0400008E RID: 142 private static readonly FieldCodec _repeated_paths_codec = FieldCodec.ForString(10U); // Token: 0x0400008F RID: 143 private readonly RepeatedField paths_ = new RepeatedField(); } }