AnalyzeRawProtobuf.Program.OneofDescriptorProto C# (CSharp) Method

OneofDescriptorProto() private method

The oneof descriptor proto.
private OneofDescriptorProto ( uint totalLength, OneofDescriptor od ) : void
totalLength uint /// The total length. ///
od OneofDescriptor /// The oneof descriptor. ///
return void
        private void OneofDescriptorProto(uint totalLength, OneofDescriptor od)
        {
            intend++;

            while (totalLength != 0)
            {
                int type, no;
                var l = GetTypeAndFieldNo(out type, out no);
                ix += l;
                totalLength -= (uint)l;

                switch (no)
                {
                    case 1: // string name
                        {
                            uint length;
                            var ixl = GetVarint(out length);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            od.Name = GetString(length);
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, Name = {3}", type, no, length, od.Name));
                            ix += (int)length;
                            totalLength -= length;
                            break;
                        }
                }
            }

            intend--;
        }