AnalyzeRawProtobuf.Program.FileOptions C# (CSharp) Method

FileOptions() private method

The file options.
private FileOptions ( uint totalLength, FileOptions options ) : void
totalLength uint /// The total length. ///
options FileOptions File options.
return void
        private void FileOptions(uint totalLength, FileOptions options)
        {
            intend++;

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

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

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

                    case 9: // OptimizeMode optimize_for
                        {
                            uint value;
                            var ixl = GetVarint(out value);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            options.OptimizeFor = (FileOptions.OptimizeMode)value;
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, optimize_for = {3}", type, no, ixl, value));
                            break;
                        }

                    case 10: // bool java_multiple_files
                        {
                            uint value;
                            var ixl = GetVarint(out value);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            options.JavaMultipleFiles = value != 0;
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, java_multiple_files = {3}", type, no, ixl, value));
                            break;
                        }

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

                    case 16: // bool cc_generic_services
                        {
                            uint value;
                            var ixl = GetVarint(out value);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            options.CcGenericServices = value != 0;
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, cc_generic_services = {3}", type, no, ixl, value));
                            break;
                        }

                    case 17: // bool java_generic_services
                        {
                            uint value;
                            var ixl = GetVarint(out value);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            options.JavaGenericServices = value != 0;
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, java_generic_services = {3}", type, no, ixl, value));
                            break;
                        }

                    case 18: // bool py_generic_services
                        {
                            uint value;
                            var ixl = GetVarint(out value);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            options.PyGenericServices = value != 0;
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, py_generic_services = {3}", type, no, ixl, value));
                            break;
                        }

                    case 20: // bool java_generate_equals_and_hash
                        {
                            uint value;
                            var ixl = GetVarint(out value);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            options.JavaGenerateEqualsAndHash = value != 0;
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, java_generate_equals_and_hash = {3}", type, no, ixl, value));
                            break;
                        }

                    case 23: // bool deprecated
                        {
                            uint value;
                            var ixl = GetVarint(out value);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            options.Deprecated = value != 0;
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, deprecated = {3}", type, no, ixl, value));
                            break;
                        }

                    case 27: // bool java_string_check_utf8
                        {
                            uint value;
                            var ixl = GetVarint(out value);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            options.JavaStringCheckUtf8 = value != 0;
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, java_string_check_utf8 = {3}", type, no, ixl, value));
                            break;
                        }
                }
            }

            intend--;
        }