diff --git a/.github/mergeable.yml b/.github/mergeable.yml index a827eb7c68..ade6c679a4 100644 --- a/.github/mergeable.yml +++ b/.github/mergeable.yml @@ -11,8 +11,8 @@ mergeable: regex: 'release notes: yes' message: 'Please include release notes: yes' - must_include: - regex: '^(c#|c\+\+|cleanup|conformance tests|integration|java|javascript|go|objective-c|php|python|ruby|bazel)' - message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: bazel, cleanup, conformance tests, integration.' + regex: '^(autotools|bazel|c#|c\+\+|cleanup|cmake|conformance tests|integration|go|java|javascript|objective-c|php|protoc|python|ruby|kotlin)' + message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: autotools, bazel, cmake, cleanup, conformance tests, integration, protoc.' - must_include: regex: 'release notes: no' message: 'Please include release notes: no' diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..497e811c8b --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,16 @@ +# GitHub Action to automate the identification of common misspellings in text files. +# https://github.com/codespell-project/actions-codespell +# https://github.com/codespell-project/codespell +name: codespell +on: [push, pull_request] +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: codespell-project/actions-codespell@master + with: + check_filenames: true + skip: ./.git,./conformance/third_party,*.snk,*.pb,*.pb.cc,*.pb.h,./src/google/protobuf/testdata,./objectivec/Tests,./python/compatibility_tests/v2.5.0/tests/google/protobuf/internal,./.github/workflows/codespell.yml + ignore_words_list: "alow,alse,ba,cleare,copyable,cloneable,dedup,dur,errorprone,files',fo,fundementals,hel,importd,inout,leapyear,nd,nin,ois,ons,parseable,process',te,testof,ue,unparseable,wasn,wee,gae,keyserver,objext,od,optin,sur" diff --git a/.gitignore b/.gitignore index 500072be1a..4e52414a2c 100644 --- a/.gitignore +++ b/.gitignore @@ -82,9 +82,7 @@ src/**/*.log src/**/*.trs # JavaBuild output. -java/core/target -java/util/target -javanano/target +java/**/target java/.idea java/**/*.iml @@ -104,7 +102,7 @@ build_msvc # needed to trigger "pod install" to rerun the preinstall commands. Pods/ -# Comformance test output +# Conformance test output conformance/.libs/ conformance/com/ conformance/conformance-cpp @@ -137,19 +135,25 @@ conformance/*.class # php test output composer.lock +php/.phpunit.result.cache +php/tests/.phpunit.result.cache php/tests/generated/ php/tests/old_protoc +php/tests/phpunit-9.phar php/tests/protobuf/ php/tests/core php/tests/vgcore* php/tests/multirequest.result php/tests/nohup.out +php/tests/.phpunit.result.cache +php/tests/phpunit-* php/ext/google/protobuf/.libs/ php/ext/google/protobuf/Makefile.fragments php/ext/google/protobuf/Makefile.global php/ext/google/protobuf/Makefile.objects php/ext/google/protobuf/acinclude.m4 php/ext/google/protobuf/build/ +php/ext/google/protobuf/bundled_php.c php/ext/google/protobuf/config.h php/ext/google/protobuf/config.h.in~ php/ext/google/protobuf/config.nice @@ -157,6 +161,7 @@ php/ext/google/protobuf/configure.ac php/ext/google/protobuf/configure.in php/ext/google/protobuf/mkinstalldirs php/ext/google/protobuf/run-tests.php +php/ext/google/protobuf/third_party/ vendor/ # JavaScript artifacts @@ -184,6 +189,7 @@ ruby/tests/generated_code_pb.rb ruby/tests/test_import_pb.rb ruby/tests/test_ruby_package_pb.rb ruby/tests/generated_code_proto2_pb.rb +ruby/tests/multi_level_nesting_test_pb.rb ruby/tests/test_import_proto2_pb.rb ruby/tests/test_ruby_package_proto2_pb.rb ruby/Gemfile.lock @@ -208,3 +214,6 @@ cmake/cmake-build-debug/ # IntelliJ .idea *.iml + +# BenchmarkDotNet +BenchmarkDotNet.Artifacts/ diff --git a/BUILD b/BUILD index 8ab4cb413e..441f28b3e1 100644 --- a/BUILD +++ b/BUILD @@ -3,8 +3,8 @@ load("@bazel_skylib//rules:common_settings.bzl", "string_flag") load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library", native_cc_proto_library = "cc_proto_library") load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") -load("@rules_proto//proto/private:native.bzl", "native_proto_common") load("@rules_python//python:defs.bzl", "py_library") +load("@rules_java//java:defs.bzl", "java_binary", "java_proto_library", "java_lite_proto_library") load(":cc_proto_blacklist_test.bzl", "cc_proto_blacklist_test") licenses(["notice"]) @@ -15,38 +15,6 @@ exports_files(["LICENSE"]) # build configuration ################################################################################ -string_flag( - name = "incompatible_use_com_google_googletest", - # TODO(yannic): Flip to `true` for `3.13.0`. - build_setting_default = "false", - values = ["true", "false"] -) - -config_setting( - name = "use_com_google_googletest", - flag_values = { - "//:incompatible_use_com_google_googletest": "true" - }, -) - -GTEST = select({ - "//:use_com_google_googletest": [ - "@com_google_googletest//:gtest", - ], - "//conditions:default": [ - "//external:gtest", - ], -}) - -GTEST_MAIN = select({ - "//:use_com_google_googletest": [ - "@com_google_googletest//:gtest_main", - ], - "//conditions:default": [ - "//external:gtest_main", - ], -}) - ################################################################################ # ZLIB configuration ################################################################################ @@ -165,6 +133,7 @@ cc_library( # AUTOGEN(protobuf_lite_srcs) "src/google/protobuf/any_lite.cc", "src/google/protobuf/arena.cc", + "src/google/protobuf/arenastring.cc", "src/google/protobuf/extension_set.cc", "src/google/protobuf/generated_enum_util.cc", "src/google/protobuf/generated_message_table_driven_lite.cc", @@ -176,6 +145,7 @@ cc_library( "src/google/protobuf/io/zero_copy_stream.cc", "src/google/protobuf/io/zero_copy_stream_impl.cc", "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", + "src/google/protobuf/map.cc", "src/google/protobuf/message_lite.cc", "src/google/protobuf/parse_context.cc", "src/google/protobuf/repeated_field.cc", @@ -222,6 +192,7 @@ cc_library( "src/google/protobuf/dynamic_message.cc", "src/google/protobuf/empty.pb.cc", "src/google/protobuf/extension_set_heavy.cc", + "src/google/protobuf/field_access_listener.cc", "src/google/protobuf/field_mask.pb.cc", "src/google/protobuf/generated_message_reflection.cc", "src/google/protobuf/generated_message_table_driven.cc", @@ -322,12 +293,45 @@ WELL_KNOWN_PROTO_MAP = { WELL_KNOWN_PROTOS = [value[0] for value in WELL_KNOWN_PROTO_MAP.values()] +LITE_WELL_KNOWN_PROTO_MAP = { + "any": ("src/google/protobuf/any.proto", []), + "api": ( + "src/google/protobuf/api.proto", + [ + "source_context", + "type", + ], + ), + "duration": ("src/google/protobuf/duration.proto", []), + "empty": ("src/google/protobuf/empty.proto", []), + "field_mask": ("src/google/protobuf/field_mask.proto", []), + "source_context": ("src/google/protobuf/source_context.proto", []), + "struct": ("src/google/protobuf/struct.proto", []), + "timestamp": ("src/google/protobuf/timestamp.proto", []), + "type": ( + "src/google/protobuf/type.proto", + [ + "any", + "source_context", + ], + ), + "wrappers": ("src/google/protobuf/wrappers.proto", []), +} + +LITE_WELL_KNOWN_PROTOS = [value[0] for value in LITE_WELL_KNOWN_PROTO_MAP.values()] + filegroup( name = "well_known_protos", srcs = WELL_KNOWN_PROTOS, visibility = ["//visibility:public"], ) +filegroup( + name = "lite_well_known_protos", + srcs = LITE_WELL_KNOWN_PROTOS, + visibility = ["//visibility:public"], +) + adapt_proto_library( name = "cc_wkt_protos_genproto", deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], @@ -368,7 +372,15 @@ cc_library( cc_proto_blacklist_test( name = "cc_proto_blacklist_test", - deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()] + deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], + tags = [ + # Exclude this target from wildcard expansion (//...). Due to + # https://github.com/bazelbuild/bazel/issues/10590, this test has to + # be nominated using the `@com_google_protobuf//` prefix. We do that, + # e.g., in kokoro/linux/bazel/build.sh. + # See also https://github.com/protocolbuffers/protobuf/pull/7096. + "manual", + ], ) ################################################################################ @@ -392,6 +404,7 @@ cc_library( "src/google/protobuf/compiler/cpp/cpp_message.cc", "src/google/protobuf/compiler/cpp/cpp_message_field.cc", "src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc", + "src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc", "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", "src/google/protobuf/compiler/cpp/cpp_service.cc", "src/google/protobuf/compiler/cpp/cpp_string_field.cc", @@ -424,6 +437,7 @@ cc_library( "src/google/protobuf/compiler/java/java_generator.cc", "src/google/protobuf/compiler/java/java_generator_factory.cc", "src/google/protobuf/compiler/java/java_helpers.cc", + "src/google/protobuf/compiler/java/java_kotlin_generator.cc", "src/google/protobuf/compiler/java/java_map_field.cc", "src/google/protobuf/compiler/java/java_map_field_lite.cc", "src/google/protobuf/compiler/java/java_message.cc", @@ -480,13 +494,18 @@ cc_binary( # Tests ################################################################################ +filegroup( + name = "testdata", + visibility = ["//:__subpackages__"], + srcs = glob(["src/google/protobuf/testdata/**/*"]), +) + RELATIVE_LITE_TEST_PROTOS = [ # AUTOGEN(lite_test_protos) "google/protobuf/map_lite_unittest.proto", "google/protobuf/unittest_import_lite.proto", "google/protobuf/unittest_import_public_lite.proto", "google/protobuf/unittest_lite.proto", - "google/protobuf/unittest_no_arena_lite.proto", ] LITE_TEST_PROTOS = ["src/" + s for s in RELATIVE_LITE_TEST_PROTOS] @@ -513,8 +532,6 @@ RELATIVE_TEST_PROTOS = [ "google/protobuf/unittest_lite_imports_nonlite.proto", "google/protobuf/unittest_mset.proto", "google/protobuf/unittest_mset_wire_format.proto", - "google/protobuf/unittest_no_arena.proto", - "google/protobuf/unittest_no_arena_import.proto", "google/protobuf/unittest_no_field_presence.proto", "google/protobuf/unittest_no_generic_services.proto", "google/protobuf/unittest_optimize_for.proto", @@ -544,6 +561,57 @@ RELATIVE_TEST_PROTOS = [ TEST_PROTOS = ["src/" + s for s in RELATIVE_TEST_PROTOS] +GENERIC_RELATIVE_TEST_PROTOS = [ + "google/protobuf/unittest.proto", + "google/protobuf/unittest_arena.proto", + "google/protobuf/unittest_custom_options.proto", + "google/protobuf/unittest_drop_unknown_fields.proto", + "google/protobuf/unittest_embed_optimize_for.proto", + "google/protobuf/unittest_empty.proto", + "google/protobuf/unittest_enormous_descriptor.proto", + "google/protobuf/unittest_import.proto", + "google/protobuf/unittest_import_public.proto", + "google/protobuf/unittest_lazy_dependencies.proto", + "google/protobuf/unittest_lazy_dependencies_custom_option.proto", + "google/protobuf/unittest_lazy_dependencies_enum.proto", + "google/protobuf/unittest_lite_imports_nonlite.proto", + "google/protobuf/unittest_mset.proto", + "google/protobuf/unittest_mset_wire_format.proto", + "google/protobuf/unittest_no_field_presence.proto", + "google/protobuf/unittest_no_generic_services.proto", + "google/protobuf/unittest_optimize_for.proto", + "google/protobuf/unittest_preserve_unknown_enum.proto", + "google/protobuf/unittest_preserve_unknown_enum2.proto", + "google/protobuf/unittest_proto3.proto", + "google/protobuf/unittest_proto3_arena.proto", + "google/protobuf/unittest_proto3_arena_lite.proto", + "google/protobuf/unittest_proto3_lite.proto", + "google/protobuf/unittest_proto3_optional.proto", + "google/protobuf/unittest_well_known_types.proto", +] + +GENERIC_TEST_PROTOS = ["src/" + s for s in GENERIC_RELATIVE_TEST_PROTOS] + +proto_library( + name = "generic_test_protos", + visibility = ["//:__subpackages__"], + strip_import_prefix = "src", + srcs = LITE_TEST_PROTOS + GENERIC_TEST_PROTOS, + deps = [ + "//:any_proto", + "//:api_proto", + "//:descriptor_proto", + "//:duration_proto", + "//:empty_proto", + "//:field_mask_proto", + "//:source_context_proto", + "//:struct_proto", + "//:timestamp_proto", + "//:type_proto", + "//:wrappers_proto", + ], +) + cc_proto_library( name = "cc_test_protos", srcs = LITE_TEST_PROTOS + TEST_PROTOS, @@ -565,6 +633,7 @@ COMMON_TEST_SRCS = [ cc_binary( name = "test_plugin", + testonly = True, srcs = [ # AUTOGEN(test_plugin_srcs) "src/google/protobuf/compiler/mock_code_generator.cc", @@ -574,7 +643,8 @@ cc_binary( deps = [ ":protobuf", ":protoc_lib", - ] + GTEST, + "@com_google_googletest//:gtest", + ], ) cc_test( @@ -586,7 +656,9 @@ cc_test( ], deps = [ ":protobuf_lite", - ] + GTEST_MAIN, + "@com_google_googletest//:gtest", + "@com_google_googletest//:gtest_main", + ], ) cc_test( @@ -689,7 +761,9 @@ cc_test( ":cc_test_protos", ":protobuf", ":protoc_lib", - ] + PROTOBUF_DEPS + GTEST_MAIN, + "@com_google_googletest//:gtest", + "@com_google_googletest//:gtest_main", + ] + PROTOBUF_DEPS, ) ################################################################################ @@ -704,6 +778,15 @@ internal_gen_well_known_protos_java( ], ) +internal_gen_well_known_protos_java( + name = "gen_well_known_protos_javalite", + deps = [proto + "_proto" for proto in LITE_WELL_KNOWN_PROTO_MAP.keys()], + javalite = True, + visibility = [ + "//java:__subpackages__", + ], +) + alias( name = "protobuf_java", actual = "//java/core", @@ -742,10 +825,9 @@ py_library( name = "python_srcs", srcs = glob( [ - "python/google/**/*.py", + "python/google/protobuf/**/*.py", ], exclude = [ - "python/google/protobuf/**/__init__.py", "python/google/protobuf/internal/*_test.py", "python/google/protobuf/internal/test_util.py", ], @@ -760,6 +842,13 @@ cc_binary( copts = COPTS + [ "-DPYTHON_PROTO2_CPP_IMPL_V2", ], + tags = [ + # Exclude this target from wildcard expansion (//...) because it may + # not even be buildable. It will be built if it is needed according + # to :use_fast_cpp_protos. + # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes + "manual", + ], linkshared = 1, linkstatic = 1, deps = select({ @@ -784,6 +873,13 @@ cc_binary( "python/", "src/", ], + tags = [ + # Exclude this target from wildcard expansion (//...) because it may + # not even be buildable. It will be built if it is needed according + # to :use_fast_cpp_protos. + # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes + "manual", + ], linkshared = 1, linkstatic = 1, deps = [ @@ -846,7 +942,6 @@ py_proto_library( }), default_runtime = "", protoc = ":protoc", - py_extra_srcs = glob(["python/**/__init__.py"]), py_libs = [ ":python_srcs", "@six//:six", @@ -948,13 +1043,9 @@ cc_library( ], ) -# Note: We use `native_proto_common` here because we depend on an implementation-detail of -# `proto_lang_toolchain`, which may not be available on `proto_common`. -reject_blacklisted_files = hasattr(native_proto_common, "proto_lang_toolchain_rejects_files_do_not_use_or_we_will_break_you_without_mercy") -cc_toolchain_blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()] if reject_blacklisted_files else [":well_known_protos"] proto_lang_toolchain( name = "cc_toolchain", - blacklisted_protos = cc_toolchain_blacklisted_protos, + blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()], command_line = "--cpp_out=$(OUT)", runtime = ":protobuf", visibility = ["//visibility:public"], @@ -962,86 +1053,13 @@ proto_lang_toolchain( alias( name = "objectivec", - actual = ":protobuf_objc", + actual = "//objectivec", visibility = ["//visibility:public"], ) -objc_library( +alias( name = "protobuf_objc", - hdrs = [ - "objectivec/GPBArray.h", - "objectivec/GPBBootstrap.h", - "objectivec/GPBCodedInputStream.h", - "objectivec/GPBCodedOutputStream.h", - "objectivec/GPBDescriptor.h", - "objectivec/GPBDictionary.h", - "objectivec/GPBExtensionInternals.h", - "objectivec/GPBExtensionRegistry.h", - "objectivec/GPBMessage.h", - "objectivec/GPBProtocolBuffers.h", - "objectivec/GPBProtocolBuffers_RuntimeSupport.h", - "objectivec/GPBRootObject.h", - "objectivec/GPBRuntimeTypes.h", - "objectivec/GPBUnknownField.h", - "objectivec/GPBUnknownFieldSet.h", - "objectivec/GPBUtilities.h", - "objectivec/GPBWellKnownTypes.h", - "objectivec/GPBWireFormat.h", - "objectivec/google/protobuf/Any.pbobjc.h", - "objectivec/google/protobuf/Api.pbobjc.h", - "objectivec/google/protobuf/Duration.pbobjc.h", - "objectivec/google/protobuf/Empty.pbobjc.h", - "objectivec/google/protobuf/FieldMask.pbobjc.h", - "objectivec/google/protobuf/SourceContext.pbobjc.h", - "objectivec/google/protobuf/Struct.pbobjc.h", - "objectivec/google/protobuf/Timestamp.pbobjc.h", - "objectivec/google/protobuf/Type.pbobjc.h", - "objectivec/google/protobuf/Wrappers.pbobjc.h", - # Package private headers, but exposed because the generated sources - # need to use them. - "objectivec/GPBArray_PackagePrivate.h", - "objectivec/GPBCodedInputStream_PackagePrivate.h", - "objectivec/GPBCodedOutputStream_PackagePrivate.h", - "objectivec/GPBDescriptor_PackagePrivate.h", - "objectivec/GPBDictionary_PackagePrivate.h", - "objectivec/GPBMessage_PackagePrivate.h", - "objectivec/GPBRootObject_PackagePrivate.h", - "objectivec/GPBUnknownFieldSet_PackagePrivate.h", - "objectivec/GPBUnknownField_PackagePrivate.h", - "objectivec/GPBUtilities_PackagePrivate.h", - ], - copts = [ - "-Wno-vla", - ], - includes = [ - "objectivec", - ], - non_arc_srcs = [ - "objectivec/GPBArray.m", - "objectivec/GPBCodedInputStream.m", - "objectivec/GPBCodedOutputStream.m", - "objectivec/GPBDescriptor.m", - "objectivec/GPBDictionary.m", - "objectivec/GPBExtensionInternals.m", - "objectivec/GPBExtensionRegistry.m", - "objectivec/GPBMessage.m", - "objectivec/GPBRootObject.m", - "objectivec/GPBUnknownField.m", - "objectivec/GPBUnknownFieldSet.m", - "objectivec/GPBUtilities.m", - "objectivec/GPBWellKnownTypes.m", - "objectivec/GPBWireFormat.m", - "objectivec/google/protobuf/Any.pbobjc.m", - "objectivec/google/protobuf/Api.pbobjc.m", - "objectivec/google/protobuf/Duration.pbobjc.m", - "objectivec/google/protobuf/Empty.pbobjc.m", - "objectivec/google/protobuf/FieldMask.pbobjc.m", - "objectivec/google/protobuf/SourceContext.pbobjc.m", - "objectivec/google/protobuf/Struct.pbobjc.m", - "objectivec/google/protobuf/Timestamp.pbobjc.m", - "objectivec/google/protobuf/Type.pbobjc.m", - "objectivec/google/protobuf/Wrappers.pbobjc.m", - ], + actual = "//objectivec", visibility = ["//visibility:public"], ) @@ -1195,3 +1213,91 @@ sh_test( "update_file_lists.sh", ], ) + +java_proto_library( + name = "test_messages_proto2_java_proto", + visibility = [ + "//java:__subpackages__", + ], + deps = [":test_messages_proto2_proto"], +) + +java_proto_library( + name = "test_messages_proto3_java_proto", + visibility = [ + "//java:__subpackages__", + ], + deps = [":test_messages_proto3_proto"], +) + +java_proto_library( + name = "conformance_java_proto", + visibility = [ + "//java:__subpackages__", + ], + deps = [":conformance_proto"], +) + +java_lite_proto_library( + name = "test_messages_proto2_java_proto_lite", + visibility = [ + "//java:__subpackages__", + ], + deps = [":test_messages_proto2_proto"], +) + +java_lite_proto_library( + name = "conformance_java_proto_lite", + visibility = [ + "//java:__subpackages__", + ], + deps = [":conformance_proto"], +) + +java_lite_proto_library( + name = "test_messages_proto3_java_proto_lite", + visibility = [ + "//java:__subpackages__", + ], + deps = [":test_messages_proto3_proto"], +) + +java_binary( + name = "conformance_java", + srcs = ["conformance/ConformanceJava.java"], + visibility = [ + "//java:__subpackages__", + ], + main_class = "ConformanceJava", + deps = [ + ":conformance_java_proto", + ":test_messages_proto2_java_proto", + ":test_messages_proto3_java_proto", + "//:protobuf_java", + "//:protobuf_java_util", + ], +) + +java_binary( + name = "conformance_java_lite", + srcs = ["conformance/ConformanceJavaLite.java"], + visibility = [ + "//java:__subpackages__", + ], + main_class = "ConformanceJavaLite", + deps = [ + ":conformance_java_proto_lite", + ":test_messages_proto2_java_proto_lite", + ":test_messages_proto3_java_proto_lite", + "//:protobuf_javalite", + "//:protobuf_java_util", + ], +) + +exports_files([ + "conformance/conformance_test_runner.sh", + "conformance/failure_list_java.txt", + "conformance/failure_list_java_lite.txt", + "conformance/text_format_failure_list_java.txt", + "conformance/text_format_failure_list_java_lite.txt", +]) diff --git a/CHANGES.txt b/CHANGES.txt index cbd3a20a88..f614602ae5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,601 @@ +2021-06-04 version 3.17.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + C++ + * Introduce FieldAccessListener. + * Stop emitting boilerplate {Copy/Merge}From in each ProtoBuf class + * Fixed some uninitialized variable warnings in generated_message_reflection.cc. + + Kotlin + * Fix duplicate proto files error (#8699) + + Java + * Fixed parser to check that we are at a proper limit when a sub-message has + finished parsing. + +2021-05-25 version 3.17.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + Kotlin + * Fix duplicate class error (#8653) + + PHP + * Fixed SEGV in sub-message getters for well-known types when message is unset + (#8670) + +2021-05-07 version 3.17.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + PHP + * Fixed PHP memory leaks and arginfo errors. (#8614) + * Fixed JSON parser to allow multiple values from the same oneof as long as + all but one are null. + + Ruby + * Fixed memory bug: properly root repeated/map field when assigning. (#8639) + * Fixed JSON parser to allow multiple values from the same oneof as long as + all but one are null. + + +2021-05-07 version 3.17.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Protocol Compiler + * Fix the generated source information for reserved values in Enums. + + C++ + * Fix -Wunused-parameter in map fields (fixes #8494) (#8500) + * Use byteswap.h when building against musl libc (#8503) + * Fix -Wundefined-inline error when using SharedCtor() or SharedDtor() (#8532) + * Fix bug where `Descriptor::DebugString()` printed proto3 synthetic oneofs. + * Provide stable versions of `SortAndUnique()`. + * Make sure to cache proto3 optional message fields when they are cleared. + * Expose UnsafeArena methods to Reflection. + * Use std::string::empty() rather than std::string::size() > 0. + + Kotlin + * Restrict extension setter and getter operators to non-nullable T. + + Java + * updating GSON and Guava to more recent versions (#8524) + * Reduce the time spent evaluating isExtensionNumber by storing the extension + ranges in a TreeMap for faster queries. This is particularly relevant for + protos which define a large number of extension ranges, for example when + each tag is defined as an extension. + * Fix java bytecode estimation logic for optional fields. + * Optimize Descriptor.isExtensionNumber. + + Python + * Add MethodDescriptor.CopyToProto() (#8327) + * Remove unused python_protobuf.{cc,h} (#8513) + * Start publishing python aarch64 manylinux wheels normally (#8530) + * Fix constness issue detected by MSVC standard conforming mode (#8568) + * Make JSON parsing match C++ and Java when multiple fields from the same + oneof are present and all but one is null. + + Ruby + * Add support for proto3 json_name in compiler and field definitions (#8356) + * Fixed memory leak of Ruby arena objects. (#8461) + * Fix source gem compilation (#8471) + * Fix various exceptions in Ruby on 64-bit Windows (#8563) + * Fix crash when calculating Message hash values on 64-bit Windows (#8565) + + Conformance Tests + * Added a conformance test for the case of multiple fields from the same + oneof. + +2021-04-06 version 3.16.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + Other + * Opensourcing kotlin protos (#8272) + * Use a newer version of rules_proto, with the new rule `proto_descriptor_set` (#8469) + + C++ + * Fix compiler warnings issue found in conformance_test_runner #8189 (#8190) + * Fix MinGW-w64 build issues. (#8286) + * [Protoc] C++ Resolved an issue where NO_DESTROY and CONSTINIT are in incorrect order (#8296) + * Fix PROTOBUF_CONSTINIT macro redefinition (#8323) + * Delete StringPiecePod (#8353) + * Fix gcc error: comparison of unsigned expression in '>= 0' is always … (#8309) + * Fix cmake install on iOS (#8301) + * Create a CMake option to control whether or not RTTI is enabled (#8347) + * Fix endian.h location on FreeBSD (#8351) + * Refactor util::Status (#8354) + * Make util::Status more similar to absl::Status (#8405) + * Fix -Wsuggest-destructor-override for generated C++ proto classes. (#8408) + * Refactor StatusOr and StringPiece (#8406) + * Refactor uint128 (#8416) + * The ::pb namespace is no longer exposed due to conflicts. + * Allow MessageDifferencer::TreatAsSet() (and friends) to override previous + calls instead of crashing. + * Reduce the size of generated proto headers for protos with `string` or + `bytes` fields. + * Move arena() operation on uncommon path to out-of-line routine + * For iterator-pair function parameter types, take both iterators by value. + * Code-space savings and perhaps some modest performance improvements in + RepeatedPtrField. + * Eliminate nullptr check from every tag parse. + * Remove unused _$name$_cached_byte_size_ fields. + * Serialize extension ranges together when not broken by a proto field in the + middle. + * Do out-of-line allocation and deallocation of string object in ArenaString. + * Streamline ParseContext::ParseMessage to avoid code bloat and improve + performance. + * New member functions RepeatedField::Assign, RepeatedPtrField::{Add, Assign}. + * Fix undefined behavior warning due to innocuous uninitialization of value + on an error path. + * Avoid expensive inlined code space for encoding message length for messages + >= 128 bytes and instead do a procedure call to a shared out-of-line routine. + * util::DefaultFieldComparator will be final in a future version of protobuf. + Subclasses should inherit from SimpleFieldComparator instead. + + C# + * Add .NET 5 target and improve WriteString performance with SIMD (#8147) + + Java + * deps: update JUnit and Truth (#8319) + * Detect invalid overflow of byteLimit and return InvalidProtocolBufferException as documented. + * Exceptions thrown while reading from an InputStream in parseFrom are now + included as causes. + * Support potentially more efficient proto parsing from RopeByteStrings. + * Clarify runtime of ByteString.Output.toStringBuffer(). + * Added UnsafeByteOperations to protobuf-lite (#8426) + + JavaScript + * Make Any.pack() chainable. + + Python + * Fix some constness / char literal issues being found by MSVC standard conforming mode (#8344) + * Switch on "new" buffer API (#8339) + * Enable crosscompiling aarch64 python wheels under dockcross manylinux docker image (#8280) + * Fixed a bug in text format where a trailing colon was printed for repeated field. + * When TextFormat encounters a duplicate message map key, replace the current + one instead of merging. + + Objective-C + * Move the class map to a CFDictionary. (#8328) + + PHP + * read_property() handler is not supposed to return NULL (#8362) + * Changed parameter type from long to integer (#7613) + * fix: README supported PHP version for C extension (#8236) + + Ruby + * Fixed quadratic memory usage when appending to arrays. (#8364) + * Fixed memory leak of Ruby arena objects. (#8461) + * Add support for proto3 json_name in compiler and field definitions. (#8356) + + Other + * Some doc on AOT compilation and protobuf (#8294) + * [CMake] Ability to pass options to protoc executable from cmake (#8374) + * Add --fatal_warnings flag to treat warnings as errors (#8131) + * [bazel] Remove deprecated way to depend on googletest (#8396) + * add error returns missing from protoc to prevent it from exiting with… (#8409) + + +2021-04-07 version 3.15.8 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Ruby + * Fixed memory leak of Ruby arena objects (#8461) + +2021-04-02 version 3.15.7 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + C++ + * Remove the ::pb namespace (alias) (#8423) + + Ruby + * Fix unbounded memory growth for Ruby <2.7 (#8429) + * Fixed message equality in cases where the message type is different (#8434) + +2021-03-10 version 3.15.6 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Ruby + * Fixed bug in string comparison logic (#8386) + +2021-03-04 version 3.15.5 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Ruby + * Fixed quadratic memory use in array append (#8379) + + PHP + * Fixed quadratic memory use in array append (#8379) + + C++ + * Do not disable RTTI by default in the CMake build (#8377) + +2021-03-02 version 3.15.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Ruby + * Fixed SEGV when users pass nil messages (#8363) + * Fixed quadratic memory usage when appending to arrays (#8364) + + C++ + * Create a CMake option to control whether or not RTTI is enabled (#8361) + + PHP + * read_property() handler is not supposed to return NULL (#8362) + +2021-02-25 version 3.15.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Ruby + * Ruby <2.7 now uses WeakMap too, which prevents memory leaks. (#8341) + +2021-02-23 version 3.15.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Ruby + * Fix for FieldDescriptor.get(msg) (#8330) + + C++ + * Fix PROTOBUF_CONSTINIT macro redefinition (#8323) + +2021-02-05 version 3.15.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Ruby + * Bugfix for Message.[] for repeated or map fields (#8313) + +2021-02-05 version 3.15.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Protocol Compiler + * Optional fields for proto3 are enabled by default, and no longer require + the --experimental_allow_proto3_optional flag. + + C++ + * MessageDifferencer: fixed bug when using custom ignore with multiple + unknown fields + * Use init_seg in MSVC to push initialization to an earlier phase. + * Runtime no longer triggers -Wsign-compare warnings. + * Fixed -Wtautological-constant-out-of-range-compare warning. + * DynamicCastToGenerated works for nullptr input for even if RTTI is disabled + * Arena is refactored and optimized. + * Clarified/specified that the exact value of Arena::SpaceAllocated() is an + implementation detail users must not rely on. It should not be used in + unit tests. + * Change the signature of Any::PackFrom() to return false on error. + * Add fast reflection getter API for strings. + * Constant initialize the global message instances + * Avoid potential for missed wakeup in UnknownFieldSet + * Now Proto3 Oneof fields have "has" methods for checking their presence in + C++. + * Bugfix for NVCC + * Return early in _InternalSerialize for empty maps. + * Adding functionality for outputting map key values in proto path logging + output (does not affect comparison logic) and stop printing 'value' in the + path. The modified print functionality is in the + MessageDifferencer::StreamReporter. + * Fixed https://github.com/protocolbuffers/protobuf/issues/8129 + * Ensure that null char symbol, package and file names do not result in a + crash. + * Constant initialize the global message instances + * Pretty print 'max' instead of numeric values in reserved ranges. + * Removed remaining instances of std::is_pod, which is deprecated in C++20. + * Changes to reduce code size for unknown field handling by making uncommon + cases out of line. + * Fix std::is_pod deprecated in C++20 (#7180) + * Fix some -Wunused-parameter warnings (#8053) + * Fix detecting file as directory on zOS issue #8051 (#8052) + * Don't include sys/param.h for _BYTE_ORDER (#8106) + * remove CMAKE_THREAD_LIBS_INIT from pkgconfig CFLAGS (#8154) + * Fix TextFormatMapTest.DynamicMessage issue#5136 (#8159) + * Fix for compiler warning issue#8145 (#8160) + * fix: support deprecated enums for GCC < 6 (#8164) + * Fix some warning when compiling with Visual Studio 2019 on x64 target (#8125) + + Python + * Provided an override for the reverse() method that will reverse the internal + collection directly instead of using the other methods of the BaseContainer. + * MessageFactory.CreateProtoype can be overridden to customize class creation. + * Fix PyUnknownFields memory leak (#7928) + * Add macOS Big Sur compatibility (#8126) + + JavaScript + * Generate `getDescriptor` methods with `*` as their `this` type. + * Enforce `let/const` for generated messages. + * js/binary/utils.js: Fix jspb.utils.joinUnsignedDecimalString to work with negative bitsLow and low but non-zero bitsHigh parameter. (#8170) + + PHP + * Added support for PHP 8. (#8105) + * unregister INI entries and fix invalid read on shutdown (#8042) + * Fix PhpDoc comments for message accessors to include "|null". (#8136) + * fix: convert native PHP floats to single precision (#8187) + * Fixed PHP to support field numbers >=2**28. (#8235) + * feat: add support for deprecated fields to PHP compiler (#8223) + * Protect against stack overflow if the user derives from Message. (#8248) + * Fixed clone for Message, RepeatedField, and MapField. (#8245) + * Updated upb to allow nonzero offset minutes in JSON timestamps. (#8258) + + Ruby + * Added support for Ruby 3. (#8184) + * Rewrote the data storage layer to be based on upb_msg objects from the + upb library. This should lead to much better parsing performance, + particularly for large messages. (#8184). + * Fill out JRuby support (#7923) + * [Ruby] Fix: (SIGSEGV) gRPC-Ruby issue on Windows. memory alloc infinite + recursion/run out of memory (#8195) + * Fix jruby support to handle messages nested more than 1 level deep (#8194) + + Java + * Avoid possible UnsupportedOperationException when using CodedInputSteam + with a direct ByteBuffer. + * Make Durations.comparator() and Timestamps.comparator() Serializable. + * Add more detailed error information for dynamic message field type + validation failure + * Removed declarations of functions declared in java_names.h from + java_helpers.h. + * Now Proto3 Oneof fields have "has" methods for checking their presence in + Java. + * Annotates Java proto generated *_FIELD_NUMBER constants. + * Add -assumevalues to remove JvmMemoryAccessor on Android. + + C# + * Fix parsing negative Int32Value that crosses segment boundary (#8035) + * Change ByteString to use memory and support unsafe create without copy (#7645) + * Optimize MapField serialization by removing MessageAdapter (#8143) + * Allow FileDescriptors to be parsed with extension registries (#8220) + * Optimize writing small strings (#8149) + +2020-11-11 version 3.14.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Protocol Compiler + * The proto compiler no longer requires a .proto filename when it is not + generating code. + * Added flag `--deterministic_output` to `protoc --encode=...`. + * Fixed deadlock when using google.protobuf.Any embedded in aggregate options. + + C++ + * Arenas are now unconditionally enabled. cc_enable_arenas no longer has + any effect. + * Removed inlined string support, which is incompatible with arenas. + * Fix a memory corruption bug in reflection when mixing optional and + non-optional fields. + * Make SpaceUsed() calculation more thorough for map fields. + * Add stack overflow protection for text format with unknown field values. + * FieldPath::FollowAll() now returns a bool to signal if an out-of-bounds + error was encountered. + * Performance improvements for Map. + * Minor formatting fix when dumping a descriptor to .proto format with + DebugString. + * UBSAN fix in RepeatedField (#2073). + * When running under ASAN, skip a test that makes huge allocations. + * Fixed a crash that could happen when creating more than 256 extensions in + a single message. + * Fix a crash in BuildFile when passing in invalid descriptor proto. + * Parser security fix when operating with CodedInputStream. + * Warn against the use of AllowUnknownExtension. + * Migrated to C++11 for-range loops instead of index-based loops where + possible. This fixes a lot of warnings when compiling with -Wsign-compare. + * Fix segment fault for proto3 optional (#7805) + * Adds a CMake option to build `libprotoc` separately (#7949) + + Java + * Bugfix in mergeFrom() when a oneof has multiple message fields. + * Fix RopeByteString.RopeInputStream.read() returning -1 when told to read + 0 bytes when not at EOF. + * Redefine remove(Object) on primitive repeated field Lists to avoid + autoboxing. + * Support "\u" escapes in textformat string literals. + * Trailing empty spaces are no longer ignored for FieldMask. + * Fix FieldMaskUtil.subtract to recursively remove mask. + * Mark enums with `@java.lang.Deprecated` if the proto enum has option + `deprecated = true;`. + * Adding forgotten duration.proto to the lite library (#7738) + + Python + * Print google.protobuf.NullValue as null instead of "NULL_VALUE" when it is + used outside WKT Value/Struct. + * Fix bug occurring when attempting to deep copy an enum type in python 3. + * Add a setuptools extension for generating Python protobufs (#7783) + * Remove uses of pkg_resources in non-namespace packages. (#7902) + * [bazel/py] Omit google/__init__.py from the Protobuf runtime. (#7908) + * Removed the unnecessary setuptools package dependency for Python package (#7511) + * Fix PyUnknownFields memory leak (#7928) + + PHP + * Added support for "==" to the PHP C extension (#7883) + * Added `==` operators for Map and Array. (#7900) + * Native C well-known types (#7944) + * Optimized away hex2bin() call in generated code (#8006) + * New version of upb, and a new hash function wyhash in third_party. (#8000) + * add missing hasOneof method to check presence of oneof fields (#8003) + + Go: + * Update go_package options to reference google.golang.org/protobuf module. + + C#: + * annotate ByteString.CopyFrom(ReadOnlySpan) as SecuritySafeCritical (#7701) + * Fix C# optional field reflection when there are regular fields too (#7705) + * Fix parsing negative Int32Value that crosses segment boundary (#8035) + + Javascript: + * JS: parse (un)packed fields conditionally (#7379) + +2020-07-14 version 3.13.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + PHP: + * The C extension is completely rewritten. The new C extension has significantly + better parsing performance and fixes a handful of conformance issues. It will + also make it easier to add support for more features like proto2 and proto3 presence. + * The new C extension does not support PHP 5.x. PHP 5.x users can still use pure-PHP. + + C++: + * Removed deprecated unsafe arena string accessors + * Enabled heterogeneous lookup for std::string keys in maps. + * Removed implicit conversion from StringPiece to std::string + * Fix use-after-destroy bug when the Map is allocated in the arena. + * Improved the randomness of map ordering + * Added stack overflow protection for text format with unknown fields + * Use std::hash for proto maps to help with portability. + * Added more Windows macros to proto whitelist. + * Arena constructors for map entry messages are now marked "explicit" + (for regular messages they were already explicit). + * Fix subtle aliasing bug in RepeatedField::Add + * Fix mismatch between MapEntry ByteSize and Serialize with respect to unset + fields. + + Python: + * JSON format conformance fixes: + * Reject lowercase t for Timestamp json format. + * Print full_name directly for extensions (no camelCase). + * Reject boolean values for integer fields. + * Reject NaN, Infinity, -Infinity that is not quoted. + * Base64 fixes for bytes fields: accept URL-safe base64 and missing padding. + * Bugfix for fields/files named "async" or "await". + * Improved the error message when AttributeError is returned from __getattr__ + in EnumTypeWrapper. + + Java: + * Fixed a bug where setting optional proto3 enums with setFooValue() would + not mark the value as present. + * Add Subtract function to FieldMaskUtil. + + C#: + * Dropped support for netstandard1.0 (replaced by support for netstandard1.1). + This was required to modernize the parsing stack to use the `Span` + type internally. (#7351) + * Add `ParseFrom(ReadOnlySequence)` method to enable GC friendly + parsing with reduced allocations and buffer copies. (#7351) + * Add support for serialization directly to a `IBufferWriter` or + to a `Span` to enable GC friendly serialization. + The new API is available as extension methods on the `IMessage` type. (#7576) + * Add `GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE` define to make + generated code compatible with old C# compilers (pre-roslyn compilers + from .NET framework and old versions of mono) that do not support + ref structs. Users that are still on a legacy stack that does + not support C# 7.2 compiler might need to use the new define + in their projects to be able to build the newly generated code. (#7490) + * Due to the major overhaul of parsing and serialization internals (#7351 and #7576), + it is recommended to regenerate your generated code to achieve the best + performance (the legacy generated code will still work, but might incur + a slight performance penalty). + +2020-07-28 version 3.12.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + +This release contains no significant changes, but exists because 3.12.3 was +mistakenly tagged at the wrong commit. + +2020-06-01 version 3.12.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Objective-C + * Tweak the union used for Extensions to support old generated code. #7573 + +2020-05-26 version 3.12.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + C++ + * Simplified the template export macros to fix the build for mingw32. (#7539) + + Objective-C + * Fix for the :protobuf_objc target in the Bazel BUILD file. (#7538) + +2020-05-20 version 3.12.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Ruby + * Re-add binary gems for Ruby 2.3 and 2.4. These are EOL upstream, however + many people still use them and dropping support will require more + coordination. + +2020-05-12 version 3.12.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Protocol Compiler + * [experimental] Singular, non-message typed fields in proto3 now support + presence tracking. This is enabled by adding the "optional" field label and + passing the --experimental_allow_proto3_optional flag to protoc. + * For usage info, see docs/field_presence.md. + * During this experimental phase, code generators should update to support + proto3 presence, see docs/implementing_proto3_presence.md for instructions. + * Allow duplicate symbol names when multiple descriptor sets are passed on + the command-line, to match the behavior when multiple .proto files are passed. + * Deterministic `protoc --descriptor_set_out` (#7175) + + C++ + * [experimental] Added proto3 presence support. + * New descriptor APIs to support proto3 presence. + * Enable Arenas by default on all .proto files. + * Documented that users are not allowed to subclass Message or MessageLite. + * Mark generated classes as final; inheriting from protos is strongly discouraged. + * Add stack overflow protection for text format with unknown fields. + * Add accessors for map key and value FieldDescriptors. + * Add FieldMaskUtil::FromFieldNumbers(). + * MessageDifferencer: use ParsePartial() on Any fields so the diff does not + fail when there are missing required fields. + * ReflectionOps::Merge(): lookup messages in the right factory, if it can. + * Added Descriptor::WellKnownTypes enum and Descriptor::well_known_type() + accessor as an easier way of determining if a message is a Well-Known Type. + * Optimized RepeatedField::Add() when it is used in a loop. + * Made proto move/swap more efficient. + * De-virtualize the GetArena() method in MessageLite. + * Improves performance of json_stream_parser.cc by factor 1000 (#7230) + * bug: #7076 undefine Windows OUT and OPTIONAL macros (#7087) + * Fixed a bug in FieldDescriptor::DebugString() that would erroneously print + an "optional" label for a field in a oneof. + * Fix bug in parsing bool extensions that assumed they are always 1 byte. + * Fix off-by-one error in FieldOptions::ByteSize() when extensions are present. + * Clarified the comments to show an example of the difference between + Descriptor::extension and DescriptorPool::FindAllExtensions. + * Add a compiler option 'code_size' to force optimize_for=code_size on all + protos where this is possible. + + Java + * [experimental] Added proto3 presence support. + * Mark java enum _VALUE constants as @Deprecated if the enum field is deprecated + * reduce size for enums with allow_alias set to true. + * Sort map fields alphabetically by the field's key when printing textproto. + * Fixed a bug in map sorting that appeared in -rc1 and -rc2 (#7508). + * TextFormat.merge() handles Any as top level type. + * Throw a descriptive IllegalArgumentException when calling + getValueDescriptor() on enum special value UNRECOGNIZED instead of + ArrayIndexOutOfBoundsException. + * Fixed an issue with JsonFormat.printer() where setting printingEnumsAsInts() + would override the configuration passed into includingDefaultValueFields(). + * Implement overrides of indexOf() and contains() on primitive lists returned + for repeated fields to avoid autoboxing the list contents. + * Add overload to FieldMaskUtil.fromStringList that accepts a descriptor. + * [bazel] Move Java runtime/toolchains into //java (#7190) + + Python + * [experimental] Added proto3 presence support. + * [experimental] fast import protobuf module, only works with cpp generated code linked in. + * Truncate 'float' fields to 4 bytes of precision in setters for pure-Python + implementation (C++ extension was already doing this). + * Fixed a memory leak in C++ bindings. + * Added a deprecation warning when code tries to create Descriptor objects + directly. + * Fix unintended comparison between bytes and string in descriptor.py. + * Avoid printing excess digits for float fields in TextFormat. + * Remove Python 2.5 syntax compatibility from the proto compiler generated _pb2.py module code. + * Drop 3.3, 3.4 and use single version docker images for all python tests (#7396) + + JavaScript + * Fix js message pivot selection (#6813) + + PHP + * Persistent Descriptor Pool (#6899) + * Implement lazy loading of php class for proto messages (#6911) + * Correct @return in Any.unpack docblock (#7089) + * Ignore unknown enum value when ignore_unknown specified (#7455) + + Ruby + * [experimental] Implemented proto3 presence for Ruby. (#7406) + * Stop building binary gems for ruby <2.5 (#7453) + * Fix for wrappers with a zero value (#7195) + * Fix for JSON serialization of 0/empty-valued wrapper types (#7198) + * Call "Class#new" over rb_class_new_instance in decoding (#7352) + * Build extensions for Ruby 2.7 (#7027) + * assigning 'nil' to submessage should clear the field. (#7397) + + C# + * [experimental] Add support for proto3 presence fields in C# (#7382) + * Mark GetOption API as obsolete and expose the "GetOptions()" method on descriptors instead (#7491) + * Remove Has/Clear members for C# message fields in proto2 (#7429) + * Enforce recursion depth checking for unknown fields (#7132) + * Fix conformance test failures for Google.Protobuf (#6910) + * Cleanup various bits of Google.Protobuf (#6674) + * Fix latest ArgumentException for C# extensions (#6938) + * Remove unnecessary branch from ReadTag (#7289) + + Objective-C + * [experimental] ObjC Proto3 optional support (#7421) + * Block subclassing of generated classes (#7124) + * Use references to Obj C classes instead of names in descriptors. (#7026) + * Revisit how the WKTs are bundled with ObjC. (#7173) + + Other + * Add a proto_lang_toolchain for javalite (#6882) + * [bazel] Update gtest and deprecate //external:{gtest,gtest_main} (#7237) + * Add application note for explicit presence tracking. (#7390) + * Howto doc for implementing proto3 presence in a code generator. (#7407) + + 2020-02-14 version 3.11.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) C# diff --git a/Makefile.am b/Makefile.am index 090e5037b0..a71f4d117b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -78,6 +78,7 @@ csharp_EXTRA_DIST= \ csharp/protos/unittest_import.proto \ csharp/protos/unittest_issues.proto \ csharp/protos/unittest_proto3.proto \ + csharp/protos/unittest_selfreferential_options.proto \ csharp/protos/unittest.proto \ csharp/src/AddressBook/AddPerson.cs \ csharp/src/AddressBook/Addressbook.cs \ @@ -88,18 +89,22 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs \ csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \ csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \ + csharp/src/Google.Protobuf.Benchmarks/ByteStringBenchmark.cs \ csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj \ csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs \ csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs \ + csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs \ csharp/src/Google.Protobuf.Benchmarks/Program.cs \ csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto \ csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs \ + csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs \ + csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs \ csharp/src/Google.Protobuf.Conformance/Conformance.cs \ csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj \ csharp/src/Google.Protobuf.Conformance/Program.cs \ csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj \ csharp/src/Google.Protobuf.JsonDump/Program.cs \ + csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs \ csharp/src/Google.Protobuf.Test/ByteStringTest.cs \ csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs \ csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs \ @@ -122,6 +127,11 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs \ csharp/src/Google.Protobuf.Test/JsonParserTest.cs \ csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs \ + csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs \ + csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs \ + csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs \ + csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs \ + csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs \ csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs \ csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs \ csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs \ @@ -148,6 +158,8 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs \ csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs \ csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs \ + csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs \ csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs \ csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs \ csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \ @@ -160,6 +172,7 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf.sln \ csharp/src/Google.Protobuf/ByteArray.cs \ csharp/src/Google.Protobuf/ByteString.cs \ + csharp/src/Google.Protobuf/ByteStringAsync.cs \ csharp/src/Google.Protobuf/CodedInputStream.cs \ csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs \ csharp/src/Google.Protobuf/CodedOutputStream.cs \ @@ -180,6 +193,7 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf/FieldMaskTree.cs \ csharp/src/Google.Protobuf/FrameworkPortability.cs \ csharp/src/Google.Protobuf/Google.Protobuf.csproj \ + csharp/src/Google.Protobuf/IBufferMessage.cs \ csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs \ csharp/src/Google.Protobuf/IDeepCloneable.cs \ csharp/src/Google.Protobuf/IExtendableMessage.cs \ @@ -194,7 +208,13 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf/MessageExtensions.cs \ csharp/src/Google.Protobuf/MessageParser.cs \ csharp/src/Google.Protobuf/ObjectIntPair.cs \ + csharp/src/Google.Protobuf/ParseContext.cs \ + csharp/src/Google.Protobuf/ParserInternalState.cs \ + csharp/src/Google.Protobuf/ParsingPrimitives.cs \ + csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs \ + csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs \ csharp/src/Google.Protobuf/ProtoPreconditions.cs \ + csharp/src/Google.Protobuf/SegmentedBufferHelper.cs \ csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs \ csharp/src/Google.Protobuf/Reflection/CustomOptions.cs \ csharp/src/Google.Protobuf/Reflection/Descriptor.cs \ @@ -244,17 +264,23 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs \ csharp/src/Google.Protobuf/WellKnownTypes/WrappersPartial.cs \ csharp/src/Google.Protobuf/WireFormat.cs \ + csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs \ + csharp/src/Google.Protobuf/WritingPrimitives.cs \ + csharp/src/Google.Protobuf/WriterInternalState.cs \ + csharp/src/Google.Protobuf/WriteContext.cs \ + csharp/src/Google.Protobuf/WriteBufferHelper.cs \ csharp/src/Google.Protobuf/UnknownField.cs \ - csharp/src/Google.Protobuf/UnknownFieldSet.cs + csharp/src/Google.Protobuf/UnknownFieldSet.cs \ + csharp/src/Google.Protobuf/UnsafeByteOperations.cs java_EXTRA_DIST= \ - java/BUILD \ java/README.md \ java/bom/pom.xml \ java/core/BUILD \ java/core/generate-sources-build.xml \ java/core/generate-test-sources-build.xml \ java/core/pom.xml \ + java/core/pom_template.xml \ java/core/src/main/java/com/google/protobuf/AbstractMessage.java \ java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java \ java/core/src/main/java/com/google/protobuf/AbstractParser.java \ @@ -504,38 +530,70 @@ java_EXTRA_DIST= java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto \ java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto \ java/core/src/test/proto/com/google/protobuf/test_custom_options.proto \ - java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto \ java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \ + java/internal/BUILD \ + java/internal/testing.bzl \ + java/kotlin/generate-sources-build.xml \ + java/kotlin/generate-test-sources-build.xml \ + java/kotlin/pom.xml \ + java/kotlin/src/main/kotlin/com/google/protobuf/DslList.kt \ + java/kotlin/src/main/kotlin/com/google/protobuf/DslMap.kt \ + java/kotlin/src/main/kotlin/com/google/protobuf/DslProxy.kt \ + java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt \ + java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageLiteExtensions.kt\ + java/kotlin/src/main/kotlin/com/google/protobuf/ExtensionList.kt \ + java/kotlin/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt\ + java/kotlin/src/main/kotlin/com/google/protobuf/ProtoDslMarker.kt \ + java/kotlin/src/main/kotlin/com/google/protobuf/UnmodifiableCollections.kt \ + java/kotlin/src/test/kotlin/com/google/protobuf/DslListTest.kt \ + java/kotlin/src/test/kotlin/com/google/protobuf/DslMapTest.kt \ + java/kotlin/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt\ + java/kotlin/src/test/kotlin/com/google/protobuf/ExtensionListTest.kt \ + java/kotlin/src/test/kotlin/com/google/protobuf/Proto2Test.kt \ + java/kotlin/src/test/kotlin/com/google/protobuf/Proto3Test.kt \ + java/kotlin/src/test/proto/com/google/protobuf/evil_names_proto2.proto \ + java/kotlin/src/test/proto/com/google/protobuf/evil_names_proto3.proto \ + java/kotlin/src/test/proto/com/google/protobuf/example_extensible_message.proto \ + java/kotlin/src/test/proto/com/google/protobuf/multiple_files_proto3.proto \ + java/kotlin-lite/generate-sources-build.xml \ + java/kotlin-lite/generate-test-sources-build.xml \ + java/kotlin-lite/lite.awk \ + java/kotlin-lite/pom.xml \ + java/kotlin-lite/process-lite-sources-build.xml \ + java/kotlin-lite/src/test/kotlin/com/google/protobuf/ExtendableMessageLiteExtensionsTest.kt\ + java/kotlin-lite/src/test/kotlin/com/google/protobuf/Proto2LiteTest.kt \ java/lite.md \ java/lite/BUILD \ java/lite/generate-sources-build.xml \ java/lite/generate-test-sources-build.xml \ java/lite/lite.awk \ java/lite/pom.xml \ + java/lite/pom_template.xml \ java/lite/process-lite-sources-build.xml \ java/lite/src/test/java/com/google/protobuf/LiteTest.java \ java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java \ + java/BUILD \ java/pom.xml \ java/util/BUILD \ java/util/pom.xml \ + java/util/pom_template.xml \ java/util/src/main/java/com/google/protobuf/util/Durations.java \ java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java \ java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java \ java/util/src/main/java/com/google/protobuf/util/JsonFormat.java \ - java/util/src/main/java/com/google/protobuf/util/TimeUtil.java \ java/util/src/main/java/com/google/protobuf/util/Structs.java \ java/util/src/main/java/com/google/protobuf/util/Timestamps.java \ java/util/src/main/java/com/google/protobuf/util/Values.java \ java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \ java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \ java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \ - java/util/src/test/java/com/google/protobuf/util/StructsTest.java \ - java/util/src/test/java/com/google/protobuf/util/TimeUtilTest.java \ + java/util/src/test/java/com/google/protobuf/util/StructsTest.java \ java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \ java/util/src/test/proto/com/google/protobuf/util/json_test.proto objectivec_EXTRA_DIST= \ objectivec/.clang-format \ + objectivec/BUILD \ objectivec/DevTools/check_version_stamps.sh \ objectivec/DevTools/compile_testing_protos.sh \ objectivec/DevTools/full_mac_build.sh \ @@ -744,25 +802,32 @@ objectivec_EXTRA_DIST= \ php_EXTRA_DIST= \ composer.json \ php/README.md \ + php/REFCOUNTING.md \ php/composer.json \ + php/ext/google/protobuf/arena.c \ + php/ext/google/protobuf/arena.h \ php/ext/google/protobuf/array.c \ - php/ext/google/protobuf/builtin_descriptors.inc \ + php/ext/google/protobuf/array.h \ php/ext/google/protobuf/config.m4 \ + php/ext/google/protobuf/convert.c \ + php/ext/google/protobuf/convert.h \ php/ext/google/protobuf/def.c \ - php/ext/google/protobuf/encode_decode.c \ + php/ext/google/protobuf/def.h \ php/ext/google/protobuf/map.c \ + php/ext/google/protobuf/map.h \ php/ext/google/protobuf/message.c \ + php/ext/google/protobuf/message.h \ + php/ext/google/protobuf/names.c \ + php/ext/google/protobuf/names.h \ php/ext/google/protobuf/package.xml \ + php/ext/google/protobuf/php-upb.c \ + php/ext/google/protobuf/php-upb.h \ php/ext/google/protobuf/protobuf.c \ php/ext/google/protobuf/protobuf.h \ - php/ext/google/protobuf/storage.c \ - php/ext/google/protobuf/type_check.c \ - php/ext/google/protobuf/upb.c \ - php/ext/google/protobuf/upb.h \ - php/ext/google/protobuf/utf8.c \ - php/ext/google/protobuf/utf8.h \ + php/ext/google/protobuf/wkt.inc \ php/generate_descriptor_protos.sh \ - php/phpunit.xml \ + php/generate_test_protos.sh \ + php/prepare_c_extension.sh \ php/release.sh \ php/src/GPBMetadata/Google/Protobuf/Any.php \ php/src/GPBMetadata/Google/Protobuf/Api.php \ @@ -798,6 +863,7 @@ php_EXTRA_DIST= \ php/src/Google/Protobuf/GPBEmpty.php \ php/src/Google/Protobuf/Int32Value.php \ php/src/Google/Protobuf/Int64Value.php \ + php/src/Google/Protobuf/Internal/AnyBase.php \ php/src/Google/Protobuf/Internal/CodedInputStream.php \ php/src/Google/Protobuf/Internal/CodedOutputStream.php \ php/src/Google/Protobuf/Internal/Descriptor.php \ @@ -857,6 +923,7 @@ php_EXTRA_DIST= \ php/src/Google/Protobuf/Internal/ServiceOptions.php \ php/src/Google/Protobuf/Internal/SourceCodeInfo.php \ php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php \ + php/src/Google/Protobuf/Internal/TimestampBase.php \ php/src/Google/Protobuf/Internal/UninterpretedOption.php \ php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php \ php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \ @@ -887,22 +954,21 @@ php_EXTRA_DIST= \ php/src/Google/Protobuf/UInt64Value.php \ php/src/Google/Protobuf/Value.php \ php/src/phpdoc.dist.xml \ - php/tests/array_test.php \ - php/tests/autoload.php \ - php/tests/bootstrap_phpunit.php \ + php/tests/ArrayTest.php \ php/tests/compatibility_test.sh \ php/tests/compile_extension.sh \ - php/tests/descriptors_test.php \ - php/tests/encode_decode_test.php \ + php/tests/DescriptorsTest.php \ + php/tests/EncodeDecodeTest.php \ + php/tests/force_c_ext.php \ php/tests/gdb_test.sh \ - php/tests/generated_class_test.php \ - php/tests/generated_phpdoc_test.php \ - php/tests/generated_service_test.php \ - php/tests/map_field_test.php \ + php/tests/GeneratedClassTest.php \ + php/tests/GeneratedPhpdocTest.php \ + php/tests/GeneratedServiceTest.php \ + php/tests/MapFieldTest.php \ php/tests/memory_leak_test.php \ php/tests/multirequest.php \ php/tests/multirequest.sh \ - php/tests/php_implementation_test.php \ + php/tests/PhpImplementationTest.php \ php/tests/proto/empty/echo.proto \ php/tests/proto/test.proto \ php/tests/proto/test_descriptors.proto \ @@ -921,12 +987,11 @@ php_EXTRA_DIST= \ php/tests/proto/test_service.proto \ php/tests/proto/test_service_namespace.proto \ php/tests/proto/test_wrapper_type_setters.proto \ - php/tests/test.sh \ php/tests/test_base.php \ php/tests/test_util.php \ - php/tests/undefined_test.php \ - php/tests/well_known_test.php \ - php/tests/wrapper_type_setters_test.php + php/tests/valgrind.supp \ + php/tests/WellKnownTest.php \ + php/tests/WrapperTypeSettersTest.php python_EXTRA_DIST= \ python/MANIFEST.in \ @@ -973,7 +1038,6 @@ python_EXTRA_DIST= \ python/google/protobuf/internal/packed_field_test.proto \ python/google/protobuf/internal/proto_builder_test.py \ python/google/protobuf/internal/python_message.py \ - python/google/protobuf/internal/python_protobuf.cc \ python/google/protobuf/internal/reflection_test.py \ python/google/protobuf/internal/service_reflection_test.py \ python/google/protobuf/internal/symbol_database_test.py \ @@ -994,7 +1058,6 @@ python_EXTRA_DIST= \ python/google/protobuf/json_format.py \ python/google/protobuf/message.py \ python/google/protobuf/message_factory.py \ - python/google/protobuf/python_protobuf.h \ python/google/protobuf/proto_api.h \ python/google/protobuf/proto_builder.py \ python/google/protobuf/pyext/README \ @@ -1058,17 +1121,21 @@ ruby_EXTRA_DIST= \ ruby/compatibility_tests/v3.0.0/test.sh \ ruby/compatibility_tests/v3.0.0/Rakefile \ ruby/compatibility_tests/v3.0.0/README.md \ + ruby/ext/google/protobuf_c/convert.c \ + ruby/ext/google/protobuf_c/convert.h \ ruby/ext/google/protobuf_c/defs.c \ - ruby/ext/google/protobuf_c/encode_decode.c \ + ruby/ext/google/protobuf_c/defs.h \ ruby/ext/google/protobuf_c/extconf.rb \ ruby/ext/google/protobuf_c/map.c \ + ruby/ext/google/protobuf_c/map.h \ ruby/ext/google/protobuf_c/message.c \ + ruby/ext/google/protobuf_c/message.h \ ruby/ext/google/protobuf_c/protobuf.c \ ruby/ext/google/protobuf_c/protobuf.h \ ruby/ext/google/protobuf_c/repeated_field.c \ - ruby/ext/google/protobuf_c/storage.c \ - ruby/ext/google/protobuf_c/upb.c \ - ruby/ext/google/protobuf_c/upb.h \ + ruby/ext/google/protobuf_c/repeated_field.h \ + ruby/ext/google/protobuf_c/ruby-upb.c \ + ruby/ext/google/protobuf_c/ruby-upb.h \ ruby/ext/google/protobuf_c/wrap_memcpy.c \ ruby/google-protobuf.gemspec \ ruby/lib/google/protobuf/message_exts.rb \ @@ -1079,13 +1146,15 @@ ruby_EXTRA_DIST= \ ruby/src/main/java/com/google/protobuf/jruby/RubyBuilder.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptor.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptorPool.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyEnum.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyEnumBuilderContext.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyEnumDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyEnum.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyFieldDescriptor.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyFileBuilderContext.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyFileDescriptor.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyMessageBuilderContext.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java \ + ruby/src/main/java/com/google/protobuf/jruby/RubyMessageBuilderContext.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyOneofBuilderContext.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyOneofDescriptor.java \ ruby/src/main/java/com/google/protobuf/jruby/RubyProtobuf.java \ @@ -1106,6 +1175,8 @@ ruby_EXTRA_DIST= \ ruby/tests/generated_code_proto2_test.rb \ ruby/tests/generated_code_proto2.proto \ ruby/tests/generated_code.proto \ + ruby/tests/multi_level_nesting_test.proto \ + ruby/tests/multi_level_nesting_test.rb \ ruby/tests/test_import_proto2.proto \ ruby/tests/test_import.proto \ ruby/tests/test_ruby_package_proto2.proto \ @@ -1193,6 +1264,10 @@ js_EXTRA_DIST= \ js/data.proto \ js/debug.js \ js/debug_test.js \ + js/experimental/runtime/kernel/message_set.js \ + js/experimental/runtime/kernel/message_set_test.js \ + js/experimental/runtime/kernel/tag.js \ + js/experimental/runtime/kernel/tag_test.js \ js/gulpfile.js \ js/jasmine.json \ js/map.js \ @@ -1349,13 +1424,12 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ examples/pubspec.yaml \ protobuf.bzl \ protobuf_deps.bzl \ - python/release/wheel/build_wheel_manylinux.sh \ - python/release/wheel/Dockerfile \ - python/release/wheel/protobuf_optimized_pip.sh \ - python/release/wheel/README.md \ third_party/six.BUILD \ third_party/zlib.BUILD \ - util/python/BUILD + third_party/wyhash/LICENSE \ + third_party/wyhash/wyhash.h \ + util/python/BUILD \ + internal.bzl # Deletes all the files generated by autogen.sh. diff --git a/Protobuf-C++.podspec b/Protobuf-C++.podspec index dcb9f4d705..2e81a7c1d3 100644 --- a/Protobuf-C++.podspec +++ b/Protobuf-C++.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Protobuf-C++' - s.version = '3.11.4' + s.version = '3.17.3' s.summary = 'Protocol Buffers v3 runtime library for C++.' s.homepage = 'https://github.com/google/protobuf' s.license = '3-Clause BSD License' diff --git a/Protobuf.podspec b/Protobuf.podspec index d6d6a8e785..c1b4795cdc 100644 --- a/Protobuf.podspec +++ b/Protobuf.podspec @@ -5,7 +5,7 @@ # dependent projects use the :git notation to refer to the library. Pod::Spec.new do |s| s.name = 'Protobuf' - s.version = '3.11.4' + s.version = '3.17.3' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.homepage = 'https://github.com/protocolbuffers/protobuf' s.license = '3-Clause BSD License' @@ -34,7 +34,7 @@ Pod::Spec.new do |s| s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' } s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' } - s.ios.deployment_target = '7.0' + s.ios.deployment_target = '9.0' s.osx.deployment_target = '10.9' s.tvos.deployment_target = '9.0' s.watchos.deployment_target = '2.0' diff --git a/README.md b/README.md index 2f42c6c934..618dc2a775 100644 --- a/README.md +++ b/README.md @@ -52,18 +52,18 @@ Protobuf supports several different programming languages. For each programming language, you can find instructions in the corresponding source directory about how to install protobuf runtime for that specific language: -| Language | Source | Ubuntu | MacOS | Windows | -|--------------------------------------|-------------------------------------------------------------|--------|-------|---------| -| C++ (include C++ runtime and protoc) | [src](src) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-cpp_distcheck.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fcpp_distcheck%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-bazel.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fbazel%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-dist_install.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fdist_install%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fcpp%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-cpp_distcheck.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fcpp_distcheck%2Fcontinuous) | [![Build status](https://ci.appveyor.com/api/projects/status/73ctee6ua4w2ruin?svg=true)](https://ci.appveyor.com/project/protobuf/protobuf) | -| Java | [java](java) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_compatibility.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_compatibility%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_jdk7.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_jdk7%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_oracle7.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_oracle7%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_linkage_monitor.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_linkage_monitor%2Fcontinuous) | | | -| Python | [python](python) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python27.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython27%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python35.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython35%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python36.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython36%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python37.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython37%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python_compatibility.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython_compatibility%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python27_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython27_cpp%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python35_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython35_cpp%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python36_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython36_cpp%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python37_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython37_cpp%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython_release%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython_cpp%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython_release%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/windows-python-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fwindows%2Fpython_release%2Fcontinuous) | -| Objective-C | [objectivec](objectivec) | | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_cocoapods_integration.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_cocoapods_integration%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_ios_debug.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_ios_debug%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_ios_release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_ios_release%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_osx.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_osx%2Fcontinuous) | | -| C# | [csharp](csharp) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-csharp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fcsharp%2Fcontinuous) | | [![Build status](https://ci.appveyor.com/api/projects/status/73ctee6ua4w2ruin?svg=true)](https://ci.appveyor.com/project/protobuf/protobuf)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/windows-csharp-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fwindows%2Fcsharp_release%2Fcontinuous) | -| JavaScript | [js](js) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-javascript.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjavascript%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-javascript.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fjavascript%2Fcontinuous) | | -| Ruby | [ruby](ruby) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby23.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby23%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby24.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby24%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby25.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby25%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby26.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby26%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby_release%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby23.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby23%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby24.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby24%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby25.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby25%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby26.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby26%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby_release%2Fcontinuous) | | -| Go | [golang/protobuf](https://github.com/golang/protobuf) | | | | -| PHP | [php](php) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-php_all.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fphp_all%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-32-bit.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2F32-bit%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-php5.6_mac.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fphp5.6_mac%2Fcontinuous)
[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-php7.0_mac.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fphp7.0_mac%2Fcontinuous) | | -| Dart | [dart-lang/protobuf](https://github.com/dart-lang/protobuf) | [![Build Status](https://travis-ci.org/dart-lang/protobuf.svg?branch=master)](https://travis-ci.org/dart-lang/protobuf) | | | +| Language | Source | +|--------------------------------------|-------------------------------------------------------------| +| C++ (include C++ runtime and protoc) | [src](src) | +| Java | [java](java) | +| Python | [python](python) | +| Objective-C | [objectivec](objectivec) | +| C# | [csharp](csharp) | +| JavaScript | [js](js) | +| Ruby | [ruby](ruby) | +| Go | [protocolbuffers/protobuf-go](https://github.com/protocolbuffers/protobuf-go)| +| PHP | [php](php) | +| Dart | [dart-lang/protobuf](https://github.com/dart-lang/protobuf) | Quick Start ----------- diff --git a/WORKSPACE b/WORKSPACE index cb16ae882c..94aa8d86b8 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -17,76 +17,82 @@ http_archive( ], ) -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("//:protobuf_deps.bzl", "protobuf_deps") +http_archive( + name = "com_github_google_benchmark", + sha256 = "2a778d821997df7d8646c9c59b8edb9a573a6e04c534c01892a40aa524a7b68c", + strip_prefix = "benchmark-bf585a2789e30585b4e3ce6baf11ef2750b54677", + urls = [ + "https://github.com/google/benchmark/archive/bf585a2789e30585b4e3ce6baf11ef2750b54677.zip", + ], +) # Load common dependencies. +load("//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() -load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") bind( name = "python_headers", actual = "//util/python:python_headers", ) -# TODO(yannic): Remove in 3.13.0. -bind( - name = "gtest", - actual = "@com_google_googletest//:gtest", +load("@rules_jvm_external//:defs.bzl", "maven_install") +maven_install( + artifacts = [ + "com.google.code.gson:gson:2.8.6", + "com.google.errorprone:error_prone_annotations:2.3.2", + "com.google.guava:guava:30.1.1-jre", + "com.google.truth:truth:1.1.2", + "junit:junit:4.12", + "org.easymock:easymock:3.2", + "org.easymock:easymockclassextension:3.2", + ], + repositories = [ + "https://repo1.maven.org/maven2", + "https://repo.maven.apache.org/maven2", + ], + # For updating instructions, see: + # https://github.com/bazelbuild/rules_jvm_external#updating-maven_installjson + maven_install_json = "//:maven_install.json", ) -# TODO(yannic): Remove in 3.13.0. +load("@maven//:defs.bzl", "pinned_maven_install") +pinned_maven_install() + bind( - name = "gtest_main", - actual = "@com_google_googletest//:gtest_main", + name = "guava", + actual = "@maven//:com_google_guava_guava", ) -jvm_maven_import_external( - name = "guava_maven", - artifact = "com.google.guava:guava:18.0", - artifact_sha256 = "d664fbfc03d2e5ce9cab2a44fb01f1d0bf9dfebeccc1a473b1f9ea31f79f6f99", - server_urls = [ - "https://jcenter.bintray.com/", - "https://repo1.maven.org/maven2", - ], +bind( + name = "gson", + actual = "@maven//:com_google_code_gson_gson", ) bind( - name = "guava", - actual = "@guava_maven//jar", + name = "error_prone_annotations", + actual = "@maven//:com_google_errorprone_error_prone_annotations", ) -jvm_maven_import_external( - name = "gson_maven", - artifact = "com.google.code.gson:gson:2.7", - artifact_sha256 = "2d43eb5ea9e133d2ee2405cc14f5ee08951b8361302fdd93494a3a997b508d32", - server_urls = [ - "https://jcenter.bintray.com/", - "https://repo1.maven.org/maven2", - ], +bind( + name = "junit", + actual = "@maven//:junit_junit", ) bind( - name = "gson", - actual = "@gson_maven//jar", + name = "easymock", + actual = "@maven//:org_easymock_easymock", ) -jvm_maven_import_external( - name = "error_prone_annotations_maven", - artifact = "com.google.errorprone:error_prone_annotations:2.3.2", - artifact_sha256 = "357cd6cfb067c969226c442451502aee13800a24e950fdfde77bcdb4565a668d", - server_urls = [ - "https://jcenter.bintray.com/", - "https://repo1.maven.org/maven2", - ], +bind( + name = "easymock_classextension", + actual = "@maven//:org_easymock_easymockclassextension", ) bind( - name = "error_prone_annotations", - actual = "@error_prone_annotations_maven//jar", + name = "truth", + actual = "@maven//:com_google_truth_truth", ) -# For `cc_proto_blacklist_test`. +# For `cc_proto_blacklist_test` and `build_test`. load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - bazel_skylib_workspace() diff --git a/autogen.sh b/autogen.sh index d00d21727c..105bf09b67 100755 --- a/autogen.sh +++ b/autogen.sh @@ -30,8 +30,12 @@ set -ex # The absence of a m4 directory in googletest causes autoreconf to fail when # building under the CentOS docker image. It's a warning in regular build on -# Ubuntu/gLinux as well. -mkdir -p third_party/googletest/m4 +# Ubuntu/gLinux as well. (This is only needed if git submodules have been +# initialized, which is typically only needed for testing; see the installation +# instructions for details.) +if test -d third_party/googletest; then + mkdir -p third_party/googletest/m4 +fi # TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings. autoreconf -f -i -Wall,no-obsolete diff --git a/benchmarks/BUILD b/benchmarks/BUILD new file mode 100644 index 0000000000..8e6063ba83 --- /dev/null +++ b/benchmarks/BUILD @@ -0,0 +1,65 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") +load("@rules_java//java:defs.bzl", "java_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + +proto_library( + name = "benchmarks_proto", + srcs = [ + "benchmarks.proto", + ], + strip_import_prefix = "/benchmarks", + visibility = [ + "//benchmarks:__subpackages__", + ], +) + +cc_proto_library( + name = "benchmarks_cc_proto", + visibility = [ + "//benchmarks:__subpackages__", + ], + deps = [ + "benchmarks_proto", + ], +) + +java_proto_library( + name = "benchmarks_java_proto", + visibility = [ + "//benchmarks:__subpackages__", + ], + deps = [ + "benchmarks_proto", + ], +) + +proto_library( + name = "google_size_proto", + srcs = [ + "google_size.proto", + ], + strip_import_prefix = "/benchmarks", + visibility = [ + "//benchmarks:__subpackages__", + ], +) + +cc_proto_library( + name = "google_size_cc_proto", + visibility = [ + "//benchmarks:__subpackages__", + ], + deps = [ + "google_size_proto", + ], +) + +java_proto_library( + name = "google_size_java_proto", + visibility = [ + "//benchmarks:__subpackages__", + ], + deps = [ + "google_size_proto", + ], +) diff --git a/benchmarks/README.md b/benchmarks/README.md index 436c148a34..76788175c6 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -135,7 +135,7 @@ $ make go ### PHP -We have two version of php protobuf implemention: pure php, php with c extension. To run these version benchmark, you need to: +We have two version of php protobuf implementation: pure php, php with c extension. To run these version benchmark, you need to: #### Pure PHP ``` $ make php diff --git a/benchmarks/cpp/BUILD b/benchmarks/cpp/BUILD new file mode 100644 index 0000000000..b744f896ad --- /dev/null +++ b/benchmarks/cpp/BUILD @@ -0,0 +1,15 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") + +cc_binary( + name = "cpp", + srcs = [ + "cpp_benchmark.cc", + ], + tags = ["benchmark"], + deps = [ + "//:protobuf", + "//benchmarks:benchmarks_cc_proto", + "//benchmarks/datasets:cc_protos", + "@com_github_google_benchmark//:benchmark_main", + ], +) diff --git a/benchmarks/datasets/BUILD b/benchmarks/datasets/BUILD new file mode 100644 index 0000000000..f29a27650b --- /dev/null +++ b/benchmarks/datasets/BUILD @@ -0,0 +1,59 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") +load("@rules_java//java:defs.bzl", "java_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + +filegroup( + name = "datasets", + srcs = [ + "//benchmarks/datasets/google_message1/proto2:datasets", + "//benchmarks/datasets/google_message1/proto3:datasets", + "//benchmarks/datasets/google_message2:datasets", + "//benchmarks/datasets/google_message3:datasets", + "//benchmarks/datasets/google_message4:datasets", + ], + visibility = [ + "//benchmarks:__subpackages__", + ], +) + +proto_library( + name = "protos", + visibility = [ + "//benchmarks:__subpackages__", + ], + deps = [ + "//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_proto", + "//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_proto", + "//benchmarks/datasets/google_message2:benchmark_message2_proto", + "//benchmarks/datasets/google_message3:benchmark_message3_proto", + "//benchmarks/datasets/google_message4:benchmark_message4_proto", + ], +) + +cc_library( + name = "cc_protos", + visibility = [ + "//benchmarks:__subpackages__", + ], + deps = [ + "//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_cc_proto", + "//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_cc_proto", + "//benchmarks/datasets/google_message2:benchmark_message2_cc_proto", + "//benchmarks/datasets/google_message3:benchmark_message3_cc_proto", + "//benchmarks/datasets/google_message4:benchmark_message4_cc_proto", + ], +) + +java_library( + name = "java_protos", + visibility = [ + "//benchmarks:__subpackages__", + ], + exports = [ + "//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_java_proto", + "//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_java_proto", + "//benchmarks/datasets/google_message2:benchmark_message2_java_proto", + "//benchmarks/datasets/google_message3:benchmark_message3_java_proto", + "//benchmarks/datasets/google_message4:benchmark_message4_java_proto", + ], +) diff --git a/benchmarks/datasets/google_message1/proto2/BUILD b/benchmarks/datasets/google_message1/proto2/BUILD new file mode 100644 index 0000000000..d4d38cec22 --- /dev/null +++ b/benchmarks/datasets/google_message1/proto2/BUILD @@ -0,0 +1,44 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") +load("@rules_java//java:defs.bzl", "java_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + +filegroup( + name = "datasets", + srcs = [ + "dataset.google_message1_proto2.pb", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +proto_library( + name = "benchmark_message1_proto2_proto", + srcs = [ + "benchmark_message1_proto2.proto", + ], + strip_import_prefix = "/benchmarks", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +cc_proto_library( + name = "benchmark_message1_proto2_cc_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message1_proto2_proto", + ], +) + +java_proto_library( + name = "benchmark_message1_proto2_java_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message1_proto2_proto", + ], +) diff --git a/benchmarks/datasets/google_message1/proto3/BUILD b/benchmarks/datasets/google_message1/proto3/BUILD new file mode 100644 index 0000000000..c2d627acd8 --- /dev/null +++ b/benchmarks/datasets/google_message1/proto3/BUILD @@ -0,0 +1,44 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") +load("@rules_java//java:defs.bzl", "java_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + +filegroup( + name = "datasets", + srcs = [ + "dataset.google_message1_proto3.pb", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +proto_library( + name = "benchmark_message1_proto3_proto", + srcs = [ + "benchmark_message1_proto3.proto", + ], + strip_import_prefix = "/benchmarks", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +cc_proto_library( + name = "benchmark_message1_proto3_cc_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message1_proto3_proto", + ], +) + +java_proto_library( + name = "benchmark_message1_proto3_java_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message1_proto3_proto", + ], +) diff --git a/benchmarks/datasets/google_message2/BUILD b/benchmarks/datasets/google_message2/BUILD new file mode 100644 index 0000000000..1ca87fb64f --- /dev/null +++ b/benchmarks/datasets/google_message2/BUILD @@ -0,0 +1,44 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") +load("@rules_java//java:defs.bzl", "java_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + +filegroup( + name = "datasets", + srcs = [ + "dataset.google_message2.pb", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +proto_library( + name = "benchmark_message2_proto", + srcs = [ + "benchmark_message2.proto", + ], + strip_import_prefix = "/benchmarks", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +cc_proto_library( + name = "benchmark_message2_cc_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message2_proto", + ], +) + +java_proto_library( + name = "benchmark_message2_java_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message2_proto", + ], +) diff --git a/benchmarks/datasets/google_message3/BUILD b/benchmarks/datasets/google_message3/BUILD new file mode 100644 index 0000000000..9a00294464 --- /dev/null +++ b/benchmarks/datasets/google_message3/BUILD @@ -0,0 +1,50 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") +load("@rules_java//java:defs.bzl", "java_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + +filegroup( + name = "datasets", + srcs = [], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +proto_library( + name = "benchmark_message3_proto", + srcs = [ + "benchmark_message3.proto", + "benchmark_message3_1.proto", + "benchmark_message3_2.proto", + "benchmark_message3_3.proto", + "benchmark_message3_4.proto", + "benchmark_message3_5.proto", + "benchmark_message3_6.proto", + "benchmark_message3_7.proto", + "benchmark_message3_8.proto", + ], + strip_import_prefix = "/benchmarks", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +cc_proto_library( + name = "benchmark_message3_cc_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message3_proto", + ], +) + +java_proto_library( + name = "benchmark_message3_java_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message3_proto", + ], +) diff --git a/benchmarks/datasets/google_message4/BUILD b/benchmarks/datasets/google_message4/BUILD new file mode 100644 index 0000000000..b23a4c955c --- /dev/null +++ b/benchmarks/datasets/google_message4/BUILD @@ -0,0 +1,45 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") +load("@rules_java//java:defs.bzl", "java_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + +filegroup( + name = "datasets", + srcs = [], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +proto_library( + name = "benchmark_message4_proto", + srcs = [ + "benchmark_message4.proto", + "benchmark_message4_1.proto", + "benchmark_message4_2.proto", + "benchmark_message4_3.proto", + ], + strip_import_prefix = "/benchmarks", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +cc_proto_library( + name = "benchmark_message4_cc_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message4_proto", + ], +) + +java_proto_library( + name = "benchmark_message4_java_proto", + visibility = [ + "//benchmarks/datasets:__pkg__", + ], + deps = [ + "benchmark_message4_proto", + ], +) diff --git a/benchmarks/download_data.sh b/benchmarks/download_data.sh deleted file mode 100755 index fa0729e9a3..0000000000 --- a/benchmarks/download_data.sh +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/sh - -curl -O https://storage.googleapis.com/protobuf_opensource_benchmark_data/datasets.tar.gz -tar -zvxf datasets.tar.gz - diff --git a/benchmarks/java/pom.xml b/benchmarks/java/pom.xml index 570bd6644f..c0dc9408c1 100644 --- a/benchmarks/java/pom.xml +++ b/benchmarks/java/pom.xml @@ -22,7 +22,7 @@ com.google.caliper caliper - 1.0-beta-2 + 1.0-beta-3 diff --git a/benchmarks/js/js_benchmark.js b/benchmarks/js/js_benchmark.js index c44fee01c3..9ba4828969 100644 --- a/benchmarks/js/js_benchmark.js +++ b/benchmarks/js/js_benchmark.js @@ -41,9 +41,9 @@ process.argv.forEach(function(filename, index) { totalBytes += onePayload.length; }); - var senarios = benchmarkSuite.newBenchmark( + var scenarios = benchmarkSuite.newBenchmark( benchmarkDataset.getMessageName(), filename, "js"); - senarios.suite + scenarios.suite .add("js deserialize", function() { benchmarkDataset.getPayloadList().forEach(function(onePayload) { var protoType = getNewPrototype(benchmarkDataset.getMessageName()); @@ -61,15 +61,15 @@ process.argv.forEach(function(filename, index) { results.push({ filename: filename, benchmarks: { - protobufjs_decoding: senarios.benches[0] * totalBytes / 1024 / 1024, - protobufjs_encoding: senarios.benches[1] * totalBytes / 1024 / 1024 + protobufjs_decoding: scenarios.benches[0] * totalBytes / 1024 / 1024, + protobufjs_encoding: scenarios.benches[1] * totalBytes / 1024 / 1024 } }) console.log("Throughput for deserialize: " - + senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); + + scenarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); console.log("Throughput for serialize: " - + senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); + + scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); console.log(""); }); console.log("#####################################################"); diff --git a/benchmarks/protobuf.js/protobufjs_benchmark.js b/benchmarks/protobuf.js/protobufjs_benchmark.js index 19e54972b8..e062d1c6b8 100644 --- a/benchmarks/protobuf.js/protobufjs_benchmark.js +++ b/benchmarks/protobuf.js/protobufjs_benchmark.js @@ -31,9 +31,9 @@ process.argv.forEach(function(filename, index) { totalBytes += onePayload.length; }); - var senarios = benchmarkSuite.newBenchmark( + var scenarios = benchmarkSuite.newBenchmark( benchmarkDataset.messageName, filename, "protobufjs"); - senarios.suite + scenarios.suite .add("protobuf.js static decoding", function() { benchmarkDataset.payload.forEach(function(onePayload) { var protoType = getNewPrototype(benchmarkDataset.messageName); @@ -51,15 +51,15 @@ process.argv.forEach(function(filename, index) { results.push({ filename: filename, benchmarks: { - protobufjs_decoding: senarios.benches[0] * totalBytes, - protobufjs_encoding: senarios.benches[1] * totalBytes + protobufjs_decoding: scenarios.benches[0] * totalBytes, + protobufjs_encoding: scenarios.benches[1] * totalBytes } }) console.log("Throughput for decoding: " - + senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); + + scenarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); console.log("Throughput for encoding: " - + senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); + + scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); console.log(""); }); console.log("#####################################################"); diff --git a/benchmarks/util/result_parser.py b/benchmarks/util/result_parser.py index b09f387a6b..896f47a105 100644 --- a/benchmarks/util/result_parser.py +++ b/benchmarks/util/result_parser.py @@ -1,5 +1,6 @@ # This import depends on the automake rule protoc_middleman, please make sure # protoc_middleman has been built before run this file. +import argparse import json import re import os.path @@ -298,3 +299,39 @@ def get_result_from_file(cpp_file="", __parse_php_result(php_c_file, "php") return __results + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("-cpp", "--cpp_input_file", + help="The CPP benchmark result file's name", + default="") + parser.add_argument("-java", "--java_input_file", + help="The Java benchmark result file's name", + default="") + parser.add_argument("-python", "--python_input_file", + help="The Python benchmark result file's name", + default="") + parser.add_argument("-go", "--go_input_file", + help="The golang benchmark result file's name", + default="") + parser.add_argument("-node", "--node_input_file", + help="The node.js benchmark result file's name", + default="") + parser.add_argument("-php", "--php_input_file", + help="The pure php benchmark result file's name", + default="") + parser.add_argument("-php_c", "--php_c_input_file", + help="The php with c ext benchmark result file's name", + default="") + args = parser.parse_args() + + results = get_result_from_file( + cpp_file=args.cpp_input_file, + java_file=args.java_input_file, + python_file=args.python_input_file, + go_file=args.go_input_file, + node_file=args.node_input_file, + php_file=args.php_input_file, + php_c_file=args.php_c_input_file, + ) + print(json.dumps(results, indent=2)) diff --git a/build_files_updated_unittest.sh b/build_files_updated_unittest.sh index c86307193c..87541c35fa 100755 --- a/build_files_updated_unittest.sh +++ b/build_files_updated_unittest.sh @@ -58,5 +58,5 @@ bash "${test_dir}/update_file_lists.sh" # Test whether there are any differences for file in ${generated_files[@]}; do - diff "${golden_dir}/${file}" "${test_dir}/${file}" + diff -du "${golden_dir}/${file}" "${test_dir}/${file}" done diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 849679995a..61a5c3dede 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -29,7 +29,7 @@ else() endif() # The Intel compiler isn't able to deal with noinline member functions of -# template classses defined in headers. As such it spams the output with +# template classes defined in headers. As such it spams the output with # warning #2196: routine is both "inline" and "noinline" # This silences that warning. if (CMAKE_CXX_COMPILER_ID MATCHES Intel) @@ -37,10 +37,15 @@ if (CMAKE_CXX_COMPILER_ID MATCHES Intel) endif() # Options +if(WITH_PROTOC) + set(protobuf_PROTOC_EXE ${WITH_PROTOC} CACHE FILEPATH "Protocol Buffer Compiler executable" FORCE) +endif() option(protobuf_BUILD_TESTS "Build tests" ON) option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF) option(protobuf_BUILD_EXAMPLES "Build examples" OFF) option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON) +option(protobuf_BUILD_LIBPROTOC "Build libprotoc" OFF) +option(protobuf_DISABLE_RTTI "Remove runtime type information in the binaries" OFF) if (BUILD_SHARED_LIBS) set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON) else (BUILD_SHARED_LIBS) @@ -58,6 +63,10 @@ mark_as_advanced(protobuf_DEBUG_POSTFIX) # User options include(protobuf-options.cmake) +# Overrides for option dependencies +if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS) + set(protobuf_BUILD_LIBPROTOC ON) +endif () # Path to main configure script set(protobuf_CONFIGURE_SCRIPT "../configure.ac") @@ -109,6 +118,10 @@ endif() add_definitions(-DGOOGLE_PROTOBUF_CMAKE_BUILD) +if (protobuf_DISABLE_RTTI) + add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI=1) +endif() + find_package(Threads REQUIRED) if (CMAKE_USE_PTHREADS_INIT) add_definitions(-DHAVE_PTHREAD) @@ -180,8 +193,10 @@ else (protobuf_BUILD_SHARED_LIBS) endif (protobuf_BUILD_SHARED_LIBS) if (MSVC) - # Build with multiple processes - add_definitions(/MP) + if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Build with multiple processes + add_definitions(/MP) + endif() # MSVC warning suppressions add_definitions( /wd4018 # 'expression' : signed/unsigned mismatch @@ -209,12 +224,14 @@ if (MSVC) # Suppress linker warnings about files with no symbols defined. set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221") - # Configure Resource Compiler - enable_language(RC) - # use English language (0x409) in resource compiler - set(rc_flags "/l0x409") - # fix rc.exe invocations because of usage of add_definitions() - set(CMAKE_RC_COMPILE_OBJECT " ${rc_flags} /fo ") + if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Configure Resource Compiler + enable_language(RC) + # use English language (0x409) in resource compiler + set(rc_flags "/l0x409") + # fix rc.exe invocations because of usage of add_definitions() + set(CMAKE_RC_COMPILE_OBJECT " ${rc_flags} /fo ") + endif() configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) endif (MSVC) @@ -242,11 +259,29 @@ endif (protobuf_UNICODE) include(libprotobuf-lite.cmake) include(libprotobuf.cmake) -if (protobuf_BUILD_PROTOC_BINARIES) +if (protobuf_BUILD_LIBPROTOC) include(libprotoc.cmake) +endif (protobuf_BUILD_LIBPROTOC) +if (protobuf_BUILD_PROTOC_BINARIES) include(protoc.cmake) + if (NOT DEFINED protobuf_PROTOC_EXE) + set(protobuf_PROTOC_EXE protoc) + endif (NOT DEFINED protobuf_PROTOC_EXE) endif (protobuf_BUILD_PROTOC_BINARIES) +# Ensure we have a protoc executable if we need one +if (protobuf_BUILD_TESTS OR protobuf_BUILD_CONFORMANCE OR protobuf_BUILD_EXAMPLES) + if (NOT DEFINED protobuf_PROTOC_EXE) + find_program(protobuf_PROTOC_EXE protoc) + if (NOT protobuf_PROTOC_EXE) + message(FATAL "Build requires 'protoc' but binary not found and not building protoc.") + endif () + endif () + if(protobuf_VERBOSE) + message(STATUS "Using protoc : ${protobuf_PROTOC_EXE}") + endif(protobuf_VERBOSE) +endif () + if (protobuf_BUILD_TESTS) include(tests.cmake) endif (protobuf_BUILD_TESTS) @@ -262,5 +297,5 @@ if (protobuf_BUILD_EXAMPLES) endif (protobuf_BUILD_EXAMPLES) if(protobuf_VERBOSE) - message(STATUS "Protocol Buffers Configuring done") -endif() + message(STATUS "Protocol Buffers Configuring done") +endif(protobuf_VERBOSE) diff --git a/cmake/conformance.cmake b/cmake/conformance.cmake index 82b4cf580a..056b5d0c60 100644 --- a/cmake/conformance.cmake +++ b/cmake/conformance.cmake @@ -1,8 +1,8 @@ add_custom_command( OUTPUT ${protobuf_source_dir}/conformance/conformance.pb.cc - DEPENDS protoc ${protobuf_source_dir}/conformance/conformance.proto - COMMAND protoc ${protobuf_source_dir}/conformance/conformance.proto + DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/conformance/conformance.proto + COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/conformance/conformance.proto --proto_path=${protobuf_source_dir}/conformance --cpp_out=${protobuf_source_dir}/conformance ) @@ -10,9 +10,9 @@ add_custom_command( add_custom_command( OUTPUT ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc - DEPENDS protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto - protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto - COMMAND protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto + DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto + ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto + COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto --proto_path=${protobuf_source_dir}/src --cpp_out=${protobuf_source_dir}/src @@ -21,7 +21,6 @@ add_custom_command( add_executable(conformance_test_runner ${protobuf_source_dir}/conformance/conformance.pb.cc ${protobuf_source_dir}/conformance/conformance_test.cc - ${protobuf_source_dir}/conformance/binary_json_conformance_main.cc ${protobuf_source_dir}/conformance/binary_json_conformance_suite.cc ${protobuf_source_dir}/conformance/binary_json_conformance_suite.h ${protobuf_source_dir}/conformance/conformance_test_runner.cc diff --git a/cmake/extract_includes.bat.in b/cmake/extract_includes.bat.in index 007cc80669..d2ab2dea97 100644 --- a/cmake/extract_includes.bat.in +++ b/cmake/extract_includes.bat.in @@ -26,6 +26,7 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\cshar copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_names.h" include\google\protobuf\compiler\csharp\csharp_names.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\importer.h" include\google\protobuf\compiler\importer.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_generator.h" include\google\protobuf\compiler\java\java_generator.h +copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_kotlin_generator.h" include\google\protobuf\compiler\java\java_kotlin_generator.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_names.h" include\google\protobuf\compiler\java\java_names.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\js\js_generator.h" include\google\protobuf\compiler\js\js_generator.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\js\well_known_types_embed.h" include\google\protobuf\compiler\js\well_known_types_embed.h @@ -45,15 +46,18 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\dynamic_message.h" in copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\empty.pb.h" include\google\protobuf\empty.pb.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\extension_set.h" include\google\protobuf\extension_set.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\extension_set_inl.h" include\google\protobuf\extension_set_inl.h +copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_access_listener.h" include\google\protobuf\field_access_listener.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_mask.pb.h" include\google\protobuf\field_mask.pb.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_reflection.h" include\google\protobuf\generated_enum_reflection.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_util.h" include\google\protobuf\generated_enum_util.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_reflection.h" include\google\protobuf\generated_message_reflection.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_table_driven.h" include\google\protobuf\generated_message_table_driven.h +copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tctable_decl.h" include\google\protobuf\generated_message_tctable_decl.h +copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tctable_impl.h" include\google\protobuf\generated_message_tctable_impl.h +copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tctable_impl.inc" include\google\protobuf\generated_message_tctable_impl.inc copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_util.h" include\google\protobuf\generated_message_util.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\has_bits.h" include\google\protobuf\has_bits.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\implicit_weak_message.h" include\google\protobuf\implicit_weak_message.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\inlined_string_field.h" include\google\protobuf\inlined_string_field.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\coded_stream.h" include\google\protobuf\io\coded_stream.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\gzip_stream.h" include\google\protobuf\io\gzip_stream.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\io_win32.h" include\google\protobuf\io\io_win32.h @@ -88,7 +92,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\bytestream.h" i copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\callback.h" include\google\protobuf\stubs\callback.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" include\google\protobuf\stubs\casts.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\fastmem.h" include\google\protobuf\stubs\fastmem.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h diff --git a/cmake/install.cmake b/cmake/install.cmake index be47c54a1e..ef5bb13068 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -6,9 +6,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY) set(_protobuf_libraries libprotobuf-lite libprotobuf) -if (protobuf_BUILD_PROTOC_BINARIES) +if (protobuf_BUILD_LIBPROTOC) list(APPEND _protobuf_libraries libprotoc) -endif (protobuf_BUILD_PROTOC_BINARIES) +endif (protobuf_BUILD_LIBPROTOC) foreach(_library ${_protobuf_libraries}) set_property(TARGET ${_library} @@ -30,7 +30,9 @@ endforeach() if (protobuf_BUILD_PROTOC_BINARIES) install(TARGETS protoc EXPORT protobuf-targets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT protoc) if (UNIX AND NOT APPLE) set_property(TARGET protoc PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") @@ -102,12 +104,16 @@ endforeach() # Install configuration set(_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the cmake configuration files") +set(_exampledir_desc "Directory relative to CMAKE_INSTALL_DATA to install examples") if(NOT MSVC) set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/protobuf" CACHE STRING "${_cmakedir_desc}") + set(CMAKE_INSTALL_EXAMPLEDIR "${CMAKE_INSTALL_DATADIR}/protobuf/examples" CACHE STRING "${_exampledir_desc}") else() set(CMAKE_INSTALL_CMAKEDIR "cmake" CACHE STRING "${_cmakedir_desc}") + set(CMAKE_INSTALL_EXAMPLEDIR "examples" CACHE STRING "${_exampledir_desc}") endif() mark_as_advanced(CMAKE_INSTALL_CMAKEDIR) +mark_as_advanced(CMAKE_INSTALL_EXAMPLEDIR) configure_file(protobuf-config.cmake.in ${CMAKE_INSTALL_CMAKEDIR}/protobuf-config.cmake @ONLY) @@ -145,6 +151,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}/ option(protobuf_INSTALL_EXAMPLES "Install the examples folder" OFF) if(protobuf_INSTALL_EXAMPLES) - install(DIRECTORY ../examples/ DESTINATION examples + install(DIRECTORY ../examples/ + DESTINATION "${CMAKE_INSTALL_EXAMPLEDIR}" COMPONENT protobuf-examples) endif() diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake index 6bf86a2770..e6fab3becf 100644 --- a/cmake/libprotobuf-lite.cmake +++ b/cmake/libprotobuf-lite.cmake @@ -1,6 +1,7 @@ set(libprotobuf_lite_files ${protobuf_source_dir}/src/google/protobuf/any_lite.cc ${protobuf_source_dir}/src/google/protobuf/arena.cc + ${protobuf_source_dir}/src/google/protobuf/arenastring.cc ${protobuf_source_dir}/src/google/protobuf/extension_set.cc ${protobuf_source_dir}/src/google/protobuf/generated_enum_util.cc ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.cc @@ -12,6 +13,7 @@ set(libprotobuf_lite_files ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.cc ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl.cc ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.cc + ${protobuf_source_dir}/src/google/protobuf/map.cc ${protobuf_source_dir}/src/google/protobuf/message_lite.cc ${protobuf_source_dir}/src/google/protobuf/parse_context.cc ${protobuf_source_dir}/src/google/protobuf/repeated_field.cc @@ -55,7 +57,7 @@ set(libprotobuf_lite_includes ${protobuf_source_dir}/src/google/protobuf/wire_format_lite.h ) -if (MSVC) +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(libprotobuf_lite_rc_files ${CMAKE_CURRENT_BINARY_DIR}/version.rc ) @@ -67,6 +69,9 @@ target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT}) if(protobuf_LINK_LIBATOMIC) target_link_libraries(libprotobuf-lite atomic) endif() +if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") + target_link_libraries(libprotobuf-lite log) +endif() target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src) if(MSVC AND protobuf_BUILD_SHARED_LIBS) target_compile_definitions(libprotobuf-lite diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake index 0c12596c23..f5a70becb2 100644 --- a/cmake/libprotobuf.cmake +++ b/cmake/libprotobuf.cmake @@ -11,6 +11,7 @@ set(libprotobuf_files ${protobuf_source_dir}/src/google/protobuf/dynamic_message.cc ${protobuf_source_dir}/src/google/protobuf/empty.pb.cc ${protobuf_source_dir}/src/google/protobuf/extension_set_heavy.cc + ${protobuf_source_dir}/src/google/protobuf/field_access_listener.cc ${protobuf_source_dir}/src/google/protobuf/field_mask.pb.cc ${protobuf_source_dir}/src/google/protobuf/generated_message_reflection.cc ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven.cc @@ -65,6 +66,7 @@ set(libprotobuf_includes ${protobuf_source_dir}/src/google/protobuf/duration.pb.h ${protobuf_source_dir}/src/google/protobuf/dynamic_message.h ${protobuf_source_dir}/src/google/protobuf/empty.pb.h + ${protobuf_source_dir}/src/google/protobuf/field_access_listener.h ${protobuf_source_dir}/src/google/protobuf/field_mask.pb.h ${protobuf_source_dir}/src/google/protobuf/generated_message_reflection.h ${protobuf_source_dir}/src/google/protobuf/io/gzip_stream.h @@ -106,7 +108,7 @@ set(libprotobuf_includes ${protobuf_source_dir}/src/google/protobuf/wrappers.pb.h ) -if (MSVC) +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(libprotobuf_rc_files ${CMAKE_CURRENT_BINARY_DIR}/version.rc ) @@ -121,6 +123,9 @@ endif() if(protobuf_LINK_LIBATOMIC) target_link_libraries(libprotobuf atomic) endif() +if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") + target_link_libraries(libprotobuf log) +endif() target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src) if(MSVC AND protobuf_BUILD_SHARED_LIBS) target_compile_definitions(libprotobuf diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake index b71f2f1ba9..a6f791934b 100644 --- a/cmake/libprotoc.cmake +++ b/cmake/libprotoc.cmake @@ -12,6 +12,7 @@ set(libprotoc_files ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message_field.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc + ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.cc @@ -44,6 +45,7 @@ set(libprotoc_files ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator.cc ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator_factory.cc ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_helpers.cc + ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_kotlin_generator.cc ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field.cc ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field_lite.cc ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message.cc @@ -93,8 +95,10 @@ set(libprotoc_headers ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message.h ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message_field.h ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h + ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_names.h ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_options.h ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h + ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.h ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.h ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.h ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.h @@ -159,7 +163,7 @@ set(libprotoc_headers ${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.h ) -if (MSVC) +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(libprotoc_rc_files ${CMAKE_CURRENT_BINARY_DIR}/version.rc ) diff --git a/cmake/protobuf-config.cmake.in b/cmake/protobuf-config.cmake.in index 11b85d3c07..9197625dc2 100644 --- a/cmake/protobuf-config.cmake.in +++ b/cmake/protobuf-config.cmake.in @@ -15,7 +15,7 @@ function(protobuf_generate) if(COMMAND target_sources) list(APPEND _singleargs TARGET) endif() - set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS) + set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS PROTOC_OPTIONS) cmake_parse_arguments(protobuf_generate "${_options}" "${_singleargs}" "${_multiargs}" "${ARGN}") @@ -99,13 +99,17 @@ function(protobuf_generate) foreach(_proto ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_proto} ABSOLUTE) get_filename_component(_abs_dir ${_abs_file} DIRECTORY) - get_filename_component(_basename ${_proto} NAME_WLE) + + get_filename_component(_file_full_name ${_proto} NAME) + string(FIND "${_file_full_name}" "." _file_last_ext_pos REVERSE) + string(SUBSTRING "${_file_full_name}" 0 ${_file_last_ext_pos} _basename) set(_suitable_include_found FALSE) foreach(DIR ${_protobuf_include_path}) if(NOT DIR STREQUAL "-I") file(RELATIVE_PATH _rel_dir ${DIR} ${_abs_dir}) - if(NOT "${_rel_dir}" MATCHES "^\.\.[/\\].*") + string(FIND "${_rel_dir}" "../" _is_in_parent_folder) + if (NOT ${_is_in_parent_folder} EQUAL 0) set(_suitable_include_found TRUE) break() endif() @@ -126,9 +130,9 @@ function(protobuf_generate) add_custom_command( OUTPUT ${_generated_srcs} COMMAND protobuf::protoc - ARGS --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_protobuf_include_path} ${_abs_file} + ARGS ${protobuf_generate_PROTOC_OPTIONS} --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_protobuf_include_path} ${_abs_file} DEPENDS ${_abs_file} protobuf::protoc - COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}" + COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}. Custom options: ${protobuf_generate_PROTOC_OPTIONS}" VERBATIM ) endforeach() diff --git a/cmake/protobuf-lite.pc.cmake b/cmake/protobuf-lite.pc.cmake index cbe5426afa..9745cb89c7 100644 --- a/cmake/protobuf-lite.pc.cmake +++ b/cmake/protobuf-lite.pc.cmake @@ -7,5 +7,5 @@ Name: Protocol Buffers Description: Google's Data Interchange Format Version: @protobuf_VERSION@ Libs: -L${libdir} -lprotobuf-lite @CMAKE_THREAD_LIBS_INIT@ -Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} Conflicts: protobuf diff --git a/cmake/protobuf-module.cmake.in b/cmake/protobuf-module.cmake.in index 74c5488729..810256e54c 100644 --- a/cmake/protobuf-module.cmake.in +++ b/cmake/protobuf-module.cmake.in @@ -97,6 +97,10 @@ function(_protobuf_find_libraries name filename) else() get_target_property(${name}_LIBRARY_RELEASE protobuf::lib${filename} LOCATION_RELEASE) + get_target_property(${name}_LIBRARY_RELWITHDEBINFO protobuf::lib${filename} + LOCATION_RELWITHDEBINFO) + get_target_property(${name}_LIBRARY_MINSIZEREL protobuf::lib${filename} + LOCATION_MINSIZEREL) get_target_property(${name}_LIBRARY_DEBUG protobuf::lib${filename} LOCATION_DEBUG) @@ -146,6 +150,14 @@ get_target_property(Protobuf_INCLUDE_DIRS protobuf::libprotobuf # Set the protoc Executable get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc IMPORTED_LOCATION_RELEASE) +if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_RELWITHDEBINFO) +endif() +if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_MINSIZEREL) +endif() if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc IMPORTED_LOCATION_DEBUG) diff --git a/cmake/protobuf-options.cmake b/cmake/protobuf-options.cmake index 47fb158257..93ec898e4a 100644 --- a/cmake/protobuf-options.cmake +++ b/cmake/protobuf-options.cmake @@ -2,6 +2,6 @@ option(protobuf_VERBOSE "Enable for verbose output" OFF) mark_as_advanced(protobuf_VERBOSE) -# FindProtobuf module compatibel -option(protobuf_MODULE_COMPATIBLE "CMake build-in FindProtobuf.cmake module compatible" OFF) +# FindProtobuf module compatible +option(protobuf_MODULE_COMPATIBLE "CMake built-in FindProtobuf.cmake module compatible" OFF) mark_as_advanced(protobuf_MODULE_COMPATIBLE) diff --git a/cmake/protobuf.pc.cmake b/cmake/protobuf.pc.cmake index d33e98cca8..f068e6926e 100644 --- a/cmake/protobuf.pc.cmake +++ b/cmake/protobuf.pc.cmake @@ -7,5 +7,5 @@ Name: Protocol Buffers Description: Google's Data Interchange Format Version: @protobuf_VERSION@ Libs: -L${libdir} -lprotobuf @CMAKE_THREAD_LIBS_INIT@ -Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} Conflicts: protobuf-lite diff --git a/cmake/protoc.cmake b/cmake/protoc.cmake index f90e525e80..c86d6628f2 100644 --- a/cmake/protoc.cmake +++ b/cmake/protoc.cmake @@ -2,7 +2,7 @@ set(protoc_files ${protobuf_source_dir}/src/google/protobuf/compiler/main.cc ) -if (MSVC) +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(protoc_rc_files ${CMAKE_CURRENT_BINARY_DIR}/version.rc ) diff --git a/cmake/tests.cmake b/cmake/tests.cmake index c3ef7301f5..4a54b70d74 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -33,7 +33,6 @@ set(lite_test_protos google/protobuf/unittest_import_lite.proto google/protobuf/unittest_import_public_lite.proto google/protobuf/unittest_lite.proto - google/protobuf/unittest_no_arena_lite.proto ) set(tests_protos @@ -56,8 +55,6 @@ set(tests_protos google/protobuf/unittest_lite_imports_nonlite.proto google/protobuf/unittest_mset.proto google/protobuf/unittest_mset_wire_format.proto - google/protobuf/unittest_no_arena.proto - google/protobuf/unittest_no_arena_import.proto google/protobuf/unittest_no_field_presence.proto google/protobuf/unittest_no_generic_services.proto google/protobuf/unittest_optimize_for.proto @@ -90,8 +87,8 @@ macro(compile_proto_file filename) get_filename_component(basename ${filename} NAME_WE) add_custom_command( OUTPUT ${protobuf_source_dir}/src/${dirname}/${basename}.pb.cc - DEPENDS protoc ${protobuf_source_dir}/src/${dirname}/${basename}.proto - COMMAND protoc ${protobuf_source_dir}/src/${dirname}/${basename}.proto + DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/${dirname}/${basename}.proto + COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/${dirname}/${basename}.proto --proto_path=${protobuf_source_dir}/src --cpp_out=${protobuf_source_dir}/src --experimental_allow_proto3_optional diff --git a/configure.ac b/configure.ac index a86499a571..a3309b7ddf 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ AC_PREREQ(2.59) # In the SVN trunk, the version should always be the next anticipated release # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.11.4],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.17.3],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) @@ -125,7 +125,7 @@ AC_LINK_IFELSE( [have_ld_version_script=yes; AC_MSG_RESULT(yes)], [have_ld_version_script=no; AC_MSG_RESULT(no)]) LDFLAGS=$save_LDFLAGS -AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], [test "$have_ld_version_script" == "yes"]) +AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], [test "$have_ld_version_script" = "yes"]) # Checks for header files. AC_HEADER_STDC @@ -223,6 +223,19 @@ case "$target_os" in esac AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1]) +AC_MSG_CHECKING(whether -llog is needed) +ANDROID_TEST=no +case "$target_os" in + *android*) + ANDROID_TEST=yes + ;; +esac +AC_MSG_RESULT($ANDROID_TEST) +if test "x$ANDROID_TEST" = xyes; then + LIBLOG_LIBS="-llog" +fi +AC_SUBST([LIBLOG_LIBS]) + # HACK: Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS, # since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock # too. diff --git a/conformance/ConformanceJava.java b/conformance/ConformanceJava.java index fa4dfb774d..100bec4b54 100644 --- a/conformance/ConformanceJava.java +++ b/conformance/ConformanceJava.java @@ -54,7 +54,7 @@ class ConformanceJava { while (len > 0) { int read = System.in.read(buf, ofs, len); if (read == -1) { - return false; // EOF + return false; // EOF } ofs += read; len -= read; @@ -81,10 +81,10 @@ class ConformanceJava { private void writeLittleEndianIntToStdout(int val) throws Exception { byte[] buf = new byte[4]; - buf[0] = (byte)val; - buf[1] = (byte)(val >> 8); - buf[2] = (byte)(val >> 16); - buf[3] = (byte)(val >> 24); + buf[0] = (byte) val; + buf[1] = (byte) (val >> 8); + buf[2] = (byte) (val >> 16); + buf[3] = (byte) (val >> 24); writeToStdout(buf); } @@ -98,85 +98,71 @@ class ConformanceJava { INPUT_STREAM_DECODER; } - private static class BinaryDecoder { - public MessageType decode (ByteString bytes, BinaryDecoderType type, - Parser parser, ExtensionRegistry extensions) - throws InvalidProtocolBufferException { + private static class BinaryDecoder { + public T decode( + ByteString bytes, BinaryDecoderType type, Parser parser, ExtensionRegistry extensions) + throws InvalidProtocolBufferException { switch (type) { case BTYE_STRING_DECODER: - return parser.parseFrom(bytes, extensions); case BYTE_ARRAY_DECODER: - return parser.parseFrom(bytes.toByteArray(), extensions); - case ARRAY_BYTE_BUFFER_DECODER: { - ByteBuffer buffer = ByteBuffer.allocate(bytes.size()); - bytes.copyTo(buffer); - buffer.flip(); - try { + return parser.parseFrom(bytes, extensions); + case ARRAY_BYTE_BUFFER_DECODER: + { + ByteBuffer buffer = ByteBuffer.allocate(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); return parser.parseFrom(CodedInputStream.newInstance(buffer), extensions); - } catch (InvalidProtocolBufferException e) { - throw e; } - } - case READONLY_ARRAY_BYTE_BUFFER_DECODER: { - try { + case READONLY_ARRAY_BYTE_BUFFER_DECODER: + { return parser.parseFrom( CodedInputStream.newInstance(bytes.asReadOnlyByteBuffer()), extensions); - } catch (InvalidProtocolBufferException e) { - throw e; } - } - case DIRECT_BYTE_BUFFER_DECODER: { - ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); - bytes.copyTo(buffer); - buffer.flip(); - try { + case DIRECT_BYTE_BUFFER_DECODER: + { + ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); return parser.parseFrom(CodedInputStream.newInstance(buffer), extensions); - } catch (InvalidProtocolBufferException e) { - throw e; } - } - case READONLY_DIRECT_BYTE_BUFFER_DECODER: { - ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); - bytes.copyTo(buffer); - buffer.flip(); - try { + case READONLY_DIRECT_BYTE_BUFFER_DECODER: + { + ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); return parser.parseFrom( CodedInputStream.newInstance(buffer.asReadOnlyBuffer()), extensions); - } catch (InvalidProtocolBufferException e) { - throw e; } - } - case INPUT_STREAM_DECODER: { - try { + case INPUT_STREAM_DECODER: + { return parser.parseFrom(bytes.newInput(), extensions); - } catch (InvalidProtocolBufferException e) { - throw e; } - } - default : - return null; } + return null; } } - private MessageType parseBinary( - ByteString bytes, Parser parser, ExtensionRegistry extensions) + private T parseBinary( + ByteString bytes, Parser parser, ExtensionRegistry extensions) throws InvalidProtocolBufferException { - ArrayList messages = new ArrayList (); - ArrayList exceptions = - new ArrayList (); + ArrayList messages = new ArrayList<>(); + ArrayList exceptions = new ArrayList<>(); for (int i = 0; i < BinaryDecoderType.values().length; i++) { messages.add(null); exceptions.add(null); } - BinaryDecoder decoder = new BinaryDecoder (); + if (messages.isEmpty()) { + throw new RuntimeException("binary decoder types missing"); + } + + BinaryDecoder decoder = new BinaryDecoder<>(); boolean hasMessage = false; boolean hasException = false; for (int i = 0; i < BinaryDecoderType.values().length; ++i) { try { - //= BinaryDecoderType.values()[i].parseProto3(bytes); + // = BinaryDecoderType.values()[i].parseProto3(bytes); messages.set(i, decoder.decode(bytes, BinaryDecoderType.values()[i], parser, extensions)); hasMessage = true; } catch (InvalidProtocolBufferException e) { @@ -202,7 +188,15 @@ class ConformanceJava { if (hasException) { // We do not check if exceptions are equal. Different implementations may return different // exception messages. Throw an arbitrary one out instead. - throw exceptions.get(0); + InvalidProtocolBufferException exception = null; + for (InvalidProtocolBufferException e : exceptions) { + if (exception != null) { + exception.addSuppressed(e); + } else { + exception = e; + } + } + throw exception; } // Fast path comparing all the messages with the first message, assuming equality being @@ -236,110 +230,144 @@ class ConformanceJava { private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) { com.google.protobuf.AbstractMessage testMessage; - boolean isProto3 = request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypesProto3"); - boolean isProto2 = request.getMessageType().equals("protobuf_test_messages.proto2.TestAllTypesProto2"); + boolean isProto3 = + request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypesProto3"); + boolean isProto2 = + request.getMessageType().equals("protobuf_test_messages.proto2.TestAllTypesProto2"); switch (request.getPayloadCase()) { - case PROTOBUF_PAYLOAD: { - if (isProto3) { - try { - ExtensionRegistry extensions = ExtensionRegistry.newInstance(); - TestMessagesProto3.registerAllExtensions(extensions); - testMessage = parseBinary(request.getProtobufPayload(), TestAllTypesProto3.parser(), extensions); - } catch (InvalidProtocolBufferException e) { - return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); + case PROTOBUF_PAYLOAD: + { + if (isProto3) { + try { + ExtensionRegistry extensions = ExtensionRegistry.newInstance(); + TestMessagesProto3.registerAllExtensions(extensions); + testMessage = + parseBinary( + request.getProtobufPayload(), TestAllTypesProto3.parser(), extensions); + } catch (InvalidProtocolBufferException e) { + return Conformance.ConformanceResponse.newBuilder() + .setParseError(e.getMessage()) + .build(); + } + } else if (isProto2) { + try { + ExtensionRegistry extensions = ExtensionRegistry.newInstance(); + TestMessagesProto2.registerAllExtensions(extensions); + testMessage = + parseBinary( + request.getProtobufPayload(), TestAllTypesProto2.parser(), extensions); + } catch (InvalidProtocolBufferException e) { + return Conformance.ConformanceResponse.newBuilder() + .setParseError(e.getMessage()) + .build(); + } + } else { + throw new RuntimeException("Protobuf request doesn't have specific payload type."); } - } else if (isProto2) { + break; + } + case JSON_PAYLOAD: + { try { - ExtensionRegistry extensions = ExtensionRegistry.newInstance(); - TestMessagesProto2.registerAllExtensions(extensions); - testMessage = parseBinary(request.getProtobufPayload(), TestAllTypesProto2.parser(), extensions); + JsonFormat.Parser parser = JsonFormat.parser().usingTypeRegistry(typeRegistry); + if (request.getTestCategory() + == Conformance.TestCategory.JSON_IGNORE_UNKNOWN_PARSING_TEST) { + parser = parser.ignoringUnknownFields(); + } + if (isProto3) { + TestMessagesProto3.TestAllTypesProto3.Builder builder = + TestMessagesProto3.TestAllTypesProto3.newBuilder(); + parser.merge(request.getJsonPayload(), builder); + testMessage = builder.build(); + } else if (isProto2) { + TestMessagesProto2.TestAllTypesProto2.Builder builder = + TestMessagesProto2.TestAllTypesProto2.newBuilder(); + parser.merge(request.getJsonPayload(), builder); + testMessage = builder.build(); + } else { + throw new RuntimeException("Protobuf request doesn't have specific payload type."); + } } catch (InvalidProtocolBufferException e) { - return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); - } - } else { - throw new RuntimeException("Protobuf request doesn't have specific payload type."); - } - break; - } - case JSON_PAYLOAD: { - try { - TestMessagesProto3.TestAllTypesProto3.Builder builder = - TestMessagesProto3.TestAllTypesProto3.newBuilder(); - JsonFormat.Parser parser = JsonFormat.parser().usingTypeRegistry(typeRegistry); - if (request.getTestCategory() - == Conformance.TestCategory.JSON_IGNORE_UNKNOWN_PARSING_TEST) { - parser = parser.ignoringUnknownFields(); + return Conformance.ConformanceResponse.newBuilder() + .setParseError(e.getMessage()) + .build(); } - parser.merge(request.getJsonPayload(), builder); - testMessage = builder.build(); - } catch (InvalidProtocolBufferException e) { - return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); + break; } - break; - } - case TEXT_PAYLOAD: { - if (isProto3) { - try { - TestMessagesProto3.TestAllTypesProto3.Builder builder = - TestMessagesProto3.TestAllTypesProto3.newBuilder(); - TextFormat.merge(request.getTextPayload(), builder); - testMessage = builder.build(); - } catch (TextFormat.ParseException e) { + case TEXT_PAYLOAD: + { + if (isProto3) { + try { + TestMessagesProto3.TestAllTypesProto3.Builder builder = + TestMessagesProto3.TestAllTypesProto3.newBuilder(); + TextFormat.merge(request.getTextPayload(), builder); + testMessage = builder.build(); + } catch (TextFormat.ParseException e) { return Conformance.ConformanceResponse.newBuilder() .setParseError(e.getMessage()) .build(); - } - } else if (isProto2) { - try { - TestMessagesProto2.TestAllTypesProto2.Builder builder = - TestMessagesProto2.TestAllTypesProto2.newBuilder(); - TextFormat.merge(request.getTextPayload(), builder); - testMessage = builder.build(); - } catch (TextFormat.ParseException e) { + } + } else if (isProto2) { + try { + TestMessagesProto2.TestAllTypesProto2.Builder builder = + TestMessagesProto2.TestAllTypesProto2.newBuilder(); + TextFormat.merge(request.getTextPayload(), builder); + testMessage = builder.build(); + } catch (TextFormat.ParseException e) { return Conformance.ConformanceResponse.newBuilder() .setParseError(e.getMessage()) .build(); + } + } else { + throw new RuntimeException("Protobuf request doesn't have specific payload type."); } - } else { - throw new RuntimeException("Protobuf request doesn't have specific payload type."); + break; + } + case PAYLOAD_NOT_SET: + { + throw new RuntimeException("Request didn't have payload."); } - break; - } - case PAYLOAD_NOT_SET: { - throw new RuntimeException("Request didn't have payload."); - } - default: { - throw new RuntimeException("Unexpected payload case."); - } + default: + { + throw new RuntimeException("Unexpected payload case."); + } } switch (request.getRequestedOutputFormat()) { case UNSPECIFIED: throw new RuntimeException("Unspecified output format."); - case PROTOBUF: { - ByteString MessageString = testMessage.toByteString(); - return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(MessageString).build(); - } + case PROTOBUF: + { + ByteString messageString = testMessage.toByteString(); + return Conformance.ConformanceResponse.newBuilder() + .setProtobufPayload(messageString) + .build(); + } case JSON: try { - return Conformance.ConformanceResponse.newBuilder().setJsonPayload( - JsonFormat.printer().usingTypeRegistry(typeRegistry).print(testMessage)).build(); + return Conformance.ConformanceResponse.newBuilder() + .setJsonPayload( + JsonFormat.printer().usingTypeRegistry(typeRegistry).print(testMessage)) + .build(); } catch (InvalidProtocolBufferException | IllegalArgumentException e) { - return Conformance.ConformanceResponse.newBuilder().setSerializeError( - e.getMessage()).build(); + return Conformance.ConformanceResponse.newBuilder() + .setSerializeError(e.getMessage()) + .build(); } case TEXT_FORMAT: - return Conformance.ConformanceResponse.newBuilder().setTextPayload( - TextFormat.printToString(testMessage)).build(); + return Conformance.ConformanceResponse.newBuilder() + .setTextPayload(TextFormat.printToString(testMessage)) + .build(); - default: { - throw new RuntimeException("Unexpected request output."); - } + default: + { + throw new RuntimeException("Unexpected request output."); + } } } @@ -347,7 +375,7 @@ class ConformanceJava { int bytes = readLittleEndianIntFromStdin(); if (bytes == -1) { - return false; // EOF + return false; // EOF } byte[] serializedInput = new byte[bytes]; @@ -368,14 +396,16 @@ class ConformanceJava { } public void run() throws Exception { - typeRegistry = TypeRegistry.newBuilder().add( - TestMessagesProto3.TestAllTypesProto3.getDescriptor()).build(); + typeRegistry = + TypeRegistry.newBuilder() + .add(TestMessagesProto3.TestAllTypesProto3.getDescriptor()) + .build(); while (doTestIo()) { this.testCount++; } - System.err.println("ConformanceJava: received EOF from test runner after " + - this.testCount + " tests"); + System.err.println( + "ConformanceJava: received EOF from test runner after " + this.testCount + " tests"); } public static void main(String[] args) throws Exception { diff --git a/conformance/ConformanceJavaLite.java b/conformance/ConformanceJavaLite.java index 147738dcbe..eb3d06afc5 100644 --- a/conformance/ConformanceJavaLite.java +++ b/conformance/ConformanceJavaLite.java @@ -28,8 +28,19 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import com.google.protobuf.conformance.Conformance; +import com.google.protobuf.ByteString; +import com.google.protobuf.CodedInputStream; +import com.google.protobuf.ExtensionRegistryLite; import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.MessageLite; +import com.google.protobuf.Parser; +import com.google.protobuf.conformance.Conformance; +import com.google.protobuf_test_messages.proto2.TestMessagesProto2; +import com.google.protobuf_test_messages.proto2.TestMessagesProto2.TestAllTypesProto2; +import com.google.protobuf_test_messages.proto3.TestMessagesProto3; +import com.google.protobuf_test_messages.proto3.TestMessagesProto3.TestAllTypesProto3; +import java.nio.ByteBuffer; +import java.util.ArrayList; class ConformanceJavaLite { private int testCount = 0; @@ -39,7 +50,7 @@ class ConformanceJavaLite { while (len > 0) { int read = System.in.read(buf, ofs, len); if (read == -1) { - return false; // EOF + return false; // EOF } ofs += read; len -= read; @@ -66,36 +77,214 @@ class ConformanceJavaLite { private void writeLittleEndianIntToStdout(int val) throws Exception { byte[] buf = new byte[4]; - buf[0] = (byte)val; - buf[1] = (byte)(val >> 8); - buf[2] = (byte)(val >> 16); - buf[3] = (byte)(val >> 24); + buf[0] = (byte) val; + buf[1] = (byte) (val >> 8); + buf[2] = (byte) (val >> 16); + buf[3] = (byte) (val >> 24); writeToStdout(buf); } - private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) { - Conformance.TestAllTypes testMessage; + private enum BinaryDecoderType { + BTYE_STRING_DECODER, + BYTE_ARRAY_DECODER, + ARRAY_BYTE_BUFFER_DECODER, + READONLY_ARRAY_BYTE_BUFFER_DECODER, + DIRECT_BYTE_BUFFER_DECODER, + READONLY_DIRECT_BYTE_BUFFER_DECODER, + INPUT_STREAM_DECODER; + } - switch (request.getPayloadCase()) { - case PROTOBUF_PAYLOAD: { - try { - testMessage = Conformance.TestAllTypes.parseFrom(request.getProtobufPayload()); - } catch (InvalidProtocolBufferException e) { - return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); + private static class BinaryDecoder { + public T decode( + ByteString bytes, + BinaryDecoderType type, + Parser parser, + ExtensionRegistryLite extensions) + throws InvalidProtocolBufferException { + switch (type) { + case BTYE_STRING_DECODER: + case BYTE_ARRAY_DECODER: + return parser.parseFrom(bytes, extensions); + case ARRAY_BYTE_BUFFER_DECODER: + { + ByteBuffer buffer = ByteBuffer.allocate(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); + return parser.parseFrom(CodedInputStream.newInstance(buffer), extensions); + } + case READONLY_ARRAY_BYTE_BUFFER_DECODER: + { + return parser.parseFrom( + CodedInputStream.newInstance(bytes.asReadOnlyByteBuffer()), extensions); + } + case DIRECT_BYTE_BUFFER_DECODER: + { + ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); + return parser.parseFrom(CodedInputStream.newInstance(buffer), extensions); + } + case READONLY_DIRECT_BYTE_BUFFER_DECODER: + { + ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size()); + bytes.copyTo(buffer); + buffer.flip(); + return parser.parseFrom( + CodedInputStream.newInstance(buffer.asReadOnlyBuffer()), extensions); + } + case INPUT_STREAM_DECODER: + { + return parser.parseFrom(bytes.newInput(), extensions); + } + } + return null; + } + } + + private T parseBinary( + ByteString bytes, Parser parser, ExtensionRegistryLite extensions) + throws InvalidProtocolBufferException { + ArrayList messages = new ArrayList<>(); + ArrayList exceptions = new ArrayList<>(); + + for (int i = 0; i < BinaryDecoderType.values().length; i++) { + messages.add(null); + exceptions.add(null); + } + if (messages.isEmpty()) { + throw new RuntimeException("binary decoder types missing"); + } + + BinaryDecoder decoder = new BinaryDecoder<>(); + + boolean hasMessage = false; + boolean hasException = false; + for (int i = 0; i < BinaryDecoderType.values().length; ++i) { + try { + messages.set(i, decoder.decode(bytes, BinaryDecoderType.values()[i], parser, extensions)); + hasMessage = true; + } catch (InvalidProtocolBufferException e) { + exceptions.set(i, e); + hasException = true; + } + } + + if (hasMessage && hasException) { + StringBuilder sb = + new StringBuilder("Binary decoders disagreed on whether the payload was valid.\n"); + for (int i = 0; i < BinaryDecoderType.values().length; ++i) { + sb.append(BinaryDecoderType.values()[i].name()); + if (messages.get(i) != null) { + sb.append(" accepted the payload.\n"); + } else { + sb.append(" rejected the payload.\n"); } - break; } - case JSON_PAYLOAD: { - return Conformance.ConformanceResponse.newBuilder().setSkipped( - "Lite runtime does not support JSON format.").build(); + throw new RuntimeException(sb.toString()); + } + + if (hasException) { + // We do not check if exceptions are equal. Different implementations may return different + // exception messages. Throw an arbitrary one out instead. + InvalidProtocolBufferException exception = null; + for (InvalidProtocolBufferException e : exceptions) { + if (exception != null) { + exception.addSuppressed(e); + } else { + exception = e; + } } - case PAYLOAD_NOT_SET: { - throw new RuntimeException("Request didn't have payload."); + throw exception; + } + + // Fast path comparing all the messages with the first message, assuming equality being + // symmetric and transitive. + boolean allEqual = true; + for (int i = 1; i < messages.size(); ++i) { + if (!messages.get(0).equals(messages.get(i))) { + allEqual = false; + break; } + } - default: { - throw new RuntimeException("Unexpected payload case."); + // Slow path: compare and find out all unequal pairs. + if (!allEqual) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < messages.size() - 1; ++i) { + for (int j = i + 1; j < messages.size(); ++j) { + if (!messages.get(i).equals(messages.get(j))) { + sb.append(BinaryDecoderType.values()[i].name()) + .append(" and ") + .append(BinaryDecoderType.values()[j].name()) + .append(" parsed the payload differently.\n"); + } + } } + throw new RuntimeException(sb.toString()); + } + + return messages.get(0); + } + + private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) { + com.google.protobuf.MessageLite testMessage; + boolean isProto3 = + request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypesProto3"); + boolean isProto2 = + request.getMessageType().equals("protobuf_test_messages.proto2.TestAllTypesProto2"); + + switch (request.getPayloadCase()) { + case PROTOBUF_PAYLOAD: + { + if (isProto3) { + try { + ExtensionRegistryLite extensions = ExtensionRegistryLite.newInstance(); + TestMessagesProto3.registerAllExtensions(extensions); + testMessage = + parseBinary( + request.getProtobufPayload(), TestAllTypesProto3.parser(), extensions); + } catch (InvalidProtocolBufferException e) { + return Conformance.ConformanceResponse.newBuilder() + .setParseError(e.getMessage()) + .build(); + } + } else if (isProto2) { + try { + ExtensionRegistryLite extensions = ExtensionRegistryLite.newInstance(); + TestMessagesProto2.registerAllExtensions(extensions); + testMessage = + parseBinary( + request.getProtobufPayload(), TestAllTypesProto2.parser(), extensions); + } catch (InvalidProtocolBufferException e) { + return Conformance.ConformanceResponse.newBuilder() + .setParseError(e.getMessage()) + .build(); + } + } else { + throw new RuntimeException("Protobuf request doesn't have specific payload type."); + } + break; + } + case JSON_PAYLOAD: + { + return Conformance.ConformanceResponse.newBuilder() + .setSkipped("Lite runtime does not support JSON format.") + .build(); + } + case TEXT_PAYLOAD: + { + return Conformance.ConformanceResponse.newBuilder() + .setSkipped("Lite runtime does not support Text format.") + .build(); + } + case PAYLOAD_NOT_SET: + { + throw new RuntimeException("Request didn't have payload."); + } + default: + { + throw new RuntimeException("Unexpected payload case."); + } } switch (request.getRequestedOutputFormat()) { @@ -103,15 +292,23 @@ class ConformanceJavaLite { throw new RuntimeException("Unspecified output format."); case PROTOBUF: - return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(testMessage.toByteString()).build(); + return Conformance.ConformanceResponse.newBuilder() + .setProtobufPayload(testMessage.toByteString()) + .build(); case JSON: - return Conformance.ConformanceResponse.newBuilder().setSkipped( - "Lite runtime does not support JSON format.").build(); + return Conformance.ConformanceResponse.newBuilder() + .setSkipped("Lite runtime does not support JSON format.") + .build(); - default: { - throw new RuntimeException("Unexpected request output."); - } + case TEXT_FORMAT: + return Conformance.ConformanceResponse.newBuilder() + .setSkipped("Lite runtime does not support Text format.") + .build(); + default: + { + throw new RuntimeException("Unexpected request output."); + } } } @@ -119,7 +316,7 @@ class ConformanceJavaLite { int bytes = readLittleEndianIntFromStdin(); if (bytes == -1) { - return false; // EOF + return false; // EOF } byte[] serializedInput = new byte[bytes]; @@ -144,8 +341,8 @@ class ConformanceJavaLite { this.testCount++; } - System.err.println("ConformanceJavaLite: received EOF from test runner after " + - this.testCount + " tests"); + System.err.println( + "ConformanceJavaLite: received EOF from test runner after " + this.testCount + " tests"); } public static void main(String[] args) throws Exception { diff --git a/conformance/Makefile.am b/conformance/Makefile.am index 6815c733a5..b281f9cfaa 100644 --- a/conformance/Makefile.am +++ b/conformance/Makefile.am @@ -5,7 +5,7 @@ conformance_protoc_inputs = \ $(top_srcdir)/src/google/protobuf/test_messages_proto3.proto # proto2 input files, should be separated with proto3, as we -# can't generate proto2 files for ruby, php and objc +# can't generate proto2 files for php. conformance_proto2_protoc_inputs = \ $(top_srcdir)/src/google/protobuf/test_messages_proto2.proto @@ -261,7 +261,7 @@ if USE_EXTERNAL_PROTOC # Some implementations include pre-generated versions of well-known types. protoc_middleman: $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. --php_out=. --js_out=import_style=commonjs,binary:. $(conformance_protoc_inputs) - $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --objc_out=. --python_out=. --js_out=import_style=commonjs,binary:. $(conformance_proto2_protoc_inputs) + $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. --js_out=import_style=commonjs,binary:. $(conformance_proto2_protoc_inputs) $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --python_out=. --js_out=import_style=commonjs,binary:google-protobuf $(well_known_type_protoc_inputs) ## $(PROTOC) -I$(srcdir) -I$(top_srcdir) --java_out=lite:lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) touch protoc_middleman @@ -273,7 +273,7 @@ else # building out-of-tree. protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd --php_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --objc_out=. --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_proto2_protoc_inputs) ) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_proto2_protoc_inputs) ) oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd/google-protobuf $(well_known_type_protoc_inputs) ) ## @mkdir -p lite ## oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --java_out=lite:$$oldpwd/lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) ) @@ -333,7 +333,7 @@ conformance-php-c: # Targets for actually running tests. test_cpp: protoc_middleman conformance-test-runner conformance-cpp - ./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt ./conformance-cpp + ./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt --text_format_failure_list text_format_failure_list_cpp.txt ./conformance-cpp test_java: protoc_middleman conformance-test-runner conformance-java ./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt --text_format_failure_list text_format_failure_list_java.txt ./conformance-java @@ -347,22 +347,36 @@ test_csharp: protoc_middleman conformance-test-runner conformance-csharp test_ruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_ruby.txt --text_format_failure_list text_format_failure_list_ruby.txt ./conformance_ruby.rb +test_jruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) + RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_jruby.txt --text_format_failure_list text_format_failure_list_jruby.txt ./conformance_ruby.rb + test_php: protoc_middleman conformance-test-runner conformance-php $(other_language_protoc_outputs) ./conformance-test-runner --enforce_recommended --failure_list failure_list_php.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c -test_php_c_32: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) - ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c_32.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c - # These depend on library paths being properly set up. The easiest way to # run them is to just use "tox" from the python dir. test_python: protoc_middleman conformance-test-runner - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py + VERSION="$(shell python --version 2>&1)"; \ + if [[ "$$VERSION" == "Python 2.7"* ]]; then \ + echo "Using Python 2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python_2.7.txt ./conformance_python.py; \ + else \ + echo "Using Python >2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py; \ + fi test_python_cpp: protoc_middleman conformance-test-runner - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt ./conformance_python.py + VERSION="$(shell python --version 2>&1)"; \ + if [[ "$$VERSION" == "Python 2.7"* ]]; then \ + echo "Using Python 2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp_2.7.txt ./conformance_python.py; \ + else \ + echo "Using Python >2.7 failure list."; \ + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp.txt ./conformance_python.py; \ + fi test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js diff --git a/conformance/binary_json_conformance_suite.cc b/conformance/binary_json_conformance_suite.cc index 93f43dc12b..0275e2e30b 100644 --- a/conformance/binary_json_conformance_suite.cc +++ b/conformance/binary_json_conformance_suite.cc @@ -300,7 +300,7 @@ const FieldDescriptor* GetFieldForOneofType(FieldDescriptor::Type type, } string UpperCase(string str) { - for (int i = 0; i < str.size(); i++) { + for (size_t i = 0; i < str.size(); i++) { str[i] = toupper(str[i]); } return str; @@ -556,24 +556,24 @@ void BinaryAndJsonConformanceSuite::RunValidProtobufTestWithMessage( equivalent_text_format, is_proto3); } -// According to proto3 JSON specification, JSON serializers follow more strict +// According to proto JSON specification, JSON serializers follow more strict // rules than parsers (e.g., a serializer must serialize int32 values as JSON // numbers while the parser is allowed to accept them as JSON strings). This -// method allows strict checking on a proto3 JSON serializer by inspecting +// method allows strict checking on a proto JSON serializer by inspecting // the JSON output directly. void BinaryAndJsonConformanceSuite::RunValidJsonTestWithValidator( const string& test_name, ConformanceLevel level, const string& input_json, - const Validator& validator) { - TestAllTypesProto3 prototype; - ConformanceRequestSetting setting( - level, conformance::JSON, conformance::JSON, - conformance::JSON_TEST, - prototype, test_name, input_json); + const Validator& validator, bool is_proto3) { + std::unique_ptr prototype = NewTestMessage(is_proto3); + ConformanceRequestSetting setting(level, conformance::JSON, conformance::JSON, + conformance::JSON_TEST, *prototype, + test_name, input_json); const ConformanceRequest& request = setting.GetRequest(); ConformanceResponse response; string effective_test_name = StrCat(setting.ConformanceLevelToString(level), - ".Proto3.JsonInput.", test_name, ".Validator"); + is_proto3 ? ".Proto3.JsonInput." : ".Proto2.JsonInput.", + test_name, ".Validator"); RunTest(effective_test_name, request, &response); @@ -1800,7 +1800,8 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldNameConvention() { value.isMember("fieldName2") && value.isMember("FieldName3") && value.isMember("fieldName4"); - }); + }, + true); RunValidJsonTestWithValidator( "FieldNameWithNumbers", REQUIRED, R"({ @@ -1810,7 +1811,8 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldNameConvention() { [](const Json::Value& value) { return value.isMember("field0name5") && value.isMember("field0Name6"); - }); + }, + true); RunValidJsonTestWithValidator( "FieldNameWithMixedCases", REQUIRED, R"({ @@ -1828,7 +1830,8 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldNameConvention() { value.isMember("FieldName10") && value.isMember("FIELDNAME11") && value.isMember("FIELDName12"); - }); + }, + true); RunValidJsonTestWithValidator( "FieldNameWithDoubleUnderscores", RECOMMENDED, R"({ @@ -1846,7 +1849,32 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldNameConvention() { value.isMember("fieldName16") && value.isMember("fieldName17") && value.isMember("FieldName18"); - }); + }, + true); + RunValidJsonTestWithValidator( + "StoresDefaultPrimitive", REQUIRED, + R"({ + "FieldName13": 0 + })", + [](const Json::Value& value) { return value.isMember("FieldName13"); }, + false); + RunValidJsonTestWithValidator( + "SkipsDefaultPrimitive", REQUIRED, + R"({ + "FieldName13": 0 + })", + [](const Json::Value& value) { return !value.isMember("FieldName13"); }, + true); + RunValidJsonTestWithValidator( + "FieldNameExtension", RECOMMENDED, + R"({ + "[protobuf_test_messages.proto2.extension_int32]": 1 + })", + [](const Json::Value& value) { + return value.isMember( + "[protobuf_test_messages.proto2.extension_int32]"); + }, + false); } void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() { @@ -1995,19 +2023,19 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() { // 64-bit values are serialized as strings. RunValidJsonTestWithValidator( - "Int64FieldBeString", RECOMMENDED, - R"({"optionalInt64": 1})", + "Int64FieldBeString", RECOMMENDED, R"({"optionalInt64": 1})", [](const Json::Value& value) { return value["optionalInt64"].type() == Json::stringValue && value["optionalInt64"].asString() == "1"; - }); + }, + true); RunValidJsonTestWithValidator( - "Uint64FieldBeString", RECOMMENDED, - R"({"optionalUint64": 1})", + "Uint64FieldBeString", RECOMMENDED, R"({"optionalUint64": 1})", [](const Json::Value& value) { return value["optionalUint64"].type() == Json::stringValue && value["optionalUint64"].asString() == "1"; - }); + }, + true); // Bool fields. RunValidJsonTest( @@ -2223,12 +2251,12 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() { "optional_nested_enum: BAR"); // Unknown enum values are represented as numeric values. RunValidJsonTestWithValidator( - "EnumFieldUnknownValue", REQUIRED, - R"({"optionalNestedEnum": 123})", + "EnumFieldUnknownValue", REQUIRED, R"({"optionalNestedEnum": 123})", [](const Json::Value& value) { return value["optionalNestedEnum"].type() == Json::intValue && value["optionalNestedEnum"].asInt() == 123; - }); + }, + true); // String fields. RunValidJsonTest( @@ -2301,6 +2329,12 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() { ExpectParseFailureForJson( "OneofFieldDuplicate", REQUIRED, R"({"oneofUint32": 1, "oneofString": "test"})"); + RunValidJsonTest("OneofFieldNullFirst", REQUIRED, + R"({"oneofUint32": null, "oneofString": "test"})", + "oneof_string: \"test\""); + RunValidJsonTest("OneofFieldNullSecond", REQUIRED, + R"({"oneofString": "test", "oneofUint32": null})", + "oneof_string: \"test\""); // Ensure zero values for oneof make it out/backs. TestAllTypesProto3 messageProto3; TestAllTypesProto2 messageProto2; @@ -2712,25 +2746,29 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForWrapperTypes() { R"({"optionalDuration": "1.000000000s"})", [](const Json::Value& value) { return value["optionalDuration"].asString() == "1s"; - }); + }, + true); RunValidJsonTestWithValidator( "DurationHas3FractionalDigits", RECOMMENDED, R"({"optionalDuration": "1.010000000s"})", [](const Json::Value& value) { return value["optionalDuration"].asString() == "1.010s"; - }); + }, + true); RunValidJsonTestWithValidator( "DurationHas6FractionalDigits", RECOMMENDED, R"({"optionalDuration": "1.000010000s"})", [](const Json::Value& value) { return value["optionalDuration"].asString() == "1.000010s"; - }); + }, + true); RunValidJsonTestWithValidator( "DurationHas9FractionalDigits", RECOMMENDED, R"({"optionalDuration": "1.000000010s"})", [](const Json::Value& value) { return value["optionalDuration"].asString() == "1.000000010s"; - }); + }, + true); // Timestamp RunValidJsonTest( @@ -2794,34 +2832,39 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForWrapperTypes() { R"({"optionalTimestamp": "1969-12-31T16:00:00-08:00"})", [](const Json::Value& value) { return value["optionalTimestamp"].asString() == "1970-01-01T00:00:00Z"; - }); + }, + true); RunValidJsonTestWithValidator( "TimestampHasZeroFractionalDigit", RECOMMENDED, R"({"optionalTimestamp": "1970-01-01T00:00:00.000000000Z"})", [](const Json::Value& value) { return value["optionalTimestamp"].asString() == "1970-01-01T00:00:00Z"; - }); + }, + true); RunValidJsonTestWithValidator( "TimestampHas3FractionalDigits", RECOMMENDED, R"({"optionalTimestamp": "1970-01-01T00:00:00.010000000Z"})", [](const Json::Value& value) { return value["optionalTimestamp"].asString() == "1970-01-01T00:00:00.010Z"; - }); + }, + true); RunValidJsonTestWithValidator( "TimestampHas6FractionalDigits", RECOMMENDED, R"({"optionalTimestamp": "1970-01-01T00:00:00.000010000Z"})", [](const Json::Value& value) { return value["optionalTimestamp"].asString() == "1970-01-01T00:00:00.000010Z"; - }); + }, + true); RunValidJsonTestWithValidator( "TimestampHas9FractionalDigits", RECOMMENDED, R"({"optionalTimestamp": "1970-01-01T00:00:00.000000010Z"})", [](const Json::Value& value) { return value["optionalTimestamp"].asString() == "1970-01-01T00:00:00.000000010Z"; - }); + }, + true); } void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldMask() { @@ -3014,6 +3057,29 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForValue() { } ] )"); + RunValidJsonTestWithValidator( + "NullValueInOtherOneofOldFormat", RECOMMENDED, + R"({"oneofNullValue": "NULL_VALUE"})", + [](const Json::Value& value) { + return (value.isMember("oneofNullValue") && + value["oneofNullValue"].isNull()); + }, + true); + RunValidJsonTestWithValidator( + "NullValueInOtherOneofNewFormat", RECOMMENDED, + R"({"oneofNullValue": null})", + [](const Json::Value& value) { + return (value.isMember("oneofNullValue") && + value["oneofNullValue"].isNull()); + }, + true); + RunValidJsonTestWithValidator( + "NullValueInNormalMessage", RECOMMENDED, + R"({"optionalNullValue": null})", + [](const Json::Value& value) { + return value.empty(); + }, + true); } void BinaryAndJsonConformanceSuite::RunJsonTestsForAny() { diff --git a/conformance/binary_json_conformance_suite.h b/conformance/binary_json_conformance_suite.h index aaf8bb4d9e..280ff95bbb 100644 --- a/conformance/binary_json_conformance_suite.h +++ b/conformance/binary_json_conformance_suite.h @@ -42,7 +42,7 @@ class BinaryAndJsonConformanceSuite : public ConformanceTestSuite { BinaryAndJsonConformanceSuite() {} private: - void RunSuiteImpl(); + void RunSuiteImpl() override; void RunJsonTests(); void RunJsonTestsForFieldNameConvention(); void RunJsonTestsForNonRepeatedTypes(); @@ -53,35 +53,34 @@ class BinaryAndJsonConformanceSuite : public ConformanceTestSuite { void RunJsonTestsForStruct(); void RunJsonTestsForValue(); void RunJsonTestsForAny(); - void RunValidJsonTest(const string& test_name, - ConformanceLevel level, - const string& input_json, - const string& equivalent_text_format); + void RunValidJsonTest(const std::string& test_name, ConformanceLevel level, + const std::string& input_json, + const std::string& equivalent_text_format); void RunValidJsonTestWithProtobufInput( - const string& test_name, - ConformanceLevel level, + const std::string& test_name, ConformanceLevel level, const protobuf_test_messages::proto3::TestAllTypesProto3& input, - const string& equivalent_text_format); - void RunValidJsonIgnoreUnknownTest( - const string& test_name, ConformanceLevel level, const string& input_json, - const string& equivalent_text_format); - void RunValidProtobufTest(const string& test_name, ConformanceLevel level, - const string& input_protobuf, - const string& equivalent_text_format, + const std::string& equivalent_text_format); + void RunValidJsonIgnoreUnknownTest(const std::string& test_name, + ConformanceLevel level, + const std::string& input_json, + const std::string& equivalent_text_format); + void RunValidProtobufTest(const std::string& test_name, + ConformanceLevel level, + const std::string& input_protobuf, + const std::string& equivalent_text_format, bool is_proto3); - void RunValidBinaryProtobufTest(const string& test_name, + void RunValidBinaryProtobufTest(const std::string& test_name, ConformanceLevel level, - const string& input_protobuf, + const std::string& input_protobuf, bool is_proto3); - void RunValidBinaryProtobufTest(const string& test_name, + void RunValidBinaryProtobufTest(const std::string& test_name, ConformanceLevel level, - const string& input_protobuf, - const string& expected_protobuf, + const std::string& input_protobuf, + const std::string& expected_protobuf, bool is_proto3); void RunValidProtobufTestWithMessage( - const string& test_name, ConformanceLevel level, - const Message *input, - const string& equivalent_text_format, + const std::string& test_name, ConformanceLevel level, + const Message* input, const std::string& equivalent_text_format, bool is_proto3); bool ParseJsonResponse( @@ -93,20 +92,21 @@ class BinaryAndJsonConformanceSuite : public ConformanceTestSuite { Message* test_message) override; typedef std::function Validator; - void RunValidJsonTestWithValidator(const string& test_name, + void RunValidJsonTestWithValidator(const std::string& test_name, ConformanceLevel level, - const string& input_json, - const Validator& validator); - void ExpectParseFailureForJson(const string& test_name, + const std::string& input_json, + const Validator& validator, + bool is_proto3); + void ExpectParseFailureForJson(const std::string& test_name, ConformanceLevel level, - const string& input_json); - void ExpectSerializeFailureForJson(const string& test_name, + const std::string& input_json); + void ExpectSerializeFailureForJson(const std::string& test_name, ConformanceLevel level, - const string& text_format); - void ExpectParseFailureForProtoWithProtoVersion (const string& proto, - const string& test_name, - ConformanceLevel level, - bool is_proto3); + const std::string& text_format); + void ExpectParseFailureForProtoWithProtoVersion(const std::string& proto, + const std::string& test_name, + ConformanceLevel level, + bool is_proto3); void ExpectParseFailureForProto(const std::string& proto, const std::string& test_name, ConformanceLevel level); diff --git a/conformance/conformance.proto b/conformance/conformance.proto index 26c0bd26f3..49608b38f4 100644 --- a/conformance/conformance.proto +++ b/conformance/conformance.proto @@ -64,7 +64,7 @@ enum TestCategory { BINARY_TEST = 1; // Test binary wire format. JSON_TEST = 2; // Test json wire format. // Similar to JSON_TEST. However, during parsing json, testee should ignore - // unknown fields. This feature is optional. Each implementation can descide + // unknown fields. This feature is optional. Each implementation can decide // whether to support it. See // https://developers.google.com/protocol-buffers/docs/proto3#json_options // for more detail. @@ -113,7 +113,7 @@ message ConformanceRequest { string message_type = 4; // Each test is given a specific test category. Some category may need - // spedific support in testee programs. Refer to the definition of TestCategory + // specific support in testee programs. Refer to the definition of TestCategory // for more information. TestCategory test_category = 5; diff --git a/conformance/conformance_cpp.cc b/conformance/conformance_cpp.cc index 1cdfdae457..5782789dfd 100644 --- a/conformance/conformance_cpp.cc +++ b/conformance/conformance_cpp.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include "conformance.pb.h" #include #include @@ -54,6 +55,7 @@ using google::protobuf::util::JsonToBinaryString; using google::protobuf::util::NewTypeResolverForDescriptorPool; using google::protobuf::util::TypeResolver; using protobuf_test_messages::proto3::TestAllTypesProto3; +using protobuf_test_messages::proto2::TestAllTypesProto2; using std::string; static const char kTypeUrlPrefix[] = "type.googleapis.com"; @@ -101,6 +103,8 @@ void CheckedWrite(int fd, const void *buf, size_t len) { void DoTest(const ConformanceRequest& request, ConformanceResponse* response) { Message *test_message; + google::protobuf::LinkMessageReflection(); + google::protobuf::LinkMessageReflection(); const Descriptor *descriptor = DescriptorPool::generated_pool()->FindMessageTypeByName( request.message_type()); if (!descriptor) { @@ -125,12 +129,12 @@ void DoTest(const ConformanceRequest& request, ConformanceResponse* response) { options.ignore_unknown_fields = (request.test_category() == conformance::JSON_IGNORE_UNKNOWN_PARSING_TEST); - Status status = JsonToBinaryString(type_resolver, *type_url, - request.json_payload(), &proto_binary, - options); + util::Status status = + JsonToBinaryString(type_resolver, *type_url, request.json_payload(), + &proto_binary, options); if (!status.ok()) { response->set_parse_error(string("Parse error: ") + - std::string(status.error_message())); + std::string(status.message())); return; } @@ -179,12 +183,13 @@ void DoTest(const ConformanceRequest& request, ConformanceResponse* response) { case conformance::JSON: { string proto_binary; GOOGLE_CHECK(test_message->SerializeToString(&proto_binary)); - Status status = BinaryToJsonString(type_resolver, *type_url, proto_binary, - response->mutable_json_payload()); + util::Status status = + BinaryToJsonString(type_resolver, *type_url, proto_binary, + response->mutable_json_payload()); if (!status.ok()) { response->set_serialize_error( string("Failed to serialize JSON output: ") + - std::string(status.error_message())); + std::string(status.message())); return; } break; diff --git a/conformance/conformance_ruby.rb b/conformance/conformance_ruby.rb index 79d8d3dd9e..4af7659b09 100755 --- a/conformance/conformance_ruby.rb +++ b/conformance/conformance_ruby.rb @@ -32,6 +32,7 @@ require 'conformance_pb' require 'google/protobuf/test_messages_proto3_pb' +require 'google/protobuf/test_messages_proto2_pb' $test_count = 0 $verbose = false @@ -39,39 +40,39 @@ $verbose = false def do_test(request) test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.new response = Conformance::ConformanceResponse.new + descriptor = Google::Protobuf::DescriptorPool.generated_pool.lookup(request.message_type) + + unless descriptor + response.skipped = "Unknown message type: " + request.message_type + end begin case request.payload when :protobuf_payload - if request.message_type.eql?('protobuf_test_messages.proto3.TestAllTypesProto3') - begin - test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.decode( - request.protobuf_payload) - rescue Google::Protobuf::ParseError => err - response.parse_error = err.message.encode('utf-8') - return response - end - elsif request.message_type.eql?('protobuf_test_messages.proto2.TestAllTypesProto2') - response.skipped = "Ruby doesn't support proto2" + begin + test_message = descriptor.msgclass.decode(request.protobuf_payload) + rescue Google::Protobuf::ParseError => err + response.parse_error = err.message.encode('utf-8') return response - else - fail "Protobuf request doesn't have specific payload type" end when :json_payload begin - test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.decode_json( - request.json_payload) + options = {} + if request.test_category == :JSON_IGNORE_UNKNOWN_PARSING_TEST + options[:ignore_unknown_fields] = true + end + test_message = descriptor.msgclass.decode_json(request.json_payload, options) rescue Google::Protobuf::ParseError => err response.parse_error = err.message.encode('utf-8') return response end - - when :text_payload - begin - response.skipped = "Ruby doesn't support proto2" - return response - end + + when :text_payload + begin + response.skipped = "Ruby doesn't support text format" + return response + end when nil fail "Request didn't have payload" @@ -82,10 +83,18 @@ def do_test(request) fail 'Unspecified output format' when :PROTOBUF - response.protobuf_payload = test_message.to_proto + begin + response.protobuf_payload = test_message.to_proto + rescue Google::Protobuf::ParseError => err + response.serialize_error = err.message.encode('utf-8') + end when :JSON - response.json_payload = test_message.to_json + begin + response.json_payload = test_message.to_json + rescue Google::Protobuf::ParseError => err + response.serialize_error = err.message.encode('utf-8') + end when nil fail "Request didn't have requested output format" diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h index 417ec4e3cc..76bd1bc3f1 100644 --- a/conformance/conformance_test.h +++ b/conformance/conformance_test.h @@ -88,7 +88,7 @@ class ForkPipeRunner : public ConformanceTestRunner { const std::vector& suites); ForkPipeRunner(const std::string& executable, - const std::vector& executable_args) + const std::vector& executable_args) : child_pid_(-1), executable_(executable), executable_args_(executable_args) {} @@ -113,7 +113,7 @@ class ForkPipeRunner : public ConformanceTestRunner { int read_fd_; pid_t child_pid_; std::string executable_; - const std::vector executable_args_; + const std::vector executable_args_; std::string current_test_name_; }; @@ -168,9 +168,7 @@ class ConformanceTestSuite { // Gets the flag name to the failure list file. // By default, this would return --failure_list - string GetFailureListFlagName() { - return failure_list_flag_name_; - } + std::string GetFailureListFlagName() { return failure_list_flag_name_; } void SetFailureListFlagName(const std::string& failure_list_flag_name) { failure_list_flag_name_ = failure_list_flag_name; @@ -207,18 +205,18 @@ class ConformanceTestSuite { class ConformanceRequestSetting { public: - ConformanceRequestSetting( - ConformanceLevel level, - conformance::WireFormat input_format, - conformance::WireFormat output_format, - conformance::TestCategory test_category, - const Message& prototype_message, - const string& test_name, const string& input); + ConformanceRequestSetting(ConformanceLevel level, + conformance::WireFormat input_format, + conformance::WireFormat output_format, + conformance::TestCategory test_category, + const Message& prototype_message, + const std::string& test_name, + const std::string& input); virtual ~ConformanceRequestSetting() {} std::unique_ptr NewTestMessage() const; - string GetTestName() const; + std::string GetTestName() const; const conformance::ConformanceRequest& GetRequest() const { return request_; @@ -228,7 +226,7 @@ class ConformanceTestSuite { return level_; } - string ConformanceLevelToString(ConformanceLevel level) const; + std::string ConformanceLevelToString(ConformanceLevel level) const; void SetPrintUnknownFields(bool print_unknown_fields) { request_.set_print_unknown_fields(true); @@ -239,8 +237,9 @@ class ConformanceTestSuite { } protected: - virtual string InputFormatString(conformance::WireFormat format) const; - virtual string OutputFormatString(conformance::WireFormat format) const; + virtual std::string InputFormatString(conformance::WireFormat format) const; + virtual std::string OutputFormatString( + conformance::WireFormat format) const; conformance::ConformanceRequest request_; private: @@ -249,12 +248,12 @@ class ConformanceTestSuite { ::conformance::WireFormat output_format_; const Message& prototype_message_; std::unique_ptr prototype_message_for_compare_; - string test_name_; + std::string test_name_; }; - bool CheckSetEmpty(const std::set& set_to_check, + bool CheckSetEmpty(const std::set& set_to_check, const std::string& write_to_file, const std::string& msg); - string WireFormatToString(conformance::WireFormat wire_format); + std::string WireFormatToString(conformance::WireFormat wire_format); // Parse payload in the response to the given message. Returns true on // success. @@ -264,24 +263,23 @@ class ConformanceTestSuite { Message* test_message) = 0; void VerifyResponse(const ConformanceRequestSetting& setting, - const string& equivalent_wire_format, + const std::string& equivalent_wire_format, const conformance::ConformanceResponse& response, bool need_report_success, bool require_same_wire_format); void ReportSuccess(const std::string& test_name); - void ReportFailure(const string& test_name, - ConformanceLevel level, + void ReportFailure(const std::string& test_name, ConformanceLevel level, const conformance::ConformanceRequest& request, const conformance::ConformanceResponse& response, const char* fmt, ...); - void ReportSkip(const string& test_name, + void ReportSkip(const std::string& test_name, const conformance::ConformanceRequest& request, const conformance::ConformanceResponse& response); void RunValidInputTest(const ConformanceRequestSetting& setting, - const string& equivalent_text_format); + const std::string& equivalent_text_format); void RunValidBinaryInputTest(const ConformanceRequestSetting& setting, - const string& equivalent_wire_format, + const std::string& equivalent_wire_format, bool require_same_wire_format = false); void RunTest(const std::string& test_name, diff --git a/conformance/conformance_test_runner.cc b/conformance/conformance_test_runner.cc index 9f893cb8e7..1572ac03b5 100644 --- a/conformance/conformance_test_runner.cc +++ b/conformance/conformance_test_runner.cc @@ -297,7 +297,7 @@ void ForkPipeRunner::SpawnTestProgram() { std::vector argv; argv.push_back(executable.get()); - for (int i = 0; i < executable_args_.size(); ++i) { + for (size_t i = 0; i < executable_args_.size(); ++i) { argv.push_back(executable_args_[i].c_str()); } argv.push_back(nullptr); @@ -307,7 +307,7 @@ void ForkPipeRunner::SpawnTestProgram() { } void ForkPipeRunner::CheckedWrite(int fd, const void *buf, size_t len) { - if (write(fd, buf, len) != len) { + if (static_cast(write(fd, buf, len)) != len) { GOOGLE_LOG(FATAL) << current_test_name_ << ": error writing to test program: " << strerror(errno); } diff --git a/conformance/conformance_test_runner.sh b/conformance/conformance_test_runner.sh new file mode 100755 index 0000000000..e9b2e4fffa --- /dev/null +++ b/conformance/conformance_test_runner.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +set -x +echo $@ + +set -euo pipefail +# --- begin runfiles.bash initialization --- +if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then + if [[ -f "$0.runfiles_manifest" ]]; then + export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest" + elif [[ -f "$0.runfiles/MANIFEST" ]]; then + export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST" + elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then + export RUNFILES_DIR="$0.runfiles" + fi +fi +if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then + source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash" +elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then + source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \ + "$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)" +else + echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash" + exit 1 +fi +# --- end runfiles.bash initialization --- + +TESTEE=unset +FAILURE_LIST=unset +TEXT_FORMAT_FAILURE_LIST=unset + +while [[ -n "$@" ]]; do + arg="$1"; shift + val="$1"; shift + case "$arg" in + "--testee") TESTEE="$val" ;; + "--failure_list") FAILURE_LIST="$val" ;; + "--text_format_failure_list") TEXT_FORMAT_FAILURE_LIST="$val" ;; + *) echo "Flag $arg is not recognized." && exit 1 ;; + esac +done + +conformance_test_runner=$(rlocation com_google_protobuf/conformance_test_runner) +conformance_testee=$(rlocation $TESTEE) +args=(--enforce_recommended) + +failure_list=$(rlocation $FAILURE_LIST) +if [ "$failure_list" != "1" ] ; then + args+=(--failure_list $failure_list) +fi + +text_format_failure_list=$(rlocation $TEXT_FORMAT_FAILURE_LIST) +if [ "$text_format_failure_list" != "1" ]; then + args+=(--text_format_failure_list $text_format_failure_list) +fi + +$conformance_test_runner "${args[@]}" $conformance_testee diff --git a/conformance/failure_list_cpp.txt b/conformance/failure_list_cpp.txt index 0c01e1e40c..d55fa9ff34 100644 --- a/conformance/failure_list_cpp.txt +++ b/conformance/failure_list_cpp.txt @@ -34,3 +34,4 @@ Recommended.Proto3.JsonInput.TrailingCommaInAnObject Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpace Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace +Recommended.Proto2.JsonInput.FieldNameExtension.Validator diff --git a/conformance/failure_list_csharp.txt b/conformance/failure_list_csharp.txt index 2a20aa78e7..bba295e7e2 100644 --- a/conformance/failure_list_csharp.txt +++ b/conformance/failure_list_csharp.txt @@ -1,2 +1,7 @@ +Recommended.Proto2.JsonInput.FieldNameExtension.Validator Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput +Required.Proto3.JsonInput.OneofFieldNullFirst.JsonOutput +Required.Proto3.JsonInput.OneofFieldNullFirst.ProtobufOutput +Required.Proto3.JsonInput.OneofFieldNullSecond.JsonOutput +Required.Proto3.JsonInput.OneofFieldNullSecond.ProtobufOutput diff --git a/conformance/failure_list_java.txt b/conformance/failure_list_java.txt index dc1f9ba5c9..808e230eba 100644 --- a/conformance/failure_list_java.txt +++ b/conformance/failure_list_java.txt @@ -34,6 +34,7 @@ Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted +Recommended.Proto2.JsonInput.FieldNameExtension.Validator Required.Proto3.JsonInput.EnumFieldNotQuoted Required.Proto3.JsonInput.Int32FieldLeadingZero Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero @@ -41,7 +42,3 @@ Required.Proto3.JsonInput.Int32FieldPlusSign Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt Required.Proto3.JsonInput.StringFieldNotAString -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE -Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE -Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE -Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE diff --git a/conformance/failure_list_java_lite.txt b/conformance/failure_list_java_lite.txt new file mode 100644 index 0000000000..57a082e602 --- /dev/null +++ b/conformance/failure_list_java_lite.txt @@ -0,0 +1,10 @@ +# This is the list of conformance tests that are known to fail for the Java +# implementation right now. These should be fixed. +# +# By listing them here we can keep tabs on which ones are failing and be sure +# that we don't introduce regressions in other tests. + +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE +Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE +Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE +Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE diff --git a/conformance/failure_list_jruby.txt b/conformance/failure_list_jruby.txt new file mode 100644 index 0000000000..ceaaf92a5f --- /dev/null +++ b/conformance/failure_list_jruby.txt @@ -0,0 +1,810 @@ +Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput +Recommended.FieldMaskPathsDontRoundTrip.JsonOutput +Recommended.FieldMaskTooManyUnderscore.JsonOutput +Recommended.Proto2.JsonInput.FieldNameExtension.Validator +Recommended.Proto3.JsonInput.BoolFieldAllCapitalFalse +Recommended.Proto3.JsonInput.BoolFieldAllCapitalTrue +Recommended.Proto3.JsonInput.BoolFieldCamelCaseFalse +Recommended.Proto3.JsonInput.BoolFieldCamelCaseTrue +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue +Recommended.Proto3.JsonInput.BoolMapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted +Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted +Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter +Recommended.Proto3.JsonInput.FieldNameDuplicate +Recommended.Proto3.JsonInput.FieldNameNotQuoted +Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted +Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted +Recommended.Proto3.JsonInput.Int32MapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.Int64MapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.JsonWithComments +Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth +Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey +Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue +Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder +Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate +Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate +Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted +Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted +Recommended.Proto3.ProtobufInput.OneofZeroBool.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroBool.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroBytes.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroDouble.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroDouble.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroEnum.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroEnum.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroFloat.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroFloat.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessage.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessage.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroString.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroString.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint32.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint32.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint64.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint64.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BOOL.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BOOL.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BOOL.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BOOL.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BYTES.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BYTES.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BYTES.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BYTES.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.DOUBLE.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.DOUBLE.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.DOUBLE.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.DOUBLE.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.ENUM.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.ENUM.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.ENUM.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.ENUM.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.FLOAT.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.FLOAT.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.FLOAT.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.FLOAT.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.Merge.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.STRING.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.STRING.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.STRING.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.STRING.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT32.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT32.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT32.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT32.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT64.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT64.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT64.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT64.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[6].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BYTES[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED64[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[6].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[7].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[8].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[9].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.MESSAGE[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.MESSAGE[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[6].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[6].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[7].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[8].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[9].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[2].ProtobufOutput +Required.DurationProtoInputTooLarge.JsonOutput +Required.DurationProtoInputTooSmall.JsonOutput +Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator +Required.Proto3.JsonInput.Any.JsonOutput +Required.Proto3.JsonInput.Any.ProtobufOutput +Required.Proto3.JsonInput.AnyNested.JsonOutput +Required.Proto3.JsonInput.AnyNested.ProtobufOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.JsonOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.ProtobufOutput +Required.Proto3.JsonInput.AnyWithDuration.JsonOutput +Required.Proto3.JsonInput.AnyWithDuration.ProtobufOutput +Required.Proto3.JsonInput.AnyWithFieldMask.JsonOutput +Required.Proto3.JsonInput.AnyWithFieldMask.ProtobufOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.JsonOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput +Required.Proto3.JsonInput.AnyWithStruct.JsonOutput +Required.Proto3.JsonInput.AnyWithStruct.ProtobufOutput +Required.Proto3.JsonInput.AnyWithTimestamp.JsonOutput +Required.Proto3.JsonInput.AnyWithTimestamp.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldNotQuoted +Required.Proto3.JsonInput.IgnoreUnknownJsonFalse.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonNull.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonNumber.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldLeadingZero +Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero +Required.Proto3.JsonInput.Int32FieldPlusSign +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt +Required.Proto3.JsonInput.StringFieldNotAString +Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.BOOL +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.INT32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.INT64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SINT32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.SINT64 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.UINT32 +Required.Proto3.ProtobufInput.PrematureEofInsideKnownNonRepeatedValue.UINT64 +Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BOOL.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BOOL.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BYTES.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BYTES.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.ENUM.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.ENUM.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.STRING.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.STRING.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput +Required.Proto3.ProtobufInput.UnknownVarint.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MergeValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MergeValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.MESSAGE.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.MESSAGE.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[6].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[6].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[6].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[6].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[7].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[7].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[8].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[8].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[9].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[9].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.MESSAGE[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.MESSAGE[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.MESSAGE[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.MESSAGE[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[6].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[6].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[6].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[6].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[7].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[7].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[8].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[8].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[9].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[9].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[2].ProtobufOutput +Required.TimestampProtoInputTooLarge.JsonOutput +Required.TimestampProtoInputTooSmall.JsonOutput diff --git a/conformance/failure_list_js.txt b/conformance/failure_list_js.txt index ef9131a78e..e69de29bb2 100644 --- a/conformance/failure_list_js.txt +++ b/conformance/failure_list_js.txt @@ -1,115 +0,0 @@ - -Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MergeValue.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.ProtobufOutput diff --git a/conformance/failure_list_php.txt b/conformance/failure_list_php.txt index 7ee5b9aae1..667f80ca37 100644 --- a/conformance/failure_list_php.txt +++ b/conformance/failure_list_php.txt @@ -1,72 +1,20 @@ Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Recommended.FieldMaskTooManyUnderscore.JsonOutput +Recommended.Proto2.JsonInput.FieldNameExtension.Validator Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.Merge.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput +Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator Required.Proto3.JsonInput.DoubleFieldTooSmall Required.Proto3.JsonInput.FloatFieldTooLarge Required.Proto3.JsonInput.FloatFieldTooSmall Required.Proto3.JsonInput.Int32FieldNotInteger Required.Proto3.JsonInput.Int64FieldNotInteger Required.Proto3.JsonInput.OneofFieldDuplicate +Required.Proto3.JsonInput.OneofFieldNullSecond.JsonOutput +Required.Proto3.JsonInput.OneofFieldNullSecond.ProtobufOutput Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt Required.Proto3.JsonInput.RepeatedListValue.JsonOutput Required.Proto3.JsonInput.RepeatedListValue.ProtobufOutput @@ -75,8 +23,8 @@ Required.Proto3.JsonInput.Uint32FieldNotInteger Required.Proto3.JsonInput.Uint64FieldNotInteger Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.JsonOutput Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.ProtobufOutput Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput -Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.JsonOutput -Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.ProtobufOutput diff --git a/conformance/failure_list_php_c.txt b/conformance/failure_list_php_c.txt index 6a6949fe40..63c7e8a024 100644 --- a/conformance/failure_list_php_c.txt +++ b/conformance/failure_list_php_c.txt @@ -1,109 +1,2 @@ -Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput -Recommended.FieldMaskPathsDontRoundTrip.JsonOutput -Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput -Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator -Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator -Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter -Recommended.Proto3.JsonInput.MapFieldValueIsNull -Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput -Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull -Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull -Recommended.Proto3.JsonInput.StringEndsWithEscapeChar -Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator -Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator -Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput -Required.DurationProtoInputTooLarge.JsonOutput -Required.DurationProtoInputTooSmall.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput -Required.Proto3.JsonInput.DurationMinValue.JsonOutput -Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput -Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput -Required.Proto3.JsonInput.FloatFieldNan.JsonOutput -Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput -Required.Proto3.JsonInput.OneofFieldDuplicate -Required.Proto3.JsonInput.RejectTopLevelNull -Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput -Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput -Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput -Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput -Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput -Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput -Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput -Required.TimestampProtoInputTooLarge.JsonOutput -Required.TimestampProtoInputTooSmall.JsonOutput +Recommended.Proto2.JsonInput.FieldNameExtension.Validator +Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator diff --git a/conformance/failure_list_php_c_32.txt b/conformance/failure_list_php_c_32.txt deleted file mode 100644 index f516f13ac3..0000000000 --- a/conformance/failure_list_php_c_32.txt +++ /dev/null @@ -1,142 +0,0 @@ -Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput -Recommended.FieldMaskPathsDontRoundTrip.JsonOutput -Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput -Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator -Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator -Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator -Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator -Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter -Recommended.Proto3.JsonInput.MapFieldValueIsNull -Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput -Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull -Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull -Recommended.Proto3.JsonInput.StringEndsWithEscapeChar -Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator -Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator -Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator -Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator -Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator -Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput -Required.DurationProtoInputTooLarge.JsonOutput -Required.DurationProtoInputTooSmall.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput -Required.Proto3.JsonInput.DurationMaxValue.JsonOutput -Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput -Required.Proto3.JsonInput.DurationMinValue.JsonOutput -Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput -Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput -Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput -Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput -Required.Proto3.JsonInput.FloatFieldNan.JsonOutput -Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput -Required.Proto3.JsonInput.Int64FieldMaxValue.JsonOutput -Required.Proto3.JsonInput.Int64FieldMaxValue.ProtobufOutput -Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput -Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput -Required.Proto3.JsonInput.Int64FieldMinValue.JsonOutput -Required.Proto3.JsonInput.Int64FieldMinValue.ProtobufOutput -Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.JsonOutput -Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.ProtobufOutput -Required.Proto3.JsonInput.OneofFieldDuplicate -Required.Proto3.JsonInput.RejectTopLevelNull -Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput -Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput -Required.Proto3.JsonInput.TimestampLeap.JsonOutput -Required.Proto3.JsonInput.TimestampLeap.ProtobufOutput -Required.Proto3.JsonInput.TimestampMaxValue.JsonOutput -Required.Proto3.JsonInput.TimestampMaxValue.ProtobufOutput -Required.Proto3.JsonInput.TimestampMinValue.JsonOutput -Required.Proto3.JsonInput.TimestampMinValue.ProtobufOutput -Required.Proto3.JsonInput.TimestampRepeatedValue.JsonOutput -Required.Proto3.JsonInput.TimestampRepeatedValue.ProtobufOutput -Required.Proto3.JsonInput.TimestampWithNegativeOffset.JsonOutput -Required.Proto3.JsonInput.TimestampWithNegativeOffset.ProtobufOutput -Required.Proto3.JsonInput.TimestampWithPositiveOffset.JsonOutput -Required.Proto3.JsonInput.TimestampWithPositiveOffset.ProtobufOutput -Required.Proto3.JsonInput.Uint64FieldMaxValue.JsonOutput -Required.Proto3.JsonInput.Uint64FieldMaxValue.ProtobufOutput -Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput -Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput -Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput -Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput -Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput -Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput -Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput -Required.TimestampProtoInputTooLarge.JsonOutput -Required.TimestampProtoInputTooSmall.JsonOutput diff --git a/conformance/failure_list_python.txt b/conformance/failure_list_python.txt index f55122790b..e69de29bb2 100644 --- a/conformance/failure_list_python.txt +++ b/conformance/failure_list_python.txt @@ -1,31 +0,0 @@ -Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput -Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted -Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BYTES[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED64[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[6].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[0].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[5].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[0].ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldTooSmall -Required.Proto3.JsonInput.FloatFieldTooLarge -Required.Proto3.JsonInput.FloatFieldTooSmall -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool -Required.Proto3.JsonInput.TimestampJsonInputLowercaseT diff --git a/conformance/failure_list_python_cpp.txt b/conformance/failure_list_python_cpp.txt index 59a969d2f5..9efb6cf8b7 100644 --- a/conformance/failure_list_python_cpp.txt +++ b/conformance/failure_list_python_cpp.txt @@ -6,17 +6,3 @@ # # TODO(haberman): insert links to corresponding bugs tracking the issue. # Should we use GitHub issues or the Google-internal bug tracker? - -Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput -Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted -Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted -Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted -Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted -Required.Proto3.JsonInput.DoubleFieldTooSmall -Required.Proto3.JsonInput.FloatFieldTooLarge -Required.Proto3.JsonInput.FloatFieldTooSmall -Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool -Required.Proto3.JsonInput.TimestampJsonInputLowercaseT diff --git a/conformance/failure_list_ruby.txt b/conformance/failure_list_ruby.txt index f9533ae8ff..4938202ad7 100644 --- a/conformance/failure_list_ruby.txt +++ b/conformance/failure_list_ruby.txt @@ -1,109 +1,58 @@ -Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput -Recommended.FieldMaskPathsDontRoundTrip.JsonOutput -Recommended.FieldMaskTooManyUnderscore.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput -Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput -Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator -Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator -Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter -Recommended.Proto3.JsonInput.MapFieldValueIsNull -Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull -Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull -Recommended.Proto3.JsonInput.StringEndsWithEscapeChar -Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder -Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate -Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate -Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator -Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.JsonInput.FieldNameExtension.Validator +Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.Merge.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.UnpackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput -Required.DurationProtoInputTooLarge.JsonOutput -Required.DurationProtoInputTooSmall.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput -Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput -Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput -Required.Proto3.JsonInput.DurationMinValue.JsonOutput -Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput -Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput -Required.Proto3.JsonInput.FloatFieldNan.JsonOutput -Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput -Required.Proto3.JsonInput.IgnoreUnknownJsonFalse.ProtobufOutput -Required.Proto3.JsonInput.IgnoreUnknownJsonNull.ProtobufOutput -Required.Proto3.JsonInput.IgnoreUnknownJsonNumber.ProtobufOutput -Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput -Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput -Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput -Required.Proto3.JsonInput.OneofFieldDuplicate -Required.Proto3.JsonInput.RejectTopLevelNull -Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput -Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput -Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput -Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput -Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput -Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput -Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MissingDefault.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput -Required.TimestampProtoInputTooLarge.JsonOutput -Required.TimestampProtoInputTooSmall.JsonOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.UnpackedOutput.ProtobufOutput diff --git a/conformance/text_format_conformance_suite.cc b/conformance/text_format_conformance_suite.cc index 6574b10c50..460bc24900 100644 --- a/conformance/text_format_conformance_suite.cc +++ b/conformance/text_format_conformance_suite.cc @@ -258,6 +258,84 @@ void TextFormatConformanceTestSuite::RunSuiteImpl() { RunValidTextFormatTest("FloatFieldLargerThanUint64", REQUIRED, "optional_float: 18446744073709551616"); + // String literals x {Strings, Bytes} + for (const auto& field_type : std::vector{"String", "Bytes"}) { + const std::string field_name = + field_type == "String" ? "optional_string" : "optional_bytes"; + RunValidTextFormatTest( + StrCat("StringLiteralConcat", field_type), REQUIRED, + StrCat(field_name, ": 'first' \"second\"\n'third'")); + RunValidTextFormatTest( + StrCat("StringLiteralBasicEscapes", field_type), REQUIRED, + StrCat(field_name, ": '\\a\\b\\f\\n\\r\\t\\v\\?\\\\\\'\\\"'")); + RunValidTextFormatTest( + StrCat("StringLiteralOctalEscapes", field_type), REQUIRED, + StrCat(field_name, ": '\\341\\210\\264'")); + RunValidTextFormatTest(StrCat("StringLiteralHexEscapes", field_type), + REQUIRED, + StrCat(field_name, ": '\\xe1\\x88\\xb4'")); + RunValidTextFormatTest( + StrCat("StringLiteralShortUnicodeEscape", field_type), + RECOMMENDED, StrCat(field_name, ": '\\u1234'")); + RunValidTextFormatTest( + StrCat("StringLiteralLongUnicodeEscapes", field_type), + RECOMMENDED, StrCat(field_name, ": '\\U00001234\\U00010437'")); + // String literals don't include line feeds. + ExpectParseFailure(StrCat("StringLiteralIncludesLF", field_type), + REQUIRED, + StrCat(field_name, ": 'first line\nsecond line'")); + // Unicode escapes don't include code points that lie beyond the planes + // (> 0x10ffff). + ExpectParseFailure( + StrCat("StringLiteralLongUnicodeEscapeTooLarge", field_type), + REQUIRED, StrCat(field_name, ": '\\U00110000'")); + // Unicode escapes don't include surrogates. + ExpectParseFailure( + StrCat("StringLiteralShortUnicodeEscapeSurrogatePair", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\ud801\\udc37'")); + ExpectParseFailure( + StrCat("StringLiteralShortUnicodeEscapeSurrogateFirstOnly", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\ud800'")); + ExpectParseFailure( + StrCat("StringLiteralShortUnicodeEscapeSurrogateSecondOnly", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\udc00'")); + ExpectParseFailure( + StrCat("StringLiteralLongUnicodeEscapeSurrogateFirstOnly", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\U0000d800'")); + ExpectParseFailure( + StrCat("StringLiteralLongUnicodeEscapeSurrogateSecondOnly", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\U0000dc00'")); + ExpectParseFailure( + StrCat("StringLiteralLongUnicodeEscapeSurrogatePair", field_type), + RECOMMENDED, StrCat(field_name, ": '\\U0000d801\\U00000dc37'")); + ExpectParseFailure( + StrCat("StringLiteralUnicodeEscapeSurrogatePairLongShort", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\U0000d801\\udc37'")); + ExpectParseFailure( + StrCat("StringLiteralUnicodeEscapeSurrogatePairShortLong", + field_type), + RECOMMENDED, StrCat(field_name, ": '\\ud801\\U0000dc37'")); + + // The following method depend on the type of field, as strings have extra + // validation. + const auto test_method = + field_type == "String" + ? &TextFormatConformanceTestSuite::ExpectParseFailure + : &TextFormatConformanceTestSuite::RunValidTextFormatTest; + + // String fields reject invalid UTF-8 byte sequences; bytes fields don't. + (this->*test_method)(StrCat(field_type, "FieldBadUTF8Octal"), + REQUIRED, StrCat(field_name, ": '\\300'")); + (this->*test_method)(StrCat(field_type, "FieldBadUTF8Hex"), REQUIRED, + StrCat(field_name, ": '\\xc0'")); + } + // Group fields RunValidTextFormatTestProto2("GroupFieldNoColon", REQUIRED, "Data { group_int32: 1 }"); @@ -373,6 +451,27 @@ void TextFormatConformanceTestSuite::RunSuiteImpl() { } )", prototype); + + prototype.Clear(); + ConformanceRequestSetting setting_map( + REQUIRED, conformance::TEXT_FORMAT, conformance::PROTOBUF, + conformance::TEXT_FORMAT_TEST, prototype, "DuplicateMapKey", R"( + map_string_nested_message { + key: "duplicate" + value: { a: 123 } + } + map_string_nested_message { + key: "duplicate" + value: { corecursive: {} } + } + )"); + // The last-specified value will be retained in a parsed map + RunValidInputTest(setting_map, R"( + map_string_nested_message { + key: "duplicate" + value: { corecursive: {} } + } + )"); } } // namespace protobuf diff --git a/conformance/text_format_conformance_suite.h b/conformance/text_format_conformance_suite.h index dd258f50b8..e875f3148e 100644 --- a/conformance/text_format_conformance_suite.h +++ b/conformance/text_format_conformance_suite.h @@ -41,20 +41,20 @@ class TextFormatConformanceTestSuite : public ConformanceTestSuite { TextFormatConformanceTestSuite(); private: - void RunSuiteImpl(); - void RunValidTextFormatTest(const string& test_name, ConformanceLevel level, - const string& input); - void RunValidTextFormatTestProto2(const string& test_name, + void RunSuiteImpl() override; + void RunValidTextFormatTest(const std::string& test_name, + ConformanceLevel level, const std::string& input); + void RunValidTextFormatTestProto2(const std::string& test_name, ConformanceLevel level, - const string& input); - void RunValidTextFormatTestWithMessage(const string& test_name, + const std::string& input); + void RunValidTextFormatTestWithMessage(const std::string& test_name, ConformanceLevel level, - const string& input_text, + const std::string& input_text, const Message& prototype); - void RunValidUnknownTextFormatTest(const string& test_name, + void RunValidUnknownTextFormatTest(const std::string& test_name, const Message& message); - void ExpectParseFailure(const string& test_name, ConformanceLevel level, - const string& input); + void ExpectParseFailure(const std::string& test_name, ConformanceLevel level, + const std::string& input); bool ParseTextFormatResponse(const conformance::ConformanceResponse& response, const ConformanceRequestSetting& setting, Message* test_message); diff --git a/conformance/text_format_failure_list_cpp.txt b/conformance/text_format_failure_list_cpp.txt new file mode 100644 index 0000000000..a25f04faf2 --- /dev/null +++ b/conformance/text_format_failure_list_cpp.txt @@ -0,0 +1,20 @@ +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString +Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex +Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString diff --git a/conformance/text_format_failure_list_java.txt b/conformance/text_format_failure_list_java.txt index 81433b441a..71e32429ec 100644 --- a/conformance/text_format_failure_list_java.txt +++ b/conformance/text_format_failure_list_java.txt @@ -4,3 +4,10 @@ Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput Required.Proto3.TextFormatInput.AnyField.ProtobufOutput Required.Proto3.TextFormatInput.AnyField.TextFormatOutput + +Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex +Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput diff --git a/conformance/text_format_failure_list_java_lite.txt b/conformance/text_format_failure_list_java_lite.txt new file mode 100644 index 0000000000..61f1a964fe --- /dev/null +++ b/conformance/text_format_failure_list_java_lite.txt @@ -0,0 +1,5 @@ +# This is the list of conformance tests that are known to fail for the Java +# Lite TextFormat implementation right now. These should be fixed. +# +# By listing them here we can keep tabs on which ones are failing and be sure +# that we don't introduce regressions in other tests. diff --git a/conformance/text_format_failure_list_jruby.txt b/conformance/text_format_failure_list_jruby.txt new file mode 100644 index 0000000000..404b64a584 --- /dev/null +++ b/conformance/text_format_failure_list_jruby.txt @@ -0,0 +1,8 @@ +Recommended.Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput +Recommended.Proto3.ProtobufInput.GroupUnknownFields_Print.TextFormatOutput +Recommended.Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput +Recommended.Proto3.ProtobufInput.MessageUnknownFields_Print.TextFormatOutput +Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput +Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Print.TextFormatOutput +Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput +Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Print.TextFormatOutput diff --git a/conformance/text_format_failure_list_python.txt b/conformance/text_format_failure_list_python.txt index b2db95e7de..6bf7c1aa63 100644 --- a/conformance/text_format_failure_list_python.txt +++ b/conformance/text_format_failure_list_python.txt @@ -3,3 +3,32 @@ # TODO: These should be fixed. Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput + +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput diff --git a/conformance/text_format_failure_list_python_2.7.txt b/conformance/text_format_failure_list_python_2.7.txt new file mode 100644 index 0000000000..cada2bc03b --- /dev/null +++ b/conformance/text_format_failure_list_python_2.7.txt @@ -0,0 +1,36 @@ +# This is the list of text format conformance tests that are known to fail right +# now. +# TODO: These should be fixed. +Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput + +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString diff --git a/conformance/text_format_failure_list_python_cpp.txt b/conformance/text_format_failure_list_python_cpp.txt new file mode 100644 index 0000000000..91fc2ea3cd --- /dev/null +++ b/conformance/text_format_failure_list_python_cpp.txt @@ -0,0 +1,28 @@ +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput diff --git a/conformance/text_format_failure_list_python_cpp_2.7.txt b/conformance/text_format_failure_list_python_cpp_2.7.txt new file mode 100644 index 0000000000..ba2089bcaa --- /dev/null +++ b/conformance/text_format_failure_list_python_cpp_2.7.txt @@ -0,0 +1,30 @@ +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString diff --git a/conformance/third_party/jsoncpp/json.h b/conformance/third_party/jsoncpp/json.h index 5639c92451..373ec98bde 100644 --- a/conformance/third_party/jsoncpp/json.h +++ b/conformance/third_party/jsoncpp/json.h @@ -1371,7 +1371,7 @@ public: */ std::string getFormattedErrorMessages() const; - /** \brief Returns a vector of structured errors encounted while parsing. + /** \brief Returns a vector of structured errors encountered while parsing. * \return A (possibly empty) vector of StructuredError objects. Currently * only one error can be returned, but the caller should tolerate * multiple @@ -1867,7 +1867,7 @@ private: * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * - * If the Value have comments then they are outputed according to their + * If the Value have comments then they are outputted according to their *#CommentPlacement. * * \sa Reader, Value, Value::setComment() @@ -1928,7 +1928,7 @@ private: * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * - * If the Value have comments then they are outputed according to their + * If the Value have comments then they are outputted according to their #CommentPlacement. * * \param indentation Each level will be indented by this amount extra. diff --git a/conformance/third_party/jsoncpp/jsoncpp.cpp b/conformance/third_party/jsoncpp/jsoncpp.cpp index d313d0563c..78919eac0f 100644 --- a/conformance/third_party/jsoncpp/jsoncpp.cpp +++ b/conformance/third_party/jsoncpp/jsoncpp.cpp @@ -142,7 +142,7 @@ enum { typedef char UIntToStringBuffer[uintToStringBufferSize]; /** Converts an unsigned integer to string. - * @param value Unsigned interger to convert to string + * @param value Unsigned integer to convert to string * @param current Input/Output string buffer. * Must have at least uintToStringBufferSize chars free. */ diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index 91d28ed140..cca07bac94 100644 --- a/csharp/Google.Protobuf.Tools.nuspec +++ b/csharp/Google.Protobuf.Tools.nuspec @@ -5,7 +5,7 @@ Google Protocol Buffers tools Tools for Protocol Buffers - Google's data interchange format. See project site for more info. - 3.11.4 + 3.17.3 Google Inc. protobuf-packages https://github.com/protocolbuffers/protobuf/blob/master/LICENSE diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs index 73a578d2b5..11d06f1d7b 100644 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs +++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs @@ -201,29 +201,29 @@ namespace Google.Protobuf [Test] public void DecodeZigZag32() { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(0)); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(1)); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(2)); - Assert.AreEqual(-2, CodedInputStream.DecodeZigZag32(3)); - Assert.AreEqual(0x3FFFFFFF, CodedInputStream.DecodeZigZag32(0x7FFFFFFE)); - Assert.AreEqual(unchecked((int) 0xC0000000), CodedInputStream.DecodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0x7FFFFFFF, CodedInputStream.DecodeZigZag32(0xFFFFFFFE)); - Assert.AreEqual(unchecked((int) 0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF)); + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(0)); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(1)); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(2)); + Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag32(3)); + Assert.AreEqual(0x3FFFFFFF, ParsingPrimitives.DecodeZigZag32(0x7FFFFFFE)); + Assert.AreEqual(unchecked((int) 0xC0000000), ParsingPrimitives.DecodeZigZag32(0x7FFFFFFF)); + Assert.AreEqual(0x7FFFFFFF, ParsingPrimitives.DecodeZigZag32(0xFFFFFFFE)); + Assert.AreEqual(unchecked((int) 0x80000000), ParsingPrimitives.DecodeZigZag32(0xFFFFFFFF)); } [Test] public void DecodeZigZag64() { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(0)); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(1)); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(2)); - Assert.AreEqual(-2, CodedInputStream.DecodeZigZag64(3)); - Assert.AreEqual(0x000000003FFFFFFFL, CodedInputStream.DecodeZigZag64(0x000000007FFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), CodedInputStream.DecodeZigZag64(0x000000007FFFFFFFL)); - Assert.AreEqual(0x000000007FFFFFFFL, CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFFL)); - Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(0)); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(1)); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(2)); + Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag64(3)); + Assert.AreEqual(0x000000003FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFEL)); + Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFFL)); + Assert.AreEqual(0x000000007FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFEL)); + Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFFL)); + Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); + Assert.AreEqual(unchecked((long) 0x8000000000000000L), ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); } [Test] diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs index 01bd3218f3..e9b4ea8cf0 100644 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs +++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs @@ -211,35 +211,35 @@ namespace Google.Protobuf [Test] public void EncodeZigZag32() { - Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag32(0)); - Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag32(-1)); - Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag32(1)); - Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag32(-2)); - Assert.AreEqual(0x7FFFFFFEu, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF)); - Assert.AreEqual(0x7FFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0xC0000000))); - Assert.AreEqual(0xFFFFFFFEu, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0xFFFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0x80000000))); + Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag32(0)); + Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag32(-1)); + Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag32(1)); + Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag32(-2)); + Assert.AreEqual(0x7FFFFFFEu, WritingPrimitives.EncodeZigZag32(0x3FFFFFFF)); + Assert.AreEqual(0x7FFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0xC0000000))); + Assert.AreEqual(0xFFFFFFFEu, WritingPrimitives.EncodeZigZag32(0x7FFFFFFF)); + Assert.AreEqual(0xFFFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0x80000000))); } [Test] public void EncodeZigZag64() { - Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag64(0)); - Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag64(-1)); - Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag64(1)); - Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag64(-2)); + Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag64(0)); + Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag64(-1)); + Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag64(1)); + Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag64(-2)); Assert.AreEqual(0x000000007FFFFFFEuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); Assert.AreEqual(0x000000007FFFFFFFuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); Assert.AreEqual(0x00000000FFFFFFFEuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); Assert.AreEqual(0x00000000FFFFFFFFuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); Assert.AreEqual(0xFFFFFFFFFFFFFFFEL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); Assert.AreEqual(0xFFFFFFFFFFFFFFFFL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); } [Test] @@ -247,26 +247,26 @@ namespace Google.Protobuf { // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) // were chosen semi-randomly via keyboard bashing. - Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(0))); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(1))); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-1))); - Assert.AreEqual(14927, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(14927))); - Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612))); + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(0))); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(1))); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-1))); + Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(14927))); + Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-3612))); } [Test] public void RoundTripZigZag64() { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0))); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(1))); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-1))); - Assert.AreEqual(14927, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(14927))); - Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-3612))); + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(0))); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(1))); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-1))); + Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(14927))); + Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-3612))); Assert.AreEqual(856912304801416L, - CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(856912304801416L))); + ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(856912304801416L))); Assert.AreEqual(-75123905439571256L, - CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-75123905439571256L))); + ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-75123905439571256L))); } [Test] @@ -395,7 +395,7 @@ namespace Google.Protobuf Assert.IsTrue(memoryStream.CanWrite); using (var cos = new CodedOutputStream(memoryStream)) { - cos.WriteRawByte(0); + cos.WriteRawBytes(new byte[] {0}); Assert.AreEqual(0, memoryStream.Position); // Not flushed yet } Assert.AreEqual(1, memoryStream.ToArray().Length); // Flushed data from CodedOutputStream to MemoryStream @@ -409,7 +409,7 @@ namespace Google.Protobuf Assert.IsTrue(memoryStream.CanWrite); using (var cos = new CodedOutputStream(memoryStream, true)) { - cos.WriteRawByte(0); + cos.WriteRawBytes(new byte[] {0}); Assert.AreEqual(0, memoryStream.Position); // Not flushed yet } Assert.AreEqual(1, memoryStream.Position); // Flushed data from CodedOutputStream to MemoryStream diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs index 3907666827..18e8767217 100644 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs +++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs @@ -124,11 +124,20 @@ namespace Google.Protobuf { var stream = new MemoryStream(); var codedOutput = new CodedOutputStream(stream); - codec.ValueWriter(codedOutput, sampleValue); + WriteContext.Initialize(codedOutput, out WriteContext ctx); + try + { + // only write the value using the codec + codec.ValueWriter(ref ctx, sampleValue); + } + finally + { + ctx.CopyStateTo(codedOutput); + } codedOutput.Flush(); stream.Position = 0; var codedInput = new CodedInputStream(stream); - Assert.AreEqual(sampleValue, codec.ValueReader(codedInput)); + Assert.AreEqual(sampleValue, codec.Read(codedInput)); Assert.IsTrue(codedInput.IsAtEnd); } @@ -172,13 +181,22 @@ namespace Google.Protobuf if (codec.DefaultValue != null) // This part isn't appropriate for message types. { codedOutput = new CodedOutputStream(stream); - codec.ValueWriter(codedOutput, codec.DefaultValue); + WriteContext.Initialize(codedOutput, out WriteContext ctx); + try + { + // only write the value using the codec + codec.ValueWriter(ref ctx, codec.DefaultValue); + } + finally + { + ctx.CopyStateTo(codedOutput); + } codedOutput.Flush(); Assert.AreNotEqual(0, stream.Position); Assert.AreEqual(stream.Position, codec.ValueSizeCalculator(codec.DefaultValue)); stream.Position = 0; var codedInput = new CodedInputStream(stream); - Assert.AreEqual(codec.DefaultValue, codec.ValueReader(codedInput)); + Assert.AreEqual(codec.DefaultValue, codec.Read(codedInput)); } } diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj index d9b1e86ebb..cbb6fee5f7 100644 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj +++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj @@ -5,7 +5,6 @@ net451;netcoreapp2.1 ../../keys/Google.Protobuf.snk true - true False diff --git a/csharp/generate_protos.sh b/csharp/generate_protos.sh index e6687c308e..b663138d10 100755 --- a/csharp/generate_protos.sh +++ b/csharp/generate_protos.sh @@ -45,6 +45,7 @@ $PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf \ # and old_extensions2.proto, which are generated with an older version # of protoc. $PROTOC -Isrc -Icsharp/protos \ + --experimental_allow_proto3_optional \ --csharp_out=csharp/src/Google.Protobuf.Test.TestProtos \ --descriptor_set_out=csharp/src/Google.Protobuf.Test/testprotos.pb \ --include_source_info \ @@ -61,9 +62,11 @@ $PROTOC -Isrc -Icsharp/protos \ csharp/protos/unittest_issue6936_a.proto \ csharp/protos/unittest_issue6936_b.proto \ csharp/protos/unittest_issue6936_c.proto \ + csharp/protos/unittest_selfreferential_options.proto \ src/google/protobuf/unittest_well_known_types.proto \ src/google/protobuf/test_messages_proto3.proto \ - src/google/protobuf/test_messages_proto2.proto + src/google/protobuf/test_messages_proto2.proto \ + src/google/protobuf/unittest_proto3_optional.proto # AddressBook sample protos $PROTOC -Iexamples -Isrc --csharp_out=csharp/src/AddressBook \ diff --git a/csharp/install_dotnet_sdk.ps1 b/csharp/install_dotnet_sdk.ps1 index 9e300eda06..c78655cc02 100755 --- a/csharp/install_dotnet_sdk.ps1 +++ b/csharp/install_dotnet_sdk.ps1 @@ -1,5 +1,5 @@ #!/usr/bin/env powershell -# Install dotnet SDK based on the SDK version from global.json +# Install dotnet SDK using the official dotnet-install.ps1 script Set-StrictMode -Version 2 $ErrorActionPreference = 'Stop' @@ -9,16 +9,12 @@ $ErrorActionPreference = 'Stop' $InstallScriptUrl = 'https://dot.net/v1/dotnet-install.ps1' $InstallScriptPath = Join-Path "$env:TEMP" 'dotnet-install.ps1' -$GlobalJsonPath = Join-Path $PSScriptRoot '..' | Join-Path -ChildPath 'global.json' - -# Resolve SDK version from global.json file -$GlobalJson = Get-Content -Raw $GlobalJsonPath | ConvertFrom-Json -$SDKVersion = $GlobalJson.sdk.version # Download install script Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath" Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath -&$InstallScriptPath -Version $SDKVersion -# Also install dotnet SDK LTS which is required to run some of the tests +# The SDK versions to install should be kept in sync with versions +# installed by kokoro/linux/dockerfile/test/csharp/Dockerfile &$InstallScriptPath -Version 2.1.802 +&$InstallScriptPath -Version 5.0.102 diff --git a/csharp/protos/unittest_issues.proto b/csharp/protos/unittest_issues.proto index b4a88d8648..388998f0a0 100644 --- a/csharp/protos/unittest_issues.proto +++ b/csharp/protos/unittest_issues.proto @@ -8,6 +8,8 @@ option csharp_namespace = "UnitTest.Issues.TestProtos"; package unittest_issues; +import "google/protobuf/struct.proto"; + // Issue 307: when generating doubly-nested types, any references // should be of the form A.Types.B.Types.C. message Issue307 { @@ -137,4 +139,20 @@ message OneofMerging { string text = 1; Nested nested = 2; } -} \ No newline at end of file +} + +message NullValueOutsideStruct { + oneof value { + string string_value = 1; + google.protobuf.NullValue null_value = 2; + } +} + +message NullValueNotInOneof { + google.protobuf.NullValue null_value = 2; +} + +message MixedRegularAndOptional { + string regular_field = 1; + optional string optional_field = 2; +} diff --git a/csharp/protos/unittest_selfreferential_options.proto b/csharp/protos/unittest_selfreferential_options.proto new file mode 100644 index 0000000000..22f16cfbf5 --- /dev/null +++ b/csharp/protos/unittest_selfreferential_options.proto @@ -0,0 +1,64 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; + +package protobuf_unittest_selfreferential_options; +option csharp_namespace = "UnitTest.Issues.TestProtos.SelfreferentialOptions"; + +import "google/protobuf/descriptor.proto"; + +message FooOptions { + // Custom field option used in definition of the extension message. + optional int32 int_opt = 1 [(foo_options) = { + int_opt: 1 + [foo_int_opt]: 2 + [foo_foo_opt]: { + int_opt: 3 + } + }]; + + // Custom field option used in definition of the custom option's message. + optional int32 foo = 2 [(foo_options) = {foo: 1234}]; + + extensions 1000 to max; +} + +extend google.protobuf.FieldOptions { + // Custom field option used on the definition of that field option. + optional int32 bar_options = 1000 [(bar_options) = 1234]; + + optional FooOptions foo_options = 1001; +} + +extend FooOptions { + optional int32 foo_int_opt = 1000; + optional FooOptions foo_foo_opt = 1001; +} diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index cbd9772696..2e88db9a18 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -32,9 +32,9 @@ namespace Google.Protobuf.Examples.AddressBook { "Eg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3JpYWwuUGVy", "c29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAASCAoESE9N", "RRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZW9wbGUYASADKAsy", - "EC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUudHV0b3JpYWxCEUFk", - "ZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVmLkV4YW1wbGVzLkFk", - "ZHJlc3NCb29rYgZwcm90bzM=")); + "EC50dXRvcmlhbC5QZXJzb25CZgobY29tLmV4YW1wbGUudHV0b3JpYWwucHJv", + "dG9zQhFBZGRyZXNzQm9va1Byb3Rvc1ABWgsuLi90dXRvcmlhbKoCJEdvb2ds", + "ZS5Qcm90b2J1Zi5FeGFtcGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -49,23 +49,31 @@ namespace Google.Protobuf.Examples.AddressBook { /// /// [START messages] /// - public sealed partial class Person : pb::IMessage { + public sealed partial class Person : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Person()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Person() { OnConstruction(); } @@ -73,6 +81,7 @@ namespace Google.Protobuf.Examples.AddressBook { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Person(Person other) : this() { name_ = other.name_; id_ = other.id_; @@ -83,6 +92,7 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Person Clone() { return new Person(this); } @@ -91,6 +101,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int NameFieldNumber = 1; private string name_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -105,6 +116,7 @@ namespace Google.Protobuf.Examples.AddressBook { /// Unique ID number for this person. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Id { get { return id_; } set { @@ -116,6 +128,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int EmailFieldNumber = 3; private string email_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Email { get { return email_; } set { @@ -129,6 +142,7 @@ namespace Google.Protobuf.Examples.AddressBook { = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser); private readonly pbc::RepeatedField phones_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Phones { get { return phones_; } } @@ -137,6 +151,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int LastUpdatedFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.Timestamp lastUpdated_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp LastUpdated { get { return lastUpdated_; } set { @@ -145,11 +160,13 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Person); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Person other) { if (ReferenceEquals(other, null)) { return false; @@ -166,6 +183,7 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -180,12 +198,17 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); @@ -206,9 +229,38 @@ namespace Google.Protobuf.Examples.AddressBook { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Id != 0) { + output.WriteRawTag(16); + output.WriteInt32(Id); + } + if (Email.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Email); + } + phones_.WriteTo(ref output, _repeated_phones_codec); + if (lastUpdated_ != null) { + output.WriteRawTag(42); + output.WriteMessage(LastUpdated); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -231,6 +283,7 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Person other) { if (other == null) { return; @@ -255,7 +308,11 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -287,11 +344,51 @@ namespace Google.Protobuf.Examples.AddressBook { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + Id = input.ReadInt32(); + break; + } + case 26: { + Email = input.ReadString(); + break; + } + case 34: { + phones_.AddEntriesFrom(ref input, _repeated_phones_codec); + break; + } + case 42: { + if (lastUpdated_ == null) { + LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(LastUpdated); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the Person message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum PhoneType { [pbr::OriginalName("MOBILE")] Mobile = 0, @@ -299,23 +396,31 @@ namespace Google.Protobuf.Examples.AddressBook { [pbr::OriginalName("WORK")] Work = 2, } - public sealed partial class PhoneNumber : pb::IMessage { + public sealed partial class PhoneNumber : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PhoneNumber()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PhoneNumber() { OnConstruction(); } @@ -323,6 +428,7 @@ namespace Google.Protobuf.Examples.AddressBook { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PhoneNumber(PhoneNumber other) : this() { number_ = other.number_; type_ = other.type_; @@ -330,6 +436,7 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PhoneNumber Clone() { return new PhoneNumber(this); } @@ -338,6 +445,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int NumberFieldNumber = 1; private string number_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Number { get { return number_; } set { @@ -349,6 +457,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int TypeFieldNumber = 2; private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { get { return type_; } set { @@ -357,11 +466,13 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as PhoneNumber); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(PhoneNumber other) { if (ReferenceEquals(other, null)) { return false; @@ -375,6 +486,7 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Number.Length != 0) hash ^= Number.GetHashCode(); @@ -386,12 +498,17 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Number.Length != 0) { output.WriteRawTag(10); output.WriteString(Number); @@ -403,9 +520,29 @@ namespace Google.Protobuf.Examples.AddressBook { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Number.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Number); + } + if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) { + output.WriteRawTag(16); + output.WriteEnum((int) Type); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Number.Length != 0) { @@ -421,6 +558,7 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(PhoneNumber other) { if (other == null) { return; @@ -435,7 +573,11 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -452,8 +594,32 @@ namespace Google.Protobuf.Examples.AddressBook { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Number = input.ReadString(); + break; + } + case 16: { + Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum(); + break; + } + } + } + } + #endif + } } @@ -464,23 +630,31 @@ namespace Google.Protobuf.Examples.AddressBook { /// /// Our address book file is just one of these. /// - public sealed partial class AddressBook : pb::IMessage { + public sealed partial class AddressBook : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddressBook()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Examples.AddressBook.AddressbookReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AddressBook() { OnConstruction(); } @@ -488,12 +662,14 @@ namespace Google.Protobuf.Examples.AddressBook { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AddressBook(AddressBook other) : this() { people_ = other.people_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AddressBook Clone() { return new AddressBook(this); } @@ -504,16 +680,19 @@ namespace Google.Protobuf.Examples.AddressBook { = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser); private readonly pbc::RepeatedField people_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField People { get { return people_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as AddressBook); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(AddressBook other) { if (ReferenceEquals(other, null)) { return false; @@ -526,6 +705,7 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= people_.GetHashCode(); @@ -536,19 +716,37 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else people_.WriteTo(output, _repeated_people_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + people_.WriteTo(ref output, _repeated_people_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += people_.CalculateSize(_repeated_people_codec); @@ -559,6 +757,7 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(AddressBook other) { if (other == null) { return; @@ -568,7 +767,11 @@ namespace Google.Protobuf.Examples.AddressBook { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -581,7 +784,27 @@ namespace Google.Protobuf.Examples.AddressBook { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + people_.AddEntriesFrom(ref input, _repeated_people_codec); + break; + } + } + } } + #endif } diff --git a/csharp/src/AddressBook/Program.cs b/csharp/src/AddressBook/Program.cs index ff7b9c085e..de4867a0ce 100644 --- a/csharp/src/AddressBook/Program.cs +++ b/csharp/src/AddressBook/Program.cs @@ -37,7 +37,7 @@ namespace Google.Protobuf.Examples.AddressBook /// /// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour /// to individual actions. Each action has its own Main method, so that it can be used as an - /// invidual complete program. + /// individual complete program. /// internal class Program { diff --git a/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs index 9e8c330a2b..412440417c 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs @@ -64,23 +64,31 @@ namespace Benchmarks.Proto3 { } #region Messages - public sealed partial class GoogleMessage1 : pb::IMessage { + public sealed partial class GoogleMessage1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GoogleMessage1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Benchmarks.Proto3.BenchmarkMessage1Proto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GoogleMessage1() { OnConstruction(); } @@ -88,6 +96,7 @@ namespace Benchmarks.Proto3 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GoogleMessage1(GoogleMessage1 other) : this() { field1_ = other.field1_; field9_ = other.field9_; @@ -134,6 +143,7 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GoogleMessage1 Clone() { return new GoogleMessage1(this); } @@ -142,6 +152,7 @@ namespace Benchmarks.Proto3 { public const int Field1FieldNumber = 1; private string field1_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field1 { get { return field1_; } set { @@ -153,6 +164,7 @@ namespace Benchmarks.Proto3 { public const int Field9FieldNumber = 9; private string field9_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field9 { get { return field9_; } set { @@ -164,6 +176,7 @@ namespace Benchmarks.Proto3 { public const int Field18FieldNumber = 18; private string field18_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field18 { get { return field18_; } set { @@ -175,6 +188,7 @@ namespace Benchmarks.Proto3 { public const int Field80FieldNumber = 80; private bool field80_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field80 { get { return field80_; } set { @@ -186,6 +200,7 @@ namespace Benchmarks.Proto3 { public const int Field81FieldNumber = 81; private bool field81_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field81 { get { return field81_; } set { @@ -197,6 +212,7 @@ namespace Benchmarks.Proto3 { public const int Field2FieldNumber = 2; private int field2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field2 { get { return field2_; } set { @@ -208,6 +224,7 @@ namespace Benchmarks.Proto3 { public const int Field3FieldNumber = 3; private int field3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field3 { get { return field3_; } set { @@ -219,6 +236,7 @@ namespace Benchmarks.Proto3 { public const int Field280FieldNumber = 280; private int field280_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field280 { get { return field280_; } set { @@ -230,6 +248,7 @@ namespace Benchmarks.Proto3 { public const int Field6FieldNumber = 6; private int field6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field6 { get { return field6_; } set { @@ -241,6 +260,7 @@ namespace Benchmarks.Proto3 { public const int Field22FieldNumber = 22; private long field22_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Field22 { get { return field22_; } set { @@ -252,6 +272,7 @@ namespace Benchmarks.Proto3 { public const int Field4FieldNumber = 4; private string field4_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field4 { get { return field4_; } set { @@ -265,6 +286,7 @@ namespace Benchmarks.Proto3 { = pb::FieldCodec.ForFixed64(42); private readonly pbc::RepeatedField field5_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Field5 { get { return field5_; } } @@ -273,6 +295,7 @@ namespace Benchmarks.Proto3 { public const int Field59FieldNumber = 59; private bool field59_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field59 { get { return field59_; } set { @@ -284,6 +307,7 @@ namespace Benchmarks.Proto3 { public const int Field7FieldNumber = 7; private string field7_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field7 { get { return field7_; } set { @@ -295,6 +319,7 @@ namespace Benchmarks.Proto3 { public const int Field16FieldNumber = 16; private int field16_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field16 { get { return field16_; } set { @@ -306,6 +331,7 @@ namespace Benchmarks.Proto3 { public const int Field130FieldNumber = 130; private int field130_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field130 { get { return field130_; } set { @@ -317,6 +343,7 @@ namespace Benchmarks.Proto3 { public const int Field12FieldNumber = 12; private bool field12_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field12 { get { return field12_; } set { @@ -328,6 +355,7 @@ namespace Benchmarks.Proto3 { public const int Field17FieldNumber = 17; private bool field17_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field17 { get { return field17_; } set { @@ -339,6 +367,7 @@ namespace Benchmarks.Proto3 { public const int Field13FieldNumber = 13; private bool field13_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field13 { get { return field13_; } set { @@ -350,6 +379,7 @@ namespace Benchmarks.Proto3 { public const int Field14FieldNumber = 14; private bool field14_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field14 { get { return field14_; } set { @@ -361,6 +391,7 @@ namespace Benchmarks.Proto3 { public const int Field104FieldNumber = 104; private int field104_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field104 { get { return field104_; } set { @@ -372,6 +403,7 @@ namespace Benchmarks.Proto3 { public const int Field100FieldNumber = 100; private int field100_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field100 { get { return field100_; } set { @@ -383,6 +415,7 @@ namespace Benchmarks.Proto3 { public const int Field101FieldNumber = 101; private int field101_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field101 { get { return field101_; } set { @@ -394,6 +427,7 @@ namespace Benchmarks.Proto3 { public const int Field102FieldNumber = 102; private string field102_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field102 { get { return field102_; } set { @@ -405,6 +439,7 @@ namespace Benchmarks.Proto3 { public const int Field103FieldNumber = 103; private string field103_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field103 { get { return field103_; } set { @@ -416,6 +451,7 @@ namespace Benchmarks.Proto3 { public const int Field29FieldNumber = 29; private int field29_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field29 { get { return field29_; } set { @@ -427,6 +463,7 @@ namespace Benchmarks.Proto3 { public const int Field30FieldNumber = 30; private bool field30_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field30 { get { return field30_; } set { @@ -438,6 +475,7 @@ namespace Benchmarks.Proto3 { public const int Field60FieldNumber = 60; private int field60_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field60 { get { return field60_; } set { @@ -449,6 +487,7 @@ namespace Benchmarks.Proto3 { public const int Field271FieldNumber = 271; private int field271_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field271 { get { return field271_; } set { @@ -460,6 +499,7 @@ namespace Benchmarks.Proto3 { public const int Field272FieldNumber = 272; private int field272_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field272 { get { return field272_; } set { @@ -471,6 +511,7 @@ namespace Benchmarks.Proto3 { public const int Field150FieldNumber = 150; private int field150_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field150 { get { return field150_; } set { @@ -482,6 +523,7 @@ namespace Benchmarks.Proto3 { public const int Field23FieldNumber = 23; private int field23_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field23 { get { return field23_; } set { @@ -493,6 +535,7 @@ namespace Benchmarks.Proto3 { public const int Field24FieldNumber = 24; private bool field24_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field24 { get { return field24_; } set { @@ -504,6 +547,7 @@ namespace Benchmarks.Proto3 { public const int Field25FieldNumber = 25; private int field25_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field25 { get { return field25_; } set { @@ -515,6 +559,7 @@ namespace Benchmarks.Proto3 { public const int Field15FieldNumber = 15; private global::Benchmarks.Proto3.GoogleMessage1SubMessage field15_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Benchmarks.Proto3.GoogleMessage1SubMessage Field15 { get { return field15_; } set { @@ -526,6 +571,7 @@ namespace Benchmarks.Proto3 { public const int Field78FieldNumber = 78; private bool field78_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field78 { get { return field78_; } set { @@ -537,6 +583,7 @@ namespace Benchmarks.Proto3 { public const int Field67FieldNumber = 67; private int field67_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field67 { get { return field67_; } set { @@ -548,6 +595,7 @@ namespace Benchmarks.Proto3 { public const int Field68FieldNumber = 68; private int field68_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field68 { get { return field68_; } set { @@ -559,6 +607,7 @@ namespace Benchmarks.Proto3 { public const int Field128FieldNumber = 128; private int field128_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field128 { get { return field128_; } set { @@ -570,6 +619,7 @@ namespace Benchmarks.Proto3 { public const int Field129FieldNumber = 129; private string field129_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field129 { get { return field129_; } set { @@ -581,6 +631,7 @@ namespace Benchmarks.Proto3 { public const int Field131FieldNumber = 131; private int field131_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field131 { get { return field131_; } set { @@ -589,11 +640,13 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as GoogleMessage1); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(GoogleMessage1 other) { if (ReferenceEquals(other, null)) { return false; @@ -646,6 +699,7 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Field1.Length != 0) hash ^= Field1.GetHashCode(); @@ -696,12 +750,17 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Field1.Length != 0) { output.WriteRawTag(10); output.WriteString(Field1); @@ -866,9 +925,182 @@ namespace Benchmarks.Proto3 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Field1.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Field1); + } + if (Field2 != 0) { + output.WriteRawTag(16); + output.WriteInt32(Field2); + } + if (Field3 != 0) { + output.WriteRawTag(24); + output.WriteInt32(Field3); + } + if (Field4.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Field4); + } + field5_.WriteTo(ref output, _repeated_field5_codec); + if (Field6 != 0) { + output.WriteRawTag(48); + output.WriteInt32(Field6); + } + if (Field7.Length != 0) { + output.WriteRawTag(58); + output.WriteString(Field7); + } + if (Field9.Length != 0) { + output.WriteRawTag(74); + output.WriteString(Field9); + } + if (Field12 != false) { + output.WriteRawTag(96); + output.WriteBool(Field12); + } + if (Field13 != false) { + output.WriteRawTag(104); + output.WriteBool(Field13); + } + if (Field14 != false) { + output.WriteRawTag(112); + output.WriteBool(Field14); + } + if (field15_ != null) { + output.WriteRawTag(122); + output.WriteMessage(Field15); + } + if (Field16 != 0) { + output.WriteRawTag(128, 1); + output.WriteInt32(Field16); + } + if (Field17 != false) { + output.WriteRawTag(136, 1); + output.WriteBool(Field17); + } + if (Field18.Length != 0) { + output.WriteRawTag(146, 1); + output.WriteString(Field18); + } + if (Field22 != 0L) { + output.WriteRawTag(176, 1); + output.WriteInt64(Field22); + } + if (Field23 != 0) { + output.WriteRawTag(184, 1); + output.WriteInt32(Field23); + } + if (Field24 != false) { + output.WriteRawTag(192, 1); + output.WriteBool(Field24); + } + if (Field25 != 0) { + output.WriteRawTag(200, 1); + output.WriteInt32(Field25); + } + if (Field29 != 0) { + output.WriteRawTag(232, 1); + output.WriteInt32(Field29); + } + if (Field30 != false) { + output.WriteRawTag(240, 1); + output.WriteBool(Field30); + } + if (Field59 != false) { + output.WriteRawTag(216, 3); + output.WriteBool(Field59); + } + if (Field60 != 0) { + output.WriteRawTag(224, 3); + output.WriteInt32(Field60); + } + if (Field67 != 0) { + output.WriteRawTag(152, 4); + output.WriteInt32(Field67); + } + if (Field68 != 0) { + output.WriteRawTag(160, 4); + output.WriteInt32(Field68); + } + if (Field78 != false) { + output.WriteRawTag(240, 4); + output.WriteBool(Field78); + } + if (Field80 != false) { + output.WriteRawTag(128, 5); + output.WriteBool(Field80); + } + if (Field81 != false) { + output.WriteRawTag(136, 5); + output.WriteBool(Field81); + } + if (Field100 != 0) { + output.WriteRawTag(160, 6); + output.WriteInt32(Field100); + } + if (Field101 != 0) { + output.WriteRawTag(168, 6); + output.WriteInt32(Field101); + } + if (Field102.Length != 0) { + output.WriteRawTag(178, 6); + output.WriteString(Field102); + } + if (Field103.Length != 0) { + output.WriteRawTag(186, 6); + output.WriteString(Field103); + } + if (Field104 != 0) { + output.WriteRawTag(192, 6); + output.WriteInt32(Field104); + } + if (Field128 != 0) { + output.WriteRawTag(128, 8); + output.WriteInt32(Field128); + } + if (Field129.Length != 0) { + output.WriteRawTag(138, 8); + output.WriteString(Field129); + } + if (Field130 != 0) { + output.WriteRawTag(144, 8); + output.WriteInt32(Field130); + } + if (Field131 != 0) { + output.WriteRawTag(152, 8); + output.WriteInt32(Field131); + } + if (Field150 != 0) { + output.WriteRawTag(176, 9); + output.WriteInt32(Field150); + } + if (Field271 != 0) { + output.WriteRawTag(248, 16); + output.WriteInt32(Field271); + } + if (Field272 != 0) { + output.WriteRawTag(128, 17); + output.WriteInt32(Field272); + } + if (Field280 != 0) { + output.WriteRawTag(192, 17); + output.WriteInt32(Field280); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Field1.Length != 0) { @@ -999,6 +1231,7 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(GoogleMessage1 other) { if (other == null) { return; @@ -1107,36 +1340,223 @@ namespace Benchmarks.Proto3 { if (field15_ == null) { Field15 = new global::Benchmarks.Proto3.GoogleMessage1SubMessage(); } - Field15.MergeFrom(other.Field15); - } - if (other.Field78 != false) { - Field78 = other.Field78; - } - if (other.Field67 != 0) { - Field67 = other.Field67; - } - if (other.Field68 != 0) { - Field68 = other.Field68; - } - if (other.Field128 != 0) { - Field128 = other.Field128; - } - if (other.Field129.Length != 0) { - Field129 = other.Field129; - } - if (other.Field131 != 0) { - Field131 = other.Field131; + Field15.MergeFrom(other.Field15); + } + if (other.Field78 != false) { + Field78 = other.Field78; + } + if (other.Field67 != 0) { + Field67 = other.Field67; + } + if (other.Field68 != 0) { + Field68 = other.Field68; + } + if (other.Field128 != 0) { + Field128 = other.Field128; + } + if (other.Field129.Length != 0) { + Field129 = other.Field129; + } + if (other.Field131 != 0) { + Field131 = other.Field131; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Field1 = input.ReadString(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 34: { + Field4 = input.ReadString(); + break; + } + case 42: + case 41: { + field5_.AddEntriesFrom(input, _repeated_field5_codec); + break; + } + case 48: { + Field6 = input.ReadInt32(); + break; + } + case 58: { + Field7 = input.ReadString(); + break; + } + case 74: { + Field9 = input.ReadString(); + break; + } + case 96: { + Field12 = input.ReadBool(); + break; + } + case 104: { + Field13 = input.ReadBool(); + break; + } + case 112: { + Field14 = input.ReadBool(); + break; + } + case 122: { + if (field15_ == null) { + Field15 = new global::Benchmarks.Proto3.GoogleMessage1SubMessage(); + } + input.ReadMessage(Field15); + break; + } + case 128: { + Field16 = input.ReadInt32(); + break; + } + case 136: { + Field17 = input.ReadBool(); + break; + } + case 146: { + Field18 = input.ReadString(); + break; + } + case 176: { + Field22 = input.ReadInt64(); + break; + } + case 184: { + Field23 = input.ReadInt32(); + break; + } + case 192: { + Field24 = input.ReadBool(); + break; + } + case 200: { + Field25 = input.ReadInt32(); + break; + } + case 232: { + Field29 = input.ReadInt32(); + break; + } + case 240: { + Field30 = input.ReadBool(); + break; + } + case 472: { + Field59 = input.ReadBool(); + break; + } + case 480: { + Field60 = input.ReadInt32(); + break; + } + case 536: { + Field67 = input.ReadInt32(); + break; + } + case 544: { + Field68 = input.ReadInt32(); + break; + } + case 624: { + Field78 = input.ReadBool(); + break; + } + case 640: { + Field80 = input.ReadBool(); + break; + } + case 648: { + Field81 = input.ReadBool(); + break; + } + case 800: { + Field100 = input.ReadInt32(); + break; + } + case 808: { + Field101 = input.ReadInt32(); + break; + } + case 818: { + Field102 = input.ReadString(); + break; + } + case 826: { + Field103 = input.ReadString(); + break; + } + case 832: { + Field104 = input.ReadInt32(); + break; + } + case 1024: { + Field128 = input.ReadInt32(); + break; + } + case 1034: { + Field129 = input.ReadString(); + break; + } + case 1040: { + Field130 = input.ReadInt32(); + break; + } + case 1048: { + Field131 = input.ReadInt32(); + break; + } + case 1200: { + Field150 = input.ReadInt32(); + break; + } + case 2168: { + Field271 = input.ReadInt32(); + break; + } + case 2176: { + Field272 = input.ReadInt32(); + break; + } + case 2240: { + Field280 = input.ReadInt32(); + break; + } + } } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { Field1 = input.ReadString(); @@ -1156,7 +1576,7 @@ namespace Benchmarks.Proto3 { } case 42: case 41: { - field5_.AddEntriesFrom(input, _repeated_field5_codec); + field5_.AddEntriesFrom(ref input, _repeated_field5_codec); break; } case 48: { @@ -1309,26 +1729,35 @@ namespace Benchmarks.Proto3 { } } } + #endif } - public sealed partial class GoogleMessage1SubMessage : pb::IMessage { + public sealed partial class GoogleMessage1SubMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GoogleMessage1SubMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Benchmarks.Proto3.BenchmarkMessage1Proto3Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GoogleMessage1SubMessage() { OnConstruction(); } @@ -1336,6 +1765,7 @@ namespace Benchmarks.Proto3 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GoogleMessage1SubMessage(GoogleMessage1SubMessage other) : this() { field1_ = other.field1_; field2_ = other.field2_; @@ -1361,6 +1791,7 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GoogleMessage1SubMessage Clone() { return new GoogleMessage1SubMessage(this); } @@ -1369,6 +1800,7 @@ namespace Benchmarks.Proto3 { public const int Field1FieldNumber = 1; private int field1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field1 { get { return field1_; } set { @@ -1380,6 +1812,7 @@ namespace Benchmarks.Proto3 { public const int Field2FieldNumber = 2; private int field2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field2 { get { return field2_; } set { @@ -1391,6 +1824,7 @@ namespace Benchmarks.Proto3 { public const int Field3FieldNumber = 3; private int field3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field3 { get { return field3_; } set { @@ -1402,6 +1836,7 @@ namespace Benchmarks.Proto3 { public const int Field15FieldNumber = 15; private string field15_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field15 { get { return field15_; } set { @@ -1413,6 +1848,7 @@ namespace Benchmarks.Proto3 { public const int Field12FieldNumber = 12; private bool field12_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field12 { get { return field12_; } set { @@ -1424,6 +1860,7 @@ namespace Benchmarks.Proto3 { public const int Field13FieldNumber = 13; private long field13_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Field13 { get { return field13_; } set { @@ -1435,6 +1872,7 @@ namespace Benchmarks.Proto3 { public const int Field14FieldNumber = 14; private long field14_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Field14 { get { return field14_; } set { @@ -1446,6 +1884,7 @@ namespace Benchmarks.Proto3 { public const int Field16FieldNumber = 16; private int field16_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field16 { get { return field16_; } set { @@ -1457,6 +1896,7 @@ namespace Benchmarks.Proto3 { public const int Field19FieldNumber = 19; private int field19_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field19 { get { return field19_; } set { @@ -1468,6 +1908,7 @@ namespace Benchmarks.Proto3 { public const int Field20FieldNumber = 20; private bool field20_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field20 { get { return field20_; } set { @@ -1479,6 +1920,7 @@ namespace Benchmarks.Proto3 { public const int Field28FieldNumber = 28; private bool field28_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field28 { get { return field28_; } set { @@ -1490,6 +1932,7 @@ namespace Benchmarks.Proto3 { public const int Field21FieldNumber = 21; private ulong field21_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong Field21 { get { return field21_; } set { @@ -1501,6 +1944,7 @@ namespace Benchmarks.Proto3 { public const int Field22FieldNumber = 22; private int field22_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field22 { get { return field22_; } set { @@ -1512,6 +1956,7 @@ namespace Benchmarks.Proto3 { public const int Field23FieldNumber = 23; private bool field23_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field23 { get { return field23_; } set { @@ -1523,6 +1968,7 @@ namespace Benchmarks.Proto3 { public const int Field206FieldNumber = 206; private bool field206_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Field206 { get { return field206_; } set { @@ -1534,6 +1980,7 @@ namespace Benchmarks.Proto3 { public const int Field203FieldNumber = 203; private uint field203_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint Field203 { get { return field203_; } set { @@ -1545,6 +1992,7 @@ namespace Benchmarks.Proto3 { public const int Field204FieldNumber = 204; private int field204_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field204 { get { return field204_; } set { @@ -1556,6 +2004,7 @@ namespace Benchmarks.Proto3 { public const int Field205FieldNumber = 205; private string field205_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field205 { get { return field205_; } set { @@ -1567,6 +2016,7 @@ namespace Benchmarks.Proto3 { public const int Field207FieldNumber = 207; private ulong field207_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong Field207 { get { return field207_; } set { @@ -1578,6 +2028,7 @@ namespace Benchmarks.Proto3 { public const int Field300FieldNumber = 300; private ulong field300_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong Field300 { get { return field300_; } set { @@ -1586,11 +2037,13 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as GoogleMessage1SubMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(GoogleMessage1SubMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -1622,6 +2075,7 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Field1 != 0) hash ^= Field1.GetHashCode(); @@ -1651,12 +2105,17 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Field1 != 0) { output.WriteRawTag(8); output.WriteInt32(Field1); @@ -1740,9 +2199,101 @@ namespace Benchmarks.Proto3 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Field1 != 0) { + output.WriteRawTag(8); + output.WriteInt32(Field1); + } + if (Field2 != 0) { + output.WriteRawTag(16); + output.WriteInt32(Field2); + } + if (Field3 != 0) { + output.WriteRawTag(24); + output.WriteInt32(Field3); + } + if (Field12 != false) { + output.WriteRawTag(96); + output.WriteBool(Field12); + } + if (Field13 != 0L) { + output.WriteRawTag(104); + output.WriteInt64(Field13); + } + if (Field14 != 0L) { + output.WriteRawTag(112); + output.WriteInt64(Field14); + } + if (Field15.Length != 0) { + output.WriteRawTag(122); + output.WriteString(Field15); + } + if (Field16 != 0) { + output.WriteRawTag(128, 1); + output.WriteInt32(Field16); + } + if (Field19 != 0) { + output.WriteRawTag(152, 1); + output.WriteInt32(Field19); + } + if (Field20 != false) { + output.WriteRawTag(160, 1); + output.WriteBool(Field20); + } + if (Field21 != 0UL) { + output.WriteRawTag(169, 1); + output.WriteFixed64(Field21); + } + if (Field22 != 0) { + output.WriteRawTag(176, 1); + output.WriteInt32(Field22); + } + if (Field23 != false) { + output.WriteRawTag(184, 1); + output.WriteBool(Field23); + } + if (Field28 != false) { + output.WriteRawTag(224, 1); + output.WriteBool(Field28); + } + if (Field203 != 0) { + output.WriteRawTag(221, 12); + output.WriteFixed32(Field203); + } + if (Field204 != 0) { + output.WriteRawTag(224, 12); + output.WriteInt32(Field204); + } + if (Field205.Length != 0) { + output.WriteRawTag(234, 12); + output.WriteString(Field205); + } + if (Field206 != false) { + output.WriteRawTag(240, 12); + output.WriteBool(Field206); + } + if (Field207 != 0UL) { + output.WriteRawTag(248, 12); + output.WriteUInt64(Field207); + } + if (Field300 != 0UL) { + output.WriteRawTag(224, 18); + output.WriteUInt64(Field300); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Field1 != 0) { @@ -1812,6 +2363,7 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(GoogleMessage1SubMessage other) { if (other == null) { return; @@ -1880,7 +2432,11 @@ namespace Benchmarks.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1969,7 +2525,103 @@ namespace Benchmarks.Proto3 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Field1 = input.ReadInt32(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 96: { + Field12 = input.ReadBool(); + break; + } + case 104: { + Field13 = input.ReadInt64(); + break; + } + case 112: { + Field14 = input.ReadInt64(); + break; + } + case 122: { + Field15 = input.ReadString(); + break; + } + case 128: { + Field16 = input.ReadInt32(); + break; + } + case 152: { + Field19 = input.ReadInt32(); + break; + } + case 160: { + Field20 = input.ReadBool(); + break; + } + case 169: { + Field21 = input.ReadFixed64(); + break; + } + case 176: { + Field22 = input.ReadInt32(); + break; + } + case 184: { + Field23 = input.ReadBool(); + break; + } + case 224: { + Field28 = input.ReadBool(); + break; + } + case 1629: { + Field203 = input.ReadFixed32(); + break; + } + case 1632: { + Field204 = input.ReadInt32(); + break; + } + case 1642: { + Field205 = input.ReadString(); + break; + } + case 1648: { + Field206 = input.ReadBool(); + break; + } + case 1656: { + Field207 = input.ReadUInt64(); + break; + } + case 2400: { + Field300 = input.ReadUInt64(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs b/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs index 01dfcd72dc..faa37b0508 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs @@ -38,23 +38,31 @@ namespace Benchmarks { } #region Messages - public sealed partial class BenchmarkDataset : pb::IMessage { + public sealed partial class BenchmarkDataset : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BenchmarkDataset()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Benchmarks.BenchmarksReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BenchmarkDataset() { OnConstruction(); } @@ -62,6 +70,7 @@ namespace Benchmarks { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BenchmarkDataset(BenchmarkDataset other) : this() { name_ = other.name_; messageName_ = other.messageName_; @@ -70,6 +79,7 @@ namespace Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BenchmarkDataset Clone() { return new BenchmarkDataset(this); } @@ -82,6 +92,7 @@ namespace Benchmarks { /// Should only contain word characters: [a-zA-Z0-9_] /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -102,6 +113,7 @@ namespace Benchmarks { /// in those files. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MessageName { get { return messageName_; } set { @@ -130,16 +142,19 @@ namespace Benchmarks { /// good branch prediction performance. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Payload { get { return payload_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BenchmarkDataset); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BenchmarkDataset other) { if (ReferenceEquals(other, null)) { return false; @@ -154,6 +169,7 @@ namespace Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -166,12 +182,17 @@ namespace Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); @@ -184,9 +205,30 @@ namespace Benchmarks { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (MessageName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(MessageName); + } + payload_.WriteTo(ref output, _repeated_payload_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -203,6 +245,7 @@ namespace Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BenchmarkDataset other) { if (other == null) { return; @@ -218,7 +261,11 @@ namespace Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -239,7 +286,35 @@ namespace Benchmarks { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + MessageName = input.ReadString(); + break; + } + case 26: { + payload_.AddEntriesFrom(ref input, _repeated_payload_codec); + break; + } + } + } } + #endif } diff --git a/java/compatibility_tests/v2.5.0/more_protos/src/proto/com/google/protobuf/non_nested_extension.proto b/csharp/src/Google.Protobuf.Benchmarks/ByteStringBenchmark.cs similarity index 57% rename from java/compatibility_tests/v2.5.0/more_protos/src/proto/com/google/protobuf/non_nested_extension.proto rename to csharp/src/Google.Protobuf.Benchmarks/ByteStringBenchmark.cs index f61b419bc2..a755850a66 100644 --- a/java/compatibility_tests/v2.5.0/more_protos/src/proto/com/google/protobuf/non_nested_extension.proto +++ b/csharp/src/Google.Protobuf.Benchmarks/ByteStringBenchmark.cs @@ -1,6 +1,7 @@ +#region Copyright notice and license // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -27,22 +28,45 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion -// Author: Darick Tong (darick@google.com) -// -// A proto file with extensions. +using BenchmarkDotNet.Attributes; +namespace Google.Protobuf.Benchmarks +{ + /// + /// Benchmarks using ByteString. + /// + [MemoryDiagnoser] + public class ByteStringBenchmark + { + private const int Zero = 0; + private const int Kilobyte = 1024; + private const int _128Kilobytes = 1024 * 128; + private const int Megabyte = 1024 * 1024; + private const int _10Megabytes = 1024 * 1024 * 10; -package protobuf_unittest; + byte[] byteBuffer; -message MessageToBeExtended { - extensions 1 to max; -} + [GlobalSetup] + public void GlobalSetup() + { + byteBuffer = new byte[PayloadSize]; + } -message MyNonNestedExtension { -} + [Params(Zero, Kilobyte, _128Kilobytes, Megabyte, _10Megabytes)] + public int PayloadSize { get; set; } -extend MessageToBeExtended { - optional MyNonNestedExtension nonNestedExtension = 1; -} + [Benchmark] + public ByteString CopyFrom() + { + return ByteString.CopyFrom(byteBuffer); + } + [Benchmark] + public ByteString UnsafeWrap() + { + return UnsafeByteOperations.UnsafeWrap(byteBuffer); + } + } +} diff --git a/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj b/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj index ecc064ea7d..ac8e009adc 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj +++ b/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj @@ -2,12 +2,20 @@ Exe - netcoreapp2.1 + net5.0 + ../../keys/Google.Protobuf.snk + true False + pdbonly + true - + + + + + diff --git a/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs index cbc47328fa..8e6710b708 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs @@ -37,6 +37,7 @@ using System.IO; using System.Linq; using System.Buffers; using Google.Protobuf.WellKnownTypes; +using Benchmarks.Proto3; namespace Google.Protobuf.Benchmarks { @@ -50,6 +51,7 @@ namespace Google.Protobuf.Benchmarks SubTest manyWrapperFieldsTest = new SubTest(CreateManyWrapperFieldsMessage(), ManyWrapperFieldsMessage.Parser, () => new ManyWrapperFieldsMessage(), MaxMessages); SubTest manyPrimitiveFieldsTest = new SubTest(CreateManyPrimitiveFieldsMessage(), ManyPrimitiveFieldsMessage.Parser, () => new ManyPrimitiveFieldsMessage(), MaxMessages); + SubTest repeatedFieldTest = new SubTest(CreateRepeatedFieldMessage(), GoogleMessage1.Parser, () => new GoogleMessage1(), MaxMessages); SubTest emptyMessageTest = new SubTest(new Empty(), Empty.Parser, () => new Empty(), MaxMessages); public IEnumerable MessageCountValues => new[] { 10, 100 }; @@ -65,18 +67,48 @@ namespace Google.Protobuf.Benchmarks return manyWrapperFieldsTest.ParseFromByteArray(); } + [Benchmark] + public IMessage ManyWrapperFieldsMessage_ParseFromReadOnlySequence() + { + return manyWrapperFieldsTest.ParseFromReadOnlySequence(); + } + [Benchmark] public IMessage ManyPrimitiveFieldsMessage_ParseFromByteArray() { return manyPrimitiveFieldsTest.ParseFromByteArray(); } + [Benchmark] + public IMessage ManyPrimitiveFieldsMessage_ParseFromReadOnlySequence() + { + return manyPrimitiveFieldsTest.ParseFromReadOnlySequence(); + } + + [Benchmark] + public IMessage RepeatedFieldMessage_ParseFromByteArray() + { + return repeatedFieldTest.ParseFromByteArray(); + } + + [Benchmark] + public IMessage RepeatedFieldMessage_ParseFromReadOnlySequence() + { + return repeatedFieldTest.ParseFromReadOnlySequence(); + } + [Benchmark] public IMessage EmptyMessage_ParseFromByteArray() { return emptyMessageTest.ParseFromByteArray(); } + [Benchmark] + public IMessage EmptyMessage_ParseFromReadOnlySequence() + { + return emptyMessageTest.ParseFromReadOnlySequence(); + } + [Benchmark] [ArgumentsSource(nameof(MessageCountValues))] public void ManyWrapperFieldsMessage_ParseDelimitedMessagesFromByteArray(int messageCount) @@ -84,6 +116,13 @@ namespace Google.Protobuf.Benchmarks manyWrapperFieldsTest.ParseDelimitedMessagesFromByteArray(messageCount); } + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyWrapperFieldsMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount) + { + manyWrapperFieldsTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount); + } + [Benchmark] [ArgumentsSource(nameof(MessageCountValues))] public void ManyPrimitiveFieldsMessage_ParseDelimitedMessagesFromByteArray(int messageCount) @@ -91,7 +130,28 @@ namespace Google.Protobuf.Benchmarks manyPrimitiveFieldsTest.ParseDelimitedMessagesFromByteArray(messageCount); } - private static ManyWrapperFieldsMessage CreateManyWrapperFieldsMessage() + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyPrimitiveFieldsMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount) + { + manyPrimitiveFieldsTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void RepeatedFieldMessage_ParseDelimitedMessagesFromByteArray(int messageCount) + { + repeatedFieldTest.ParseDelimitedMessagesFromByteArray(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void RepeatedFieldMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount) + { + repeatedFieldTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount); + } + + public static ManyWrapperFieldsMessage CreateManyWrapperFieldsMessage() { // Example data match data of an internal benchmarks return new ManyWrapperFieldsMessage() @@ -108,7 +168,7 @@ namespace Google.Protobuf.Benchmarks }; } - private static ManyPrimitiveFieldsMessage CreateManyPrimitiveFieldsMessage() + public static ManyPrimitiveFieldsMessage CreateManyPrimitiveFieldsMessage() { // Example data match data of an internal benchmarks return new ManyPrimitiveFieldsMessage() @@ -125,6 +185,17 @@ namespace Google.Protobuf.Benchmarks }; } + public static GoogleMessage1 CreateRepeatedFieldMessage() + { + // Message with a repeated fixed length item collection + var message = new GoogleMessage1(); + for (ulong i = 0; i < 1000; i++) + { + message.Field5.Add(i); + } + return message; + } + private class SubTest { private readonly IMessage message; @@ -133,6 +204,9 @@ namespace Google.Protobuf.Benchmarks private readonly byte[] data; private readonly byte[] multipleMessagesData; + private ReadOnlySequence dataSequence; + private ReadOnlySequence multipleMessagesDataSequence; + public SubTest(IMessage message, MessageParser parser, Func factory, int maxMessageCount) { this.message = message; @@ -140,10 +214,14 @@ namespace Google.Protobuf.Benchmarks this.factory = factory; this.data = message.ToByteArray(); this.multipleMessagesData = CreateBufferWithMultipleMessages(message, maxMessageCount); + this.dataSequence = new ReadOnlySequence(this.data); + this.multipleMessagesDataSequence = new ReadOnlySequence(this.multipleMessagesData); } public IMessage ParseFromByteArray() => parser.ParseFrom(data); + public IMessage ParseFromReadOnlySequence() => parser.ParseFrom(dataSequence); + public void ParseDelimitedMessagesFromByteArray(int messageCount) { var input = new CodedInputStream(multipleMessagesData); @@ -154,6 +232,16 @@ namespace Google.Protobuf.Benchmarks } } + public void ParseDelimitedMessagesFromReadOnlySequence(int messageCount) + { + ParseContext.Initialize(multipleMessagesDataSequence, out ParseContext ctx); + for (int i = 0; i < messageCount; i++) + { + var msg = factory(); + ctx.ReadMessage(msg); + } + } + private static byte[] CreateBufferWithMultipleMessages(IMessage msg, int msgCount) { var ms = new MemoryStream(); diff --git a/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs index 44dde2ff8c..6df1c872c3 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs @@ -35,6 +35,7 @@ using System; using System.Buffers.Binary; using System.Collections.Generic; using System.IO; +using System.Buffers; namespace Google.Protobuf.Benchmarks { @@ -51,8 +52,15 @@ namespace Google.Protobuf.Benchmarks byte[] floatInputBuffer; byte[] fixedIntInputBuffer; + // key is the encodedSize of string values + Dictionary stringInputBuffers; + Dictionary> stringInputBuffersSegmented; + Random random = new Random(417384220); // random but deterministic seed + public IEnumerable StringEncodedSizes => new[] { 1, 4, 10, 105, 10080 }; + public IEnumerable StringSegmentedEncodedSizes => new[] { 105, 10080 }; + [GlobalSetup] public void GlobalSetup() { @@ -70,6 +78,20 @@ namespace Google.Protobuf.Benchmarks doubleInputBuffer = CreateBufferWithRandomDoubles(random, BytesToParse / sizeof(double), paddingValueCount); floatInputBuffer = CreateBufferWithRandomFloats(random, BytesToParse / sizeof(float), paddingValueCount); fixedIntInputBuffer = CreateBufferWithRandomData(random, BytesToParse / sizeof(long), sizeof(long), paddingValueCount); + + stringInputBuffers = new Dictionary(); + foreach (var encodedSize in StringEncodedSizes) + { + byte[] buffer = CreateBufferWithStrings(BytesToParse / encodedSize, encodedSize, encodedSize < 10 ? 10 : 1 ); + stringInputBuffers.Add(encodedSize, buffer); + } + + stringInputBuffersSegmented = new Dictionary>(); + foreach (var encodedSize in StringSegmentedEncodedSizes) + { + byte[] buffer = CreateBufferWithStrings(BytesToParse / encodedSize, encodedSize, encodedSize < 10 ? 10 : 1); + stringInputBuffersSegmented.Add(encodedSize, ReadOnlySequenceFactory.CreateWithContent(buffer, segmentSize: 128, addEmptySegmentDelimiters: false)); + } } // Total number of bytes that each benchmark will parse. @@ -85,7 +107,7 @@ namespace Google.Protobuf.Benchmarks [Arguments(3)] [Arguments(4)] [Arguments(5)] - public int ParseRawVarint32(int encodedSize) + public int ParseRawVarint32_CodedInputStream(int encodedSize) { CodedInputStream cis = new CodedInputStream(varintInputBuffers[encodedSize]); int sum = 0; @@ -96,6 +118,23 @@ namespace Google.Protobuf.Benchmarks return sum; } + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + public int ParseRawVarint32_ParseContext(int encodedSize) + { + InitializeParseContext(varintInputBuffers[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadInt32(); + } + return sum; + } + [Benchmark] [Arguments(1)] [Arguments(2)] @@ -107,7 +146,7 @@ namespace Google.Protobuf.Benchmarks [Arguments(8)] [Arguments(9)] [Arguments(10)] - public long ParseRawVarint64(int encodedSize) + public long ParseRawVarint64_CodedInputStream(int encodedSize) { CodedInputStream cis = new CodedInputStream(varintInputBuffers[encodedSize]); long sum = 0; @@ -119,7 +158,29 @@ namespace Google.Protobuf.Benchmarks } [Benchmark] - public uint ParseFixed32() + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + [Arguments(6)] + [Arguments(7)] + [Arguments(8)] + [Arguments(9)] + [Arguments(10)] + public long ParseRawVarint64_ParseContext(int encodedSize) + { + InitializeParseContext(varintInputBuffers[encodedSize], out ParseContext ctx); + long sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadInt64(); + } + return sum; + } + + [Benchmark] + public uint ParseFixed32_CodedInputStream() { const int encodedSize = sizeof(uint); CodedInputStream cis = new CodedInputStream(fixedIntInputBuffer); @@ -132,7 +193,20 @@ namespace Google.Protobuf.Benchmarks } [Benchmark] - public ulong ParseFixed64() + public uint ParseFixed32_ParseContext() + { + const int encodedSize = sizeof(uint); + InitializeParseContext(fixedIntInputBuffer, out ParseContext ctx); + uint sum = 0; + for (uint i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadFixed32(); + } + return sum; + } + + [Benchmark] + public ulong ParseFixed64_CodedInputStream() { const int encodedSize = sizeof(ulong); CodedInputStream cis = new CodedInputStream(fixedIntInputBuffer); @@ -145,7 +219,20 @@ namespace Google.Protobuf.Benchmarks } [Benchmark] - public float ParseRawFloat() + public ulong ParseFixed64_ParseContext() + { + const int encodedSize = sizeof(ulong); + InitializeParseContext(fixedIntInputBuffer, out ParseContext ctx); + ulong sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadFixed64(); + } + return sum; + } + + [Benchmark] + public float ParseRawFloat_CodedInputStream() { const int encodedSize = sizeof(float); CodedInputStream cis = new CodedInputStream(floatInputBuffer); @@ -158,7 +245,20 @@ namespace Google.Protobuf.Benchmarks } [Benchmark] - public double ParseRawDouble() + public float ParseRawFloat_ParseContext() + { + const int encodedSize = sizeof(float); + InitializeParseContext(floatInputBuffer, out ParseContext ctx); + float sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadFloat(); + } + return sum; + } + + [Benchmark] + public double ParseRawDouble_CodedInputStream() { const int encodedSize = sizeof(double); CodedInputStream cis = new CodedInputStream(doubleInputBuffer); @@ -170,13 +270,114 @@ namespace Google.Protobuf.Benchmarks return sum; } + [Benchmark] + public double ParseRawDouble_ParseContext() + { + const int encodedSize = sizeof(double); + InitializeParseContext(doubleInputBuffer, out ParseContext ctx); + double sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadDouble(); + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public int ParseString_CodedInputStream(int encodedSize) + { + CodedInputStream cis = new CodedInputStream(stringInputBuffers[encodedSize]); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadString().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public int ParseString_ParseContext(int encodedSize) + { + InitializeParseContext(stringInputBuffers[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadString().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringSegmentedEncodedSizes))] + public int ParseString_ParseContext_MultipleSegments(int encodedSize) + { + InitializeParseContext(stringInputBuffersSegmented[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadString().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public int ParseBytes_CodedInputStream(int encodedSize) + { + CodedInputStream cis = new CodedInputStream(stringInputBuffers[encodedSize]); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += cis.ReadBytes().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public int ParseBytes_ParseContext(int encodedSize) + { + InitializeParseContext(stringInputBuffers[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadBytes().Length; + } + return sum; + } + + [Benchmark] + [ArgumentsSource(nameof(StringSegmentedEncodedSizes))] + public int ParseBytes_ParseContext_MultipleSegments(int encodedSize) + { + InitializeParseContext(stringInputBuffersSegmented[encodedSize], out ParseContext ctx); + int sum = 0; + for (int i = 0; i < BytesToParse / encodedSize; i++) + { + sum += ctx.ReadBytes().Length; + } + return sum; + } + + private static void InitializeParseContext(byte[] buffer, out ParseContext ctx) + { + ParseContext.Initialize(new ReadOnlySequence(buffer), out ctx); + } + + private static void InitializeParseContext(ReadOnlySequence buffer, out ParseContext ctx) + { + ParseContext.Initialize(buffer, out ctx); + } + private static byte[] CreateBufferWithRandomVarints(Random random, int valueCount, int encodedSize, int paddingValueCount) { MemoryStream ms = new MemoryStream(); CodedOutputStream cos = new CodedOutputStream(ms); for (int i = 0; i < valueCount + paddingValueCount; i++) { - cos.WriteUInt64(RandomUnsignedVarint(random, encodedSize)); + cos.WriteUInt64(RandomUnsignedVarint(random, encodedSize, false)); } cos.Flush(); var buffer = ms.ToArray(); @@ -225,11 +426,11 @@ namespace Google.Protobuf.Benchmarks /// /// Generate a random value that will take exactly "encodedSize" bytes when varint-encoded. /// - private static ulong RandomUnsignedVarint(Random random, int encodedSize) + public static ulong RandomUnsignedVarint(Random random, int encodedSize, bool fitsIn32Bits) { Span randomBytesBuffer = stackalloc byte[8]; - if (encodedSize < 1 || encodedSize > 10) + if (encodedSize < 1 || encodedSize > 10 || (fitsIn32Bits && encodedSize > 5)) { throw new ArgumentException("Illegal encodedSize value requested", nameof(encodedSize)); } @@ -245,6 +446,12 @@ namespace Google.Protobuf.Benchmarks ulong bitmask = encodedSize < 10 ? ((1UL << (encodedSize * bitsPerByte)) - 1) : ulong.MaxValue; result = randomValue & bitmask; + if (fitsIn32Bits) + { + // make sure the resulting value is representable by a uint. + result &= uint.MaxValue; + } + if (encodedSize == 10) { // for 10-byte values the highest bit always needs to be set (7*9=63) @@ -261,5 +468,69 @@ namespace Google.Protobuf.Benchmarks } return result; } + + private static byte[] CreateBufferWithStrings(int valueCount, int encodedSize, int paddingValueCount) + { + var str = CreateStringWithEncodedSize(encodedSize); + + MemoryStream ms = new MemoryStream(); + CodedOutputStream cos = new CodedOutputStream(ms); + for (int i = 0; i < valueCount + paddingValueCount; i++) + { + cos.WriteString(str); + } + cos.Flush(); + var buffer = ms.ToArray(); + + if (buffer.Length != encodedSize * (valueCount + paddingValueCount)) + { + throw new InvalidOperationException($"Unexpected output buffer length {buffer.Length}"); + } + return buffer; + } + + public static string CreateStringWithEncodedSize(int encodedSize) + { + var str = new string('a', encodedSize); + while (CodedOutputStream.ComputeStringSize(str) > encodedSize) + { + str = str.Substring(1); + } + + if (CodedOutputStream.ComputeStringSize(str) != encodedSize) + { + throw new InvalidOperationException($"Generated string with wrong encodedSize"); + } + return str; + } + + public static string CreateNonAsciiStringWithEncodedSize(int encodedSize) + { + if (encodedSize < 3) + { + throw new ArgumentException("Illegal encoded size for a string with non-ascii chars."); + } + var twoByteChar = '\u00DC'; // U-umlaut, UTF8 encoding has 2 bytes + var str = new string(twoByteChar, encodedSize / 2); + while (CodedOutputStream.ComputeStringSize(str) > encodedSize) + { + str = str.Substring(1); + } + + // add padding of ascii characters to reach the desired encoded size. + while (CodedOutputStream.ComputeStringSize(str) < encodedSize) + { + str += 'a'; + } + + // Note that for a few specific encodedSize values, it might be impossible to generate + // the string with the desired encodedSize using the algorithm above. For testing purposes, checking that + // the encoded size we got is actually correct is good enough. + if (CodedOutputStream.ComputeStringSize(str) != encodedSize) + { + throw new InvalidOperationException($"Generated string with wrong encodedSize"); + } + return str; + } } } diff --git a/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs b/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs index 0cc86e2ad4..df427e8023 100644 --- a/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs +++ b/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs @@ -237,23 +237,31 @@ namespace Google.Protobuf.Benchmarks { /// a message that has a large number of wrapper fields /// obfuscated version of an internal message /// - public sealed partial class ManyWrapperFieldsMessage : pb::IMessage { + public sealed partial class ManyWrapperFieldsMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyWrapperFieldsMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Benchmarks.WrapperBenchmarkMessagesReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ManyWrapperFieldsMessage() { OnConstruction(); } @@ -261,6 +269,7 @@ namespace Google.Protobuf.Benchmarks { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ManyWrapperFieldsMessage(ManyWrapperFieldsMessage other) : this() { DoubleField95 = other.DoubleField95; DoubleField1 = other.DoubleField1; @@ -377,6 +386,7 @@ namespace Google.Protobuf.Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ManyWrapperFieldsMessage Clone() { return new ManyWrapperFieldsMessage(this); } @@ -386,6 +396,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField95_codec = pb::FieldCodec.ForStructWrapper(762); private double? doubleField95_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField95 { get { return doubleField95_; } set { @@ -399,6 +410,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField1_codec = pb::FieldCodec.ForStructWrapper(10); private double? doubleField1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField1 { get { return doubleField1_; } set { @@ -412,6 +424,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField79_codec = pb::FieldCodec.ForStructWrapper(634); private double? doubleField79_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField79 { get { return doubleField79_; } set { @@ -425,6 +438,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field2_codec = pb::FieldCodec.ForStructWrapper(18); private long? int64Field2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field2 { get { return int64Field2_; } set { @@ -438,6 +452,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField96_codec = pb::FieldCodec.ForStructWrapper(770); private double? doubleField96_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField96 { get { return doubleField96_; } set { @@ -451,6 +466,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field3_codec = pb::FieldCodec.ForStructWrapper(26); private long? int64Field3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field3 { get { return int64Field3_; } set { @@ -464,6 +480,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field4_codec = pb::FieldCodec.ForStructWrapper(34); private long? int64Field4_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field4 { get { return int64Field4_; } set { @@ -477,6 +494,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField97_codec = pb::FieldCodec.ForStructWrapper(778); private double? doubleField97_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField97 { get { return doubleField97_; } set { @@ -490,6 +508,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField65_codec = pb::FieldCodec.ForStructWrapper(522); private double? doubleField65_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField65 { get { return doubleField65_; } set { @@ -503,6 +522,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField66_codec = pb::FieldCodec.ForStructWrapper(530); private double? doubleField66_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField66 { get { return doubleField66_; } set { @@ -516,6 +536,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField7_codec = pb::FieldCodec.ForStructWrapper(58); private double? doubleField7_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField7 { get { return doubleField7_; } set { @@ -529,6 +550,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField62_codec = pb::FieldCodec.ForStructWrapper(498); private double? doubleField62_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField62 { get { return doubleField62_; } set { @@ -542,6 +564,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField118_codec = pb::FieldCodec.ForStructWrapper(946); private double? doubleField118_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField118 { get { return doubleField118_; } set { @@ -555,6 +578,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField119_codec = pb::FieldCodec.ForStructWrapper(954); private double? doubleField119_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField119 { get { return doubleField119_; } set { @@ -568,6 +592,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField67_codec = pb::FieldCodec.ForStructWrapper(538); private double? doubleField67_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField67 { get { return doubleField67_; } set { @@ -581,6 +606,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField120_codec = pb::FieldCodec.ForStructWrapper(962); private double? doubleField120_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField120 { get { return doubleField120_; } set { @@ -594,6 +620,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField121_codec = pb::FieldCodec.ForStructWrapper(970); private double? doubleField121_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField121 { get { return doubleField121_; } set { @@ -607,6 +634,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField122_codec = pb::FieldCodec.ForStructWrapper(978); private double? doubleField122_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField122 { get { return doubleField122_; } set { @@ -620,6 +648,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField123_codec = pb::FieldCodec.ForStructWrapper(986); private double? doubleField123_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField123 { get { return doubleField123_; } set { @@ -633,6 +662,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField124_codec = pb::FieldCodec.ForStructWrapper(994); private double? doubleField124_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField124 { get { return doubleField124_; } set { @@ -646,6 +676,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField8_codec = pb::FieldCodec.ForStructWrapper(66); private double? doubleField8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField8 { get { return doubleField8_; } set { @@ -659,6 +690,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField9_codec = pb::FieldCodec.ForStructWrapper(74); private double? doubleField9_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField9 { get { return doubleField9_; } set { @@ -672,6 +704,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField98_codec = pb::FieldCodec.ForStructWrapper(786); private double? doubleField98_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField98 { get { return doubleField98_; } set { @@ -685,6 +718,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField10_codec = pb::FieldCodec.ForStructWrapper(82); private double? doubleField10_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField10 { get { return doubleField10_; } set { @@ -698,6 +732,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField11_codec = pb::FieldCodec.ForStructWrapper(90); private double? doubleField11_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField11 { get { return doubleField11_; } set { @@ -711,6 +746,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField99_codec = pb::FieldCodec.ForStructWrapper(794); private double? doubleField99_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField99 { get { return doubleField99_; } set { @@ -724,6 +760,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField84_codec = pb::FieldCodec.ForStructWrapper(674); private double? doubleField84_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField84 { get { return doubleField84_; } set { @@ -737,6 +774,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField14_codec = pb::FieldCodec.ForStructWrapper(114); private double? doubleField14_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField14 { get { return doubleField14_; } set { @@ -750,6 +788,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField77_codec = pb::FieldCodec.ForStructWrapper(618); private double? doubleField77_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField77 { get { return doubleField77_; } set { @@ -763,6 +802,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField15_codec = pb::FieldCodec.ForStructWrapper(122); private double? doubleField15_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField15 { get { return doubleField15_; } set { @@ -776,6 +816,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field19_codec = pb::FieldCodec.ForStructWrapper(154); private long? int64Field19_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field19 { get { return int64Field19_; } set { @@ -789,6 +830,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field115_codec = pb::FieldCodec.ForStructWrapper(922); private long? int64Field115_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field115 { get { return int64Field115_; } set { @@ -802,6 +844,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField116_codec = pb::FieldCodec.ForStructWrapper(930); private double? doubleField116_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField116 { get { return doubleField116_; } set { @@ -815,6 +858,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field117_codec = pb::FieldCodec.ForStructWrapper(938); private long? int64Field117_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field117 { get { return int64Field117_; } set { @@ -828,6 +872,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField20_codec = pb::FieldCodec.ForStructWrapper(162); private double? doubleField20_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField20 { get { return doubleField20_; } set { @@ -841,6 +886,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField21_codec = pb::FieldCodec.ForStructWrapper(170); private double? doubleField21_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField21 { get { return doubleField21_; } set { @@ -854,6 +900,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_stringField73_codec = pb::FieldCodec.ForClassWrapper(586); private string stringField73_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField73 { get { return stringField73_; } set { @@ -867,6 +914,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_stringField74_codec = pb::FieldCodec.ForClassWrapper(594); private string stringField74_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField74 { get { return stringField74_; } set { @@ -880,6 +928,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField22_codec = pb::FieldCodec.ForStructWrapper(178); private double? doubleField22_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField22 { get { return doubleField22_; } set { @@ -893,6 +942,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField69_codec = pb::FieldCodec.ForStructWrapper(554); private double? doubleField69_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField69 { get { return doubleField69_; } set { @@ -906,6 +956,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField70_codec = pb::FieldCodec.ForStructWrapper(562); private double? doubleField70_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField70 { get { return doubleField70_; } set { @@ -919,6 +970,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField71_codec = pb::FieldCodec.ForStructWrapper(570); private double? doubleField71_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField71 { get { return doubleField71_; } set { @@ -932,6 +984,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField72_codec = pb::FieldCodec.ForStructWrapper(578); private double? doubleField72_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField72 { get { return doubleField72_; } set { @@ -945,6 +998,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField25_codec = pb::FieldCodec.ForStructWrapper(202); private double? doubleField25_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField25 { get { return doubleField25_; } set { @@ -958,6 +1012,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field26_codec = pb::FieldCodec.ForStructWrapper(210); private long? int64Field26_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field26 { get { return int64Field26_; } set { @@ -971,6 +1026,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField68_codec = pb::FieldCodec.ForStructWrapper(546); private double? doubleField68_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField68 { get { return doubleField68_; } set { @@ -984,6 +1040,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField28_codec = pb::FieldCodec.ForStructWrapper(226); private double? doubleField28_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField28 { get { return doubleField28_; } set { @@ -997,6 +1054,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField106_codec = pb::FieldCodec.ForStructWrapper(850); private double? doubleField106_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField106 { get { return doubleField106_; } set { @@ -1010,6 +1068,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField29_codec = pb::FieldCodec.ForStructWrapper(234); private double? doubleField29_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField29 { get { return doubleField29_; } set { @@ -1023,6 +1082,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField30_codec = pb::FieldCodec.ForStructWrapper(242); private double? doubleField30_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField30 { get { return doubleField30_; } set { @@ -1036,6 +1096,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField101_codec = pb::FieldCodec.ForStructWrapper(810); private double? doubleField101_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField101 { get { return doubleField101_; } set { @@ -1049,6 +1110,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField102_codec = pb::FieldCodec.ForStructWrapper(818); private double? doubleField102_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField102 { get { return doubleField102_; } set { @@ -1062,6 +1124,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField103_codec = pb::FieldCodec.ForStructWrapper(826); private double? doubleField103_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField103 { get { return doubleField103_; } set { @@ -1075,6 +1138,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField104_codec = pb::FieldCodec.ForStructWrapper(834); private double? doubleField104_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField104 { get { return doubleField104_; } set { @@ -1088,6 +1152,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField105_codec = pb::FieldCodec.ForStructWrapper(842); private double? doubleField105_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField105 { get { return doubleField105_; } set { @@ -1101,6 +1166,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField31_codec = pb::FieldCodec.ForStructWrapper(250); private double? doubleField31_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField31 { get { return doubleField31_; } set { @@ -1114,6 +1180,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field32_codec = pb::FieldCodec.ForStructWrapper(258); private long? int64Field32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field32 { get { return int64Field32_; } set { @@ -1127,6 +1194,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField75_codec = pb::FieldCodec.ForStructWrapper(602); private double? doubleField75_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField75 { get { return doubleField75_; } set { @@ -1140,6 +1208,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField129_codec = pb::FieldCodec.ForStructWrapper(1034); private double? doubleField129_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField129 { get { return doubleField129_; } set { @@ -1152,6 +1221,7 @@ namespace Google.Protobuf.Benchmarks { public const int EnumField80FieldNumber = 80; private int enumField80_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int EnumField80 { get { return enumField80_; } set { @@ -1163,6 +1233,7 @@ namespace Google.Protobuf.Benchmarks { public const int EnumField81FieldNumber = 81; private int enumField81_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int EnumField81 { get { return enumField81_; } set { @@ -1175,6 +1246,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field82_codec = pb::FieldCodec.ForStructWrapper(658); private long? int64Field82_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field82 { get { return int64Field82_; } set { @@ -1187,6 +1259,7 @@ namespace Google.Protobuf.Benchmarks { public const int EnumField83FieldNumber = 83; private int enumField83_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int EnumField83 { get { return enumField83_; } set { @@ -1199,6 +1272,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field85_codec = pb::FieldCodec.ForStructWrapper(682); private long? int64Field85_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field85 { get { return int64Field85_; } set { @@ -1212,6 +1286,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field86_codec = pb::FieldCodec.ForStructWrapper(690); private long? int64Field86_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field86 { get { return int64Field86_; } set { @@ -1225,6 +1300,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field87_codec = pb::FieldCodec.ForStructWrapper(698); private long? int64Field87_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field87 { get { return int64Field87_; } set { @@ -1238,6 +1314,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field125_codec = pb::FieldCodec.ForStructWrapper(1002); private long? int64Field125_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field125 { get { return int64Field125_; } set { @@ -1251,6 +1328,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field37_codec = pb::FieldCodec.ForStructWrapper(298); private long? int64Field37_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field37 { get { return int64Field37_; } set { @@ -1264,6 +1342,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField38_codec = pb::FieldCodec.ForStructWrapper(306); private double? doubleField38_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField38 { get { return doubleField38_; } set { @@ -1277,6 +1356,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_interactions_codec = pb::FieldCodec.ForStructWrapper(314); private long? interactions_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Interactions { get { return interactions_; } set { @@ -1291,6 +1371,7 @@ namespace Google.Protobuf.Benchmarks { = pb::FieldCodec.ForInt32(802); private readonly pbc::RepeatedField repeatedIntField100_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedIntField100 { get { return repeatedIntField100_; } } @@ -1300,6 +1381,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField40_codec = pb::FieldCodec.ForStructWrapper(322); private double? doubleField40_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField40 { get { return doubleField40_; } set { @@ -1313,6 +1395,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field41_codec = pb::FieldCodec.ForStructWrapper(330); private long? int64Field41_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field41 { get { return int64Field41_; } set { @@ -1326,6 +1409,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field126_codec = pb::FieldCodec.ForStructWrapper(1010); private long? int64Field126_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field126 { get { return int64Field126_; } set { @@ -1339,6 +1423,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field127_codec = pb::FieldCodec.ForStructWrapper(1018); private long? int64Field127_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field127 { get { return int64Field127_; } set { @@ -1352,6 +1437,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField128_codec = pb::FieldCodec.ForStructWrapper(1026); private double? doubleField128_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField128 { get { return doubleField128_; } set { @@ -1365,6 +1451,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField109_codec = pb::FieldCodec.ForStructWrapper(874); private double? doubleField109_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField109 { get { return doubleField109_; } set { @@ -1378,6 +1465,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field110_codec = pb::FieldCodec.ForStructWrapper(882); private long? int64Field110_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field110 { get { return int64Field110_; } set { @@ -1391,6 +1479,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField111_codec = pb::FieldCodec.ForStructWrapper(890); private double? doubleField111_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField111 { get { return doubleField111_; } set { @@ -1404,6 +1493,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field112_codec = pb::FieldCodec.ForStructWrapper(898); private long? int64Field112_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field112 { get { return int64Field112_; } set { @@ -1417,6 +1507,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField113_codec = pb::FieldCodec.ForStructWrapper(906); private double? doubleField113_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField113 { get { return doubleField113_; } set { @@ -1430,6 +1521,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field114_codec = pb::FieldCodec.ForStructWrapper(914); private long? int64Field114_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field114 { get { return int64Field114_; } set { @@ -1443,6 +1535,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField42_codec = pb::FieldCodec.ForStructWrapper(338); private double? doubleField42_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField42 { get { return doubleField42_; } set { @@ -1456,6 +1549,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field43_codec = pb::FieldCodec.ForStructWrapper(346); private long? int64Field43_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field43 { get { return int64Field43_; } set { @@ -1469,6 +1563,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field44_codec = pb::FieldCodec.ForStructWrapper(354); private long? int64Field44_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field44 { get { return int64Field44_; } set { @@ -1482,6 +1577,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField45_codec = pb::FieldCodec.ForStructWrapper(362); private double? doubleField45_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField45 { get { return doubleField45_; } set { @@ -1495,6 +1591,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField46_codec = pb::FieldCodec.ForStructWrapper(370); private double? doubleField46_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField46 { get { return doubleField46_; } set { @@ -1508,6 +1605,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField78_codec = pb::FieldCodec.ForStructWrapper(626); private double? doubleField78_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField78 { get { return doubleField78_; } set { @@ -1521,6 +1619,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField88_codec = pb::FieldCodec.ForStructWrapper(706); private double? doubleField88_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField88 { get { return doubleField88_; } set { @@ -1534,6 +1633,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField47_codec = pb::FieldCodec.ForStructWrapper(378); private double? doubleField47_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField47 { get { return doubleField47_; } set { @@ -1547,6 +1647,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField89_codec = pb::FieldCodec.ForStructWrapper(714); private double? doubleField89_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField89 { get { return doubleField89_; } set { @@ -1560,6 +1661,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField48_codec = pb::FieldCodec.ForStructWrapper(386); private double? doubleField48_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField48 { get { return doubleField48_; } set { @@ -1573,6 +1675,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField49_codec = pb::FieldCodec.ForStructWrapper(394); private double? doubleField49_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField49 { get { return doubleField49_; } set { @@ -1586,6 +1689,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField50_codec = pb::FieldCodec.ForStructWrapper(402); private double? doubleField50_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField50 { get { return doubleField50_; } set { @@ -1599,6 +1703,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField90_codec = pb::FieldCodec.ForStructWrapper(722); private double? doubleField90_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField90 { get { return doubleField90_; } set { @@ -1612,6 +1717,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField51_codec = pb::FieldCodec.ForStructWrapper(410); private double? doubleField51_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField51 { get { return doubleField51_; } set { @@ -1625,6 +1731,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField91_codec = pb::FieldCodec.ForStructWrapper(730); private double? doubleField91_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField91 { get { return doubleField91_; } set { @@ -1638,6 +1745,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField92_codec = pb::FieldCodec.ForStructWrapper(738); private double? doubleField92_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField92 { get { return doubleField92_; } set { @@ -1651,6 +1759,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field107_codec = pb::FieldCodec.ForStructWrapper(858); private long? int64Field107_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field107 { get { return int64Field107_; } set { @@ -1664,6 +1773,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField93_codec = pb::FieldCodec.ForStructWrapper(746); private double? doubleField93_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField93 { get { return doubleField93_; } set { @@ -1677,6 +1787,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField108_codec = pb::FieldCodec.ForStructWrapper(866); private double? doubleField108_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField108 { get { return doubleField108_; } set { @@ -1690,6 +1801,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField52_codec = pb::FieldCodec.ForStructWrapper(418); private double? doubleField52_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField52 { get { return doubleField52_; } set { @@ -1703,6 +1815,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField53_codec = pb::FieldCodec.ForStructWrapper(426); private double? doubleField53_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField53 { get { return doubleField53_; } set { @@ -1716,6 +1829,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField94_codec = pb::FieldCodec.ForStructWrapper(754); private double? doubleField94_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField94 { get { return doubleField94_; } set { @@ -1729,6 +1843,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField54_codec = pb::FieldCodec.ForStructWrapper(434); private double? doubleField54_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField54 { get { return doubleField54_; } set { @@ -1742,6 +1857,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField55_codec = pb::FieldCodec.ForStructWrapper(442); private double? doubleField55_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField55 { get { return doubleField55_; } set { @@ -1755,6 +1871,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField56_codec = pb::FieldCodec.ForStructWrapper(450); private double? doubleField56_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField56 { get { return doubleField56_; } set { @@ -1768,6 +1885,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField57_codec = pb::FieldCodec.ForStructWrapper(458); private double? doubleField57_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField57 { get { return doubleField57_; } set { @@ -1781,6 +1899,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_doubleField58_codec = pb::FieldCodec.ForStructWrapper(466); private double? doubleField58_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField58 { get { return doubleField58_; } set { @@ -1794,6 +1913,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field59_codec = pb::FieldCodec.ForStructWrapper(474); private long? int64Field59_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field59 { get { return int64Field59_; } set { @@ -1807,6 +1927,7 @@ namespace Google.Protobuf.Benchmarks { private static readonly pb::FieldCodec _single_int64Field60_codec = pb::FieldCodec.ForStructWrapper(482); private long? int64Field60_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field60 { get { return int64Field60_; } set { @@ -1816,11 +1937,13 @@ namespace Google.Protobuf.Benchmarks { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ManyWrapperFieldsMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ManyWrapperFieldsMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -1943,6 +2066,7 @@ namespace Google.Protobuf.Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (doubleField95_ != null) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode(DoubleField95); @@ -2063,12 +2187,17 @@ namespace Google.Protobuf.Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (doubleField1_ != null) { _single_doubleField1_codec.WriteTagAndValue(output, DoubleField1); } @@ -2406,9 +2535,355 @@ namespace Google.Protobuf.Benchmarks { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (doubleField1_ != null) { + _single_doubleField1_codec.WriteTagAndValue(ref output, DoubleField1); + } + if (int64Field2_ != null) { + _single_int64Field2_codec.WriteTagAndValue(ref output, Int64Field2); + } + if (int64Field3_ != null) { + _single_int64Field3_codec.WriteTagAndValue(ref output, Int64Field3); + } + if (int64Field4_ != null) { + _single_int64Field4_codec.WriteTagAndValue(ref output, Int64Field4); + } + if (doubleField7_ != null) { + _single_doubleField7_codec.WriteTagAndValue(ref output, DoubleField7); + } + if (doubleField8_ != null) { + _single_doubleField8_codec.WriteTagAndValue(ref output, DoubleField8); + } + if (doubleField9_ != null) { + _single_doubleField9_codec.WriteTagAndValue(ref output, DoubleField9); + } + if (doubleField10_ != null) { + _single_doubleField10_codec.WriteTagAndValue(ref output, DoubleField10); + } + if (doubleField11_ != null) { + _single_doubleField11_codec.WriteTagAndValue(ref output, DoubleField11); + } + if (doubleField14_ != null) { + _single_doubleField14_codec.WriteTagAndValue(ref output, DoubleField14); + } + if (doubleField15_ != null) { + _single_doubleField15_codec.WriteTagAndValue(ref output, DoubleField15); + } + if (int64Field19_ != null) { + _single_int64Field19_codec.WriteTagAndValue(ref output, Int64Field19); + } + if (doubleField20_ != null) { + _single_doubleField20_codec.WriteTagAndValue(ref output, DoubleField20); + } + if (doubleField21_ != null) { + _single_doubleField21_codec.WriteTagAndValue(ref output, DoubleField21); + } + if (doubleField22_ != null) { + _single_doubleField22_codec.WriteTagAndValue(ref output, DoubleField22); + } + if (doubleField25_ != null) { + _single_doubleField25_codec.WriteTagAndValue(ref output, DoubleField25); + } + if (int64Field26_ != null) { + _single_int64Field26_codec.WriteTagAndValue(ref output, Int64Field26); + } + if (doubleField28_ != null) { + _single_doubleField28_codec.WriteTagAndValue(ref output, DoubleField28); + } + if (doubleField29_ != null) { + _single_doubleField29_codec.WriteTagAndValue(ref output, DoubleField29); + } + if (doubleField30_ != null) { + _single_doubleField30_codec.WriteTagAndValue(ref output, DoubleField30); + } + if (doubleField31_ != null) { + _single_doubleField31_codec.WriteTagAndValue(ref output, DoubleField31); + } + if (int64Field32_ != null) { + _single_int64Field32_codec.WriteTagAndValue(ref output, Int64Field32); + } + if (int64Field37_ != null) { + _single_int64Field37_codec.WriteTagAndValue(ref output, Int64Field37); + } + if (doubleField38_ != null) { + _single_doubleField38_codec.WriteTagAndValue(ref output, DoubleField38); + } + if (interactions_ != null) { + _single_interactions_codec.WriteTagAndValue(ref output, Interactions); + } + if (doubleField40_ != null) { + _single_doubleField40_codec.WriteTagAndValue(ref output, DoubleField40); + } + if (int64Field41_ != null) { + _single_int64Field41_codec.WriteTagAndValue(ref output, Int64Field41); + } + if (doubleField42_ != null) { + _single_doubleField42_codec.WriteTagAndValue(ref output, DoubleField42); + } + if (int64Field43_ != null) { + _single_int64Field43_codec.WriteTagAndValue(ref output, Int64Field43); + } + if (int64Field44_ != null) { + _single_int64Field44_codec.WriteTagAndValue(ref output, Int64Field44); + } + if (doubleField45_ != null) { + _single_doubleField45_codec.WriteTagAndValue(ref output, DoubleField45); + } + if (doubleField46_ != null) { + _single_doubleField46_codec.WriteTagAndValue(ref output, DoubleField46); + } + if (doubleField47_ != null) { + _single_doubleField47_codec.WriteTagAndValue(ref output, DoubleField47); + } + if (doubleField48_ != null) { + _single_doubleField48_codec.WriteTagAndValue(ref output, DoubleField48); + } + if (doubleField49_ != null) { + _single_doubleField49_codec.WriteTagAndValue(ref output, DoubleField49); + } + if (doubleField50_ != null) { + _single_doubleField50_codec.WriteTagAndValue(ref output, DoubleField50); + } + if (doubleField51_ != null) { + _single_doubleField51_codec.WriteTagAndValue(ref output, DoubleField51); + } + if (doubleField52_ != null) { + _single_doubleField52_codec.WriteTagAndValue(ref output, DoubleField52); + } + if (doubleField53_ != null) { + _single_doubleField53_codec.WriteTagAndValue(ref output, DoubleField53); + } + if (doubleField54_ != null) { + _single_doubleField54_codec.WriteTagAndValue(ref output, DoubleField54); + } + if (doubleField55_ != null) { + _single_doubleField55_codec.WriteTagAndValue(ref output, DoubleField55); + } + if (doubleField56_ != null) { + _single_doubleField56_codec.WriteTagAndValue(ref output, DoubleField56); + } + if (doubleField57_ != null) { + _single_doubleField57_codec.WriteTagAndValue(ref output, DoubleField57); + } + if (doubleField58_ != null) { + _single_doubleField58_codec.WriteTagAndValue(ref output, DoubleField58); + } + if (int64Field59_ != null) { + _single_int64Field59_codec.WriteTagAndValue(ref output, Int64Field59); + } + if (int64Field60_ != null) { + _single_int64Field60_codec.WriteTagAndValue(ref output, Int64Field60); + } + if (doubleField62_ != null) { + _single_doubleField62_codec.WriteTagAndValue(ref output, DoubleField62); + } + if (doubleField65_ != null) { + _single_doubleField65_codec.WriteTagAndValue(ref output, DoubleField65); + } + if (doubleField66_ != null) { + _single_doubleField66_codec.WriteTagAndValue(ref output, DoubleField66); + } + if (doubleField67_ != null) { + _single_doubleField67_codec.WriteTagAndValue(ref output, DoubleField67); + } + if (doubleField68_ != null) { + _single_doubleField68_codec.WriteTagAndValue(ref output, DoubleField68); + } + if (doubleField69_ != null) { + _single_doubleField69_codec.WriteTagAndValue(ref output, DoubleField69); + } + if (doubleField70_ != null) { + _single_doubleField70_codec.WriteTagAndValue(ref output, DoubleField70); + } + if (doubleField71_ != null) { + _single_doubleField71_codec.WriteTagAndValue(ref output, DoubleField71); + } + if (doubleField72_ != null) { + _single_doubleField72_codec.WriteTagAndValue(ref output, DoubleField72); + } + if (stringField73_ != null) { + _single_stringField73_codec.WriteTagAndValue(ref output, StringField73); + } + if (stringField74_ != null) { + _single_stringField74_codec.WriteTagAndValue(ref output, StringField74); + } + if (doubleField75_ != null) { + _single_doubleField75_codec.WriteTagAndValue(ref output, DoubleField75); + } + if (doubleField77_ != null) { + _single_doubleField77_codec.WriteTagAndValue(ref output, DoubleField77); + } + if (doubleField78_ != null) { + _single_doubleField78_codec.WriteTagAndValue(ref output, DoubleField78); + } + if (doubleField79_ != null) { + _single_doubleField79_codec.WriteTagAndValue(ref output, DoubleField79); + } + if (EnumField80 != 0) { + output.WriteRawTag(128, 5); + output.WriteInt32(EnumField80); + } + if (EnumField81 != 0) { + output.WriteRawTag(136, 5); + output.WriteInt32(EnumField81); + } + if (int64Field82_ != null) { + _single_int64Field82_codec.WriteTagAndValue(ref output, Int64Field82); + } + if (EnumField83 != 0) { + output.WriteRawTag(152, 5); + output.WriteInt32(EnumField83); + } + if (doubleField84_ != null) { + _single_doubleField84_codec.WriteTagAndValue(ref output, DoubleField84); + } + if (int64Field85_ != null) { + _single_int64Field85_codec.WriteTagAndValue(ref output, Int64Field85); + } + if (int64Field86_ != null) { + _single_int64Field86_codec.WriteTagAndValue(ref output, Int64Field86); + } + if (int64Field87_ != null) { + _single_int64Field87_codec.WriteTagAndValue(ref output, Int64Field87); + } + if (doubleField88_ != null) { + _single_doubleField88_codec.WriteTagAndValue(ref output, DoubleField88); + } + if (doubleField89_ != null) { + _single_doubleField89_codec.WriteTagAndValue(ref output, DoubleField89); + } + if (doubleField90_ != null) { + _single_doubleField90_codec.WriteTagAndValue(ref output, DoubleField90); + } + if (doubleField91_ != null) { + _single_doubleField91_codec.WriteTagAndValue(ref output, DoubleField91); + } + if (doubleField92_ != null) { + _single_doubleField92_codec.WriteTagAndValue(ref output, DoubleField92); + } + if (doubleField93_ != null) { + _single_doubleField93_codec.WriteTagAndValue(ref output, DoubleField93); + } + if (doubleField94_ != null) { + _single_doubleField94_codec.WriteTagAndValue(ref output, DoubleField94); + } + if (doubleField95_ != null) { + _single_doubleField95_codec.WriteTagAndValue(ref output, DoubleField95); + } + if (doubleField96_ != null) { + _single_doubleField96_codec.WriteTagAndValue(ref output, DoubleField96); + } + if (doubleField97_ != null) { + _single_doubleField97_codec.WriteTagAndValue(ref output, DoubleField97); + } + if (doubleField98_ != null) { + _single_doubleField98_codec.WriteTagAndValue(ref output, DoubleField98); + } + if (doubleField99_ != null) { + _single_doubleField99_codec.WriteTagAndValue(ref output, DoubleField99); + } + repeatedIntField100_.WriteTo(ref output, _repeated_repeatedIntField100_codec); + if (doubleField101_ != null) { + _single_doubleField101_codec.WriteTagAndValue(ref output, DoubleField101); + } + if (doubleField102_ != null) { + _single_doubleField102_codec.WriteTagAndValue(ref output, DoubleField102); + } + if (doubleField103_ != null) { + _single_doubleField103_codec.WriteTagAndValue(ref output, DoubleField103); + } + if (doubleField104_ != null) { + _single_doubleField104_codec.WriteTagAndValue(ref output, DoubleField104); + } + if (doubleField105_ != null) { + _single_doubleField105_codec.WriteTagAndValue(ref output, DoubleField105); + } + if (doubleField106_ != null) { + _single_doubleField106_codec.WriteTagAndValue(ref output, DoubleField106); + } + if (int64Field107_ != null) { + _single_int64Field107_codec.WriteTagAndValue(ref output, Int64Field107); + } + if (doubleField108_ != null) { + _single_doubleField108_codec.WriteTagAndValue(ref output, DoubleField108); + } + if (doubleField109_ != null) { + _single_doubleField109_codec.WriteTagAndValue(ref output, DoubleField109); + } + if (int64Field110_ != null) { + _single_int64Field110_codec.WriteTagAndValue(ref output, Int64Field110); + } + if (doubleField111_ != null) { + _single_doubleField111_codec.WriteTagAndValue(ref output, DoubleField111); + } + if (int64Field112_ != null) { + _single_int64Field112_codec.WriteTagAndValue(ref output, Int64Field112); + } + if (doubleField113_ != null) { + _single_doubleField113_codec.WriteTagAndValue(ref output, DoubleField113); + } + if (int64Field114_ != null) { + _single_int64Field114_codec.WriteTagAndValue(ref output, Int64Field114); + } + if (int64Field115_ != null) { + _single_int64Field115_codec.WriteTagAndValue(ref output, Int64Field115); + } + if (doubleField116_ != null) { + _single_doubleField116_codec.WriteTagAndValue(ref output, DoubleField116); + } + if (int64Field117_ != null) { + _single_int64Field117_codec.WriteTagAndValue(ref output, Int64Field117); + } + if (doubleField118_ != null) { + _single_doubleField118_codec.WriteTagAndValue(ref output, DoubleField118); + } + if (doubleField119_ != null) { + _single_doubleField119_codec.WriteTagAndValue(ref output, DoubleField119); + } + if (doubleField120_ != null) { + _single_doubleField120_codec.WriteTagAndValue(ref output, DoubleField120); + } + if (doubleField121_ != null) { + _single_doubleField121_codec.WriteTagAndValue(ref output, DoubleField121); + } + if (doubleField122_ != null) { + _single_doubleField122_codec.WriteTagAndValue(ref output, DoubleField122); + } + if (doubleField123_ != null) { + _single_doubleField123_codec.WriteTagAndValue(ref output, DoubleField123); + } + if (doubleField124_ != null) { + _single_doubleField124_codec.WriteTagAndValue(ref output, DoubleField124); + } + if (int64Field125_ != null) { + _single_int64Field125_codec.WriteTagAndValue(ref output, Int64Field125); + } + if (int64Field126_ != null) { + _single_int64Field126_codec.WriteTagAndValue(ref output, Int64Field126); + } + if (int64Field127_ != null) { + _single_int64Field127_codec.WriteTagAndValue(ref output, Int64Field127); + } + if (doubleField128_ != null) { + _single_doubleField128_codec.WriteTagAndValue(ref output, DoubleField128); + } + if (doubleField129_ != null) { + _single_doubleField129_codec.WriteTagAndValue(ref output, DoubleField129); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (doubleField95_ != null) { @@ -2749,6 +3224,7 @@ namespace Google.Protobuf.Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ManyWrapperFieldsMessage other) { if (other == null) { return; @@ -3302,7 +3778,11 @@ namespace Google.Protobuf.Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4077,1632 +4557,2994 @@ namespace Google.Protobuf.Benchmarks { } } } + #endif } - } - - /// - /// same as ManyWrapperFieldsMessages, but with primitive fields - /// for comparison. - /// - public sealed partial class ManyPrimitiveFieldsMessage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyPrimitiveFieldsMessage()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Benchmarks.WrapperBenchmarkMessagesReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ManyPrimitiveFieldsMessage() { - OnConstruction(); - } - + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + double? value = _single_doubleField1_codec.Read(ref input); + if (doubleField1_ == null || value != 0D) { + DoubleField1 = value; + } + break; + } + case 18: { + long? value = _single_int64Field2_codec.Read(ref input); + if (int64Field2_ == null || value != 0L) { + Int64Field2 = value; + } + break; + } + case 26: { + long? value = _single_int64Field3_codec.Read(ref input); + if (int64Field3_ == null || value != 0L) { + Int64Field3 = value; + } + break; + } + case 34: { + long? value = _single_int64Field4_codec.Read(ref input); + if (int64Field4_ == null || value != 0L) { + Int64Field4 = value; + } + break; + } + case 58: { + double? value = _single_doubleField7_codec.Read(ref input); + if (doubleField7_ == null || value != 0D) { + DoubleField7 = value; + } + break; + } + case 66: { + double? value = _single_doubleField8_codec.Read(ref input); + if (doubleField8_ == null || value != 0D) { + DoubleField8 = value; + } + break; + } + case 74: { + double? value = _single_doubleField9_codec.Read(ref input); + if (doubleField9_ == null || value != 0D) { + DoubleField9 = value; + } + break; + } + case 82: { + double? value = _single_doubleField10_codec.Read(ref input); + if (doubleField10_ == null || value != 0D) { + DoubleField10 = value; + } + break; + } + case 90: { + double? value = _single_doubleField11_codec.Read(ref input); + if (doubleField11_ == null || value != 0D) { + DoubleField11 = value; + } + break; + } + case 114: { + double? value = _single_doubleField14_codec.Read(ref input); + if (doubleField14_ == null || value != 0D) { + DoubleField14 = value; + } + break; + } + case 122: { + double? value = _single_doubleField15_codec.Read(ref input); + if (doubleField15_ == null || value != 0D) { + DoubleField15 = value; + } + break; + } + case 154: { + long? value = _single_int64Field19_codec.Read(ref input); + if (int64Field19_ == null || value != 0L) { + Int64Field19 = value; + } + break; + } + case 162: { + double? value = _single_doubleField20_codec.Read(ref input); + if (doubleField20_ == null || value != 0D) { + DoubleField20 = value; + } + break; + } + case 170: { + double? value = _single_doubleField21_codec.Read(ref input); + if (doubleField21_ == null || value != 0D) { + DoubleField21 = value; + } + break; + } + case 178: { + double? value = _single_doubleField22_codec.Read(ref input); + if (doubleField22_ == null || value != 0D) { + DoubleField22 = value; + } + break; + } + case 202: { + double? value = _single_doubleField25_codec.Read(ref input); + if (doubleField25_ == null || value != 0D) { + DoubleField25 = value; + } + break; + } + case 210: { + long? value = _single_int64Field26_codec.Read(ref input); + if (int64Field26_ == null || value != 0L) { + Int64Field26 = value; + } + break; + } + case 226: { + double? value = _single_doubleField28_codec.Read(ref input); + if (doubleField28_ == null || value != 0D) { + DoubleField28 = value; + } + break; + } + case 234: { + double? value = _single_doubleField29_codec.Read(ref input); + if (doubleField29_ == null || value != 0D) { + DoubleField29 = value; + } + break; + } + case 242: { + double? value = _single_doubleField30_codec.Read(ref input); + if (doubleField30_ == null || value != 0D) { + DoubleField30 = value; + } + break; + } + case 250: { + double? value = _single_doubleField31_codec.Read(ref input); + if (doubleField31_ == null || value != 0D) { + DoubleField31 = value; + } + break; + } + case 258: { + long? value = _single_int64Field32_codec.Read(ref input); + if (int64Field32_ == null || value != 0L) { + Int64Field32 = value; + } + break; + } + case 298: { + long? value = _single_int64Field37_codec.Read(ref input); + if (int64Field37_ == null || value != 0L) { + Int64Field37 = value; + } + break; + } + case 306: { + double? value = _single_doubleField38_codec.Read(ref input); + if (doubleField38_ == null || value != 0D) { + DoubleField38 = value; + } + break; + } + case 314: { + long? value = _single_interactions_codec.Read(ref input); + if (interactions_ == null || value != 0L) { + Interactions = value; + } + break; + } + case 322: { + double? value = _single_doubleField40_codec.Read(ref input); + if (doubleField40_ == null || value != 0D) { + DoubleField40 = value; + } + break; + } + case 330: { + long? value = _single_int64Field41_codec.Read(ref input); + if (int64Field41_ == null || value != 0L) { + Int64Field41 = value; + } + break; + } + case 338: { + double? value = _single_doubleField42_codec.Read(ref input); + if (doubleField42_ == null || value != 0D) { + DoubleField42 = value; + } + break; + } + case 346: { + long? value = _single_int64Field43_codec.Read(ref input); + if (int64Field43_ == null || value != 0L) { + Int64Field43 = value; + } + break; + } + case 354: { + long? value = _single_int64Field44_codec.Read(ref input); + if (int64Field44_ == null || value != 0L) { + Int64Field44 = value; + } + break; + } + case 362: { + double? value = _single_doubleField45_codec.Read(ref input); + if (doubleField45_ == null || value != 0D) { + DoubleField45 = value; + } + break; + } + case 370: { + double? value = _single_doubleField46_codec.Read(ref input); + if (doubleField46_ == null || value != 0D) { + DoubleField46 = value; + } + break; + } + case 378: { + double? value = _single_doubleField47_codec.Read(ref input); + if (doubleField47_ == null || value != 0D) { + DoubleField47 = value; + } + break; + } + case 386: { + double? value = _single_doubleField48_codec.Read(ref input); + if (doubleField48_ == null || value != 0D) { + DoubleField48 = value; + } + break; + } + case 394: { + double? value = _single_doubleField49_codec.Read(ref input); + if (doubleField49_ == null || value != 0D) { + DoubleField49 = value; + } + break; + } + case 402: { + double? value = _single_doubleField50_codec.Read(ref input); + if (doubleField50_ == null || value != 0D) { + DoubleField50 = value; + } + break; + } + case 410: { + double? value = _single_doubleField51_codec.Read(ref input); + if (doubleField51_ == null || value != 0D) { + DoubleField51 = value; + } + break; + } + case 418: { + double? value = _single_doubleField52_codec.Read(ref input); + if (doubleField52_ == null || value != 0D) { + DoubleField52 = value; + } + break; + } + case 426: { + double? value = _single_doubleField53_codec.Read(ref input); + if (doubleField53_ == null || value != 0D) { + DoubleField53 = value; + } + break; + } + case 434: { + double? value = _single_doubleField54_codec.Read(ref input); + if (doubleField54_ == null || value != 0D) { + DoubleField54 = value; + } + break; + } + case 442: { + double? value = _single_doubleField55_codec.Read(ref input); + if (doubleField55_ == null || value != 0D) { + DoubleField55 = value; + } + break; + } + case 450: { + double? value = _single_doubleField56_codec.Read(ref input); + if (doubleField56_ == null || value != 0D) { + DoubleField56 = value; + } + break; + } + case 458: { + double? value = _single_doubleField57_codec.Read(ref input); + if (doubleField57_ == null || value != 0D) { + DoubleField57 = value; + } + break; + } + case 466: { + double? value = _single_doubleField58_codec.Read(ref input); + if (doubleField58_ == null || value != 0D) { + DoubleField58 = value; + } + break; + } + case 474: { + long? value = _single_int64Field59_codec.Read(ref input); + if (int64Field59_ == null || value != 0L) { + Int64Field59 = value; + } + break; + } + case 482: { + long? value = _single_int64Field60_codec.Read(ref input); + if (int64Field60_ == null || value != 0L) { + Int64Field60 = value; + } + break; + } + case 498: { + double? value = _single_doubleField62_codec.Read(ref input); + if (doubleField62_ == null || value != 0D) { + DoubleField62 = value; + } + break; + } + case 522: { + double? value = _single_doubleField65_codec.Read(ref input); + if (doubleField65_ == null || value != 0D) { + DoubleField65 = value; + } + break; + } + case 530: { + double? value = _single_doubleField66_codec.Read(ref input); + if (doubleField66_ == null || value != 0D) { + DoubleField66 = value; + } + break; + } + case 538: { + double? value = _single_doubleField67_codec.Read(ref input); + if (doubleField67_ == null || value != 0D) { + DoubleField67 = value; + } + break; + } + case 546: { + double? value = _single_doubleField68_codec.Read(ref input); + if (doubleField68_ == null || value != 0D) { + DoubleField68 = value; + } + break; + } + case 554: { + double? value = _single_doubleField69_codec.Read(ref input); + if (doubleField69_ == null || value != 0D) { + DoubleField69 = value; + } + break; + } + case 562: { + double? value = _single_doubleField70_codec.Read(ref input); + if (doubleField70_ == null || value != 0D) { + DoubleField70 = value; + } + break; + } + case 570: { + double? value = _single_doubleField71_codec.Read(ref input); + if (doubleField71_ == null || value != 0D) { + DoubleField71 = value; + } + break; + } + case 578: { + double? value = _single_doubleField72_codec.Read(ref input); + if (doubleField72_ == null || value != 0D) { + DoubleField72 = value; + } + break; + } + case 586: { + string value = _single_stringField73_codec.Read(ref input); + if (stringField73_ == null || value != "") { + StringField73 = value; + } + break; + } + case 594: { + string value = _single_stringField74_codec.Read(ref input); + if (stringField74_ == null || value != "") { + StringField74 = value; + } + break; + } + case 602: { + double? value = _single_doubleField75_codec.Read(ref input); + if (doubleField75_ == null || value != 0D) { + DoubleField75 = value; + } + break; + } + case 618: { + double? value = _single_doubleField77_codec.Read(ref input); + if (doubleField77_ == null || value != 0D) { + DoubleField77 = value; + } + break; + } + case 626: { + double? value = _single_doubleField78_codec.Read(ref input); + if (doubleField78_ == null || value != 0D) { + DoubleField78 = value; + } + break; + } + case 634: { + double? value = _single_doubleField79_codec.Read(ref input); + if (doubleField79_ == null || value != 0D) { + DoubleField79 = value; + } + break; + } + case 640: { + EnumField80 = input.ReadInt32(); + break; + } + case 648: { + EnumField81 = input.ReadInt32(); + break; + } + case 658: { + long? value = _single_int64Field82_codec.Read(ref input); + if (int64Field82_ == null || value != 0L) { + Int64Field82 = value; + } + break; + } + case 664: { + EnumField83 = input.ReadInt32(); + break; + } + case 674: { + double? value = _single_doubleField84_codec.Read(ref input); + if (doubleField84_ == null || value != 0D) { + DoubleField84 = value; + } + break; + } + case 682: { + long? value = _single_int64Field85_codec.Read(ref input); + if (int64Field85_ == null || value != 0L) { + Int64Field85 = value; + } + break; + } + case 690: { + long? value = _single_int64Field86_codec.Read(ref input); + if (int64Field86_ == null || value != 0L) { + Int64Field86 = value; + } + break; + } + case 698: { + long? value = _single_int64Field87_codec.Read(ref input); + if (int64Field87_ == null || value != 0L) { + Int64Field87 = value; + } + break; + } + case 706: { + double? value = _single_doubleField88_codec.Read(ref input); + if (doubleField88_ == null || value != 0D) { + DoubleField88 = value; + } + break; + } + case 714: { + double? value = _single_doubleField89_codec.Read(ref input); + if (doubleField89_ == null || value != 0D) { + DoubleField89 = value; + } + break; + } + case 722: { + double? value = _single_doubleField90_codec.Read(ref input); + if (doubleField90_ == null || value != 0D) { + DoubleField90 = value; + } + break; + } + case 730: { + double? value = _single_doubleField91_codec.Read(ref input); + if (doubleField91_ == null || value != 0D) { + DoubleField91 = value; + } + break; + } + case 738: { + double? value = _single_doubleField92_codec.Read(ref input); + if (doubleField92_ == null || value != 0D) { + DoubleField92 = value; + } + break; + } + case 746: { + double? value = _single_doubleField93_codec.Read(ref input); + if (doubleField93_ == null || value != 0D) { + DoubleField93 = value; + } + break; + } + case 754: { + double? value = _single_doubleField94_codec.Read(ref input); + if (doubleField94_ == null || value != 0D) { + DoubleField94 = value; + } + break; + } + case 762: { + double? value = _single_doubleField95_codec.Read(ref input); + if (doubleField95_ == null || value != 0D) { + DoubleField95 = value; + } + break; + } + case 770: { + double? value = _single_doubleField96_codec.Read(ref input); + if (doubleField96_ == null || value != 0D) { + DoubleField96 = value; + } + break; + } + case 778: { + double? value = _single_doubleField97_codec.Read(ref input); + if (doubleField97_ == null || value != 0D) { + DoubleField97 = value; + } + break; + } + case 786: { + double? value = _single_doubleField98_codec.Read(ref input); + if (doubleField98_ == null || value != 0D) { + DoubleField98 = value; + } + break; + } + case 794: { + double? value = _single_doubleField99_codec.Read(ref input); + if (doubleField99_ == null || value != 0D) { + DoubleField99 = value; + } + break; + } + case 802: + case 800: { + repeatedIntField100_.AddEntriesFrom(ref input, _repeated_repeatedIntField100_codec); + break; + } + case 810: { + double? value = _single_doubleField101_codec.Read(ref input); + if (doubleField101_ == null || value != 0D) { + DoubleField101 = value; + } + break; + } + case 818: { + double? value = _single_doubleField102_codec.Read(ref input); + if (doubleField102_ == null || value != 0D) { + DoubleField102 = value; + } + break; + } + case 826: { + double? value = _single_doubleField103_codec.Read(ref input); + if (doubleField103_ == null || value != 0D) { + DoubleField103 = value; + } + break; + } + case 834: { + double? value = _single_doubleField104_codec.Read(ref input); + if (doubleField104_ == null || value != 0D) { + DoubleField104 = value; + } + break; + } + case 842: { + double? value = _single_doubleField105_codec.Read(ref input); + if (doubleField105_ == null || value != 0D) { + DoubleField105 = value; + } + break; + } + case 850: { + double? value = _single_doubleField106_codec.Read(ref input); + if (doubleField106_ == null || value != 0D) { + DoubleField106 = value; + } + break; + } + case 858: { + long? value = _single_int64Field107_codec.Read(ref input); + if (int64Field107_ == null || value != 0L) { + Int64Field107 = value; + } + break; + } + case 866: { + double? value = _single_doubleField108_codec.Read(ref input); + if (doubleField108_ == null || value != 0D) { + DoubleField108 = value; + } + break; + } + case 874: { + double? value = _single_doubleField109_codec.Read(ref input); + if (doubleField109_ == null || value != 0D) { + DoubleField109 = value; + } + break; + } + case 882: { + long? value = _single_int64Field110_codec.Read(ref input); + if (int64Field110_ == null || value != 0L) { + Int64Field110 = value; + } + break; + } + case 890: { + double? value = _single_doubleField111_codec.Read(ref input); + if (doubleField111_ == null || value != 0D) { + DoubleField111 = value; + } + break; + } + case 898: { + long? value = _single_int64Field112_codec.Read(ref input); + if (int64Field112_ == null || value != 0L) { + Int64Field112 = value; + } + break; + } + case 906: { + double? value = _single_doubleField113_codec.Read(ref input); + if (doubleField113_ == null || value != 0D) { + DoubleField113 = value; + } + break; + } + case 914: { + long? value = _single_int64Field114_codec.Read(ref input); + if (int64Field114_ == null || value != 0L) { + Int64Field114 = value; + } + break; + } + case 922: { + long? value = _single_int64Field115_codec.Read(ref input); + if (int64Field115_ == null || value != 0L) { + Int64Field115 = value; + } + break; + } + case 930: { + double? value = _single_doubleField116_codec.Read(ref input); + if (doubleField116_ == null || value != 0D) { + DoubleField116 = value; + } + break; + } + case 938: { + long? value = _single_int64Field117_codec.Read(ref input); + if (int64Field117_ == null || value != 0L) { + Int64Field117 = value; + } + break; + } + case 946: { + double? value = _single_doubleField118_codec.Read(ref input); + if (doubleField118_ == null || value != 0D) { + DoubleField118 = value; + } + break; + } + case 954: { + double? value = _single_doubleField119_codec.Read(ref input); + if (doubleField119_ == null || value != 0D) { + DoubleField119 = value; + } + break; + } + case 962: { + double? value = _single_doubleField120_codec.Read(ref input); + if (doubleField120_ == null || value != 0D) { + DoubleField120 = value; + } + break; + } + case 970: { + double? value = _single_doubleField121_codec.Read(ref input); + if (doubleField121_ == null || value != 0D) { + DoubleField121 = value; + } + break; + } + case 978: { + double? value = _single_doubleField122_codec.Read(ref input); + if (doubleField122_ == null || value != 0D) { + DoubleField122 = value; + } + break; + } + case 986: { + double? value = _single_doubleField123_codec.Read(ref input); + if (doubleField123_ == null || value != 0D) { + DoubleField123 = value; + } + break; + } + case 994: { + double? value = _single_doubleField124_codec.Read(ref input); + if (doubleField124_ == null || value != 0D) { + DoubleField124 = value; + } + break; + } + case 1002: { + long? value = _single_int64Field125_codec.Read(ref input); + if (int64Field125_ == null || value != 0L) { + Int64Field125 = value; + } + break; + } + case 1010: { + long? value = _single_int64Field126_codec.Read(ref input); + if (int64Field126_ == null || value != 0L) { + Int64Field126 = value; + } + break; + } + case 1018: { + long? value = _single_int64Field127_codec.Read(ref input); + if (int64Field127_ == null || value != 0L) { + Int64Field127 = value; + } + break; + } + case 1026: { + double? value = _single_doubleField128_codec.Read(ref input); + if (doubleField128_ == null || value != 0D) { + DoubleField128 = value; + } + break; + } + case 1034: { + double? value = _single_doubleField129_codec.Read(ref input); + if (doubleField129_ == null || value != 0D) { + DoubleField129 = value; + } + break; + } + } + } + } + #endif + + } + + /// + /// same as ManyWrapperFieldsMessages, but with primitive fields + /// for comparison. + /// + public sealed partial class ManyPrimitiveFieldsMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyPrimitiveFieldsMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.Benchmarks.WrapperBenchmarkMessagesReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManyPrimitiveFieldsMessage() { + OnConstruction(); + } + partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ManyPrimitiveFieldsMessage(ManyPrimitiveFieldsMessage other) : this() { - doubleField95_ = other.doubleField95_; - doubleField1_ = other.doubleField1_; - doubleField79_ = other.doubleField79_; - int64Field2_ = other.int64Field2_; - doubleField96_ = other.doubleField96_; - int64Field3_ = other.int64Field3_; - int64Field4_ = other.int64Field4_; - doubleField97_ = other.doubleField97_; - doubleField65_ = other.doubleField65_; - doubleField66_ = other.doubleField66_; - doubleField7_ = other.doubleField7_; - doubleField62_ = other.doubleField62_; - doubleField118_ = other.doubleField118_; - doubleField119_ = other.doubleField119_; - doubleField67_ = other.doubleField67_; - doubleField120_ = other.doubleField120_; - doubleField121_ = other.doubleField121_; - doubleField122_ = other.doubleField122_; - doubleField123_ = other.doubleField123_; - doubleField124_ = other.doubleField124_; - doubleField8_ = other.doubleField8_; - doubleField9_ = other.doubleField9_; - doubleField98_ = other.doubleField98_; - doubleField10_ = other.doubleField10_; - doubleField11_ = other.doubleField11_; - doubleField99_ = other.doubleField99_; - doubleField84_ = other.doubleField84_; - doubleField14_ = other.doubleField14_; - doubleField77_ = other.doubleField77_; - doubleField15_ = other.doubleField15_; - int64Field19_ = other.int64Field19_; - int64Field115_ = other.int64Field115_; - doubleField116_ = other.doubleField116_; - int64Field117_ = other.int64Field117_; - doubleField20_ = other.doubleField20_; - doubleField21_ = other.doubleField21_; - stringField73_ = other.stringField73_; - stringField74_ = other.stringField74_; - doubleField22_ = other.doubleField22_; - doubleField69_ = other.doubleField69_; - doubleField70_ = other.doubleField70_; - doubleField71_ = other.doubleField71_; - doubleField72_ = other.doubleField72_; - doubleField25_ = other.doubleField25_; - int64Field26_ = other.int64Field26_; - doubleField68_ = other.doubleField68_; - doubleField28_ = other.doubleField28_; - doubleField106_ = other.doubleField106_; - doubleField29_ = other.doubleField29_; - doubleField30_ = other.doubleField30_; - doubleField101_ = other.doubleField101_; - doubleField102_ = other.doubleField102_; - doubleField103_ = other.doubleField103_; - doubleField104_ = other.doubleField104_; - doubleField105_ = other.doubleField105_; - doubleField31_ = other.doubleField31_; - int64Field32_ = other.int64Field32_; - doubleField75_ = other.doubleField75_; - doubleField129_ = other.doubleField129_; - enumField80_ = other.enumField80_; - enumField81_ = other.enumField81_; - int64Field82_ = other.int64Field82_; - enumField83_ = other.enumField83_; - int64Field85_ = other.int64Field85_; - int64Field86_ = other.int64Field86_; - int64Field87_ = other.int64Field87_; - int64Field125_ = other.int64Field125_; - int64Field37_ = other.int64Field37_; - doubleField38_ = other.doubleField38_; - interactions_ = other.interactions_; - repeatedIntField100_ = other.repeatedIntField100_.Clone(); - doubleField40_ = other.doubleField40_; - int64Field41_ = other.int64Field41_; - int64Field126_ = other.int64Field126_; - int64Field127_ = other.int64Field127_; - doubleField128_ = other.doubleField128_; - doubleField109_ = other.doubleField109_; - int64Field110_ = other.int64Field110_; - doubleField111_ = other.doubleField111_; - int64Field112_ = other.int64Field112_; - doubleField113_ = other.doubleField113_; - int64Field114_ = other.int64Field114_; - doubleField42_ = other.doubleField42_; - int64Field43_ = other.int64Field43_; - int64Field44_ = other.int64Field44_; - doubleField45_ = other.doubleField45_; - doubleField46_ = other.doubleField46_; - doubleField78_ = other.doubleField78_; - doubleField88_ = other.doubleField88_; - doubleField47_ = other.doubleField47_; - doubleField89_ = other.doubleField89_; - doubleField48_ = other.doubleField48_; - doubleField49_ = other.doubleField49_; - doubleField50_ = other.doubleField50_; - doubleField90_ = other.doubleField90_; - doubleField51_ = other.doubleField51_; - doubleField91_ = other.doubleField91_; - doubleField92_ = other.doubleField92_; - int64Field107_ = other.int64Field107_; - doubleField93_ = other.doubleField93_; - doubleField108_ = other.doubleField108_; - doubleField52_ = other.doubleField52_; - doubleField53_ = other.doubleField53_; - doubleField94_ = other.doubleField94_; - doubleField54_ = other.doubleField54_; - doubleField55_ = other.doubleField55_; - doubleField56_ = other.doubleField56_; - doubleField57_ = other.doubleField57_; - doubleField58_ = other.doubleField58_; - int64Field59_ = other.int64Field59_; - int64Field60_ = other.int64Field60_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManyPrimitiveFieldsMessage(ManyPrimitiveFieldsMessage other) : this() { + doubleField95_ = other.doubleField95_; + doubleField1_ = other.doubleField1_; + doubleField79_ = other.doubleField79_; + int64Field2_ = other.int64Field2_; + doubleField96_ = other.doubleField96_; + int64Field3_ = other.int64Field3_; + int64Field4_ = other.int64Field4_; + doubleField97_ = other.doubleField97_; + doubleField65_ = other.doubleField65_; + doubleField66_ = other.doubleField66_; + doubleField7_ = other.doubleField7_; + doubleField62_ = other.doubleField62_; + doubleField118_ = other.doubleField118_; + doubleField119_ = other.doubleField119_; + doubleField67_ = other.doubleField67_; + doubleField120_ = other.doubleField120_; + doubleField121_ = other.doubleField121_; + doubleField122_ = other.doubleField122_; + doubleField123_ = other.doubleField123_; + doubleField124_ = other.doubleField124_; + doubleField8_ = other.doubleField8_; + doubleField9_ = other.doubleField9_; + doubleField98_ = other.doubleField98_; + doubleField10_ = other.doubleField10_; + doubleField11_ = other.doubleField11_; + doubleField99_ = other.doubleField99_; + doubleField84_ = other.doubleField84_; + doubleField14_ = other.doubleField14_; + doubleField77_ = other.doubleField77_; + doubleField15_ = other.doubleField15_; + int64Field19_ = other.int64Field19_; + int64Field115_ = other.int64Field115_; + doubleField116_ = other.doubleField116_; + int64Field117_ = other.int64Field117_; + doubleField20_ = other.doubleField20_; + doubleField21_ = other.doubleField21_; + stringField73_ = other.stringField73_; + stringField74_ = other.stringField74_; + doubleField22_ = other.doubleField22_; + doubleField69_ = other.doubleField69_; + doubleField70_ = other.doubleField70_; + doubleField71_ = other.doubleField71_; + doubleField72_ = other.doubleField72_; + doubleField25_ = other.doubleField25_; + int64Field26_ = other.int64Field26_; + doubleField68_ = other.doubleField68_; + doubleField28_ = other.doubleField28_; + doubleField106_ = other.doubleField106_; + doubleField29_ = other.doubleField29_; + doubleField30_ = other.doubleField30_; + doubleField101_ = other.doubleField101_; + doubleField102_ = other.doubleField102_; + doubleField103_ = other.doubleField103_; + doubleField104_ = other.doubleField104_; + doubleField105_ = other.doubleField105_; + doubleField31_ = other.doubleField31_; + int64Field32_ = other.int64Field32_; + doubleField75_ = other.doubleField75_; + doubleField129_ = other.doubleField129_; + enumField80_ = other.enumField80_; + enumField81_ = other.enumField81_; + int64Field82_ = other.int64Field82_; + enumField83_ = other.enumField83_; + int64Field85_ = other.int64Field85_; + int64Field86_ = other.int64Field86_; + int64Field87_ = other.int64Field87_; + int64Field125_ = other.int64Field125_; + int64Field37_ = other.int64Field37_; + doubleField38_ = other.doubleField38_; + interactions_ = other.interactions_; + repeatedIntField100_ = other.repeatedIntField100_.Clone(); + doubleField40_ = other.doubleField40_; + int64Field41_ = other.int64Field41_; + int64Field126_ = other.int64Field126_; + int64Field127_ = other.int64Field127_; + doubleField128_ = other.doubleField128_; + doubleField109_ = other.doubleField109_; + int64Field110_ = other.int64Field110_; + doubleField111_ = other.doubleField111_; + int64Field112_ = other.int64Field112_; + doubleField113_ = other.doubleField113_; + int64Field114_ = other.int64Field114_; + doubleField42_ = other.doubleField42_; + int64Field43_ = other.int64Field43_; + int64Field44_ = other.int64Field44_; + doubleField45_ = other.doubleField45_; + doubleField46_ = other.doubleField46_; + doubleField78_ = other.doubleField78_; + doubleField88_ = other.doubleField88_; + doubleField47_ = other.doubleField47_; + doubleField89_ = other.doubleField89_; + doubleField48_ = other.doubleField48_; + doubleField49_ = other.doubleField49_; + doubleField50_ = other.doubleField50_; + doubleField90_ = other.doubleField90_; + doubleField51_ = other.doubleField51_; + doubleField91_ = other.doubleField91_; + doubleField92_ = other.doubleField92_; + int64Field107_ = other.int64Field107_; + doubleField93_ = other.doubleField93_; + doubleField108_ = other.doubleField108_; + doubleField52_ = other.doubleField52_; + doubleField53_ = other.doubleField53_; + doubleField94_ = other.doubleField94_; + doubleField54_ = other.doubleField54_; + doubleField55_ = other.doubleField55_; + doubleField56_ = other.doubleField56_; + doubleField57_ = other.doubleField57_; + doubleField58_ = other.doubleField58_; + int64Field59_ = other.int64Field59_; + int64Field60_ = other.int64Field60_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ManyPrimitiveFieldsMessage Clone() { + return new ManyPrimitiveFieldsMessage(this); + } + + /// Field number for the "double_field_95" field. + public const int DoubleField95FieldNumber = 95; + private double doubleField95_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField95 { + get { return doubleField95_; } + set { + doubleField95_ = value; + } + } + + /// Field number for the "double_field_1" field. + public const int DoubleField1FieldNumber = 1; + private double doubleField1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField1 { + get { return doubleField1_; } + set { + doubleField1_ = value; + } + } + + /// Field number for the "double_field_79" field. + public const int DoubleField79FieldNumber = 79; + private double doubleField79_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField79 { + get { return doubleField79_; } + set { + doubleField79_ = value; + } + } + + /// Field number for the "int64_field_2" field. + public const int Int64Field2FieldNumber = 2; + private long int64Field2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field2 { + get { return int64Field2_; } + set { + int64Field2_ = value; + } + } + + /// Field number for the "double_field_96" field. + public const int DoubleField96FieldNumber = 96; + private double doubleField96_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField96 { + get { return doubleField96_; } + set { + doubleField96_ = value; + } + } + + /// Field number for the "int64_field_3" field. + public const int Int64Field3FieldNumber = 3; + private long int64Field3_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field3 { + get { return int64Field3_; } + set { + int64Field3_ = value; + } + } + + /// Field number for the "int64_field_4" field. + public const int Int64Field4FieldNumber = 4; + private long int64Field4_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field4 { + get { return int64Field4_; } + set { + int64Field4_ = value; + } + } + + /// Field number for the "double_field_97" field. + public const int DoubleField97FieldNumber = 97; + private double doubleField97_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField97 { + get { return doubleField97_; } + set { + doubleField97_ = value; + } + } + + /// Field number for the "double_field_65" field. + public const int DoubleField65FieldNumber = 65; + private double doubleField65_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField65 { + get { return doubleField65_; } + set { + doubleField65_ = value; + } + } + + /// Field number for the "double_field_66" field. + public const int DoubleField66FieldNumber = 66; + private double doubleField66_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField66 { + get { return doubleField66_; } + set { + doubleField66_ = value; + } + } + + /// Field number for the "double_field_7" field. + public const int DoubleField7FieldNumber = 7; + private double doubleField7_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField7 { + get { return doubleField7_; } + set { + doubleField7_ = value; + } + } + + /// Field number for the "double_field_62" field. + public const int DoubleField62FieldNumber = 62; + private double doubleField62_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField62 { + get { return doubleField62_; } + set { + doubleField62_ = value; + } + } + + /// Field number for the "double_field_118" field. + public const int DoubleField118FieldNumber = 118; + private double doubleField118_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField118 { + get { return doubleField118_; } + set { + doubleField118_ = value; + } + } + + /// Field number for the "double_field_119" field. + public const int DoubleField119FieldNumber = 119; + private double doubleField119_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField119 { + get { return doubleField119_; } + set { + doubleField119_ = value; + } + } + + /// Field number for the "double_field_67" field. + public const int DoubleField67FieldNumber = 67; + private double doubleField67_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField67 { + get { return doubleField67_; } + set { + doubleField67_ = value; + } + } + + /// Field number for the "double_field_120" field. + public const int DoubleField120FieldNumber = 120; + private double doubleField120_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField120 { + get { return doubleField120_; } + set { + doubleField120_ = value; + } + } + + /// Field number for the "double_field_121" field. + public const int DoubleField121FieldNumber = 121; + private double doubleField121_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField121 { + get { return doubleField121_; } + set { + doubleField121_ = value; + } + } + + /// Field number for the "double_field_122" field. + public const int DoubleField122FieldNumber = 122; + private double doubleField122_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField122 { + get { return doubleField122_; } + set { + doubleField122_ = value; + } + } + + /// Field number for the "double_field_123" field. + public const int DoubleField123FieldNumber = 123; + private double doubleField123_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField123 { + get { return doubleField123_; } + set { + doubleField123_ = value; + } + } + + /// Field number for the "double_field_124" field. + public const int DoubleField124FieldNumber = 124; + private double doubleField124_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField124 { + get { return doubleField124_; } + set { + doubleField124_ = value; + } + } + + /// Field number for the "double_field_8" field. + public const int DoubleField8FieldNumber = 8; + private double doubleField8_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField8 { + get { return doubleField8_; } + set { + doubleField8_ = value; + } + } + + /// Field number for the "double_field_9" field. + public const int DoubleField9FieldNumber = 9; + private double doubleField9_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField9 { + get { return doubleField9_; } + set { + doubleField9_ = value; + } + } + + /// Field number for the "double_field_98" field. + public const int DoubleField98FieldNumber = 98; + private double doubleField98_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField98 { + get { return doubleField98_; } + set { + doubleField98_ = value; + } + } + + /// Field number for the "double_field_10" field. + public const int DoubleField10FieldNumber = 10; + private double doubleField10_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField10 { + get { return doubleField10_; } + set { + doubleField10_ = value; + } + } + + /// Field number for the "double_field_11" field. + public const int DoubleField11FieldNumber = 11; + private double doubleField11_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField11 { + get { return doubleField11_; } + set { + doubleField11_ = value; + } + } + + /// Field number for the "double_field_99" field. + public const int DoubleField99FieldNumber = 99; + private double doubleField99_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField99 { + get { return doubleField99_; } + set { + doubleField99_ = value; + } + } + + /// Field number for the "double_field_84" field. + public const int DoubleField84FieldNumber = 84; + private double doubleField84_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField84 { + get { return doubleField84_; } + set { + doubleField84_ = value; + } + } + + /// Field number for the "double_field_14" field. + public const int DoubleField14FieldNumber = 14; + private double doubleField14_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField14 { + get { return doubleField14_; } + set { + doubleField14_ = value; + } + } + + /// Field number for the "double_field_77" field. + public const int DoubleField77FieldNumber = 77; + private double doubleField77_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField77 { + get { return doubleField77_; } + set { + doubleField77_ = value; + } + } + + /// Field number for the "double_field_15" field. + public const int DoubleField15FieldNumber = 15; + private double doubleField15_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField15 { + get { return doubleField15_; } + set { + doubleField15_ = value; + } + } + + /// Field number for the "int64_field_19" field. + public const int Int64Field19FieldNumber = 19; + private long int64Field19_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field19 { + get { return int64Field19_; } + set { + int64Field19_ = value; + } + } + + /// Field number for the "int64_field_115" field. + public const int Int64Field115FieldNumber = 115; + private long int64Field115_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field115 { + get { return int64Field115_; } + set { + int64Field115_ = value; + } + } + + /// Field number for the "double_field_116" field. + public const int DoubleField116FieldNumber = 116; + private double doubleField116_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField116 { + get { return doubleField116_; } + set { + doubleField116_ = value; + } + } + + /// Field number for the "int64_field_117" field. + public const int Int64Field117FieldNumber = 117; + private long int64Field117_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field117 { + get { return int64Field117_; } + set { + int64Field117_ = value; + } + } + + /// Field number for the "double_field_20" field. + public const int DoubleField20FieldNumber = 20; + private double doubleField20_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField20 { + get { return doubleField20_; } + set { + doubleField20_ = value; + } + } + + /// Field number for the "double_field_21" field. + public const int DoubleField21FieldNumber = 21; + private double doubleField21_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField21 { + get { return doubleField21_; } + set { + doubleField21_ = value; + } + } + + /// Field number for the "string_field_73" field. + public const int StringField73FieldNumber = 73; + private string stringField73_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string StringField73 { + get { return stringField73_; } + set { + stringField73_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "string_field_74" field. + public const int StringField74FieldNumber = 74; + private string stringField74_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string StringField74 { + get { return stringField74_; } + set { + stringField74_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "double_field_22" field. + public const int DoubleField22FieldNumber = 22; + private double doubleField22_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField22 { + get { return doubleField22_; } + set { + doubleField22_ = value; + } + } + + /// Field number for the "double_field_69" field. + public const int DoubleField69FieldNumber = 69; + private double doubleField69_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField69 { + get { return doubleField69_; } + set { + doubleField69_ = value; + } + } + + /// Field number for the "double_field_70" field. + public const int DoubleField70FieldNumber = 70; + private double doubleField70_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField70 { + get { return doubleField70_; } + set { + doubleField70_ = value; + } + } + + /// Field number for the "double_field_71" field. + public const int DoubleField71FieldNumber = 71; + private double doubleField71_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField71 { + get { return doubleField71_; } + set { + doubleField71_ = value; + } + } + + /// Field number for the "double_field_72" field. + public const int DoubleField72FieldNumber = 72; + private double doubleField72_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField72 { + get { return doubleField72_; } + set { + doubleField72_ = value; + } + } + + /// Field number for the "double_field_25" field. + public const int DoubleField25FieldNumber = 25; + private double doubleField25_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField25 { + get { return doubleField25_; } + set { + doubleField25_ = value; + } + } + + /// Field number for the "int64_field_26" field. + public const int Int64Field26FieldNumber = 26; + private long int64Field26_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field26 { + get { return int64Field26_; } + set { + int64Field26_ = value; + } + } + + /// Field number for the "double_field_68" field. + public const int DoubleField68FieldNumber = 68; + private double doubleField68_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField68 { + get { return doubleField68_; } + set { + doubleField68_ = value; + } + } + + /// Field number for the "double_field_28" field. + public const int DoubleField28FieldNumber = 28; + private double doubleField28_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField28 { + get { return doubleField28_; } + set { + doubleField28_ = value; + } + } + + /// Field number for the "double_field_106" field. + public const int DoubleField106FieldNumber = 106; + private double doubleField106_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField106 { + get { return doubleField106_; } + set { + doubleField106_ = value; + } + } + + /// Field number for the "double_field_29" field. + public const int DoubleField29FieldNumber = 29; + private double doubleField29_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField29 { + get { return doubleField29_; } + set { + doubleField29_ = value; + } + } + + /// Field number for the "double_field_30" field. + public const int DoubleField30FieldNumber = 30; + private double doubleField30_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField30 { + get { return doubleField30_; } + set { + doubleField30_ = value; + } + } + + /// Field number for the "double_field_101" field. + public const int DoubleField101FieldNumber = 101; + private double doubleField101_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField101 { + get { return doubleField101_; } + set { + doubleField101_ = value; + } + } + + /// Field number for the "double_field_102" field. + public const int DoubleField102FieldNumber = 102; + private double doubleField102_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField102 { + get { return doubleField102_; } + set { + doubleField102_ = value; + } + } + + /// Field number for the "double_field_103" field. + public const int DoubleField103FieldNumber = 103; + private double doubleField103_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField103 { + get { return doubleField103_; } + set { + doubleField103_ = value; + } + } + + /// Field number for the "double_field_104" field. + public const int DoubleField104FieldNumber = 104; + private double doubleField104_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField104 { + get { return doubleField104_; } + set { + doubleField104_ = value; + } + } + + /// Field number for the "double_field_105" field. + public const int DoubleField105FieldNumber = 105; + private double doubleField105_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField105 { + get { return doubleField105_; } + set { + doubleField105_ = value; + } + } + + /// Field number for the "double_field_31" field. + public const int DoubleField31FieldNumber = 31; + private double doubleField31_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField31 { + get { return doubleField31_; } + set { + doubleField31_ = value; + } + } + + /// Field number for the "int64_field_32" field. + public const int Int64Field32FieldNumber = 32; + private long int64Field32_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field32 { + get { return int64Field32_; } + set { + int64Field32_ = value; + } + } + + /// Field number for the "double_field_75" field. + public const int DoubleField75FieldNumber = 75; + private double doubleField75_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField75 { + get { return doubleField75_; } + set { + doubleField75_ = value; + } + } + + /// Field number for the "double_field_129" field. + public const int DoubleField129FieldNumber = 129; + private double doubleField129_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField129 { + get { return doubleField129_; } + set { + doubleField129_ = value; + } + } + + /// Field number for the "enum_field_80" field. + public const int EnumField80FieldNumber = 80; + private int enumField80_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int EnumField80 { + get { return enumField80_; } + set { + enumField80_ = value; + } + } + + /// Field number for the "enum_field_81" field. + public const int EnumField81FieldNumber = 81; + private int enumField81_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int EnumField81 { + get { return enumField81_; } + set { + enumField81_ = value; + } + } + + /// Field number for the "int64_field_82" field. + public const int Int64Field82FieldNumber = 82; + private long int64Field82_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field82 { + get { return int64Field82_; } + set { + int64Field82_ = value; + } + } + + /// Field number for the "enum_field_83" field. + public const int EnumField83FieldNumber = 83; + private int enumField83_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int EnumField83 { + get { return enumField83_; } + set { + enumField83_ = value; + } + } + + /// Field number for the "int64_field_85" field. + public const int Int64Field85FieldNumber = 85; + private long int64Field85_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field85 { + get { return int64Field85_; } + set { + int64Field85_ = value; + } + } + + /// Field number for the "int64_field_86" field. + public const int Int64Field86FieldNumber = 86; + private long int64Field86_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field86 { + get { return int64Field86_; } + set { + int64Field86_ = value; + } + } + + /// Field number for the "int64_field_87" field. + public const int Int64Field87FieldNumber = 87; + private long int64Field87_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field87 { + get { return int64Field87_; } + set { + int64Field87_ = value; + } + } + + /// Field number for the "int64_field_125" field. + public const int Int64Field125FieldNumber = 125; + private long int64Field125_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field125 { + get { return int64Field125_; } + set { + int64Field125_ = value; + } + } + + /// Field number for the "int64_field_37" field. + public const int Int64Field37FieldNumber = 37; + private long int64Field37_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field37 { + get { return int64Field37_; } + set { + int64Field37_ = value; + } + } + + /// Field number for the "double_field_38" field. + public const int DoubleField38FieldNumber = 38; + private double doubleField38_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField38 { + get { return doubleField38_; } + set { + doubleField38_ = value; + } + } + + /// Field number for the "interactions" field. + public const int InteractionsFieldNumber = 39; + private long interactions_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Interactions { + get { return interactions_; } + set { + interactions_ = value; + } + } + + /// Field number for the "repeated_int_field_100" field. + public const int RepeatedIntField100FieldNumber = 100; + private static readonly pb::FieldCodec _repeated_repeatedIntField100_codec + = pb::FieldCodec.ForInt32(802); + private readonly pbc::RepeatedField repeatedIntField100_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField RepeatedIntField100 { + get { return repeatedIntField100_; } + } + + /// Field number for the "double_field_40" field. + public const int DoubleField40FieldNumber = 40; + private double doubleField40_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField40 { + get { return doubleField40_; } + set { + doubleField40_ = value; + } + } + + /// Field number for the "int64_field_41" field. + public const int Int64Field41FieldNumber = 41; + private long int64Field41_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field41 { + get { return int64Field41_; } + set { + int64Field41_ = value; + } + } + + /// Field number for the "int64_field_126" field. + public const int Int64Field126FieldNumber = 126; + private long int64Field126_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field126 { + get { return int64Field126_; } + set { + int64Field126_ = value; + } + } + + /// Field number for the "int64_field_127" field. + public const int Int64Field127FieldNumber = 127; + private long int64Field127_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field127 { + get { return int64Field127_; } + set { + int64Field127_ = value; + } + } + + /// Field number for the "double_field_128" field. + public const int DoubleField128FieldNumber = 128; + private double doubleField128_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField128 { + get { return doubleField128_; } + set { + doubleField128_ = value; + } + } + + /// Field number for the "double_field_109" field. + public const int DoubleField109FieldNumber = 109; + private double doubleField109_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField109 { + get { return doubleField109_; } + set { + doubleField109_ = value; + } + } + + /// Field number for the "int64_field_110" field. + public const int Int64Field110FieldNumber = 110; + private long int64Field110_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field110 { + get { return int64Field110_; } + set { + int64Field110_ = value; + } + } + + /// Field number for the "double_field_111" field. + public const int DoubleField111FieldNumber = 111; + private double doubleField111_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField111 { + get { return doubleField111_; } + set { + doubleField111_ = value; + } + } + + /// Field number for the "int64_field_112" field. + public const int Int64Field112FieldNumber = 112; + private long int64Field112_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field112 { + get { return int64Field112_; } + set { + int64Field112_ = value; + } + } + + /// Field number for the "double_field_113" field. + public const int DoubleField113FieldNumber = 113; + private double doubleField113_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField113 { + get { return doubleField113_; } + set { + doubleField113_ = value; + } + } + + /// Field number for the "int64_field_114" field. + public const int Int64Field114FieldNumber = 114; + private long int64Field114_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field114 { + get { return int64Field114_; } + set { + int64Field114_ = value; + } + } + + /// Field number for the "double_field_42" field. + public const int DoubleField42FieldNumber = 42; + private double doubleField42_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField42 { + get { return doubleField42_; } + set { + doubleField42_ = value; + } + } + + /// Field number for the "int64_field_43" field. + public const int Int64Field43FieldNumber = 43; + private long int64Field43_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field43 { + get { return int64Field43_; } + set { + int64Field43_ = value; + } } + /// Field number for the "int64_field_44" field. + public const int Int64Field44FieldNumber = 44; + private long int64Field44_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ManyPrimitiveFieldsMessage Clone() { - return new ManyPrimitiveFieldsMessage(this); + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field44 { + get { return int64Field44_; } + set { + int64Field44_ = value; + } } - /// Field number for the "double_field_95" field. - public const int DoubleField95FieldNumber = 95; - private double doubleField95_; + /// Field number for the "double_field_45" field. + public const int DoubleField45FieldNumber = 45; + private double doubleField45_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField95 { - get { return doubleField95_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField45 { + get { return doubleField45_; } set { - doubleField95_ = value; + doubleField45_ = value; } } - /// Field number for the "double_field_1" field. - public const int DoubleField1FieldNumber = 1; - private double doubleField1_; + /// Field number for the "double_field_46" field. + public const int DoubleField46FieldNumber = 46; + private double doubleField46_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField1 { - get { return doubleField1_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField46 { + get { return doubleField46_; } set { - doubleField1_ = value; + doubleField46_ = value; } } - /// Field number for the "double_field_79" field. - public const int DoubleField79FieldNumber = 79; - private double doubleField79_; + /// Field number for the "double_field_78" field. + public const int DoubleField78FieldNumber = 78; + private double doubleField78_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField79 { - get { return doubleField79_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField78 { + get { return doubleField78_; } set { - doubleField79_ = value; + doubleField78_ = value; } } - /// Field number for the "int64_field_2" field. - public const int Int64Field2FieldNumber = 2; - private long int64Field2_; + /// Field number for the "double_field_88" field. + public const int DoubleField88FieldNumber = 88; + private double doubleField88_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field2 { - get { return int64Field2_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField88 { + get { return doubleField88_; } set { - int64Field2_ = value; + doubleField88_ = value; } } - /// Field number for the "double_field_96" field. - public const int DoubleField96FieldNumber = 96; - private double doubleField96_; + /// Field number for the "double_field_47" field. + public const int DoubleField47FieldNumber = 47; + private double doubleField47_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField96 { - get { return doubleField96_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField47 { + get { return doubleField47_; } set { - doubleField96_ = value; + doubleField47_ = value; } } - /// Field number for the "int64_field_3" field. - public const int Int64Field3FieldNumber = 3; - private long int64Field3_; + /// Field number for the "double_field_89" field. + public const int DoubleField89FieldNumber = 89; + private double doubleField89_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field3 { - get { return int64Field3_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField89 { + get { return doubleField89_; } set { - int64Field3_ = value; + doubleField89_ = value; } } - /// Field number for the "int64_field_4" field. - public const int Int64Field4FieldNumber = 4; - private long int64Field4_; + /// Field number for the "double_field_48" field. + public const int DoubleField48FieldNumber = 48; + private double doubleField48_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field4 { - get { return int64Field4_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField48 { + get { return doubleField48_; } set { - int64Field4_ = value; + doubleField48_ = value; } } - /// Field number for the "double_field_97" field. - public const int DoubleField97FieldNumber = 97; - private double doubleField97_; + /// Field number for the "double_field_49" field. + public const int DoubleField49FieldNumber = 49; + private double doubleField49_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField97 { - get { return doubleField97_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField49 { + get { return doubleField49_; } set { - doubleField97_ = value; + doubleField49_ = value; } } - /// Field number for the "double_field_65" field. - public const int DoubleField65FieldNumber = 65; - private double doubleField65_; + /// Field number for the "double_field_50" field. + public const int DoubleField50FieldNumber = 50; + private double doubleField50_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField65 { - get { return doubleField65_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField50 { + get { return doubleField50_; } set { - doubleField65_ = value; + doubleField50_ = value; } } - /// Field number for the "double_field_66" field. - public const int DoubleField66FieldNumber = 66; - private double doubleField66_; + /// Field number for the "double_field_90" field. + public const int DoubleField90FieldNumber = 90; + private double doubleField90_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField66 { - get { return doubleField66_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField90 { + get { return doubleField90_; } set { - doubleField66_ = value; + doubleField90_ = value; } } - /// Field number for the "double_field_7" field. - public const int DoubleField7FieldNumber = 7; - private double doubleField7_; + /// Field number for the "double_field_51" field. + public const int DoubleField51FieldNumber = 51; + private double doubleField51_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField7 { - get { return doubleField7_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField51 { + get { return doubleField51_; } + set { + doubleField51_ = value; + } + } + + /// Field number for the "double_field_91" field. + public const int DoubleField91FieldNumber = 91; + private double doubleField91_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField91 { + get { return doubleField91_; } + set { + doubleField91_ = value; + } + } + + /// Field number for the "double_field_92" field. + public const int DoubleField92FieldNumber = 92; + private double doubleField92_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField92 { + get { return doubleField92_; } + set { + doubleField92_ = value; + } + } + + /// Field number for the "int64_field_107" field. + public const int Int64Field107FieldNumber = 107; + private long int64Field107_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field107 { + get { return int64Field107_; } + set { + int64Field107_ = value; + } + } + + /// Field number for the "double_field_93" field. + public const int DoubleField93FieldNumber = 93; + private double doubleField93_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField93 { + get { return doubleField93_; } + set { + doubleField93_ = value; + } + } + + /// Field number for the "double_field_108" field. + public const int DoubleField108FieldNumber = 108; + private double doubleField108_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField108 { + get { return doubleField108_; } + set { + doubleField108_ = value; + } + } + + /// Field number for the "double_field_52" field. + public const int DoubleField52FieldNumber = 52; + private double doubleField52_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField52 { + get { return doubleField52_; } + set { + doubleField52_ = value; + } + } + + /// Field number for the "double_field_53" field. + public const int DoubleField53FieldNumber = 53; + private double doubleField53_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField53 { + get { return doubleField53_; } + set { + doubleField53_ = value; + } + } + + /// Field number for the "double_field_94" field. + public const int DoubleField94FieldNumber = 94; + private double doubleField94_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField94 { + get { return doubleField94_; } + set { + doubleField94_ = value; + } + } + + /// Field number for the "double_field_54" field. + public const int DoubleField54FieldNumber = 54; + private double doubleField54_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField54 { + get { return doubleField54_; } + set { + doubleField54_ = value; + } + } + + /// Field number for the "double_field_55" field. + public const int DoubleField55FieldNumber = 55; + private double doubleField55_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField55 { + get { return doubleField55_; } set { - doubleField7_ = value; + doubleField55_ = value; } } - /// Field number for the "double_field_62" field. - public const int DoubleField62FieldNumber = 62; - private double doubleField62_; + /// Field number for the "double_field_56" field. + public const int DoubleField56FieldNumber = 56; + private double doubleField56_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField62 { - get { return doubleField62_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField56 { + get { return doubleField56_; } set { - doubleField62_ = value; + doubleField56_ = value; } } - /// Field number for the "double_field_118" field. - public const int DoubleField118FieldNumber = 118; - private double doubleField118_; + /// Field number for the "double_field_57" field. + public const int DoubleField57FieldNumber = 57; + private double doubleField57_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField118 { - get { return doubleField118_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField57 { + get { return doubleField57_; } set { - doubleField118_ = value; + doubleField57_ = value; } } - /// Field number for the "double_field_119" field. - public const int DoubleField119FieldNumber = 119; - private double doubleField119_; + /// Field number for the "double_field_58" field. + public const int DoubleField58FieldNumber = 58; + private double doubleField58_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField119 { - get { return doubleField119_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double DoubleField58 { + get { return doubleField58_; } set { - doubleField119_ = value; + doubleField58_ = value; } } - /// Field number for the "double_field_67" field. - public const int DoubleField67FieldNumber = 67; - private double doubleField67_; + /// Field number for the "int64_field_59" field. + public const int Int64Field59FieldNumber = 59; + private long int64Field59_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField67 { - get { return doubleField67_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field59 { + get { return int64Field59_; } set { - doubleField67_ = value; + int64Field59_ = value; } } - /// Field number for the "double_field_120" field. - public const int DoubleField120FieldNumber = 120; - private double doubleField120_; + /// Field number for the "int64_field_60" field. + public const int Int64Field60FieldNumber = 60; + private long int64Field60_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField120 { - get { return doubleField120_; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Int64Field60 { + get { return int64Field60_; } set { - doubleField120_ = value; + int64Field60_ = value; } } - /// Field number for the "double_field_121" field. - public const int DoubleField121FieldNumber = 121; - private double doubleField121_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField121 { - get { return doubleField121_; } - set { - doubleField121_ = value; - } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ManyPrimitiveFieldsMessage); } - /// Field number for the "double_field_122" field. - public const int DoubleField122FieldNumber = 122; - private double doubleField122_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField122 { - get { return doubleField122_; } - set { - doubleField122_ = value; + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ManyPrimitiveFieldsMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField95, other.DoubleField95)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField1, other.DoubleField1)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField79, other.DoubleField79)) return false; + if (Int64Field2 != other.Int64Field2) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField96, other.DoubleField96)) return false; + if (Int64Field3 != other.Int64Field3) return false; + if (Int64Field4 != other.Int64Field4) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField97, other.DoubleField97)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField65, other.DoubleField65)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField66, other.DoubleField66)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField7, other.DoubleField7)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField62, other.DoubleField62)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField118, other.DoubleField118)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField119, other.DoubleField119)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField67, other.DoubleField67)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField120, other.DoubleField120)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField121, other.DoubleField121)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField122, other.DoubleField122)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField123, other.DoubleField123)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField124, other.DoubleField124)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField8, other.DoubleField8)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField9, other.DoubleField9)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField98, other.DoubleField98)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField10, other.DoubleField10)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField11, other.DoubleField11)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField99, other.DoubleField99)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField84, other.DoubleField84)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField14, other.DoubleField14)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField77, other.DoubleField77)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField15, other.DoubleField15)) return false; + if (Int64Field19 != other.Int64Field19) return false; + if (Int64Field115 != other.Int64Field115) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField116, other.DoubleField116)) return false; + if (Int64Field117 != other.Int64Field117) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField20, other.DoubleField20)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField21, other.DoubleField21)) return false; + if (StringField73 != other.StringField73) return false; + if (StringField74 != other.StringField74) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField22, other.DoubleField22)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField69, other.DoubleField69)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField70, other.DoubleField70)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField71, other.DoubleField71)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField72, other.DoubleField72)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField25, other.DoubleField25)) return false; + if (Int64Field26 != other.Int64Field26) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField68, other.DoubleField68)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField28, other.DoubleField28)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField106, other.DoubleField106)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField29, other.DoubleField29)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField30, other.DoubleField30)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField101, other.DoubleField101)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField102, other.DoubleField102)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField103, other.DoubleField103)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField104, other.DoubleField104)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField105, other.DoubleField105)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField31, other.DoubleField31)) return false; + if (Int64Field32 != other.Int64Field32) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField75, other.DoubleField75)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField129, other.DoubleField129)) return false; + if (EnumField80 != other.EnumField80) return false; + if (EnumField81 != other.EnumField81) return false; + if (Int64Field82 != other.Int64Field82) return false; + if (EnumField83 != other.EnumField83) return false; + if (Int64Field85 != other.Int64Field85) return false; + if (Int64Field86 != other.Int64Field86) return false; + if (Int64Field87 != other.Int64Field87) return false; + if (Int64Field125 != other.Int64Field125) return false; + if (Int64Field37 != other.Int64Field37) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField38, other.DoubleField38)) return false; + if (Interactions != other.Interactions) return false; + if(!repeatedIntField100_.Equals(other.repeatedIntField100_)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField40, other.DoubleField40)) return false; + if (Int64Field41 != other.Int64Field41) return false; + if (Int64Field126 != other.Int64Field126) return false; + if (Int64Field127 != other.Int64Field127) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField128, other.DoubleField128)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField109, other.DoubleField109)) return false; + if (Int64Field110 != other.Int64Field110) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField111, other.DoubleField111)) return false; + if (Int64Field112 != other.Int64Field112) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField113, other.DoubleField113)) return false; + if (Int64Field114 != other.Int64Field114) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField42, other.DoubleField42)) return false; + if (Int64Field43 != other.Int64Field43) return false; + if (Int64Field44 != other.Int64Field44) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField45, other.DoubleField45)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField46, other.DoubleField46)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField78, other.DoubleField78)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField88, other.DoubleField88)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField47, other.DoubleField47)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField89, other.DoubleField89)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField48, other.DoubleField48)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField49, other.DoubleField49)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField50, other.DoubleField50)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField90, other.DoubleField90)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField51, other.DoubleField51)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField91, other.DoubleField91)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField92, other.DoubleField92)) return false; + if (Int64Field107 != other.Int64Field107) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField93, other.DoubleField93)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField108, other.DoubleField108)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField52, other.DoubleField52)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField53, other.DoubleField53)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField94, other.DoubleField94)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField54, other.DoubleField54)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField55, other.DoubleField55)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField56, other.DoubleField56)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField57, other.DoubleField57)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField58, other.DoubleField58)) return false; + if (Int64Field59 != other.Int64Field59) return false; + if (Int64Field60 != other.Int64Field60) return false; + return Equals(_unknownFields, other._unknownFields); } - /// Field number for the "double_field_123" field. - public const int DoubleField123FieldNumber = 123; - private double doubleField123_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField123 { - get { return doubleField123_; } - set { - doubleField123_ = value; + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (DoubleField95 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField95); + if (DoubleField1 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField1); + if (DoubleField79 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField79); + if (Int64Field2 != 0L) hash ^= Int64Field2.GetHashCode(); + if (DoubleField96 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField96); + if (Int64Field3 != 0L) hash ^= Int64Field3.GetHashCode(); + if (Int64Field4 != 0L) hash ^= Int64Field4.GetHashCode(); + if (DoubleField97 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField97); + if (DoubleField65 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField65); + if (DoubleField66 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField66); + if (DoubleField7 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField7); + if (DoubleField62 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField62); + if (DoubleField118 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField118); + if (DoubleField119 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField119); + if (DoubleField67 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField67); + if (DoubleField120 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField120); + if (DoubleField121 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField121); + if (DoubleField122 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField122); + if (DoubleField123 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField123); + if (DoubleField124 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField124); + if (DoubleField8 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField8); + if (DoubleField9 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField9); + if (DoubleField98 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField98); + if (DoubleField10 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField10); + if (DoubleField11 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField11); + if (DoubleField99 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField99); + if (DoubleField84 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField84); + if (DoubleField14 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField14); + if (DoubleField77 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField77); + if (DoubleField15 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField15); + if (Int64Field19 != 0L) hash ^= Int64Field19.GetHashCode(); + if (Int64Field115 != 0L) hash ^= Int64Field115.GetHashCode(); + if (DoubleField116 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField116); + if (Int64Field117 != 0L) hash ^= Int64Field117.GetHashCode(); + if (DoubleField20 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField20); + if (DoubleField21 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField21); + if (StringField73.Length != 0) hash ^= StringField73.GetHashCode(); + if (StringField74.Length != 0) hash ^= StringField74.GetHashCode(); + if (DoubleField22 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField22); + if (DoubleField69 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField69); + if (DoubleField70 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField70); + if (DoubleField71 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField71); + if (DoubleField72 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField72); + if (DoubleField25 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField25); + if (Int64Field26 != 0L) hash ^= Int64Field26.GetHashCode(); + if (DoubleField68 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField68); + if (DoubleField28 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField28); + if (DoubleField106 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField106); + if (DoubleField29 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField29); + if (DoubleField30 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField30); + if (DoubleField101 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField101); + if (DoubleField102 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField102); + if (DoubleField103 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField103); + if (DoubleField104 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField104); + if (DoubleField105 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField105); + if (DoubleField31 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField31); + if (Int64Field32 != 0L) hash ^= Int64Field32.GetHashCode(); + if (DoubleField75 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField75); + if (DoubleField129 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField129); + if (EnumField80 != 0) hash ^= EnumField80.GetHashCode(); + if (EnumField81 != 0) hash ^= EnumField81.GetHashCode(); + if (Int64Field82 != 0L) hash ^= Int64Field82.GetHashCode(); + if (EnumField83 != 0) hash ^= EnumField83.GetHashCode(); + if (Int64Field85 != 0L) hash ^= Int64Field85.GetHashCode(); + if (Int64Field86 != 0L) hash ^= Int64Field86.GetHashCode(); + if (Int64Field87 != 0L) hash ^= Int64Field87.GetHashCode(); + if (Int64Field125 != 0L) hash ^= Int64Field125.GetHashCode(); + if (Int64Field37 != 0L) hash ^= Int64Field37.GetHashCode(); + if (DoubleField38 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField38); + if (Interactions != 0L) hash ^= Interactions.GetHashCode(); + hash ^= repeatedIntField100_.GetHashCode(); + if (DoubleField40 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField40); + if (Int64Field41 != 0L) hash ^= Int64Field41.GetHashCode(); + if (Int64Field126 != 0L) hash ^= Int64Field126.GetHashCode(); + if (Int64Field127 != 0L) hash ^= Int64Field127.GetHashCode(); + if (DoubleField128 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField128); + if (DoubleField109 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField109); + if (Int64Field110 != 0L) hash ^= Int64Field110.GetHashCode(); + if (DoubleField111 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField111); + if (Int64Field112 != 0L) hash ^= Int64Field112.GetHashCode(); + if (DoubleField113 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField113); + if (Int64Field114 != 0L) hash ^= Int64Field114.GetHashCode(); + if (DoubleField42 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField42); + if (Int64Field43 != 0L) hash ^= Int64Field43.GetHashCode(); + if (Int64Field44 != 0L) hash ^= Int64Field44.GetHashCode(); + if (DoubleField45 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField45); + if (DoubleField46 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField46); + if (DoubleField78 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField78); + if (DoubleField88 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField88); + if (DoubleField47 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField47); + if (DoubleField89 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField89); + if (DoubleField48 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField48); + if (DoubleField49 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField49); + if (DoubleField50 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField50); + if (DoubleField90 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField90); + if (DoubleField51 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField51); + if (DoubleField91 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField91); + if (DoubleField92 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField92); + if (Int64Field107 != 0L) hash ^= Int64Field107.GetHashCode(); + if (DoubleField93 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField93); + if (DoubleField108 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField108); + if (DoubleField52 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField52); + if (DoubleField53 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField53); + if (DoubleField94 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField94); + if (DoubleField54 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField54); + if (DoubleField55 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField55); + if (DoubleField56 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField56); + if (DoubleField57 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField57); + if (DoubleField58 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField58); + if (Int64Field59 != 0L) hash ^= Int64Field59.GetHashCode(); + if (Int64Field60 != 0L) hash ^= Int64Field60.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); } + return hash; } - /// Field number for the "double_field_124" field. - public const int DoubleField124FieldNumber = 124; - private double doubleField124_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField124 { - get { return doubleField124_; } - set { - doubleField124_ = value; - } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); } - /// Field number for the "double_field_8" field. - public const int DoubleField8FieldNumber = 8; - private double doubleField8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField8 { - get { return doubleField8_; } - set { - doubleField8_ = value; + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (DoubleField1 != 0D) { + output.WriteRawTag(9); + output.WriteDouble(DoubleField1); } - } - - /// Field number for the "double_field_9" field. - public const int DoubleField9FieldNumber = 9; - private double doubleField9_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField9 { - get { return doubleField9_; } - set { - doubleField9_ = value; + if (Int64Field2 != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Int64Field2); } - } - - /// Field number for the "double_field_98" field. - public const int DoubleField98FieldNumber = 98; - private double doubleField98_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField98 { - get { return doubleField98_; } - set { - doubleField98_ = value; + if (Int64Field3 != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Int64Field3); } - } - - /// Field number for the "double_field_10" field. - public const int DoubleField10FieldNumber = 10; - private double doubleField10_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField10 { - get { return doubleField10_; } - set { - doubleField10_ = value; + if (Int64Field4 != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Int64Field4); } - } - - /// Field number for the "double_field_11" field. - public const int DoubleField11FieldNumber = 11; - private double doubleField11_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField11 { - get { return doubleField11_; } - set { - doubleField11_ = value; + if (DoubleField7 != 0D) { + output.WriteRawTag(57); + output.WriteDouble(DoubleField7); } - } - - /// Field number for the "double_field_99" field. - public const int DoubleField99FieldNumber = 99; - private double doubleField99_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField99 { - get { return doubleField99_; } - set { - doubleField99_ = value; + if (DoubleField8 != 0D) { + output.WriteRawTag(65); + output.WriteDouble(DoubleField8); } - } - - /// Field number for the "double_field_84" field. - public const int DoubleField84FieldNumber = 84; - private double doubleField84_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField84 { - get { return doubleField84_; } - set { - doubleField84_ = value; + if (DoubleField9 != 0D) { + output.WriteRawTag(73); + output.WriteDouble(DoubleField9); } - } - - /// Field number for the "double_field_14" field. - public const int DoubleField14FieldNumber = 14; - private double doubleField14_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField14 { - get { return doubleField14_; } - set { - doubleField14_ = value; + if (DoubleField10 != 0D) { + output.WriteRawTag(81); + output.WriteDouble(DoubleField10); } - } - - /// Field number for the "double_field_77" field. - public const int DoubleField77FieldNumber = 77; - private double doubleField77_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField77 { - get { return doubleField77_; } - set { - doubleField77_ = value; + if (DoubleField11 != 0D) { + output.WriteRawTag(89); + output.WriteDouble(DoubleField11); } - } - - /// Field number for the "double_field_15" field. - public const int DoubleField15FieldNumber = 15; - private double doubleField15_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField15 { - get { return doubleField15_; } - set { - doubleField15_ = value; + if (DoubleField14 != 0D) { + output.WriteRawTag(113); + output.WriteDouble(DoubleField14); } - } - - /// Field number for the "int64_field_19" field. - public const int Int64Field19FieldNumber = 19; - private long int64Field19_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field19 { - get { return int64Field19_; } - set { - int64Field19_ = value; + if (DoubleField15 != 0D) { + output.WriteRawTag(121); + output.WriteDouble(DoubleField15); } - } - - /// Field number for the "int64_field_115" field. - public const int Int64Field115FieldNumber = 115; - private long int64Field115_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field115 { - get { return int64Field115_; } - set { - int64Field115_ = value; + if (Int64Field19 != 0L) { + output.WriteRawTag(152, 1); + output.WriteInt64(Int64Field19); } - } - - /// Field number for the "double_field_116" field. - public const int DoubleField116FieldNumber = 116; - private double doubleField116_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField116 { - get { return doubleField116_; } - set { - doubleField116_ = value; + if (DoubleField20 != 0D) { + output.WriteRawTag(161, 1); + output.WriteDouble(DoubleField20); } - } - - /// Field number for the "int64_field_117" field. - public const int Int64Field117FieldNumber = 117; - private long int64Field117_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field117 { - get { return int64Field117_; } - set { - int64Field117_ = value; + if (DoubleField21 != 0D) { + output.WriteRawTag(169, 1); + output.WriteDouble(DoubleField21); } - } - - /// Field number for the "double_field_20" field. - public const int DoubleField20FieldNumber = 20; - private double doubleField20_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField20 { - get { return doubleField20_; } - set { - doubleField20_ = value; + if (DoubleField22 != 0D) { + output.WriteRawTag(177, 1); + output.WriteDouble(DoubleField22); } - } - - /// Field number for the "double_field_21" field. - public const int DoubleField21FieldNumber = 21; - private double doubleField21_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField21 { - get { return doubleField21_; } - set { - doubleField21_ = value; + if (DoubleField25 != 0D) { + output.WriteRawTag(201, 1); + output.WriteDouble(DoubleField25); } - } - - /// Field number for the "string_field_73" field. - public const int StringField73FieldNumber = 73; - private string stringField73_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string StringField73 { - get { return stringField73_; } - set { - stringField73_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + if (Int64Field26 != 0L) { + output.WriteRawTag(208, 1); + output.WriteInt64(Int64Field26); } - } - - /// Field number for the "string_field_74" field. - public const int StringField74FieldNumber = 74; - private string stringField74_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string StringField74 { - get { return stringField74_; } - set { - stringField74_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + if (DoubleField28 != 0D) { + output.WriteRawTag(225, 1); + output.WriteDouble(DoubleField28); } - } - - /// Field number for the "double_field_22" field. - public const int DoubleField22FieldNumber = 22; - private double doubleField22_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField22 { - get { return doubleField22_; } - set { - doubleField22_ = value; + if (DoubleField29 != 0D) { + output.WriteRawTag(233, 1); + output.WriteDouble(DoubleField29); } - } - - /// Field number for the "double_field_69" field. - public const int DoubleField69FieldNumber = 69; - private double doubleField69_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField69 { - get { return doubleField69_; } - set { - doubleField69_ = value; + if (DoubleField30 != 0D) { + output.WriteRawTag(241, 1); + output.WriteDouble(DoubleField30); } - } - - /// Field number for the "double_field_70" field. - public const int DoubleField70FieldNumber = 70; - private double doubleField70_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField70 { - get { return doubleField70_; } - set { - doubleField70_ = value; + if (DoubleField31 != 0D) { + output.WriteRawTag(249, 1); + output.WriteDouble(DoubleField31); } - } - - /// Field number for the "double_field_71" field. - public const int DoubleField71FieldNumber = 71; - private double doubleField71_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField71 { - get { return doubleField71_; } - set { - doubleField71_ = value; + if (Int64Field32 != 0L) { + output.WriteRawTag(128, 2); + output.WriteInt64(Int64Field32); } - } - - /// Field number for the "double_field_72" field. - public const int DoubleField72FieldNumber = 72; - private double doubleField72_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField72 { - get { return doubleField72_; } - set { - doubleField72_ = value; + if (Int64Field37 != 0L) { + output.WriteRawTag(168, 2); + output.WriteInt64(Int64Field37); } - } - - /// Field number for the "double_field_25" field. - public const int DoubleField25FieldNumber = 25; - private double doubleField25_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField25 { - get { return doubleField25_; } - set { - doubleField25_ = value; + if (DoubleField38 != 0D) { + output.WriteRawTag(177, 2); + output.WriteDouble(DoubleField38); } - } - - /// Field number for the "int64_field_26" field. - public const int Int64Field26FieldNumber = 26; - private long int64Field26_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field26 { - get { return int64Field26_; } - set { - int64Field26_ = value; + if (Interactions != 0L) { + output.WriteRawTag(184, 2); + output.WriteInt64(Interactions); } - } - - /// Field number for the "double_field_68" field. - public const int DoubleField68FieldNumber = 68; - private double doubleField68_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField68 { - get { return doubleField68_; } - set { - doubleField68_ = value; + if (DoubleField40 != 0D) { + output.WriteRawTag(193, 2); + output.WriteDouble(DoubleField40); } - } - - /// Field number for the "double_field_28" field. - public const int DoubleField28FieldNumber = 28; - private double doubleField28_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField28 { - get { return doubleField28_; } - set { - doubleField28_ = value; + if (Int64Field41 != 0L) { + output.WriteRawTag(200, 2); + output.WriteInt64(Int64Field41); } - } - - /// Field number for the "double_field_106" field. - public const int DoubleField106FieldNumber = 106; - private double doubleField106_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField106 { - get { return doubleField106_; } - set { - doubleField106_ = value; + if (DoubleField42 != 0D) { + output.WriteRawTag(209, 2); + output.WriteDouble(DoubleField42); } - } - - /// Field number for the "double_field_29" field. - public const int DoubleField29FieldNumber = 29; - private double doubleField29_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField29 { - get { return doubleField29_; } - set { - doubleField29_ = value; + if (Int64Field43 != 0L) { + output.WriteRawTag(216, 2); + output.WriteInt64(Int64Field43); } - } - - /// Field number for the "double_field_30" field. - public const int DoubleField30FieldNumber = 30; - private double doubleField30_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField30 { - get { return doubleField30_; } - set { - doubleField30_ = value; + if (Int64Field44 != 0L) { + output.WriteRawTag(224, 2); + output.WriteInt64(Int64Field44); } - } - - /// Field number for the "double_field_101" field. - public const int DoubleField101FieldNumber = 101; - private double doubleField101_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField101 { - get { return doubleField101_; } - set { - doubleField101_ = value; + if (DoubleField45 != 0D) { + output.WriteRawTag(233, 2); + output.WriteDouble(DoubleField45); } - } - - /// Field number for the "double_field_102" field. - public const int DoubleField102FieldNumber = 102; - private double doubleField102_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField102 { - get { return doubleField102_; } - set { - doubleField102_ = value; + if (DoubleField46 != 0D) { + output.WriteRawTag(241, 2); + output.WriteDouble(DoubleField46); } - } - - /// Field number for the "double_field_103" field. - public const int DoubleField103FieldNumber = 103; - private double doubleField103_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField103 { - get { return doubleField103_; } - set { - doubleField103_ = value; + if (DoubleField47 != 0D) { + output.WriteRawTag(249, 2); + output.WriteDouble(DoubleField47); + } + if (DoubleField48 != 0D) { + output.WriteRawTag(129, 3); + output.WriteDouble(DoubleField48); + } + if (DoubleField49 != 0D) { + output.WriteRawTag(137, 3); + output.WriteDouble(DoubleField49); } - } - - /// Field number for the "double_field_104" field. - public const int DoubleField104FieldNumber = 104; - private double doubleField104_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField104 { - get { return doubleField104_; } - set { - doubleField104_ = value; + if (DoubleField50 != 0D) { + output.WriteRawTag(145, 3); + output.WriteDouble(DoubleField50); } - } - - /// Field number for the "double_field_105" field. - public const int DoubleField105FieldNumber = 105; - private double doubleField105_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField105 { - get { return doubleField105_; } - set { - doubleField105_ = value; + if (DoubleField51 != 0D) { + output.WriteRawTag(153, 3); + output.WriteDouble(DoubleField51); } - } - - /// Field number for the "double_field_31" field. - public const int DoubleField31FieldNumber = 31; - private double doubleField31_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField31 { - get { return doubleField31_; } - set { - doubleField31_ = value; + if (DoubleField52 != 0D) { + output.WriteRawTag(161, 3); + output.WriteDouble(DoubleField52); } - } - - /// Field number for the "int64_field_32" field. - public const int Int64Field32FieldNumber = 32; - private long int64Field32_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field32 { - get { return int64Field32_; } - set { - int64Field32_ = value; + if (DoubleField53 != 0D) { + output.WriteRawTag(169, 3); + output.WriteDouble(DoubleField53); } - } - - /// Field number for the "double_field_75" field. - public const int DoubleField75FieldNumber = 75; - private double doubleField75_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField75 { - get { return doubleField75_; } - set { - doubleField75_ = value; + if (DoubleField54 != 0D) { + output.WriteRawTag(177, 3); + output.WriteDouble(DoubleField54); } - } - - /// Field number for the "double_field_129" field. - public const int DoubleField129FieldNumber = 129; - private double doubleField129_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField129 { - get { return doubleField129_; } - set { - doubleField129_ = value; + if (DoubleField55 != 0D) { + output.WriteRawTag(185, 3); + output.WriteDouble(DoubleField55); } - } - - /// Field number for the "enum_field_80" field. - public const int EnumField80FieldNumber = 80; - private int enumField80_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int EnumField80 { - get { return enumField80_; } - set { - enumField80_ = value; + if (DoubleField56 != 0D) { + output.WriteRawTag(193, 3); + output.WriteDouble(DoubleField56); } - } - - /// Field number for the "enum_field_81" field. - public const int EnumField81FieldNumber = 81; - private int enumField81_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int EnumField81 { - get { return enumField81_; } - set { - enumField81_ = value; + if (DoubleField57 != 0D) { + output.WriteRawTag(201, 3); + output.WriteDouble(DoubleField57); } - } - - /// Field number for the "int64_field_82" field. - public const int Int64Field82FieldNumber = 82; - private long int64Field82_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field82 { - get { return int64Field82_; } - set { - int64Field82_ = value; + if (DoubleField58 != 0D) { + output.WriteRawTag(209, 3); + output.WriteDouble(DoubleField58); } - } - - /// Field number for the "enum_field_83" field. - public const int EnumField83FieldNumber = 83; - private int enumField83_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int EnumField83 { - get { return enumField83_; } - set { - enumField83_ = value; + if (Int64Field59 != 0L) { + output.WriteRawTag(216, 3); + output.WriteInt64(Int64Field59); } - } - - /// Field number for the "int64_field_85" field. - public const int Int64Field85FieldNumber = 85; - private long int64Field85_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field85 { - get { return int64Field85_; } - set { - int64Field85_ = value; + if (Int64Field60 != 0L) { + output.WriteRawTag(224, 3); + output.WriteInt64(Int64Field60); } - } - - /// Field number for the "int64_field_86" field. - public const int Int64Field86FieldNumber = 86; - private long int64Field86_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field86 { - get { return int64Field86_; } - set { - int64Field86_ = value; + if (DoubleField62 != 0D) { + output.WriteRawTag(241, 3); + output.WriteDouble(DoubleField62); } - } - - /// Field number for the "int64_field_87" field. - public const int Int64Field87FieldNumber = 87; - private long int64Field87_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field87 { - get { return int64Field87_; } - set { - int64Field87_ = value; + if (DoubleField65 != 0D) { + output.WriteRawTag(137, 4); + output.WriteDouble(DoubleField65); } - } - - /// Field number for the "int64_field_125" field. - public const int Int64Field125FieldNumber = 125; - private long int64Field125_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field125 { - get { return int64Field125_; } - set { - int64Field125_ = value; + if (DoubleField66 != 0D) { + output.WriteRawTag(145, 4); + output.WriteDouble(DoubleField66); } - } - - /// Field number for the "int64_field_37" field. - public const int Int64Field37FieldNumber = 37; - private long int64Field37_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field37 { - get { return int64Field37_; } - set { - int64Field37_ = value; + if (DoubleField67 != 0D) { + output.WriteRawTag(153, 4); + output.WriteDouble(DoubleField67); } - } - - /// Field number for the "double_field_38" field. - public const int DoubleField38FieldNumber = 38; - private double doubleField38_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField38 { - get { return doubleField38_; } - set { - doubleField38_ = value; + if (DoubleField68 != 0D) { + output.WriteRawTag(161, 4); + output.WriteDouble(DoubleField68); } - } - - /// Field number for the "interactions" field. - public const int InteractionsFieldNumber = 39; - private long interactions_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Interactions { - get { return interactions_; } - set { - interactions_ = value; + if (DoubleField69 != 0D) { + output.WriteRawTag(169, 4); + output.WriteDouble(DoubleField69); } - } - - /// Field number for the "repeated_int_field_100" field. - public const int RepeatedIntField100FieldNumber = 100; - private static readonly pb::FieldCodec _repeated_repeatedIntField100_codec - = pb::FieldCodec.ForInt32(802); - private readonly pbc::RepeatedField repeatedIntField100_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField RepeatedIntField100 { - get { return repeatedIntField100_; } - } - - /// Field number for the "double_field_40" field. - public const int DoubleField40FieldNumber = 40; - private double doubleField40_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField40 { - get { return doubleField40_; } - set { - doubleField40_ = value; + if (DoubleField70 != 0D) { + output.WriteRawTag(177, 4); + output.WriteDouble(DoubleField70); } - } - - /// Field number for the "int64_field_41" field. - public const int Int64Field41FieldNumber = 41; - private long int64Field41_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field41 { - get { return int64Field41_; } - set { - int64Field41_ = value; + if (DoubleField71 != 0D) { + output.WriteRawTag(185, 4); + output.WriteDouble(DoubleField71); } - } - - /// Field number for the "int64_field_126" field. - public const int Int64Field126FieldNumber = 126; - private long int64Field126_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field126 { - get { return int64Field126_; } - set { - int64Field126_ = value; + if (DoubleField72 != 0D) { + output.WriteRawTag(193, 4); + output.WriteDouble(DoubleField72); } - } - - /// Field number for the "int64_field_127" field. - public const int Int64Field127FieldNumber = 127; - private long int64Field127_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field127 { - get { return int64Field127_; } - set { - int64Field127_ = value; + if (StringField73.Length != 0) { + output.WriteRawTag(202, 4); + output.WriteString(StringField73); } - } - - /// Field number for the "double_field_128" field. - public const int DoubleField128FieldNumber = 128; - private double doubleField128_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField128 { - get { return doubleField128_; } - set { - doubleField128_ = value; + if (StringField74.Length != 0) { + output.WriteRawTag(210, 4); + output.WriteString(StringField74); } - } - - /// Field number for the "double_field_109" field. - public const int DoubleField109FieldNumber = 109; - private double doubleField109_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField109 { - get { return doubleField109_; } - set { - doubleField109_ = value; + if (DoubleField75 != 0D) { + output.WriteRawTag(217, 4); + output.WriteDouble(DoubleField75); } - } - - /// Field number for the "int64_field_110" field. - public const int Int64Field110FieldNumber = 110; - private long int64Field110_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field110 { - get { return int64Field110_; } - set { - int64Field110_ = value; + if (DoubleField77 != 0D) { + output.WriteRawTag(233, 4); + output.WriteDouble(DoubleField77); } - } - - /// Field number for the "double_field_111" field. - public const int DoubleField111FieldNumber = 111; - private double doubleField111_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField111 { - get { return doubleField111_; } - set { - doubleField111_ = value; + if (DoubleField78 != 0D) { + output.WriteRawTag(241, 4); + output.WriteDouble(DoubleField78); } - } - - /// Field number for the "int64_field_112" field. - public const int Int64Field112FieldNumber = 112; - private long int64Field112_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field112 { - get { return int64Field112_; } - set { - int64Field112_ = value; + if (DoubleField79 != 0D) { + output.WriteRawTag(249, 4); + output.WriteDouble(DoubleField79); } - } - - /// Field number for the "double_field_113" field. - public const int DoubleField113FieldNumber = 113; - private double doubleField113_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField113 { - get { return doubleField113_; } - set { - doubleField113_ = value; + if (EnumField80 != 0) { + output.WriteRawTag(128, 5); + output.WriteInt32(EnumField80); } - } - - /// Field number for the "int64_field_114" field. - public const int Int64Field114FieldNumber = 114; - private long int64Field114_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field114 { - get { return int64Field114_; } - set { - int64Field114_ = value; + if (EnumField81 != 0) { + output.WriteRawTag(136, 5); + output.WriteInt32(EnumField81); } - } - - /// Field number for the "double_field_42" field. - public const int DoubleField42FieldNumber = 42; - private double doubleField42_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField42 { - get { return doubleField42_; } - set { - doubleField42_ = value; + if (Int64Field82 != 0L) { + output.WriteRawTag(144, 5); + output.WriteInt64(Int64Field82); } - } - - /// Field number for the "int64_field_43" field. - public const int Int64Field43FieldNumber = 43; - private long int64Field43_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field43 { - get { return int64Field43_; } - set { - int64Field43_ = value; + if (EnumField83 != 0) { + output.WriteRawTag(152, 5); + output.WriteInt32(EnumField83); } - } - - /// Field number for the "int64_field_44" field. - public const int Int64Field44FieldNumber = 44; - private long int64Field44_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field44 { - get { return int64Field44_; } - set { - int64Field44_ = value; + if (DoubleField84 != 0D) { + output.WriteRawTag(161, 5); + output.WriteDouble(DoubleField84); } - } - - /// Field number for the "double_field_45" field. - public const int DoubleField45FieldNumber = 45; - private double doubleField45_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField45 { - get { return doubleField45_; } - set { - doubleField45_ = value; + if (Int64Field85 != 0L) { + output.WriteRawTag(168, 5); + output.WriteInt64(Int64Field85); } - } - - /// Field number for the "double_field_46" field. - public const int DoubleField46FieldNumber = 46; - private double doubleField46_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField46 { - get { return doubleField46_; } - set { - doubleField46_ = value; + if (Int64Field86 != 0L) { + output.WriteRawTag(176, 5); + output.WriteInt64(Int64Field86); } - } - - /// Field number for the "double_field_78" field. - public const int DoubleField78FieldNumber = 78; - private double doubleField78_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField78 { - get { return doubleField78_; } - set { - doubleField78_ = value; + if (Int64Field87 != 0L) { + output.WriteRawTag(184, 5); + output.WriteInt64(Int64Field87); } - } - - /// Field number for the "double_field_88" field. - public const int DoubleField88FieldNumber = 88; - private double doubleField88_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField88 { - get { return doubleField88_; } - set { - doubleField88_ = value; + if (DoubleField88 != 0D) { + output.WriteRawTag(193, 5); + output.WriteDouble(DoubleField88); } - } - - /// Field number for the "double_field_47" field. - public const int DoubleField47FieldNumber = 47; - private double doubleField47_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField47 { - get { return doubleField47_; } - set { - doubleField47_ = value; + if (DoubleField89 != 0D) { + output.WriteRawTag(201, 5); + output.WriteDouble(DoubleField89); } - } - - /// Field number for the "double_field_89" field. - public const int DoubleField89FieldNumber = 89; - private double doubleField89_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField89 { - get { return doubleField89_; } - set { - doubleField89_ = value; + if (DoubleField90 != 0D) { + output.WriteRawTag(209, 5); + output.WriteDouble(DoubleField90); } - } - - /// Field number for the "double_field_48" field. - public const int DoubleField48FieldNumber = 48; - private double doubleField48_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField48 { - get { return doubleField48_; } - set { - doubleField48_ = value; + if (DoubleField91 != 0D) { + output.WriteRawTag(217, 5); + output.WriteDouble(DoubleField91); + } + if (DoubleField92 != 0D) { + output.WriteRawTag(225, 5); + output.WriteDouble(DoubleField92); + } + if (DoubleField93 != 0D) { + output.WriteRawTag(233, 5); + output.WriteDouble(DoubleField93); } - } - - /// Field number for the "double_field_49" field. - public const int DoubleField49FieldNumber = 49; - private double doubleField49_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField49 { - get { return doubleField49_; } - set { - doubleField49_ = value; + if (DoubleField94 != 0D) { + output.WriteRawTag(241, 5); + output.WriteDouble(DoubleField94); } - } - - /// Field number for the "double_field_50" field. - public const int DoubleField50FieldNumber = 50; - private double doubleField50_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField50 { - get { return doubleField50_; } - set { - doubleField50_ = value; + if (DoubleField95 != 0D) { + output.WriteRawTag(249, 5); + output.WriteDouble(DoubleField95); } - } - - /// Field number for the "double_field_90" field. - public const int DoubleField90FieldNumber = 90; - private double doubleField90_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField90 { - get { return doubleField90_; } - set { - doubleField90_ = value; + if (DoubleField96 != 0D) { + output.WriteRawTag(129, 6); + output.WriteDouble(DoubleField96); } - } - - /// Field number for the "double_field_51" field. - public const int DoubleField51FieldNumber = 51; - private double doubleField51_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField51 { - get { return doubleField51_; } - set { - doubleField51_ = value; + if (DoubleField97 != 0D) { + output.WriteRawTag(137, 6); + output.WriteDouble(DoubleField97); } - } - - /// Field number for the "double_field_91" field. - public const int DoubleField91FieldNumber = 91; - private double doubleField91_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField91 { - get { return doubleField91_; } - set { - doubleField91_ = value; + if (DoubleField98 != 0D) { + output.WriteRawTag(145, 6); + output.WriteDouble(DoubleField98); } - } - - /// Field number for the "double_field_92" field. - public const int DoubleField92FieldNumber = 92; - private double doubleField92_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField92 { - get { return doubleField92_; } - set { - doubleField92_ = value; + if (DoubleField99 != 0D) { + output.WriteRawTag(153, 6); + output.WriteDouble(DoubleField99); } - } - - /// Field number for the "int64_field_107" field. - public const int Int64Field107FieldNumber = 107; - private long int64Field107_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field107 { - get { return int64Field107_; } - set { - int64Field107_ = value; + repeatedIntField100_.WriteTo(output, _repeated_repeatedIntField100_codec); + if (DoubleField101 != 0D) { + output.WriteRawTag(169, 6); + output.WriteDouble(DoubleField101); } - } - - /// Field number for the "double_field_93" field. - public const int DoubleField93FieldNumber = 93; - private double doubleField93_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField93 { - get { return doubleField93_; } - set { - doubleField93_ = value; + if (DoubleField102 != 0D) { + output.WriteRawTag(177, 6); + output.WriteDouble(DoubleField102); } - } - - /// Field number for the "double_field_108" field. - public const int DoubleField108FieldNumber = 108; - private double doubleField108_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField108 { - get { return doubleField108_; } - set { - doubleField108_ = value; + if (DoubleField103 != 0D) { + output.WriteRawTag(185, 6); + output.WriteDouble(DoubleField103); } - } - - /// Field number for the "double_field_52" field. - public const int DoubleField52FieldNumber = 52; - private double doubleField52_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField52 { - get { return doubleField52_; } - set { - doubleField52_ = value; + if (DoubleField104 != 0D) { + output.WriteRawTag(193, 6); + output.WriteDouble(DoubleField104); } - } - - /// Field number for the "double_field_53" field. - public const int DoubleField53FieldNumber = 53; - private double doubleField53_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField53 { - get { return doubleField53_; } - set { - doubleField53_ = value; + if (DoubleField105 != 0D) { + output.WriteRawTag(201, 6); + output.WriteDouble(DoubleField105); } - } - - /// Field number for the "double_field_94" field. - public const int DoubleField94FieldNumber = 94; - private double doubleField94_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField94 { - get { return doubleField94_; } - set { - doubleField94_ = value; + if (DoubleField106 != 0D) { + output.WriteRawTag(209, 6); + output.WriteDouble(DoubleField106); } - } - - /// Field number for the "double_field_54" field. - public const int DoubleField54FieldNumber = 54; - private double doubleField54_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField54 { - get { return doubleField54_; } - set { - doubleField54_ = value; + if (Int64Field107 != 0L) { + output.WriteRawTag(216, 6); + output.WriteInt64(Int64Field107); } - } - - /// Field number for the "double_field_55" field. - public const int DoubleField55FieldNumber = 55; - private double doubleField55_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField55 { - get { return doubleField55_; } - set { - doubleField55_ = value; + if (DoubleField108 != 0D) { + output.WriteRawTag(225, 6); + output.WriteDouble(DoubleField108); } - } - - /// Field number for the "double_field_56" field. - public const int DoubleField56FieldNumber = 56; - private double doubleField56_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField56 { - get { return doubleField56_; } - set { - doubleField56_ = value; + if (DoubleField109 != 0D) { + output.WriteRawTag(233, 6); + output.WriteDouble(DoubleField109); } - } - - /// Field number for the "double_field_57" field. - public const int DoubleField57FieldNumber = 57; - private double doubleField57_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField57 { - get { return doubleField57_; } - set { - doubleField57_ = value; + if (Int64Field110 != 0L) { + output.WriteRawTag(240, 6); + output.WriteInt64(Int64Field110); } - } - - /// Field number for the "double_field_58" field. - public const int DoubleField58FieldNumber = 58; - private double doubleField58_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public double DoubleField58 { - get { return doubleField58_; } - set { - doubleField58_ = value; + if (DoubleField111 != 0D) { + output.WriteRawTag(249, 6); + output.WriteDouble(DoubleField111); } - } - - /// Field number for the "int64_field_59" field. - public const int Int64Field59FieldNumber = 59; - private long int64Field59_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field59 { - get { return int64Field59_; } - set { - int64Field59_ = value; + if (Int64Field112 != 0L) { + output.WriteRawTag(128, 7); + output.WriteInt64(Int64Field112); } - } - - /// Field number for the "int64_field_60" field. - public const int Int64Field60FieldNumber = 60; - private long int64Field60_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Int64Field60 { - get { return int64Field60_; } - set { - int64Field60_ = value; + if (DoubleField113 != 0D) { + output.WriteRawTag(137, 7); + output.WriteDouble(DoubleField113); + } + if (Int64Field114 != 0L) { + output.WriteRawTag(144, 7); + output.WriteInt64(Int64Field114); + } + if (Int64Field115 != 0L) { + output.WriteRawTag(152, 7); + output.WriteInt64(Int64Field115); } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ManyPrimitiveFieldsMessage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ManyPrimitiveFieldsMessage other) { - if (ReferenceEquals(other, null)) { - return false; + if (DoubleField116 != 0D) { + output.WriteRawTag(161, 7); + output.WriteDouble(DoubleField116); } - if (ReferenceEquals(other, this)) { - return true; + if (Int64Field117 != 0L) { + output.WriteRawTag(168, 7); + output.WriteInt64(Int64Field117); + } + if (DoubleField118 != 0D) { + output.WriteRawTag(177, 7); + output.WriteDouble(DoubleField118); + } + if (DoubleField119 != 0D) { + output.WriteRawTag(185, 7); + output.WriteDouble(DoubleField119); + } + if (DoubleField120 != 0D) { + output.WriteRawTag(193, 7); + output.WriteDouble(DoubleField120); + } + if (DoubleField121 != 0D) { + output.WriteRawTag(201, 7); + output.WriteDouble(DoubleField121); + } + if (DoubleField122 != 0D) { + output.WriteRawTag(209, 7); + output.WriteDouble(DoubleField122); + } + if (DoubleField123 != 0D) { + output.WriteRawTag(217, 7); + output.WriteDouble(DoubleField123); + } + if (DoubleField124 != 0D) { + output.WriteRawTag(225, 7); + output.WriteDouble(DoubleField124); + } + if (Int64Field125 != 0L) { + output.WriteRawTag(232, 7); + output.WriteInt64(Int64Field125); + } + if (Int64Field126 != 0L) { + output.WriteRawTag(240, 7); + output.WriteInt64(Int64Field126); + } + if (Int64Field127 != 0L) { + output.WriteRawTag(248, 7); + output.WriteInt64(Int64Field127); + } + if (DoubleField128 != 0D) { + output.WriteRawTag(129, 8); + output.WriteDouble(DoubleField128); + } + if (DoubleField129 != 0D) { + output.WriteRawTag(137, 8); + output.WriteDouble(DoubleField129); } - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField95, other.DoubleField95)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField1, other.DoubleField1)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField79, other.DoubleField79)) return false; - if (Int64Field2 != other.Int64Field2) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField96, other.DoubleField96)) return false; - if (Int64Field3 != other.Int64Field3) return false; - if (Int64Field4 != other.Int64Field4) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField97, other.DoubleField97)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField65, other.DoubleField65)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField66, other.DoubleField66)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField7, other.DoubleField7)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField62, other.DoubleField62)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField118, other.DoubleField118)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField119, other.DoubleField119)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField67, other.DoubleField67)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField120, other.DoubleField120)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField121, other.DoubleField121)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField122, other.DoubleField122)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField123, other.DoubleField123)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField124, other.DoubleField124)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField8, other.DoubleField8)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField9, other.DoubleField9)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField98, other.DoubleField98)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField10, other.DoubleField10)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField11, other.DoubleField11)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField99, other.DoubleField99)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField84, other.DoubleField84)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField14, other.DoubleField14)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField77, other.DoubleField77)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField15, other.DoubleField15)) return false; - if (Int64Field19 != other.Int64Field19) return false; - if (Int64Field115 != other.Int64Field115) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField116, other.DoubleField116)) return false; - if (Int64Field117 != other.Int64Field117) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField20, other.DoubleField20)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField21, other.DoubleField21)) return false; - if (StringField73 != other.StringField73) return false; - if (StringField74 != other.StringField74) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField22, other.DoubleField22)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField69, other.DoubleField69)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField70, other.DoubleField70)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField71, other.DoubleField71)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField72, other.DoubleField72)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField25, other.DoubleField25)) return false; - if (Int64Field26 != other.Int64Field26) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField68, other.DoubleField68)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField28, other.DoubleField28)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField106, other.DoubleField106)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField29, other.DoubleField29)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField30, other.DoubleField30)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField101, other.DoubleField101)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField102, other.DoubleField102)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField103, other.DoubleField103)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField104, other.DoubleField104)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField105, other.DoubleField105)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField31, other.DoubleField31)) return false; - if (Int64Field32 != other.Int64Field32) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField75, other.DoubleField75)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField129, other.DoubleField129)) return false; - if (EnumField80 != other.EnumField80) return false; - if (EnumField81 != other.EnumField81) return false; - if (Int64Field82 != other.Int64Field82) return false; - if (EnumField83 != other.EnumField83) return false; - if (Int64Field85 != other.Int64Field85) return false; - if (Int64Field86 != other.Int64Field86) return false; - if (Int64Field87 != other.Int64Field87) return false; - if (Int64Field125 != other.Int64Field125) return false; - if (Int64Field37 != other.Int64Field37) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField38, other.DoubleField38)) return false; - if (Interactions != other.Interactions) return false; - if(!repeatedIntField100_.Equals(other.repeatedIntField100_)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField40, other.DoubleField40)) return false; - if (Int64Field41 != other.Int64Field41) return false; - if (Int64Field126 != other.Int64Field126) return false; - if (Int64Field127 != other.Int64Field127) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField128, other.DoubleField128)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField109, other.DoubleField109)) return false; - if (Int64Field110 != other.Int64Field110) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField111, other.DoubleField111)) return false; - if (Int64Field112 != other.Int64Field112) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField113, other.DoubleField113)) return false; - if (Int64Field114 != other.Int64Field114) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField42, other.DoubleField42)) return false; - if (Int64Field43 != other.Int64Field43) return false; - if (Int64Field44 != other.Int64Field44) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField45, other.DoubleField45)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField46, other.DoubleField46)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField78, other.DoubleField78)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField88, other.DoubleField88)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField47, other.DoubleField47)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField89, other.DoubleField89)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField48, other.DoubleField48)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField49, other.DoubleField49)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField50, other.DoubleField50)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField90, other.DoubleField90)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField51, other.DoubleField51)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField91, other.DoubleField91)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField92, other.DoubleField92)) return false; - if (Int64Field107 != other.Int64Field107) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField93, other.DoubleField93)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField108, other.DoubleField108)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField52, other.DoubleField52)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField53, other.DoubleField53)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField94, other.DoubleField94)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField54, other.DoubleField54)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField55, other.DoubleField55)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField56, other.DoubleField56)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField57, other.DoubleField57)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleField58, other.DoubleField58)) return false; - if (Int64Field59 != other.Int64Field59) return false; - if (Int64Field60 != other.Int64Field60) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (DoubleField95 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField95); - if (DoubleField1 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField1); - if (DoubleField79 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField79); - if (Int64Field2 != 0L) hash ^= Int64Field2.GetHashCode(); - if (DoubleField96 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField96); - if (Int64Field3 != 0L) hash ^= Int64Field3.GetHashCode(); - if (Int64Field4 != 0L) hash ^= Int64Field4.GetHashCode(); - if (DoubleField97 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField97); - if (DoubleField65 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField65); - if (DoubleField66 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField66); - if (DoubleField7 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField7); - if (DoubleField62 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField62); - if (DoubleField118 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField118); - if (DoubleField119 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField119); - if (DoubleField67 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField67); - if (DoubleField120 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField120); - if (DoubleField121 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField121); - if (DoubleField122 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField122); - if (DoubleField123 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField123); - if (DoubleField124 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField124); - if (DoubleField8 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField8); - if (DoubleField9 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField9); - if (DoubleField98 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField98); - if (DoubleField10 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField10); - if (DoubleField11 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField11); - if (DoubleField99 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField99); - if (DoubleField84 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField84); - if (DoubleField14 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField14); - if (DoubleField77 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField77); - if (DoubleField15 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField15); - if (Int64Field19 != 0L) hash ^= Int64Field19.GetHashCode(); - if (Int64Field115 != 0L) hash ^= Int64Field115.GetHashCode(); - if (DoubleField116 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField116); - if (Int64Field117 != 0L) hash ^= Int64Field117.GetHashCode(); - if (DoubleField20 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField20); - if (DoubleField21 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField21); - if (StringField73.Length != 0) hash ^= StringField73.GetHashCode(); - if (StringField74.Length != 0) hash ^= StringField74.GetHashCode(); - if (DoubleField22 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField22); - if (DoubleField69 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField69); - if (DoubleField70 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField70); - if (DoubleField71 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField71); - if (DoubleField72 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField72); - if (DoubleField25 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField25); - if (Int64Field26 != 0L) hash ^= Int64Field26.GetHashCode(); - if (DoubleField68 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField68); - if (DoubleField28 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField28); - if (DoubleField106 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField106); - if (DoubleField29 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField29); - if (DoubleField30 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField30); - if (DoubleField101 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField101); - if (DoubleField102 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField102); - if (DoubleField103 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField103); - if (DoubleField104 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField104); - if (DoubleField105 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField105); - if (DoubleField31 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField31); - if (Int64Field32 != 0L) hash ^= Int64Field32.GetHashCode(); - if (DoubleField75 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField75); - if (DoubleField129 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField129); - if (EnumField80 != 0) hash ^= EnumField80.GetHashCode(); - if (EnumField81 != 0) hash ^= EnumField81.GetHashCode(); - if (Int64Field82 != 0L) hash ^= Int64Field82.GetHashCode(); - if (EnumField83 != 0) hash ^= EnumField83.GetHashCode(); - if (Int64Field85 != 0L) hash ^= Int64Field85.GetHashCode(); - if (Int64Field86 != 0L) hash ^= Int64Field86.GetHashCode(); - if (Int64Field87 != 0L) hash ^= Int64Field87.GetHashCode(); - if (Int64Field125 != 0L) hash ^= Int64Field125.GetHashCode(); - if (Int64Field37 != 0L) hash ^= Int64Field37.GetHashCode(); - if (DoubleField38 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField38); - if (Interactions != 0L) hash ^= Interactions.GetHashCode(); - hash ^= repeatedIntField100_.GetHashCode(); - if (DoubleField40 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField40); - if (Int64Field41 != 0L) hash ^= Int64Field41.GetHashCode(); - if (Int64Field126 != 0L) hash ^= Int64Field126.GetHashCode(); - if (Int64Field127 != 0L) hash ^= Int64Field127.GetHashCode(); - if (DoubleField128 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField128); - if (DoubleField109 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField109); - if (Int64Field110 != 0L) hash ^= Int64Field110.GetHashCode(); - if (DoubleField111 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField111); - if (Int64Field112 != 0L) hash ^= Int64Field112.GetHashCode(); - if (DoubleField113 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField113); - if (Int64Field114 != 0L) hash ^= Int64Field114.GetHashCode(); - if (DoubleField42 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField42); - if (Int64Field43 != 0L) hash ^= Int64Field43.GetHashCode(); - if (Int64Field44 != 0L) hash ^= Int64Field44.GetHashCode(); - if (DoubleField45 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField45); - if (DoubleField46 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField46); - if (DoubleField78 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField78); - if (DoubleField88 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField88); - if (DoubleField47 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField47); - if (DoubleField89 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField89); - if (DoubleField48 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField48); - if (DoubleField49 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField49); - if (DoubleField50 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField50); - if (DoubleField90 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField90); - if (DoubleField51 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField51); - if (DoubleField91 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField91); - if (DoubleField92 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField92); - if (Int64Field107 != 0L) hash ^= Int64Field107.GetHashCode(); - if (DoubleField93 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField93); - if (DoubleField108 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField108); - if (DoubleField52 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField52); - if (DoubleField53 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField53); - if (DoubleField94 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField94); - if (DoubleField54 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField54); - if (DoubleField55 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField55); - if (DoubleField56 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField56); - if (DoubleField57 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField57); - if (DoubleField58 != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleField58); - if (Int64Field59 != 0L) hash ^= Int64Field59.GetHashCode(); - if (Int64Field60 != 0L) hash ^= Int64Field60.GetHashCode(); if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); + _unknownFields.WriteTo(output); } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (DoubleField1 != 0D) { output.WriteRawTag(9); output.WriteDouble(DoubleField1); @@ -6027,7 +7869,7 @@ namespace Google.Protobuf.Benchmarks { output.WriteRawTag(153, 6); output.WriteDouble(DoubleField99); } - repeatedIntField100_.WriteTo(output, _repeated_repeatedIntField100_codec); + repeatedIntField100_.WriteTo(ref output, _repeated_repeatedIntField100_codec); if (DoubleField101 != 0D) { output.WriteRawTag(169, 6); output.WriteDouble(DoubleField101); @@ -6145,11 +7987,13 @@ namespace Google.Protobuf.Benchmarks { output.WriteDouble(DoubleField129); } if (_unknownFields != null) { - _unknownFields.WriteTo(output); + _unknownFields.WriteTo(ref output); } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (DoubleField95 != 0D) { @@ -6490,6 +8334,7 @@ namespace Google.Protobuf.Benchmarks { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ManyPrimitiveFieldsMessage other) { if (other == null) { return; @@ -6825,16 +8670,480 @@ namespace Google.Protobuf.Benchmarks { if (other.Int64Field60 != 0L) { Int64Field60 = other.Int64Field60; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + DoubleField1 = input.ReadDouble(); + break; + } + case 16: { + Int64Field2 = input.ReadInt64(); + break; + } + case 24: { + Int64Field3 = input.ReadInt64(); + break; + } + case 32: { + Int64Field4 = input.ReadInt64(); + break; + } + case 57: { + DoubleField7 = input.ReadDouble(); + break; + } + case 65: { + DoubleField8 = input.ReadDouble(); + break; + } + case 73: { + DoubleField9 = input.ReadDouble(); + break; + } + case 81: { + DoubleField10 = input.ReadDouble(); + break; + } + case 89: { + DoubleField11 = input.ReadDouble(); + break; + } + case 113: { + DoubleField14 = input.ReadDouble(); + break; + } + case 121: { + DoubleField15 = input.ReadDouble(); + break; + } + case 152: { + Int64Field19 = input.ReadInt64(); + break; + } + case 161: { + DoubleField20 = input.ReadDouble(); + break; + } + case 169: { + DoubleField21 = input.ReadDouble(); + break; + } + case 177: { + DoubleField22 = input.ReadDouble(); + break; + } + case 201: { + DoubleField25 = input.ReadDouble(); + break; + } + case 208: { + Int64Field26 = input.ReadInt64(); + break; + } + case 225: { + DoubleField28 = input.ReadDouble(); + break; + } + case 233: { + DoubleField29 = input.ReadDouble(); + break; + } + case 241: { + DoubleField30 = input.ReadDouble(); + break; + } + case 249: { + DoubleField31 = input.ReadDouble(); + break; + } + case 256: { + Int64Field32 = input.ReadInt64(); + break; + } + case 296: { + Int64Field37 = input.ReadInt64(); + break; + } + case 305: { + DoubleField38 = input.ReadDouble(); + break; + } + case 312: { + Interactions = input.ReadInt64(); + break; + } + case 321: { + DoubleField40 = input.ReadDouble(); + break; + } + case 328: { + Int64Field41 = input.ReadInt64(); + break; + } + case 337: { + DoubleField42 = input.ReadDouble(); + break; + } + case 344: { + Int64Field43 = input.ReadInt64(); + break; + } + case 352: { + Int64Field44 = input.ReadInt64(); + break; + } + case 361: { + DoubleField45 = input.ReadDouble(); + break; + } + case 369: { + DoubleField46 = input.ReadDouble(); + break; + } + case 377: { + DoubleField47 = input.ReadDouble(); + break; + } + case 385: { + DoubleField48 = input.ReadDouble(); + break; + } + case 393: { + DoubleField49 = input.ReadDouble(); + break; + } + case 401: { + DoubleField50 = input.ReadDouble(); + break; + } + case 409: { + DoubleField51 = input.ReadDouble(); + break; + } + case 417: { + DoubleField52 = input.ReadDouble(); + break; + } + case 425: { + DoubleField53 = input.ReadDouble(); + break; + } + case 433: { + DoubleField54 = input.ReadDouble(); + break; + } + case 441: { + DoubleField55 = input.ReadDouble(); + break; + } + case 449: { + DoubleField56 = input.ReadDouble(); + break; + } + case 457: { + DoubleField57 = input.ReadDouble(); + break; + } + case 465: { + DoubleField58 = input.ReadDouble(); + break; + } + case 472: { + Int64Field59 = input.ReadInt64(); + break; + } + case 480: { + Int64Field60 = input.ReadInt64(); + break; + } + case 497: { + DoubleField62 = input.ReadDouble(); + break; + } + case 521: { + DoubleField65 = input.ReadDouble(); + break; + } + case 529: { + DoubleField66 = input.ReadDouble(); + break; + } + case 537: { + DoubleField67 = input.ReadDouble(); + break; + } + case 545: { + DoubleField68 = input.ReadDouble(); + break; + } + case 553: { + DoubleField69 = input.ReadDouble(); + break; + } + case 561: { + DoubleField70 = input.ReadDouble(); + break; + } + case 569: { + DoubleField71 = input.ReadDouble(); + break; + } + case 577: { + DoubleField72 = input.ReadDouble(); + break; + } + case 586: { + StringField73 = input.ReadString(); + break; + } + case 594: { + StringField74 = input.ReadString(); + break; + } + case 601: { + DoubleField75 = input.ReadDouble(); + break; + } + case 617: { + DoubleField77 = input.ReadDouble(); + break; + } + case 625: { + DoubleField78 = input.ReadDouble(); + break; + } + case 633: { + DoubleField79 = input.ReadDouble(); + break; + } + case 640: { + EnumField80 = input.ReadInt32(); + break; + } + case 648: { + EnumField81 = input.ReadInt32(); + break; + } + case 656: { + Int64Field82 = input.ReadInt64(); + break; + } + case 664: { + EnumField83 = input.ReadInt32(); + break; + } + case 673: { + DoubleField84 = input.ReadDouble(); + break; + } + case 680: { + Int64Field85 = input.ReadInt64(); + break; + } + case 688: { + Int64Field86 = input.ReadInt64(); + break; + } + case 696: { + Int64Field87 = input.ReadInt64(); + break; + } + case 705: { + DoubleField88 = input.ReadDouble(); + break; + } + case 713: { + DoubleField89 = input.ReadDouble(); + break; + } + case 721: { + DoubleField90 = input.ReadDouble(); + break; + } + case 729: { + DoubleField91 = input.ReadDouble(); + break; + } + case 737: { + DoubleField92 = input.ReadDouble(); + break; + } + case 745: { + DoubleField93 = input.ReadDouble(); + break; + } + case 753: { + DoubleField94 = input.ReadDouble(); + break; + } + case 761: { + DoubleField95 = input.ReadDouble(); + break; + } + case 769: { + DoubleField96 = input.ReadDouble(); + break; + } + case 777: { + DoubleField97 = input.ReadDouble(); + break; + } + case 785: { + DoubleField98 = input.ReadDouble(); + break; + } + case 793: { + DoubleField99 = input.ReadDouble(); + break; + } + case 802: + case 800: { + repeatedIntField100_.AddEntriesFrom(input, _repeated_repeatedIntField100_codec); + break; + } + case 809: { + DoubleField101 = input.ReadDouble(); + break; + } + case 817: { + DoubleField102 = input.ReadDouble(); + break; + } + case 825: { + DoubleField103 = input.ReadDouble(); + break; + } + case 833: { + DoubleField104 = input.ReadDouble(); + break; + } + case 841: { + DoubleField105 = input.ReadDouble(); + break; + } + case 849: { + DoubleField106 = input.ReadDouble(); + break; + } + case 856: { + Int64Field107 = input.ReadInt64(); + break; + } + case 865: { + DoubleField108 = input.ReadDouble(); + break; + } + case 873: { + DoubleField109 = input.ReadDouble(); + break; + } + case 880: { + Int64Field110 = input.ReadInt64(); + break; + } + case 889: { + DoubleField111 = input.ReadDouble(); + break; + } + case 896: { + Int64Field112 = input.ReadInt64(); + break; + } + case 905: { + DoubleField113 = input.ReadDouble(); + break; + } + case 912: { + Int64Field114 = input.ReadInt64(); + break; + } + case 920: { + Int64Field115 = input.ReadInt64(); + break; + } + case 929: { + DoubleField116 = input.ReadDouble(); + break; + } + case 936: { + Int64Field117 = input.ReadInt64(); + break; + } + case 945: { + DoubleField118 = input.ReadDouble(); + break; + } + case 953: { + DoubleField119 = input.ReadDouble(); + break; + } + case 961: { + DoubleField120 = input.ReadDouble(); + break; + } + case 969: { + DoubleField121 = input.ReadDouble(); + break; + } + case 977: { + DoubleField122 = input.ReadDouble(); + break; + } + case 985: { + DoubleField123 = input.ReadDouble(); + break; + } + case 993: { + DoubleField124 = input.ReadDouble(); + break; + } + case 1000: { + Int64Field125 = input.ReadInt64(); + break; + } + case 1008: { + Int64Field126 = input.ReadInt64(); + break; + } + case 1016: { + Int64Field127 = input.ReadInt64(); + break; + } + case 1025: { + DoubleField128 = input.ReadDouble(); + break; + } + case 1033: { + DoubleField129 = input.ReadDouble(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 9: { DoubleField1 = input.ReadDouble(); @@ -7162,7 +9471,7 @@ namespace Google.Protobuf.Benchmarks { } case 802: case 800: { - repeatedIntField100_.AddEntriesFrom(input, _repeated_repeatedIntField100_codec); + repeatedIntField100_.AddEntriesFrom(ref input, _repeated_repeatedIntField100_codec); break; } case 809: { @@ -7284,6 +9593,7 @@ namespace Google.Protobuf.Benchmarks { } } } + #endif } diff --git a/csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs new file mode 100644 index 0000000000..5a3bba74d2 --- /dev/null +++ b/csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs @@ -0,0 +1,198 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using BenchmarkDotNet.Attributes; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Buffers; +using Google.Protobuf.WellKnownTypes; + +namespace Google.Protobuf.Benchmarks +{ + /// + /// Benchmark that tests writing performance for various messages. + /// + [MemoryDiagnoser] + public class WriteMessagesBenchmark + { + const int MaxMessages = 100; + + SubTest manyWrapperFieldsTest = new SubTest(ParseMessagesBenchmark.CreateManyWrapperFieldsMessage(), MaxMessages); + SubTest manyPrimitiveFieldsTest = new SubTest(ParseMessagesBenchmark.CreateManyPrimitiveFieldsMessage(), MaxMessages); + SubTest emptyMessageTest = new SubTest(new Empty(), MaxMessages); + + public IEnumerable MessageCountValues => new[] { 10, 100 }; + + [GlobalSetup] + public void GlobalSetup() + { + } + + [Benchmark] + public byte[] ManyWrapperFieldsMessage_ToByteArray() + { + return manyWrapperFieldsTest.ToByteArray(); + } + + [Benchmark] + public byte[] ManyWrapperFieldsMessage_WriteToCodedOutputStream() + { + return manyWrapperFieldsTest.WriteToCodedOutputStream_PreAllocatedBuffer(); + } + + [Benchmark] + public byte[] ManyWrapperFieldsMessage_WriteToSpan() + { + return manyWrapperFieldsTest.WriteToSpan_PreAllocatedBuffer(); + } + + + [Benchmark] + public byte[] ManyPrimitiveFieldsMessage_ToByteArray() + { + return manyPrimitiveFieldsTest.ToByteArray(); + } + + [Benchmark] + public byte[] ManyPrimitiveFieldsMessage_WriteToCodedOutputStream() + { + return manyPrimitiveFieldsTest.WriteToCodedOutputStream_PreAllocatedBuffer(); + } + + [Benchmark] + public byte[] ManyPrimitiveFieldsMessage_WriteToSpan() + { + return manyPrimitiveFieldsTest.WriteToSpan_PreAllocatedBuffer(); + } + + [Benchmark] + public byte[] EmptyMessage_ToByteArray() + { + return emptyMessageTest.ToByteArray(); + } + + [Benchmark] + public byte[] EmptyMessage_WriteToCodedOutputStream() + { + return emptyMessageTest.WriteToCodedOutputStream_PreAllocatedBuffer(); + } + + [Benchmark] + public byte[] EmptyMessage_WriteToSpan() + { + return emptyMessageTest.WriteToSpan_PreAllocatedBuffer(); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyWrapperFieldsMessage_WriteDelimitedMessagesToCodedOutputStream(int messageCount) + { + manyWrapperFieldsTest.WriteDelimitedMessagesToCodedOutputStream_PreAllocatedBuffer(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyWrapperFieldsMessage_WriteDelimitedMessagesToSpan(int messageCount) + { + manyWrapperFieldsTest.WriteDelimitedMessagesToSpan_PreAllocatedBuffer(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyPrimitiveFieldsMessage_WriteDelimitedMessagesToCodedOutputStream(int messageCount) + { + manyPrimitiveFieldsTest.WriteDelimitedMessagesToCodedOutputStream_PreAllocatedBuffer(messageCount); + } + + [Benchmark] + [ArgumentsSource(nameof(MessageCountValues))] + public void ManyPrimitiveFieldsMessage_WriteDelimitedMessagesToSpan(int messageCount) + { + manyPrimitiveFieldsTest.WriteDelimitedMessagesToSpan_PreAllocatedBuffer(messageCount); + } + + private class SubTest + { + private readonly IMessage message; + private readonly byte[] outputBuffer; + private readonly byte[] multipleMessagesOutputBuffer; + + public SubTest(IMessage message, int maxMessageCount) + { + this.message = message; + + int messageSize = message.CalculateSize(); + this.outputBuffer = new byte[messageSize]; + this.multipleMessagesOutputBuffer = new byte[maxMessageCount * (messageSize + CodedOutputStream.ComputeLengthSize(messageSize))]; + } + + public byte[] ToByteArray() => message.ToByteArray(); + + public byte[] WriteToCodedOutputStream_PreAllocatedBuffer() + { + var cos = new CodedOutputStream(outputBuffer); // use pre-existing output buffer + message.WriteTo(cos); + return outputBuffer; + } + + public byte[] WriteToSpan_PreAllocatedBuffer() + { + var span = new Span(outputBuffer); // use pre-existing output buffer + message.WriteTo(span); + return outputBuffer; + } + + public byte[] WriteDelimitedMessagesToCodedOutputStream_PreAllocatedBuffer(int messageCount) + { + var cos = new CodedOutputStream(multipleMessagesOutputBuffer); // use pre-existing output buffer + for (int i = 0; i < messageCount; i++) + { + cos.WriteMessage(message); + } + return multipleMessagesOutputBuffer; + } + + public byte[] WriteDelimitedMessagesToSpan_PreAllocatedBuffer(int messageCount) + { + var span = new Span(multipleMessagesOutputBuffer); // use pre-existing output buffer + WriteContext.Initialize(ref span, out WriteContext ctx); + for (int i = 0; i < messageCount; i++) + { + ctx.WriteMessage(message); + } + return multipleMessagesOutputBuffer; + } + } + } +} diff --git a/csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs new file mode 100644 index 0000000000..66b6b4a028 --- /dev/null +++ b/csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs @@ -0,0 +1,519 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2019 Google Inc. All rights reserved. +// https://github.com/protocolbuffers/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using BenchmarkDotNet.Attributes; +using System; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Buffers; +using System.Text; + +namespace Google.Protobuf.Benchmarks +{ + /// + /// Benchmarks throughput when writing raw primitives. + /// + [MemoryDiagnoser] + public class WriteRawPrimitivesBenchmark + { + // key is the encodedSize of varint values + Dictionary varint32Values; + Dictionary varint64Values; + + double[] doubleValues; + float[] floatValues; + + // key is the encodedSize of string values + Dictionary stringValues; + + // key is the encodedSize of string values + Dictionary nonAsciiStringValues; + + // key is the encodedSize of string values + Dictionary byteStringValues; + + // the buffer to which all the data will be written + byte[] outputBuffer; + + Random random = new Random(417384220); // random but deterministic seed + + public IEnumerable StringEncodedSizes => new[] { 1, 4, 10, 105, 10080 }; + + public IEnumerable NonAsciiStringEncodedSizes => new[] { 4, 10, 105, 10080 }; + + [GlobalSetup] + public void GlobalSetup() + { + outputBuffer = new byte[BytesToWrite]; + + varint32Values = new Dictionary(); + varint64Values = new Dictionary(); + for (int encodedSize = 1; encodedSize <= 10; encodedSize++) + { + if (encodedSize <= 5) + { + varint32Values.Add(encodedSize, CreateRandomVarints32(random, BytesToWrite / encodedSize, encodedSize)); + } + varint64Values.Add(encodedSize, CreateRandomVarints64(random, BytesToWrite / encodedSize, encodedSize)); + } + + doubleValues = CreateRandomDoubles(random, BytesToWrite / sizeof(double)); + floatValues = CreateRandomFloats(random, BytesToWrite / sizeof(float)); + + stringValues = new Dictionary(); + + byteStringValues = new Dictionary(); + foreach(var encodedSize in StringEncodedSizes) + { + stringValues.Add(encodedSize, CreateStrings(BytesToWrite / encodedSize, encodedSize)); + byteStringValues.Add(encodedSize, CreateByteStrings(BytesToWrite / encodedSize, encodedSize)); + } + + nonAsciiStringValues = new Dictionary(); + foreach(var encodedSize in NonAsciiStringEncodedSizes) + { + nonAsciiStringValues.Add(encodedSize, CreateNonAsciiStrings(BytesToWrite / encodedSize, encodedSize)); + } + } + + // Total number of bytes that each benchmark will write. + // Measuring the time taken to write buffer of given size makes it easier to compare parsing speed for different + // types and makes it easy to calculate the througput (in MB/s) + // 10800 bytes is chosen because it is divisible by all possible encoded sizes for all primitive types {1..10} + [Params(10080)] + public int BytesToWrite { get; set; } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + public void WriteRawVarint32_CodedOutputStream(int encodedSize) + { + var values = varint32Values[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + for (int i = 0; i < values.Length; i++) + { + cos.WriteRawVarint32(values[i]); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + public void WriteRawVarint32_WriteContext(int encodedSize) + { + var values = varint32Values[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (int i = 0; i < values.Length; i++) + { + ctx.WriteUInt32(values[i]); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + [Arguments(6)] + [Arguments(7)] + [Arguments(8)] + [Arguments(9)] + [Arguments(10)] + public void WriteRawVarint64_CodedOutputStream(int encodedSize) + { + var values = varint64Values[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + for (int i = 0; i < values.Length; i++) + { + cos.WriteRawVarint64(values[i]); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [Arguments(1)] + [Arguments(2)] + [Arguments(3)] + [Arguments(4)] + [Arguments(5)] + [Arguments(6)] + [Arguments(7)] + [Arguments(8)] + [Arguments(9)] + [Arguments(10)] + public void WriteRawVarint64_WriteContext(int encodedSize) + { + var values = varint64Values[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (int i = 0; i < values.Length; i++) + { + ctx.WriteUInt64(values[i]); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteFixed32_CodedOutputStream() + { + const int encodedSize = sizeof(uint); + var cos = new CodedOutputStream(outputBuffer); + for (int i = 0; i < BytesToWrite / encodedSize; i++) + { + cos.WriteFixed32(12345); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteFixed32_WriteContext() + { + const int encodedSize = sizeof(uint); + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteFixed32(12345); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteFixed64_CodedOutputStream() + { + const int encodedSize = sizeof(ulong); + var cos = new CodedOutputStream(outputBuffer); + for(int i = 0; i < BytesToWrite / encodedSize; i++) + { + cos.WriteFixed64(123456789); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteFixed64_WriteContext() + { + const int encodedSize = sizeof(ulong); + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteFixed64(123456789); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawTag_OneByte_WriteContext() + { + const int encodedSize = 1; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteRawTag(16); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawTag_TwoBytes_WriteContext() + { + const int encodedSize = 2; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteRawTag(137, 6); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawTag_ThreeBytes_WriteContext() + { + const int encodedSize = 3; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + for (uint i = 0; i < BytesToWrite / encodedSize; i++) + { + ctx.WriteRawTag(160, 131, 1); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void Baseline_WriteContext() + { + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + ctx.state.position = outputBuffer.Length; + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawFloat_CodedOutputStream() + { + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in floatValues) + { + cos.WriteFloat(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawFloat_WriteContext() + { + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in floatValues) + { + ctx.WriteFloat(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawDouble_CodedOutputStream() + { + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in doubleValues) + { + cos.WriteDouble(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + public void WriteRawDouble_WriteContext() + { + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in doubleValues) + { + ctx.WriteDouble(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public void WriteString_CodedOutputStream(int encodedSize) + { + var values = stringValues[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in values) + { + cos.WriteString(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public void WriteString_WriteContext(int encodedSize) + { + var values = stringValues[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in values) + { + ctx.WriteString(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(NonAsciiStringEncodedSizes))] + public void WriteNonAsciiString_CodedOutputStream(int encodedSize) + { + var values = nonAsciiStringValues[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in values) + { + cos.WriteString(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(NonAsciiStringEncodedSizes))] + public void WriteNonAsciiString_WriteContext(int encodedSize) + { + var values = nonAsciiStringValues[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in values) + { + ctx.WriteString(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public void WriteBytes_CodedOutputStream(int encodedSize) + { + var values = byteStringValues[encodedSize]; + var cos = new CodedOutputStream(outputBuffer); + foreach (var value in values) + { + cos.WriteBytes(value); + } + cos.Flush(); + cos.CheckNoSpaceLeft(); + } + + [Benchmark] + [ArgumentsSource(nameof(StringEncodedSizes))] + public void WriteBytes_WriteContext(int encodedSize) + { + var values = byteStringValues[encodedSize]; + var span = new Span(outputBuffer); + WriteContext.Initialize(ref span, out WriteContext ctx); + foreach (var value in values) + { + ctx.WriteBytes(value); + } + ctx.Flush(); + ctx.CheckNoSpaceLeft(); + } + + private static uint[] CreateRandomVarints32(Random random, int valueCount, int encodedSize) + { + var result = new uint[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = (uint) ParseRawPrimitivesBenchmark.RandomUnsignedVarint(random, encodedSize, true); + } + return result; + } + + private static ulong[] CreateRandomVarints64(Random random, int valueCount, int encodedSize) + { + var result = new ulong[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = ParseRawPrimitivesBenchmark.RandomUnsignedVarint(random, encodedSize, false); + } + return result; + } + + private static float[] CreateRandomFloats(Random random, int valueCount) + { + var result = new float[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = (float)random.NextDouble(); + } + return result; + } + + private static double[] CreateRandomDoubles(Random random, int valueCount) + { + var result = new double[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = random.NextDouble(); + } + return result; + } + + private static string[] CreateStrings(int valueCount, int encodedSize) + { + var str = ParseRawPrimitivesBenchmark.CreateStringWithEncodedSize(encodedSize); + + var result = new string[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = str; + } + return result; + } + + private static string[] CreateNonAsciiStrings(int valueCount, int encodedSize) + { + var str = ParseRawPrimitivesBenchmark.CreateNonAsciiStringWithEncodedSize(encodedSize); + + var result = new string[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = str; + } + return result; + } + + private static ByteString[] CreateByteStrings(int valueCount, int encodedSize) + { + var str = ParseRawPrimitivesBenchmark.CreateStringWithEncodedSize(encodedSize); + + var result = new ByteString[valueCount]; + for (int i = 0; i < valueCount; i++) + { + result[i] = ByteString.CopyFrom(Encoding.UTF8.GetBytes(str)); + } + return result; + } + } +} diff --git a/csharp/src/Google.Protobuf.Conformance/Conformance.cs b/csharp/src/Google.Protobuf.Conformance/Conformance.cs index 23894ad3ba..fb053b2576 100644 --- a/csharp/src/Google.Protobuf.Conformance/Conformance.cs +++ b/csharp/src/Google.Protobuf.Conformance/Conformance.cs @@ -82,7 +82,7 @@ namespace Conformance { [pbr::OriginalName("JSON_TEST")] JsonTest = 2, /// /// Similar to JSON_TEST. However, during parsing json, testee should ignore - /// unknown fields. This feature is optional. Each implementation can descide + /// unknown fields. This feature is optional. Each implementation can decide /// whether to support it. See /// https://developers.google.com/protocol-buffers/docs/proto3#json_options /// for more detail. @@ -107,23 +107,31 @@ namespace Conformance { /// This will be known by message_type == "conformance.FailureSet", a conformance /// test should return a serialized FailureSet in protobuf_payload. /// - public sealed partial class FailureSet : pb::IMessage { + public sealed partial class FailureSet : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FailureSet()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FailureSet() { OnConstruction(); } @@ -131,12 +139,14 @@ namespace Conformance { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FailureSet(FailureSet other) : this() { failure_ = other.failure_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FailureSet Clone() { return new FailureSet(this); } @@ -147,16 +157,19 @@ namespace Conformance { = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField failure_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Failure { get { return failure_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FailureSet); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FailureSet other) { if (ReferenceEquals(other, null)) { return false; @@ -169,6 +182,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= failure_.GetHashCode(); @@ -179,19 +193,37 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else failure_.WriteTo(output, _repeated_failure_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + failure_.WriteTo(ref output, _repeated_failure_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += failure_.CalculateSize(_repeated_failure_codec); @@ -202,6 +234,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FailureSet other) { if (other == null) { return; @@ -211,7 +244,11 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -224,8 +261,28 @@ namespace Conformance { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + failure_.AddEntriesFrom(ref input, _repeated_failure_codec); + break; + } + } + } + } + #endif + } /// @@ -235,23 +292,31 @@ namespace Conformance { /// 2. parse the protobuf or JSON payload in "payload" (which may fail) /// 3. if the parse succeeded, serialize the message in the requested format. /// - public sealed partial class ConformanceRequest : pb::IMessage { + public sealed partial class ConformanceRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ConformanceRequest() { OnConstruction(); } @@ -259,6 +324,7 @@ namespace Conformance { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ConformanceRequest(ConformanceRequest other) : this() { requestedOutputFormat_ = other.requestedOutputFormat_; messageType_ = other.messageType_; @@ -284,6 +350,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ConformanceRequest Clone() { return new ConformanceRequest(this); } @@ -291,6 +358,7 @@ namespace Conformance { /// Field number for the "protobuf_payload" field. public const int ProtobufPayloadFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString ProtobufPayload { get { return payloadCase_ == PayloadOneofCase.ProtobufPayload ? (pb::ByteString) payload_ : pb::ByteString.Empty; } set { @@ -302,6 +370,7 @@ namespace Conformance { /// Field number for the "json_payload" field. public const int JsonPayloadFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string JsonPayload { get { return payloadCase_ == PayloadOneofCase.JsonPayload ? (string) payload_ : ""; } set { @@ -316,6 +385,7 @@ namespace Conformance { /// Google internal only. Opensource testees just skip it. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string JspbPayload { get { return payloadCase_ == PayloadOneofCase.JspbPayload ? (string) payload_ : ""; } set { @@ -327,6 +397,7 @@ namespace Conformance { /// Field number for the "text_payload" field. public const int TextPayloadFieldNumber = 8; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string TextPayload { get { return payloadCase_ == PayloadOneofCase.TextPayload ? (string) payload_ : ""; } set { @@ -342,6 +413,7 @@ namespace Conformance { /// Which format should the testee serialize its message to? /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Conformance.WireFormat RequestedOutputFormat { get { return requestedOutputFormat_; } set { @@ -358,6 +430,7 @@ namespace Conformance { /// protobuf_test_messages.proto2.TestAllTypesProto2. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MessageType { get { return messageType_; } set { @@ -370,10 +443,11 @@ namespace Conformance { private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest; /// /// Each test is given a specific test category. Some category may need - /// spedific support in testee programs. Refer to the definition of TestCategory + /// specific support in testee programs. Refer to the definition of TestCategory /// for more information. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Conformance.TestCategory TestCategory { get { return testCategory_; } set { @@ -388,6 +462,7 @@ namespace Conformance { /// Specify details for how to encode jspb. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Conformance.JspbEncodingConfig JspbEncodingOptions { get { return jspbEncodingOptions_; } set { @@ -403,6 +478,7 @@ namespace Conformance { /// unknown fields instead of ignore. This feature is optional. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool PrintUnknownFields { get { return printUnknownFields_; } set { @@ -421,22 +497,26 @@ namespace Conformance { } private PayloadOneofCase payloadCase_ = PayloadOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PayloadOneofCase PayloadCase { get { return payloadCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPayload() { payloadCase_ = PayloadOneofCase.None; payload_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ConformanceRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ConformanceRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -458,6 +538,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (payloadCase_ == PayloadOneofCase.ProtobufPayload) hash ^= ProtobufPayload.GetHashCode(); @@ -477,12 +558,17 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (payloadCase_ == PayloadOneofCase.ProtobufPayload) { output.WriteRawTag(10); output.WriteBytes(ProtobufPayload); @@ -522,9 +608,57 @@ namespace Conformance { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (payloadCase_ == PayloadOneofCase.ProtobufPayload) { + output.WriteRawTag(10); + output.WriteBytes(ProtobufPayload); + } + if (payloadCase_ == PayloadOneofCase.JsonPayload) { + output.WriteRawTag(18); + output.WriteString(JsonPayload); + } + if (RequestedOutputFormat != global::Conformance.WireFormat.Unspecified) { + output.WriteRawTag(24); + output.WriteEnum((int) RequestedOutputFormat); + } + if (MessageType.Length != 0) { + output.WriteRawTag(34); + output.WriteString(MessageType); + } + if (TestCategory != global::Conformance.TestCategory.UnspecifiedTest) { + output.WriteRawTag(40); + output.WriteEnum((int) TestCategory); + } + if (jspbEncodingOptions_ != null) { + output.WriteRawTag(50); + output.WriteMessage(JspbEncodingOptions); + } + if (payloadCase_ == PayloadOneofCase.JspbPayload) { + output.WriteRawTag(58); + output.WriteString(JspbPayload); + } + if (payloadCase_ == PayloadOneofCase.TextPayload) { + output.WriteRawTag(66); + output.WriteString(TextPayload); + } + if (PrintUnknownFields != false) { + output.WriteRawTag(72); + output.WriteBool(PrintUnknownFields); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (payloadCase_ == PayloadOneofCase.ProtobufPayload) { @@ -561,6 +695,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ConformanceRequest other) { if (other == null) { return; @@ -602,7 +737,11 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -650,30 +789,93 @@ namespace Conformance { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ProtobufPayload = input.ReadBytes(); + break; + } + case 18: { + JsonPayload = input.ReadString(); + break; + } + case 24: { + RequestedOutputFormat = (global::Conformance.WireFormat) input.ReadEnum(); + break; + } + case 34: { + MessageType = input.ReadString(); + break; + } + case 40: { + TestCategory = (global::Conformance.TestCategory) input.ReadEnum(); + break; + } + case 50: { + if (jspbEncodingOptions_ == null) { + JspbEncodingOptions = new global::Conformance.JspbEncodingConfig(); + } + input.ReadMessage(JspbEncodingOptions); + break; + } + case 58: { + JspbPayload = input.ReadString(); + break; + } + case 66: { + TextPayload = input.ReadString(); + break; + } + case 72: { + PrintUnknownFields = input.ReadBool(); + break; + } + } + } } + #endif } /// /// Represents a single test case's output. /// - public sealed partial class ConformanceResponse : pb::IMessage { + public sealed partial class ConformanceResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ConformanceResponse() { OnConstruction(); } @@ -681,6 +883,7 @@ namespace Conformance { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ConformanceResponse(ConformanceResponse other) : this() { switch (other.ResultCase) { case ResultOneofCase.ParseError: @@ -713,6 +916,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ConformanceResponse Clone() { return new ConformanceResponse(this); } @@ -727,6 +931,7 @@ namespace Conformance { /// test. Some of the test cases are intentionally invalid input. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string ParseError { get { return resultCase_ == ResultOneofCase.ParseError ? (string) result_ : ""; } set { @@ -743,6 +948,7 @@ namespace Conformance { /// this field. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string SerializeError { get { return resultCase_ == ResultOneofCase.SerializeError ? (string) result_ : ""; } set { @@ -759,6 +965,7 @@ namespace Conformance { /// about the failure. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string RuntimeError { get { return resultCase_ == ResultOneofCase.RuntimeError ? (string) result_ : ""; } set { @@ -774,6 +981,7 @@ namespace Conformance { /// protobuf, serialize it to protobuf and set it in this field. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString ProtobufPayload { get { return resultCase_ == ResultOneofCase.ProtobufPayload ? (pb::ByteString) result_ : pb::ByteString.Empty; } set { @@ -789,6 +997,7 @@ namespace Conformance { /// serialize to JSON and set it in this field. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string JsonPayload { get { return resultCase_ == ResultOneofCase.JsonPayload ? (string) result_ : ""; } set { @@ -804,6 +1013,7 @@ namespace Conformance { /// wasn't supported, like JSON input/output. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Skipped { get { return resultCase_ == ResultOneofCase.Skipped ? (string) result_ : ""; } set { @@ -820,6 +1030,7 @@ namespace Conformance { /// format. Opensource testees can just skip it. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string JspbPayload { get { return resultCase_ == ResultOneofCase.JspbPayload ? (string) result_ : ""; } set { @@ -835,6 +1046,7 @@ namespace Conformance { /// TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string TextPayload { get { return resultCase_ == ResultOneofCase.TextPayload ? (string) result_ : ""; } set { @@ -858,22 +1070,26 @@ namespace Conformance { } private ResultOneofCase resultCase_ = ResultOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ResultOneofCase ResultCase { get { return resultCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearResult() { resultCase_ = ResultOneofCase.None; result_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ConformanceResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ConformanceResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -894,6 +1110,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (resultCase_ == ResultOneofCase.ParseError) hash ^= ParseError.GetHashCode(); @@ -912,12 +1129,17 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (resultCase_ == ResultOneofCase.ParseError) { output.WriteRawTag(10); output.WriteString(ParseError); @@ -953,9 +1175,53 @@ namespace Conformance { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (resultCase_ == ResultOneofCase.ParseError) { + output.WriteRawTag(10); + output.WriteString(ParseError); + } + if (resultCase_ == ResultOneofCase.RuntimeError) { + output.WriteRawTag(18); + output.WriteString(RuntimeError); + } + if (resultCase_ == ResultOneofCase.ProtobufPayload) { + output.WriteRawTag(26); + output.WriteBytes(ProtobufPayload); + } + if (resultCase_ == ResultOneofCase.JsonPayload) { + output.WriteRawTag(34); + output.WriteString(JsonPayload); + } + if (resultCase_ == ResultOneofCase.Skipped) { + output.WriteRawTag(42); + output.WriteString(Skipped); + } + if (resultCase_ == ResultOneofCase.SerializeError) { + output.WriteRawTag(50); + output.WriteString(SerializeError); + } + if (resultCase_ == ResultOneofCase.JspbPayload) { + output.WriteRawTag(58); + output.WriteString(JspbPayload); + } + if (resultCase_ == ResultOneofCase.TextPayload) { + output.WriteRawTag(66); + output.WriteString(TextPayload); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (resultCase_ == ResultOneofCase.ParseError) { @@ -989,6 +1255,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ConformanceResponse other) { if (other == null) { return; @@ -1024,7 +1291,11 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1065,30 +1336,86 @@ namespace Conformance { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + ParseError = input.ReadString(); + break; + } + case 18: { + RuntimeError = input.ReadString(); + break; + } + case 26: { + ProtobufPayload = input.ReadBytes(); + break; + } + case 34: { + JsonPayload = input.ReadString(); + break; + } + case 42: { + Skipped = input.ReadString(); + break; + } + case 50: { + SerializeError = input.ReadString(); + break; + } + case 58: { + JspbPayload = input.ReadString(); + break; + } + case 66: { + TextPayload = input.ReadString(); + break; + } + } + } + } + #endif + } /// /// Encoding options for jspb format. /// - public sealed partial class JspbEncodingConfig : pb::IMessage { + public sealed partial class JspbEncodingConfig : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JspbEncodingConfig()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public JspbEncodingConfig() { OnConstruction(); } @@ -1096,12 +1423,14 @@ namespace Conformance { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public JspbEncodingConfig(JspbEncodingConfig other) : this() { useJspbArrayAnyFormat_ = other.useJspbArrayAnyFormat_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public JspbEncodingConfig Clone() { return new JspbEncodingConfig(this); } @@ -1113,6 +1442,7 @@ namespace Conformance { /// Encode the value field of Any as jspb array if true, otherwise binary. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool UseJspbArrayAnyFormat { get { return useJspbArrayAnyFormat_; } set { @@ -1121,11 +1451,13 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as JspbEncodingConfig); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(JspbEncodingConfig other) { if (ReferenceEquals(other, null)) { return false; @@ -1138,6 +1470,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (UseJspbArrayAnyFormat != false) hash ^= UseJspbArrayAnyFormat.GetHashCode(); @@ -1148,12 +1481,17 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (UseJspbArrayAnyFormat != false) { output.WriteRawTag(8); output.WriteBool(UseJspbArrayAnyFormat); @@ -1161,9 +1499,25 @@ namespace Conformance { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (UseJspbArrayAnyFormat != false) { + output.WriteRawTag(8); + output.WriteBool(UseJspbArrayAnyFormat); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (UseJspbArrayAnyFormat != false) { @@ -1176,6 +1530,7 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(JspbEncodingConfig other) { if (other == null) { return; @@ -1187,7 +1542,11 @@ namespace Conformance { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1200,7 +1559,27 @@ namespace Conformance { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + UseJspbArrayAnyFormat = input.ReadBool(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Conformance/Program.cs b/csharp/src/Google.Protobuf.Conformance/Program.cs index d1093abee1..d721ecfcb7 100644 --- a/csharp/src/Google.Protobuf.Conformance/Program.cs +++ b/csharp/src/Google.Protobuf.Conformance/Program.cs @@ -83,44 +83,52 @@ namespace Google.Protobuf.Conformance private static ConformanceResponse PerformRequest(ConformanceRequest request, TypeRegistry typeRegistry) { + ExtensionRegistry proto2ExtensionRegistry = new ExtensionRegistry + { + ProtobufTestMessages.Proto2.TestMessagesProto2Extensions.ExtensionInt32, + ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Extensions.MessageSetExtension, + ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Extensions.MessageSetExtension + }; IMessage message; try { switch (request.PayloadCase) { case ConformanceRequest.PayloadOneofCase.JsonPayload: - if (request.TestCategory == global::Conformance.TestCategory.JsonIgnoreUnknownParsingTest) { + if (request.TestCategory == global::Conformance.TestCategory.JsonIgnoreUnknownParsingTest) + { return new ConformanceResponse { Skipped = "CSharp doesn't support skipping unknown fields in json parsing." }; } var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry)); - message = parser.Parse(request.JsonPayload); - break; - case ConformanceRequest.PayloadOneofCase.ProtobufPayload: - { - if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypesProto3")) + switch (request.MessageType) { - message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload); + case "protobuf_test_messages.proto3.TestAllTypesProto3": + message = parser.Parse(request.JsonPayload); + break; + case "protobuf_test_messages.proto2.TestAllTypesProto2": + message = parser.Parse(request.JsonPayload); + break; + default: + throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})"); } - else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2")) - { - ExtensionRegistry registry = new ExtensionRegistry() - { - ProtobufTestMessages.Proto2.TestMessagesProto2Extensions.ExtensionInt32, - ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Extensions.MessageSetExtension, - ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Extensions.MessageSetExtension - }; - message = ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser.WithExtensionRegistry(registry).ParseFrom(request.ProtobufPayload); - } - else + break; + case ConformanceRequest.PayloadOneofCase.ProtobufPayload: + switch (request.MessageType) { - throw new Exception(" Protobuf request doesn't have specific payload type"); + case "protobuf_test_messages.proto3.TestAllTypesProto3": + message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload); + break; + case "protobuf_test_messages.proto2.TestAllTypesProto2": + message = ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser + .WithExtensionRegistry(proto2ExtensionRegistry) + .ParseFrom(request.ProtobufPayload); + break; + default: + throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})"); } break; - } case ConformanceRequest.PayloadOneofCase.TextPayload: - { return new ConformanceResponse { Skipped = "CSharp doesn't support text format" }; - } default: throw new Exception("Unsupported request payload: " + request.PayloadCase); } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj b/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj index 5b705804aa..9f2ba6b0de 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj +++ b/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj @@ -6,11 +6,10 @@ and without the internal visibility from the test project (all of which have caused issues in the past). --> - net45;netstandard1.0;netstandard2.0 + net45;netstandard1.1;netstandard2.0 3.0 ../../keys/Google.Protobuf.snk true - true False diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs index 197b197d0e..4791b73253 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs @@ -176,23 +176,31 @@ namespace Google.Protobuf.TestProtos { /// /// Tests maps. /// - public sealed partial class TestMap : pb::IMessage { + public sealed partial class TestMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMap() { OnConstruction(); } @@ -200,6 +208,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMap(TestMap other) : this() { mapInt32Int32_ = other.mapInt32Int32_.Clone(); mapInt64Int64_ = other.mapInt64Int64_.Clone(); @@ -222,6 +231,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMap Clone() { return new TestMap(this); } @@ -232,6 +242,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 10); private readonly pbc::MapField mapInt32Int32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -242,6 +253,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForInt64(16, 0L), 18); private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -252,6 +264,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForUInt32(16, 0), 26); private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -262,6 +275,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8, 0UL), pb::FieldCodec.ForUInt64(16, 0UL), 34); private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -272,6 +286,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8, 0), pb::FieldCodec.ForSInt32(16, 0), 42); private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -282,6 +297,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8, 0L), pb::FieldCodec.ForSInt64(16, 0L), 50); private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -292,6 +308,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13, 0), pb::FieldCodec.ForFixed32(21, 0), 58); private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -302,6 +319,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9, 0UL), pb::FieldCodec.ForFixed64(17, 0UL), 66); private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -312,6 +330,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13, 0), pb::FieldCodec.ForSFixed32(21, 0), 74); private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -322,6 +341,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9, 0L), pb::FieldCodec.ForSFixed64(17, 0L), 82); private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -332,6 +352,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForFloat(21, 0F), 90); private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -342,6 +363,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForDouble(17, 0D), 98); private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -352,6 +374,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8, false), pb::FieldCodec.ForBool(16, false), 106); private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -362,6 +385,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 114); private readonly pbc::MapField mapStringString_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringString { get { return mapStringString_; } } @@ -372,6 +396,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForBytes(18, pb::ByteString.Empty), 122); private readonly pbc::MapField mapInt32Bytes_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Bytes { get { return mapInt32Bytes_; } } @@ -382,6 +407,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x, global::Google.Protobuf.TestProtos.MapEnum.Foo), 130); private readonly pbc::MapField mapInt32Enum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Enum { get { return mapInt32Enum_; } } @@ -392,16 +418,19 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 138); private readonly pbc::MapField mapInt32ForeignMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32ForeignMessage { get { return mapInt32ForeignMessage_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMap other) { if (ReferenceEquals(other, null)) { return false; @@ -430,6 +459,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= MapInt32Int32.GetHashCode(); @@ -456,12 +486,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else mapInt32Int32_.WriteTo(output, _map_mapInt32Int32_codec); mapInt64Int64_.WriteTo(output, _map_mapInt64Int64_codec); mapUint32Uint32_.WriteTo(output, _map_mapUint32Uint32_codec); @@ -482,9 +517,38 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + mapInt32Int32_.WriteTo(ref output, _map_mapInt32Int32_codec); + mapInt64Int64_.WriteTo(ref output, _map_mapInt64Int64_codec); + mapUint32Uint32_.WriteTo(ref output, _map_mapUint32Uint32_codec); + mapUint64Uint64_.WriteTo(ref output, _map_mapUint64Uint64_codec); + mapSint32Sint32_.WriteTo(ref output, _map_mapSint32Sint32_codec); + mapSint64Sint64_.WriteTo(ref output, _map_mapSint64Sint64_codec); + mapFixed32Fixed32_.WriteTo(ref output, _map_mapFixed32Fixed32_codec); + mapFixed64Fixed64_.WriteTo(ref output, _map_mapFixed64Fixed64_codec); + mapSfixed32Sfixed32_.WriteTo(ref output, _map_mapSfixed32Sfixed32_codec); + mapSfixed64Sfixed64_.WriteTo(ref output, _map_mapSfixed64Sfixed64_codec); + mapInt32Float_.WriteTo(ref output, _map_mapInt32Float_codec); + mapInt32Double_.WriteTo(ref output, _map_mapInt32Double_codec); + mapBoolBool_.WriteTo(ref output, _map_mapBoolBool_codec); + mapStringString_.WriteTo(ref output, _map_mapStringString_codec); + mapInt32Bytes_.WriteTo(ref output, _map_mapInt32Bytes_codec); + mapInt32Enum_.WriteTo(ref output, _map_mapInt32Enum_codec); + mapInt32ForeignMessage_.WriteTo(ref output, _map_mapInt32ForeignMessage_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); @@ -511,6 +575,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMap other) { if (other == null) { return; @@ -536,7 +601,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -613,27 +682,119 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + mapInt32Int32_.AddEntriesFrom(ref input, _map_mapInt32Int32_codec); + break; + } + case 18: { + mapInt64Int64_.AddEntriesFrom(ref input, _map_mapInt64Int64_codec); + break; + } + case 26: { + mapUint32Uint32_.AddEntriesFrom(ref input, _map_mapUint32Uint32_codec); + break; + } + case 34: { + mapUint64Uint64_.AddEntriesFrom(ref input, _map_mapUint64Uint64_codec); + break; + } + case 42: { + mapSint32Sint32_.AddEntriesFrom(ref input, _map_mapSint32Sint32_codec); + break; + } + case 50: { + mapSint64Sint64_.AddEntriesFrom(ref input, _map_mapSint64Sint64_codec); + break; + } + case 58: { + mapFixed32Fixed32_.AddEntriesFrom(ref input, _map_mapFixed32Fixed32_codec); + break; + } + case 66: { + mapFixed64Fixed64_.AddEntriesFrom(ref input, _map_mapFixed64Fixed64_codec); + break; + } + case 74: { + mapSfixed32Sfixed32_.AddEntriesFrom(ref input, _map_mapSfixed32Sfixed32_codec); + break; + } + case 82: { + mapSfixed64Sfixed64_.AddEntriesFrom(ref input, _map_mapSfixed64Sfixed64_codec); + break; + } + case 90: { + mapInt32Float_.AddEntriesFrom(ref input, _map_mapInt32Float_codec); + break; + } + case 98: { + mapInt32Double_.AddEntriesFrom(ref input, _map_mapInt32Double_codec); + break; + } + case 106: { + mapBoolBool_.AddEntriesFrom(ref input, _map_mapBoolBool_codec); + break; + } + case 114: { + mapStringString_.AddEntriesFrom(ref input, _map_mapStringString_codec); + break; + } + case 122: { + mapInt32Bytes_.AddEntriesFrom(ref input, _map_mapInt32Bytes_codec); + break; + } + case 130: { + mapInt32Enum_.AddEntriesFrom(ref input, _map_mapInt32Enum_codec); + break; + } + case 138: { + mapInt32ForeignMessage_.AddEntriesFrom(ref input, _map_mapInt32ForeignMessage_codec); + break; + } + } + } + } + #endif + } - public sealed partial class TestMapSubmessage : pb::IMessage { + public sealed partial class TestMapSubmessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMapSubmessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMapSubmessage() { OnConstruction(); } @@ -641,12 +802,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMapSubmessage(TestMapSubmessage other) : this() { testMap_ = other.testMap_ != null ? other.testMap_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMapSubmessage Clone() { return new TestMapSubmessage(this); } @@ -655,6 +818,7 @@ namespace Google.Protobuf.TestProtos { public const int TestMapFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMap testMap_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestMap TestMap { get { return testMap_; } set { @@ -663,11 +827,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMapSubmessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMapSubmessage other) { if (ReferenceEquals(other, null)) { return false; @@ -680,6 +846,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (testMap_ != null) hash ^= TestMap.GetHashCode(); @@ -690,12 +857,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (testMap_ != null) { output.WriteRawTag(10); output.WriteMessage(TestMap); @@ -703,9 +875,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (testMap_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TestMap); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (testMap_ != null) { @@ -718,6 +906,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMapSubmessage other) { if (other == null) { return; @@ -732,7 +921,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -748,27 +941,58 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (testMap_ == null) { + TestMap = new global::Google.Protobuf.TestProtos.TestMap(); + } + input.ReadMessage(TestMap); + break; + } + } + } + } + #endif + } - public sealed partial class TestMessageMap : pb::IMessage { + public sealed partial class TestMessageMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMessageMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageMap() { OnConstruction(); } @@ -776,12 +1000,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageMap(TestMessageMap other) : this() { mapInt32Message_ = other.mapInt32Message_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageMap Clone() { return new TestMessageMap(this); } @@ -792,16 +1018,19 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.TestAllTypes.Parser), 10); private readonly pbc::MapField mapInt32Message_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Message { get { return mapInt32Message_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMessageMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMessageMap other) { if (ReferenceEquals(other, null)) { return false; @@ -814,6 +1043,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= MapInt32Message.GetHashCode(); @@ -824,19 +1054,37 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else mapInt32Message_.WriteTo(output, _map_mapInt32Message_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + mapInt32Message_.WriteTo(ref output, _map_mapInt32Message_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += mapInt32Message_.CalculateSize(_map_mapInt32Message_codec); @@ -847,6 +1095,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMessageMap other) { if (other == null) { return; @@ -856,7 +1105,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -869,30 +1122,58 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + mapInt32Message_.AddEntriesFrom(ref input, _map_mapInt32Message_codec); + break; + } + } + } + } + #endif + } /// /// Two map fields share the same entry default instance. /// - public sealed partial class TestSameTypeMap : pb::IMessage { + public sealed partial class TestSameTypeMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestSameTypeMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestSameTypeMap() { OnConstruction(); } @@ -900,6 +1181,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestSameTypeMap(TestSameTypeMap other) : this() { map1_ = other.map1_.Clone(); map2_ = other.map2_.Clone(); @@ -907,6 +1189,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestSameTypeMap Clone() { return new TestSameTypeMap(this); } @@ -917,6 +1200,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 10); private readonly pbc::MapField map1_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Map1 { get { return map1_; } } @@ -927,16 +1211,19 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 18); private readonly pbc::MapField map2_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Map2 { get { return map2_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestSameTypeMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestSameTypeMap other) { if (ReferenceEquals(other, null)) { return false; @@ -950,6 +1237,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= Map1.GetHashCode(); @@ -961,20 +1249,39 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else map1_.WriteTo(output, _map_map1_codec); map2_.WriteTo(output, _map_map2_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + map1_.WriteTo(ref output, _map_map1_codec); + map2_.WriteTo(ref output, _map_map2_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += map1_.CalculateSize(_map_map1_codec); @@ -986,6 +1293,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestSameTypeMap other) { if (other == null) { return; @@ -996,7 +1304,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1013,27 +1325,59 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + map1_.AddEntriesFrom(ref input, _map_map1_codec); + break; + } + case 18: { + map2_.AddEntriesFrom(ref input, _map_map2_codec); + break; + } + } + } } + #endif } - public sealed partial class TestArenaMap : pb::IMessage { + public sealed partial class TestArenaMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestArenaMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestArenaMap() { OnConstruction(); } @@ -1041,6 +1385,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestArenaMap(TestArenaMap other) : this() { mapInt32Int32_ = other.mapInt32Int32_.Clone(); mapInt64Int64_ = other.mapInt64Int64_.Clone(); @@ -1061,6 +1406,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestArenaMap Clone() { return new TestArenaMap(this); } @@ -1071,6 +1417,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 10); private readonly pbc::MapField mapInt32Int32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -1081,6 +1428,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForInt64(16, 0L), 18); private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -1091,6 +1439,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForUInt32(16, 0), 26); private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -1101,6 +1450,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8, 0UL), pb::FieldCodec.ForUInt64(16, 0UL), 34); private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -1111,6 +1461,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8, 0), pb::FieldCodec.ForSInt32(16, 0), 42); private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -1121,6 +1472,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8, 0L), pb::FieldCodec.ForSInt64(16, 0L), 50); private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -1131,6 +1483,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13, 0), pb::FieldCodec.ForFixed32(21, 0), 58); private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -1141,6 +1494,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9, 0UL), pb::FieldCodec.ForFixed64(17, 0UL), 66); private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -1151,6 +1505,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13, 0), pb::FieldCodec.ForSFixed32(21, 0), 74); private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -1161,6 +1516,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9, 0L), pb::FieldCodec.ForSFixed64(17, 0L), 82); private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -1171,6 +1527,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForFloat(21, 0F), 90); private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -1181,6 +1538,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForDouble(17, 0D), 98); private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -1191,6 +1549,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8, false), pb::FieldCodec.ForBool(16, false), 106); private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -1201,6 +1560,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x, global::Google.Protobuf.TestProtos.MapEnum.Foo), 114); private readonly pbc::MapField mapInt32Enum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Enum { get { return mapInt32Enum_; } } @@ -1211,16 +1571,19 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 122); private readonly pbc::MapField mapInt32ForeignMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32ForeignMessage { get { return mapInt32ForeignMessage_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestArenaMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestArenaMap other) { if (ReferenceEquals(other, null)) { return false; @@ -1247,6 +1610,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= MapInt32Int32.GetHashCode(); @@ -1271,12 +1635,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else mapInt32Int32_.WriteTo(output, _map_mapInt32Int32_codec); mapInt64Int64_.WriteTo(output, _map_mapInt64Int64_codec); mapUint32Uint32_.WriteTo(output, _map_mapUint32Uint32_codec); @@ -1295,9 +1664,36 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + mapInt32Int32_.WriteTo(ref output, _map_mapInt32Int32_codec); + mapInt64Int64_.WriteTo(ref output, _map_mapInt64Int64_codec); + mapUint32Uint32_.WriteTo(ref output, _map_mapUint32Uint32_codec); + mapUint64Uint64_.WriteTo(ref output, _map_mapUint64Uint64_codec); + mapSint32Sint32_.WriteTo(ref output, _map_mapSint32Sint32_codec); + mapSint64Sint64_.WriteTo(ref output, _map_mapSint64Sint64_codec); + mapFixed32Fixed32_.WriteTo(ref output, _map_mapFixed32Fixed32_codec); + mapFixed64Fixed64_.WriteTo(ref output, _map_mapFixed64Fixed64_codec); + mapSfixed32Sfixed32_.WriteTo(ref output, _map_mapSfixed32Sfixed32_codec); + mapSfixed64Sfixed64_.WriteTo(ref output, _map_mapSfixed64Sfixed64_codec); + mapInt32Float_.WriteTo(ref output, _map_mapInt32Float_codec); + mapInt32Double_.WriteTo(ref output, _map_mapInt32Double_codec); + mapBoolBool_.WriteTo(ref output, _map_mapBoolBool_codec); + mapInt32Enum_.WriteTo(ref output, _map_mapInt32Enum_codec); + mapInt32ForeignMessage_.WriteTo(ref output, _map_mapInt32ForeignMessage_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); @@ -1322,6 +1718,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestArenaMap other) { if (other == null) { return; @@ -1345,7 +1742,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1414,7 +1815,83 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + mapInt32Int32_.AddEntriesFrom(ref input, _map_mapInt32Int32_codec); + break; + } + case 18: { + mapInt64Int64_.AddEntriesFrom(ref input, _map_mapInt64Int64_codec); + break; + } + case 26: { + mapUint32Uint32_.AddEntriesFrom(ref input, _map_mapUint32Uint32_codec); + break; + } + case 34: { + mapUint64Uint64_.AddEntriesFrom(ref input, _map_mapUint64Uint64_codec); + break; + } + case 42: { + mapSint32Sint32_.AddEntriesFrom(ref input, _map_mapSint32Sint32_codec); + break; + } + case 50: { + mapSint64Sint64_.AddEntriesFrom(ref input, _map_mapSint64Sint64_codec); + break; + } + case 58: { + mapFixed32Fixed32_.AddEntriesFrom(ref input, _map_mapFixed32Fixed32_codec); + break; + } + case 66: { + mapFixed64Fixed64_.AddEntriesFrom(ref input, _map_mapFixed64Fixed64_codec); + break; + } + case 74: { + mapSfixed32Sfixed32_.AddEntriesFrom(ref input, _map_mapSfixed32Sfixed32_codec); + break; + } + case 82: { + mapSfixed64Sfixed64_.AddEntriesFrom(ref input, _map_mapSfixed64Sfixed64_codec); + break; + } + case 90: { + mapInt32Float_.AddEntriesFrom(ref input, _map_mapInt32Float_codec); + break; + } + case 98: { + mapInt32Double_.AddEntriesFrom(ref input, _map_mapInt32Double_codec); + break; + } + case 106: { + mapBoolBool_.AddEntriesFrom(ref input, _map_mapBoolBool_codec); + break; + } + case 114: { + mapInt32Enum_.AddEntriesFrom(ref input, _map_mapInt32Enum_codec); + break; + } + case 122: { + mapInt32ForeignMessage_.AddEntriesFrom(ref input, _map_mapInt32ForeignMessage_codec); + break; + } + } + } } + #endif } @@ -1422,23 +1899,31 @@ namespace Google.Protobuf.TestProtos { /// Previously, message containing enum called Type cannot be used as value of /// map field. /// - public sealed partial class MessageContainingEnumCalledType : pb::IMessage { + public sealed partial class MessageContainingEnumCalledType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingEnumCalledType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingEnumCalledType() { OnConstruction(); } @@ -1446,12 +1931,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingEnumCalledType(MessageContainingEnumCalledType other) : this() { type_ = other.type_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingEnumCalledType Clone() { return new MessageContainingEnumCalledType(this); } @@ -1462,16 +1949,19 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Parser), 10); private readonly pbc::MapField type_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Type { get { return type_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageContainingEnumCalledType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageContainingEnumCalledType other) { if (ReferenceEquals(other, null)) { return false; @@ -1484,6 +1974,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= Type.GetHashCode(); @@ -1494,19 +1985,37 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else type_.WriteTo(output, _map_type_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + type_.WriteTo(ref output, _map_type_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += type_.CalculateSize(_map_type_codec); @@ -1517,6 +2026,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageContainingEnumCalledType other) { if (other == null) { return; @@ -1526,7 +2036,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1539,11 +2053,32 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + type_.AddEntriesFrom(ref input, _map_type_codec); + break; + } + } + } + } + #endif + #region Nested types /// Container for nested types declared in the MessageContainingEnumCalledType message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum Type { [pbr::OriginalName("TYPE_FOO")] Foo = 0, @@ -1557,23 +2092,31 @@ namespace Google.Protobuf.TestProtos { /// /// Previously, message cannot contain map field called "entry". /// - public sealed partial class MessageContainingMapCalledEntry : pb::IMessage { + public sealed partial class MessageContainingMapCalledEntry : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingMapCalledEntry()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3Reflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingMapCalledEntry() { OnConstruction(); } @@ -1581,12 +2124,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingMapCalledEntry(MessageContainingMapCalledEntry other) : this() { entry_ = other.entry_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageContainingMapCalledEntry Clone() { return new MessageContainingMapCalledEntry(this); } @@ -1597,16 +2142,19 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForInt32(16, 0), 10); private readonly pbc::MapField entry_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Entry { get { return entry_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageContainingMapCalledEntry); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageContainingMapCalledEntry other) { if (ReferenceEquals(other, null)) { return false; @@ -1619,6 +2167,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= Entry.GetHashCode(); @@ -1629,19 +2178,37 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else entry_.WriteTo(output, _map_entry_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + entry_.WriteTo(ref output, _map_entry_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += entry_.CalculateSize(_map_entry_codec); @@ -1652,6 +2219,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageContainingMapCalledEntry other) { if (other == null) { return; @@ -1661,7 +2229,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1674,7 +2246,27 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + entry_.AddEntriesFrom(ref input, _map_entry_codec); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs index 350fb7cde7..48f9b80017 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs @@ -244,7 +244,11 @@ namespace ProtobufTestMessages.Proto2 { /// could trigger bugs that occur in any message type in this file. We verify /// this stays true in a unit test. /// - public sealed partial class TestAllTypesProto2 : pb::IExtendableMessage { + public sealed partial class TestAllTypesProto2 : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypesProto2()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; @@ -252,19 +256,23 @@ namespace ProtobufTestMessages.Proto2 { private int _hasBits0; private int _hasBits1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto2() { OnConstruction(); } @@ -272,6 +280,7 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto2(TestAllTypesProto2 other) : this() { _hasBits0 = other._hasBits0; _hasBits1 = other._hasBits1; @@ -290,13 +299,13 @@ namespace ProtobufTestMessages.Proto2 { optionalBool_ = other.optionalBool_; optionalString_ = other.optionalString_; optionalBytes_ = other.optionalBytes_; - optionalNestedMessage_ = other.HasOptionalNestedMessage ? other.optionalNestedMessage_.Clone() : null; - optionalForeignMessage_ = other.HasOptionalForeignMessage ? other.optionalForeignMessage_.Clone() : null; + optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; + optionalForeignMessage_ = other.optionalForeignMessage_ != null ? other.optionalForeignMessage_.Clone() : null; optionalNestedEnum_ = other.optionalNestedEnum_; optionalForeignEnum_ = other.optionalForeignEnum_; optionalStringPiece_ = other.optionalStringPiece_; optionalCord_ = other.optionalCord_; - recursiveMessage_ = other.HasRecursiveMessage ? other.recursiveMessage_.Clone() : null; + recursiveMessage_ = other.recursiveMessage_ != null ? other.recursiveMessage_.Clone() : null; repeatedInt32_ = other.repeatedInt32_.Clone(); repeatedInt64_ = other.repeatedInt64_.Clone(); repeatedUint32_ = other.repeatedUint32_.Clone(); @@ -419,6 +428,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto2 Clone() { return new TestAllTypesProto2(this); } @@ -432,6 +442,7 @@ namespace ProtobufTestMessages.Proto2 { /// Singular /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -441,11 +452,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } @@ -456,6 +469,7 @@ namespace ProtobufTestMessages.Proto2 { private long optionalInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalInt64 { get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return OptionalInt64DefaultValue; } } set { @@ -465,11 +479,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt64 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "optional_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt64() { _hasBits0 &= ~2; } @@ -480,6 +496,7 @@ namespace ProtobufTestMessages.Proto2 { private uint optionalUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalUint32 { get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return OptionalUint32DefaultValue; } } set { @@ -489,11 +506,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint32 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "optional_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint32() { _hasBits0 &= ~4; } @@ -504,6 +523,7 @@ namespace ProtobufTestMessages.Proto2 { private ulong optionalUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalUint64 { get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return OptionalUint64DefaultValue; } } set { @@ -513,11 +533,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint64 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "optional_uint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint64() { _hasBits0 &= ~8; } @@ -528,6 +550,7 @@ namespace ProtobufTestMessages.Proto2 { private int optionalSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSint32 { get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return OptionalSint32DefaultValue; } } set { @@ -537,11 +560,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_sint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint32 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "optional_sint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint32() { _hasBits0 &= ~16; } @@ -552,6 +577,7 @@ namespace ProtobufTestMessages.Proto2 { private long optionalSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSint64 { get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return OptionalSint64DefaultValue; } } set { @@ -561,11 +587,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_sint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint64 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "optional_sint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint64() { _hasBits0 &= ~32; } @@ -576,6 +604,7 @@ namespace ProtobufTestMessages.Proto2 { private uint optionalFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalFixed32 { get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return OptionalFixed32DefaultValue; } } set { @@ -585,11 +614,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_fixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed32 { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "optional_fixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed32() { _hasBits0 &= ~64; } @@ -600,6 +631,7 @@ namespace ProtobufTestMessages.Proto2 { private ulong optionalFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalFixed64 { get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return OptionalFixed64DefaultValue; } } set { @@ -609,11 +641,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_fixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed64 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "optional_fixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed64() { _hasBits0 &= ~128; } @@ -624,6 +658,7 @@ namespace ProtobufTestMessages.Proto2 { private int optionalSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSfixed32 { get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return OptionalSfixed32DefaultValue; } } set { @@ -633,11 +668,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_sfixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed32 { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "optional_sfixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed32() { _hasBits0 &= ~256; } @@ -648,6 +685,7 @@ namespace ProtobufTestMessages.Proto2 { private long optionalSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSfixed64 { get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return OptionalSfixed64DefaultValue; } } set { @@ -657,11 +695,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_sfixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed64 { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "optional_sfixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed64() { _hasBits0 &= ~512; } @@ -672,6 +712,7 @@ namespace ProtobufTestMessages.Proto2 { private float optionalFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OptionalFloat { get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return OptionalFloatDefaultValue; } } set { @@ -681,11 +722,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFloat { get { return (_hasBits0 & 1024) != 0; } } /// Clears the value of the "optional_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFloat() { _hasBits0 &= ~1024; } @@ -696,6 +739,7 @@ namespace ProtobufTestMessages.Proto2 { private double optionalDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OptionalDouble { get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return OptionalDoubleDefaultValue; } } set { @@ -705,11 +749,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalDouble { get { return (_hasBits0 & 2048) != 0; } } /// Clears the value of the "optional_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalDouble() { _hasBits0 &= ~2048; } @@ -720,6 +766,7 @@ namespace ProtobufTestMessages.Proto2 { private bool optionalBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OptionalBool { get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return OptionalBoolDefaultValue; } } set { @@ -729,11 +776,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBool { get { return (_hasBits0 & 4096) != 0; } } /// Clears the value of the "optional_bool" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBool() { _hasBits0 &= ~4096; } @@ -744,6 +793,7 @@ namespace ProtobufTestMessages.Proto2 { private string optionalString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_ ?? OptionalStringDefaultValue; } set { @@ -752,11 +802,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalString { get { return optionalString_ != null; } } /// Clears the value of the "optional_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalString() { optionalString_ = null; } @@ -767,6 +819,7 @@ namespace ProtobufTestMessages.Proto2 { private pb::ByteString optionalBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytes { get { return optionalBytes_ ?? OptionalBytesDefaultValue; } set { @@ -775,11 +828,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBytes { get { return optionalBytes_ != null; } } /// Clears the value of the "optional_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBytes() { optionalBytes_ = null; } @@ -788,43 +843,25 @@ namespace ProtobufTestMessages.Proto2 { public const int OptionalNestedMessageFieldNumber = 18; private global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { optionalNestedMessage_ = value; } } - /// Gets whether the optional_nested_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalNestedMessage { - get { return optionalNestedMessage_ != null; } - } - /// Clears the value of the optional_nested_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalNestedMessage() { - optionalNestedMessage_ = null; - } /// Field number for the "optional_foreign_message" field. public const int OptionalForeignMessageFieldNumber = 19; private global::ProtobufTestMessages.Proto2.ForeignMessageProto2 optionalForeignMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.ForeignMessageProto2 OptionalForeignMessage { get { return optionalForeignMessage_; } set { optionalForeignMessage_ = value; } } - /// Gets whether the optional_foreign_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalForeignMessage { - get { return optionalForeignMessage_ != null; } - } - /// Clears the value of the optional_foreign_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalForeignMessage() { - optionalForeignMessage_ = null; - } /// Field number for the "optional_nested_enum" field. public const int OptionalNestedEnumFieldNumber = 21; @@ -832,6 +869,7 @@ namespace ProtobufTestMessages.Proto2 { private global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum optionalNestedEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum OptionalNestedEnum { get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return OptionalNestedEnumDefaultValue; } } set { @@ -841,11 +879,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_nested_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalNestedEnum { get { return (_hasBits0 & 8192) != 0; } } /// Clears the value of the "optional_nested_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalNestedEnum() { _hasBits0 &= ~8192; } @@ -856,6 +896,7 @@ namespace ProtobufTestMessages.Proto2 { private global::ProtobufTestMessages.Proto2.ForeignEnumProto2 optionalForeignEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.ForeignEnumProto2 OptionalForeignEnum { get { if ((_hasBits0 & 16384) != 0) { return optionalForeignEnum_; } else { return OptionalForeignEnumDefaultValue; } } set { @@ -865,11 +906,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_foreign_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalForeignEnum { get { return (_hasBits0 & 16384) != 0; } } /// Clears the value of the "optional_foreign_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalForeignEnum() { _hasBits0 &= ~16384; } @@ -880,6 +923,7 @@ namespace ProtobufTestMessages.Proto2 { private string optionalStringPiece_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalStringPiece { get { return optionalStringPiece_ ?? OptionalStringPieceDefaultValue; } set { @@ -888,11 +932,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalStringPiece { get { return optionalStringPiece_ != null; } } /// Clears the value of the "optional_string_piece" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalStringPiece() { optionalStringPiece_ = null; } @@ -903,6 +949,7 @@ namespace ProtobufTestMessages.Proto2 { private string optionalCord_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalCord { get { return optionalCord_ ?? OptionalCordDefaultValue; } set { @@ -911,11 +958,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalCord { get { return optionalCord_ != null; } } /// Clears the value of the "optional_cord" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalCord() { optionalCord_ = null; } @@ -924,22 +973,13 @@ namespace ProtobufTestMessages.Proto2 { public const int RecursiveMessageFieldNumber = 27; private global::ProtobufTestMessages.Proto2.TestAllTypesProto2 recursiveMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2 RecursiveMessage { get { return recursiveMessage_; } set { recursiveMessage_ = value; } } - /// Gets whether the recursive_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasRecursiveMessage { - get { return recursiveMessage_ != null; } - } - /// Clears the value of the recursive_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearRecursiveMessage() { - recursiveMessage_ = null; - } /// Field number for the "repeated_int32" field. public const int RepeatedInt32FieldNumber = 31; @@ -950,6 +990,7 @@ namespace ProtobufTestMessages.Proto2 { /// Repeated /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -960,6 +1001,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForInt64(256); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -970,6 +1012,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt32(264); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -980,6 +1023,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt64(272); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -990,6 +1034,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt32(280); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -1000,6 +1045,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt64(288); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -1010,6 +1056,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed32(301); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -1020,6 +1067,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed64(305); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -1030,6 +1078,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed32(317); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -1040,6 +1089,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed64(321); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -1050,6 +1100,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFloat(333); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -1060,6 +1111,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForDouble(337); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -1070,6 +1122,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForBool(344); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -1080,6 +1133,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -1090,6 +1144,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -1100,6 +1155,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForMessage(386, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -1110,6 +1166,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForMessage(394, global::ProtobufTestMessages.Proto2.ForeignMessageProto2.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -1120,6 +1177,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForEnum(408, x => (int) x, x => (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) x); private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -1130,6 +1188,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForEnum(416, x => (int) x, x => (global::ProtobufTestMessages.Proto2.ForeignEnumProto2) x); private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } @@ -1140,6 +1199,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForString(434); private readonly pbc::RepeatedField repeatedStringPiece_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringPiece { get { return repeatedStringPiece_; } } @@ -1150,6 +1210,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForString(442); private readonly pbc::RepeatedField repeatedCord_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedCord { get { return repeatedCord_; } } @@ -1163,6 +1224,7 @@ namespace ProtobufTestMessages.Proto2 { /// Packed /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -1173,6 +1235,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForInt64(610); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -1183,6 +1246,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt32(618); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -1193,6 +1257,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt64(626); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -1203,6 +1268,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt32(634); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -1213,6 +1279,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt64(642); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -1223,6 +1290,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed32(650); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -1233,6 +1301,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed64(658); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -1243,6 +1312,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed32(666); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -1253,6 +1323,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed64(674); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -1263,6 +1334,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFloat(682); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -1273,6 +1345,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForDouble(690); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -1283,6 +1356,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForBool(698); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedBool { get { return packedBool_; } } @@ -1293,6 +1367,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForEnum(706, x => (int) x, x => (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) x); private readonly pbc::RepeatedField packedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedNestedEnum { get { return packedNestedEnum_; } } @@ -1306,6 +1381,7 @@ namespace ProtobufTestMessages.Proto2 { /// Unpacked /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -1316,6 +1392,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForInt64(720); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -1326,6 +1403,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt32(728); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -1336,6 +1414,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForUInt64(736); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -1346,6 +1425,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt32(744); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -1356,6 +1436,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSInt64(752); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -1366,6 +1447,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed32(765); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -1376,6 +1458,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFixed64(769); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -1386,6 +1469,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed32(781); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -1396,6 +1480,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForSFixed64(785); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -1406,6 +1491,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForFloat(797); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -1416,6 +1502,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForDouble(801); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -1426,6 +1513,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForBool(808); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } @@ -1436,6 +1524,7 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForEnum(816, x => (int) x, x => (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) x); private readonly pbc::RepeatedField unpackedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedNestedEnum { get { return unpackedNestedEnum_; } } @@ -1449,6 +1538,7 @@ namespace ProtobufTestMessages.Proto2 { /// Map /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -1459,6 +1549,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForInt64(16, 0L), 458); private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -1469,6 +1560,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForUInt32(16, 0), 466); private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -1479,6 +1571,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8, 0UL), pb::FieldCodec.ForUInt64(16, 0UL), 474); private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -1489,6 +1582,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8, 0), pb::FieldCodec.ForSInt32(16, 0), 482); private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -1499,6 +1593,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8, 0L), pb::FieldCodec.ForSInt64(16, 0L), 490); private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -1509,6 +1604,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13, 0), pb::FieldCodec.ForFixed32(21, 0), 498); private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -1519,6 +1615,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9, 0UL), pb::FieldCodec.ForFixed64(17, 0UL), 506); private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -1529,6 +1626,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13, 0), pb::FieldCodec.ForSFixed32(21, 0), 514); private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -1539,6 +1637,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9, 0L), pb::FieldCodec.ForSFixed64(17, 0L), 522); private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -1549,6 +1648,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForFloat(21, 0F), 530); private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -1559,6 +1659,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForDouble(17, 0D), 538); private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -1569,6 +1670,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8, false), pb::FieldCodec.ForBool(16, false), 546); private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -1579,6 +1681,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 554); private readonly pbc::MapField mapStringString_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringString { get { return mapStringString_; } } @@ -1589,6 +1692,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForBytes(18, pb::ByteString.Empty), 562); private readonly pbc::MapField mapStringBytes_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringBytes { get { return mapStringBytes_; } } @@ -1599,6 +1703,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage.Parser), 570); private readonly pbc::MapField mapStringNestedMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringNestedMessage { get { return mapStringNestedMessage_; } } @@ -1609,6 +1714,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto2.ForeignMessageProto2.Parser), 578); private readonly pbc::MapField mapStringForeignMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringForeignMessage { get { return mapStringForeignMessage_; } } @@ -1619,6 +1725,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) x, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum.Foo), 586); private readonly pbc::MapField mapStringNestedEnum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringNestedEnum { get { return mapStringNestedEnum_; } } @@ -1629,6 +1736,7 @@ namespace ProtobufTestMessages.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto2.ForeignEnumProto2) x, global::ProtobufTestMessages.Proto2.ForeignEnumProto2.ForeignFoo), 594); private readonly pbc::MapField mapStringForeignEnum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringForeignEnum { get { return mapStringForeignEnum_; } } @@ -1636,6 +1744,7 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { get { return HasOneofUint32 ? (uint) oneofField_ : 0; } set { @@ -1645,11 +1754,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32; } } /// Clears the value of the oneof if it's currently set to "oneof_uint32" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofUint32() { if (HasOneofUint32) { ClearOneofField(); @@ -1659,29 +1770,19 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage OneofNestedMessage { - get { return HasOneofNestedMessage ? (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage) oneofField_ : null; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage) oneofField_ : null; } set { oneofField_ = value; oneofFieldCase_ = value == null ? OneofFieldOneofCase.None : OneofFieldOneofCase.OneofNestedMessage; } } - /// Gets whether the "oneof_nested_message" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOneofNestedMessage { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage; } - } - /// Clears the value of the oneof if it's currently set to "oneof_nested_message" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOneofNestedMessage() { - if (HasOneofNestedMessage) { - ClearOneofField(); - } - } /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { get { return HasOneofString ? (string) oneofField_ : ""; } set { @@ -1691,11 +1792,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString; } } /// Clears the value of the oneof if it's currently set to "oneof_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofString() { if (HasOneofString) { ClearOneofField(); @@ -1705,6 +1808,7 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { get { return HasOneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -1714,11 +1818,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes; } } /// Clears the value of the oneof if it's currently set to "oneof_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofBytes() { if (HasOneofBytes) { ClearOneofField(); @@ -1728,6 +1834,7 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_bool" field. public const int OneofBoolFieldNumber = 115; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OneofBool { get { return HasOneofBool ? (bool) oneofField_ : false; } set { @@ -1737,11 +1844,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofBool { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBool; } } /// Clears the value of the oneof if it's currently set to "oneof_bool" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofBool() { if (HasOneofBool) { ClearOneofField(); @@ -1751,6 +1860,7 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_uint64" field. public const int OneofUint64FieldNumber = 116; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OneofUint64 { get { return HasOneofUint64 ? (ulong) oneofField_ : 0UL; } set { @@ -1760,11 +1870,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofUint64 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint64; } } /// Clears the value of the oneof if it's currently set to "oneof_uint64" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofUint64() { if (HasOneofUint64) { ClearOneofField(); @@ -1774,6 +1886,7 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_float" field. public const int OneofFloatFieldNumber = 117; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OneofFloat { get { return HasOneofFloat ? (float) oneofField_ : 0F; } set { @@ -1783,11 +1896,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofFloat { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofFloat; } } /// Clears the value of the oneof if it's currently set to "oneof_float" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofFloat() { if (HasOneofFloat) { ClearOneofField(); @@ -1797,6 +1912,7 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_double" field. public const int OneofDoubleFieldNumber = 118; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OneofDouble { get { return HasOneofDouble ? (double) oneofField_ : 0D; } set { @@ -1806,11 +1922,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofDouble { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofDouble; } } /// Clears the value of the oneof if it's currently set to "oneof_double" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofDouble() { if (HasOneofDouble) { ClearOneofField(); @@ -1820,6 +1938,7 @@ namespace ProtobufTestMessages.Proto2 { /// Field number for the "oneof_enum" field. public const int OneofEnumFieldNumber = 119; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum OneofEnum { get { return HasOneofEnum ? (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) oneofField_ : global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum.Foo; } set { @@ -1829,11 +1948,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "oneof_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofEnum { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofEnum; } } /// Clears the value of the oneof if it's currently set to "oneof_enum" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofEnum() { if (HasOneofEnum) { ClearOneofField(); @@ -1844,6 +1965,7 @@ namespace ProtobufTestMessages.Proto2 { public const int DataFieldNumber = 201; private global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.Data data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.Data Data { get { return data_; } set { @@ -1852,11 +1974,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the data field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return data_ != null; } } /// Clears the value of the data field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { data_ = null; } @@ -1871,22 +1995,25 @@ namespace ProtobufTestMessages.Proto2 { /// (protobuf says names can be any valid C/C++ identifier.) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Fieldname1 { - get { if ((_hasBits0 & 2097152) != 0) { return fieldname1_; } else { return Fieldname1DefaultValue; } } + get { if ((_hasBits0 & 32768) != 0) { return fieldname1_; } else { return Fieldname1DefaultValue; } } set { - _hasBits0 |= 2097152; + _hasBits0 |= 32768; fieldname1_ = value; } } /// Gets whether the "fieldname1" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldname1 { - get { return (_hasBits0 & 2097152) != 0; } + get { return (_hasBits0 & 32768) != 0; } } /// Clears the value of the "fieldname1" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldname1() { - _hasBits0 &= ~2097152; + _hasBits0 &= ~32768; } /// Field number for the "field_name2" field. @@ -1895,22 +2022,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName2 { - get { if ((_hasBits0 & 4194304) != 0) { return fieldName2_; } else { return FieldName2DefaultValue; } } + get { if ((_hasBits0 & 65536) != 0) { return fieldName2_; } else { return FieldName2DefaultValue; } } set { - _hasBits0 |= 4194304; + _hasBits0 |= 65536; fieldName2_ = value; } } /// Gets whether the "field_name2" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName2 { - get { return (_hasBits0 & 4194304) != 0; } + get { return (_hasBits0 & 65536) != 0; } } /// Clears the value of the "field_name2" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName2() { - _hasBits0 &= ~4194304; + _hasBits0 &= ~65536; } /// Field number for the "_field_name3" field. @@ -1919,22 +2049,25 @@ namespace ProtobufTestMessages.Proto2 { private int FieldName3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName3 { - get { if ((_hasBits0 & 8388608) != 0) { return FieldName3_; } else { return FieldName3DefaultValue; } } + get { if ((_hasBits0 & 131072) != 0) { return FieldName3_; } else { return FieldName3DefaultValue; } } set { - _hasBits0 |= 8388608; + _hasBits0 |= 131072; FieldName3_ = value; } } /// Gets whether the "_field_name3" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName3 { - get { return (_hasBits0 & 8388608) != 0; } + get { return (_hasBits0 & 131072) != 0; } } /// Clears the value of the "_field_name3" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName3() { - _hasBits0 &= ~8388608; + _hasBits0 &= ~131072; } /// Field number for the "field__name4_" field. @@ -1943,22 +2076,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName4_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName4 { - get { if ((_hasBits0 & 16777216) != 0) { return fieldName4_; } else { return FieldName4DefaultValue; } } + get { if ((_hasBits0 & 262144) != 0) { return fieldName4_; } else { return FieldName4DefaultValue; } } set { - _hasBits0 |= 16777216; + _hasBits0 |= 262144; fieldName4_ = value; } } /// Gets whether the "field__name4_" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName4 { - get { return (_hasBits0 & 16777216) != 0; } + get { return (_hasBits0 & 262144) != 0; } } /// Clears the value of the "field__name4_" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName4() { - _hasBits0 &= ~16777216; + _hasBits0 &= ~262144; } /// Field number for the "field0name5" field. @@ -1967,22 +2103,25 @@ namespace ProtobufTestMessages.Proto2 { private int field0Name5_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field0Name5 { - get { if ((_hasBits0 & 33554432) != 0) { return field0Name5_; } else { return Field0Name5DefaultValue; } } + get { if ((_hasBits0 & 524288) != 0) { return field0Name5_; } else { return Field0Name5DefaultValue; } } set { - _hasBits0 |= 33554432; + _hasBits0 |= 524288; field0Name5_ = value; } } /// Gets whether the "field0name5" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField0Name5 { - get { return (_hasBits0 & 33554432) != 0; } + get { return (_hasBits0 & 524288) != 0; } } /// Clears the value of the "field0name5" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField0Name5() { - _hasBits0 &= ~33554432; + _hasBits0 &= ~524288; } /// Field number for the "field_0_name6" field. @@ -1991,22 +2130,25 @@ namespace ProtobufTestMessages.Proto2 { private int field0Name6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field0Name6 { - get { if ((_hasBits0 & 67108864) != 0) { return field0Name6_; } else { return Field0Name6DefaultValue; } } + get { if ((_hasBits0 & 1048576) != 0) { return field0Name6_; } else { return Field0Name6DefaultValue; } } set { - _hasBits0 |= 67108864; + _hasBits0 |= 1048576; field0Name6_ = value; } } /// Gets whether the "field_0_name6" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField0Name6 { - get { return (_hasBits0 & 67108864) != 0; } + get { return (_hasBits0 & 1048576) != 0; } } /// Clears the value of the "field_0_name6" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField0Name6() { - _hasBits0 &= ~67108864; + _hasBits0 &= ~1048576; } /// Field number for the "fieldName7" field. @@ -2015,22 +2157,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName7_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName7 { - get { if ((_hasBits0 & 134217728) != 0) { return fieldName7_; } else { return FieldName7DefaultValue; } } + get { if ((_hasBits0 & 2097152) != 0) { return fieldName7_; } else { return FieldName7DefaultValue; } } set { - _hasBits0 |= 134217728; + _hasBits0 |= 2097152; fieldName7_ = value; } } /// Gets whether the "fieldName7" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName7 { - get { return (_hasBits0 & 134217728) != 0; } + get { return (_hasBits0 & 2097152) != 0; } } /// Clears the value of the "fieldName7" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName7() { - _hasBits0 &= ~134217728; + _hasBits0 &= ~2097152; } /// Field number for the "FieldName8" field. @@ -2039,22 +2184,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName8 { - get { if ((_hasBits0 & 268435456) != 0) { return fieldName8_; } else { return FieldName8DefaultValue; } } + get { if ((_hasBits0 & 4194304) != 0) { return fieldName8_; } else { return FieldName8DefaultValue; } } set { - _hasBits0 |= 268435456; + _hasBits0 |= 4194304; fieldName8_ = value; } } /// Gets whether the "FieldName8" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName8 { - get { return (_hasBits0 & 268435456) != 0; } + get { return (_hasBits0 & 4194304) != 0; } } /// Clears the value of the "FieldName8" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName8() { - _hasBits0 &= ~268435456; + _hasBits0 &= ~4194304; } /// Field number for the "field_Name9" field. @@ -2063,22 +2211,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName9_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName9 { - get { if ((_hasBits0 & 536870912) != 0) { return fieldName9_; } else { return FieldName9DefaultValue; } } + get { if ((_hasBits0 & 8388608) != 0) { return fieldName9_; } else { return FieldName9DefaultValue; } } set { - _hasBits0 |= 536870912; + _hasBits0 |= 8388608; fieldName9_ = value; } } /// Gets whether the "field_Name9" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName9 { - get { return (_hasBits0 & 536870912) != 0; } + get { return (_hasBits0 & 8388608) != 0; } } /// Clears the value of the "field_Name9" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName9() { - _hasBits0 &= ~536870912; + _hasBits0 &= ~8388608; } /// Field number for the "Field_Name10" field. @@ -2087,22 +2238,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName10_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName10 { - get { if ((_hasBits0 & 1073741824) != 0) { return fieldName10_; } else { return FieldName10DefaultValue; } } + get { if ((_hasBits0 & 16777216) != 0) { return fieldName10_; } else { return FieldName10DefaultValue; } } set { - _hasBits0 |= 1073741824; + _hasBits0 |= 16777216; fieldName10_ = value; } } /// Gets whether the "Field_Name10" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName10 { - get { return (_hasBits0 & 1073741824) != 0; } + get { return (_hasBits0 & 16777216) != 0; } } /// Clears the value of the "Field_Name10" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName10() { - _hasBits0 &= ~1073741824; + _hasBits0 &= ~16777216; } /// Field number for the "FIELD_NAME11" field. @@ -2111,22 +2265,25 @@ namespace ProtobufTestMessages.Proto2 { private int fIELDNAME11_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDNAME11 { - get { if ((_hasBits0 & -2147483648) != 0) { return fIELDNAME11_; } else { return FIELDNAME11DefaultValue; } } + get { if ((_hasBits0 & 33554432) != 0) { return fIELDNAME11_; } else { return FIELDNAME11DefaultValue; } } set { - _hasBits0 |= -2147483648; + _hasBits0 |= 33554432; fIELDNAME11_ = value; } } /// Gets whether the "FIELD_NAME11" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFIELDNAME11 { - get { return (_hasBits0 & -2147483648) != 0; } + get { return (_hasBits0 & 33554432) != 0; } } /// Clears the value of the "FIELD_NAME11" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFIELDNAME11() { - _hasBits0 &= ~-2147483648; + _hasBits0 &= ~33554432; } /// Field number for the "FIELD_name12" field. @@ -2135,22 +2292,25 @@ namespace ProtobufTestMessages.Proto2 { private int fIELDName12_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDName12 { - get { if ((_hasBits1 & 1) != 0) { return fIELDName12_; } else { return FIELDName12DefaultValue; } } + get { if ((_hasBits0 & 67108864) != 0) { return fIELDName12_; } else { return FIELDName12DefaultValue; } } set { - _hasBits1 |= 1; + _hasBits0 |= 67108864; fIELDName12_ = value; } } /// Gets whether the "FIELD_name12" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFIELDName12 { - get { return (_hasBits1 & 1) != 0; } + get { return (_hasBits0 & 67108864) != 0; } } /// Clears the value of the "FIELD_name12" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFIELDName12() { - _hasBits1 &= ~1; + _hasBits0 &= ~67108864; } /// Field number for the "__field_name13" field. @@ -2159,22 +2319,25 @@ namespace ProtobufTestMessages.Proto2 { private int FieldName13_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName13 { - get { if ((_hasBits1 & 2) != 0) { return FieldName13_; } else { return FieldName13DefaultValue; } } + get { if ((_hasBits0 & 134217728) != 0) { return FieldName13_; } else { return FieldName13DefaultValue; } } set { - _hasBits1 |= 2; + _hasBits0 |= 134217728; FieldName13_ = value; } } /// Gets whether the "__field_name13" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName13 { - get { return (_hasBits1 & 2) != 0; } + get { return (_hasBits0 & 134217728) != 0; } } /// Clears the value of the "__field_name13" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName13() { - _hasBits1 &= ~2; + _hasBits0 &= ~134217728; } /// Field number for the "__Field_name14" field. @@ -2183,22 +2346,25 @@ namespace ProtobufTestMessages.Proto2 { private int FieldName14_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName14 { - get { if ((_hasBits1 & 4) != 0) { return FieldName14_; } else { return FieldName14DefaultValue; } } + get { if ((_hasBits0 & 268435456) != 0) { return FieldName14_; } else { return FieldName14DefaultValue; } } set { - _hasBits1 |= 4; + _hasBits0 |= 268435456; FieldName14_ = value; } } /// Gets whether the "__Field_name14" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName14 { - get { return (_hasBits1 & 4) != 0; } + get { return (_hasBits0 & 268435456) != 0; } } /// Clears the value of the "__Field_name14" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName14() { - _hasBits1 &= ~4; + _hasBits0 &= ~268435456; } /// Field number for the "field__name15" field. @@ -2207,22 +2373,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName15_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName15 { - get { if ((_hasBits1 & 8) != 0) { return fieldName15_; } else { return FieldName15DefaultValue; } } + get { if ((_hasBits0 & 536870912) != 0) { return fieldName15_; } else { return FieldName15DefaultValue; } } set { - _hasBits1 |= 8; + _hasBits0 |= 536870912; fieldName15_ = value; } } /// Gets whether the "field__name15" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName15 { - get { return (_hasBits1 & 8) != 0; } + get { return (_hasBits0 & 536870912) != 0; } } /// Clears the value of the "field__name15" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName15() { - _hasBits1 &= ~8; + _hasBits0 &= ~536870912; } /// Field number for the "field__Name16" field. @@ -2231,22 +2400,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName16_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName16 { - get { if ((_hasBits1 & 16) != 0) { return fieldName16_; } else { return FieldName16DefaultValue; } } + get { if ((_hasBits0 & 1073741824) != 0) { return fieldName16_; } else { return FieldName16DefaultValue; } } set { - _hasBits1 |= 16; + _hasBits0 |= 1073741824; fieldName16_ = value; } } /// Gets whether the "field__Name16" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName16 { - get { return (_hasBits1 & 16) != 0; } + get { return (_hasBits0 & 1073741824) != 0; } } /// Clears the value of the "field__Name16" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName16() { - _hasBits1 &= ~16; + _hasBits0 &= ~1073741824; } /// Field number for the "field_name17__" field. @@ -2255,22 +2427,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName17_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName17 { - get { if ((_hasBits1 & 32) != 0) { return fieldName17_; } else { return FieldName17DefaultValue; } } + get { if ((_hasBits0 & -2147483648) != 0) { return fieldName17_; } else { return FieldName17DefaultValue; } } set { - _hasBits1 |= 32; + _hasBits0 |= -2147483648; fieldName17_ = value; } } /// Gets whether the "field_name17__" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName17 { - get { return (_hasBits1 & 32) != 0; } + get { return (_hasBits0 & -2147483648) != 0; } } /// Clears the value of the "field_name17__" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName17() { - _hasBits1 &= ~32; + _hasBits0 &= ~-2147483648; } /// Field number for the "Field_name18__" field. @@ -2279,22 +2454,25 @@ namespace ProtobufTestMessages.Proto2 { private int fieldName18_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName18 { - get { if ((_hasBits1 & 64) != 0) { return fieldName18_; } else { return FieldName18DefaultValue; } } + get { if ((_hasBits1 & 1) != 0) { return fieldName18_; } else { return FieldName18DefaultValue; } } set { - _hasBits1 |= 64; + _hasBits1 |= 1; fieldName18_ = value; } } /// Gets whether the "Field_name18__" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName18 { - get { return (_hasBits1 & 64) != 0; } + get { return (_hasBits1 & 1) != 0; } } /// Clears the value of the "Field_name18__" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName18() { - _hasBits1 &= ~64; + _hasBits1 &= ~1; } private object oneofField_; @@ -2313,22 +2491,26 @@ namespace ProtobufTestMessages.Proto2 { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllTypesProto2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllTypesProto2 other) { if (ReferenceEquals(other, null)) { return false; @@ -2462,6 +2644,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); @@ -2479,13 +2662,13 @@ namespace ProtobufTestMessages.Proto2 { if (HasOptionalBool) hash ^= OptionalBool.GetHashCode(); if (HasOptionalString) hash ^= OptionalString.GetHashCode(); if (HasOptionalBytes) hash ^= OptionalBytes.GetHashCode(); - if (HasOptionalNestedMessage) hash ^= OptionalNestedMessage.GetHashCode(); - if (HasOptionalForeignMessage) hash ^= OptionalForeignMessage.GetHashCode(); + if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode(); + if (optionalForeignMessage_ != null) hash ^= OptionalForeignMessage.GetHashCode(); if (HasOptionalNestedEnum) hash ^= OptionalNestedEnum.GetHashCode(); if (HasOptionalForeignEnum) hash ^= OptionalForeignEnum.GetHashCode(); if (HasOptionalStringPiece) hash ^= OptionalStringPiece.GetHashCode(); if (HasOptionalCord) hash ^= OptionalCord.GetHashCode(); - if (HasRecursiveMessage) hash ^= RecursiveMessage.GetHashCode(); + if (recursiveMessage_ != null) hash ^= RecursiveMessage.GetHashCode(); hash ^= repeatedInt32_.GetHashCode(); hash ^= repeatedInt64_.GetHashCode(); hash ^= repeatedUint32_.GetHashCode(); @@ -2555,7 +2738,7 @@ namespace ProtobufTestMessages.Proto2 { hash ^= MapStringNestedEnum.GetHashCode(); hash ^= MapStringForeignEnum.GetHashCode(); if (HasOneofUint32) hash ^= OneofUint32.GetHashCode(); - if (HasOneofNestedMessage) hash ^= OneofNestedMessage.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) hash ^= OneofNestedMessage.GetHashCode(); if (HasOneofString) hash ^= OneofString.GetHashCode(); if (HasOneofBytes) hash ^= OneofBytes.GetHashCode(); if (HasOneofBool) hash ^= OneofBool.GetHashCode(); @@ -2593,12 +2776,17 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasOptionalInt32) { output.WriteRawTag(8); output.WriteInt32(OptionalInt32); @@ -2659,11 +2847,11 @@ namespace ProtobufTestMessages.Proto2 { output.WriteRawTag(122); output.WriteBytes(OptionalBytes); } - if (HasOptionalNestedMessage) { + if (optionalNestedMessage_ != null) { output.WriteRawTag(146, 1); output.WriteMessage(OptionalNestedMessage); } - if (HasOptionalForeignMessage) { + if (optionalForeignMessage_ != null) { output.WriteRawTag(154, 1); output.WriteMessage(OptionalForeignMessage); } @@ -2683,7 +2871,7 @@ namespace ProtobufTestMessages.Proto2 { output.WriteRawTag(202, 1); output.WriteString(OptionalCord); } - if (HasRecursiveMessage) { + if (recursiveMessage_ != null) { output.WriteRawTag(218, 1); output.WriteMessage(RecursiveMessage); } @@ -2759,7 +2947,7 @@ namespace ProtobufTestMessages.Proto2 { output.WriteRawTag(248, 6); output.WriteUInt32(OneofUint32); } - if (HasOneofNestedMessage) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { output.WriteRawTag(130, 7); output.WriteMessage(OneofNestedMessage); } @@ -2874,176 +3062,460 @@ namespace ProtobufTestMessages.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasOptionalInt32) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32); + output.WriteRawTag(8); + output.WriteInt32(OptionalInt32); } if (HasOptionalInt64) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(OptionalInt64); + output.WriteRawTag(16); + output.WriteInt64(OptionalInt64); } if (HasOptionalUint32) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(OptionalUint32); + output.WriteRawTag(24); + output.WriteUInt32(OptionalUint32); } if (HasOptionalUint64) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(OptionalUint64); + output.WriteRawTag(32); + output.WriteUInt64(OptionalUint64); } if (HasOptionalSint32) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(OptionalSint32); + output.WriteRawTag(40); + output.WriteSInt32(OptionalSint32); } if (HasOptionalSint64) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(OptionalSint64); + output.WriteRawTag(48); + output.WriteSInt64(OptionalSint64); } if (HasOptionalFixed32) { - size += 1 + 4; + output.WriteRawTag(61); + output.WriteFixed32(OptionalFixed32); } if (HasOptionalFixed64) { - size += 1 + 8; + output.WriteRawTag(65); + output.WriteFixed64(OptionalFixed64); } if (HasOptionalSfixed32) { - size += 1 + 4; + output.WriteRawTag(77); + output.WriteSFixed32(OptionalSfixed32); } if (HasOptionalSfixed64) { - size += 1 + 8; + output.WriteRawTag(81); + output.WriteSFixed64(OptionalSfixed64); } if (HasOptionalFloat) { - size += 1 + 4; + output.WriteRawTag(93); + output.WriteFloat(OptionalFloat); } if (HasOptionalDouble) { - size += 1 + 8; + output.WriteRawTag(97); + output.WriteDouble(OptionalDouble); } if (HasOptionalBool) { - size += 1 + 1; + output.WriteRawTag(104); + output.WriteBool(OptionalBool); } if (HasOptionalString) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(OptionalString); + output.WriteRawTag(114); + output.WriteString(OptionalString); } if (HasOptionalBytes) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(OptionalBytes); + output.WriteRawTag(122); + output.WriteBytes(OptionalBytes); } - if (HasOptionalNestedMessage) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); + if (optionalNestedMessage_ != null) { + output.WriteRawTag(146, 1); + output.WriteMessage(OptionalNestedMessage); } - if (HasOptionalForeignMessage) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalForeignMessage); + if (optionalForeignMessage_ != null) { + output.WriteRawTag(154, 1); + output.WriteMessage(OptionalForeignMessage); } if (HasOptionalNestedEnum) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalNestedEnum); + output.WriteRawTag(168, 1); + output.WriteEnum((int) OptionalNestedEnum); } if (HasOptionalForeignEnum) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalForeignEnum); + output.WriteRawTag(176, 1); + output.WriteEnum((int) OptionalForeignEnum); } if (HasOptionalStringPiece) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalStringPiece); + output.WriteRawTag(194, 1); + output.WriteString(OptionalStringPiece); } if (HasOptionalCord) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalCord); + output.WriteRawTag(202, 1); + output.WriteString(OptionalCord); } - if (HasRecursiveMessage) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RecursiveMessage); + if (recursiveMessage_ != null) { + output.WriteRawTag(218, 1); + output.WriteMessage(RecursiveMessage); } - size += repeatedInt32_.CalculateSize(_repeated_repeatedInt32_codec); - size += repeatedInt64_.CalculateSize(_repeated_repeatedInt64_codec); - size += repeatedUint32_.CalculateSize(_repeated_repeatedUint32_codec); - size += repeatedUint64_.CalculateSize(_repeated_repeatedUint64_codec); - size += repeatedSint32_.CalculateSize(_repeated_repeatedSint32_codec); - size += repeatedSint64_.CalculateSize(_repeated_repeatedSint64_codec); - size += repeatedFixed32_.CalculateSize(_repeated_repeatedFixed32_codec); - size += repeatedFixed64_.CalculateSize(_repeated_repeatedFixed64_codec); - size += repeatedSfixed32_.CalculateSize(_repeated_repeatedSfixed32_codec); - size += repeatedSfixed64_.CalculateSize(_repeated_repeatedSfixed64_codec); - size += repeatedFloat_.CalculateSize(_repeated_repeatedFloat_codec); - size += repeatedDouble_.CalculateSize(_repeated_repeatedDouble_codec); - size += repeatedBool_.CalculateSize(_repeated_repeatedBool_codec); - size += repeatedString_.CalculateSize(_repeated_repeatedString_codec); - size += repeatedBytes_.CalculateSize(_repeated_repeatedBytes_codec); - size += repeatedNestedMessage_.CalculateSize(_repeated_repeatedNestedMessage_codec); - size += repeatedForeignMessage_.CalculateSize(_repeated_repeatedForeignMessage_codec); - size += repeatedNestedEnum_.CalculateSize(_repeated_repeatedNestedEnum_codec); - size += repeatedForeignEnum_.CalculateSize(_repeated_repeatedForeignEnum_codec); - size += repeatedStringPiece_.CalculateSize(_repeated_repeatedStringPiece_codec); - size += repeatedCord_.CalculateSize(_repeated_repeatedCord_codec); - size += packedInt32_.CalculateSize(_repeated_packedInt32_codec); - size += packedInt64_.CalculateSize(_repeated_packedInt64_codec); - size += packedUint32_.CalculateSize(_repeated_packedUint32_codec); - size += packedUint64_.CalculateSize(_repeated_packedUint64_codec); - size += packedSint32_.CalculateSize(_repeated_packedSint32_codec); - size += packedSint64_.CalculateSize(_repeated_packedSint64_codec); - size += packedFixed32_.CalculateSize(_repeated_packedFixed32_codec); - size += packedFixed64_.CalculateSize(_repeated_packedFixed64_codec); - size += packedSfixed32_.CalculateSize(_repeated_packedSfixed32_codec); - size += packedSfixed64_.CalculateSize(_repeated_packedSfixed64_codec); - size += packedFloat_.CalculateSize(_repeated_packedFloat_codec); - size += packedDouble_.CalculateSize(_repeated_packedDouble_codec); - size += packedBool_.CalculateSize(_repeated_packedBool_codec); - size += packedNestedEnum_.CalculateSize(_repeated_packedNestedEnum_codec); - size += unpackedInt32_.CalculateSize(_repeated_unpackedInt32_codec); - size += unpackedInt64_.CalculateSize(_repeated_unpackedInt64_codec); - size += unpackedUint32_.CalculateSize(_repeated_unpackedUint32_codec); - size += unpackedUint64_.CalculateSize(_repeated_unpackedUint64_codec); - size += unpackedSint32_.CalculateSize(_repeated_unpackedSint32_codec); - size += unpackedSint64_.CalculateSize(_repeated_unpackedSint64_codec); - size += unpackedFixed32_.CalculateSize(_repeated_unpackedFixed32_codec); - size += unpackedFixed64_.CalculateSize(_repeated_unpackedFixed64_codec); - size += unpackedSfixed32_.CalculateSize(_repeated_unpackedSfixed32_codec); - size += unpackedSfixed64_.CalculateSize(_repeated_unpackedSfixed64_codec); - size += unpackedFloat_.CalculateSize(_repeated_unpackedFloat_codec); - size += unpackedDouble_.CalculateSize(_repeated_unpackedDouble_codec); - size += unpackedBool_.CalculateSize(_repeated_unpackedBool_codec); - size += unpackedNestedEnum_.CalculateSize(_repeated_unpackedNestedEnum_codec); - size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); - size += mapInt64Int64_.CalculateSize(_map_mapInt64Int64_codec); - size += mapUint32Uint32_.CalculateSize(_map_mapUint32Uint32_codec); - size += mapUint64Uint64_.CalculateSize(_map_mapUint64Uint64_codec); - size += mapSint32Sint32_.CalculateSize(_map_mapSint32Sint32_codec); - size += mapSint64Sint64_.CalculateSize(_map_mapSint64Sint64_codec); - size += mapFixed32Fixed32_.CalculateSize(_map_mapFixed32Fixed32_codec); - size += mapFixed64Fixed64_.CalculateSize(_map_mapFixed64Fixed64_codec); - size += mapSfixed32Sfixed32_.CalculateSize(_map_mapSfixed32Sfixed32_codec); - size += mapSfixed64Sfixed64_.CalculateSize(_map_mapSfixed64Sfixed64_codec); - size += mapInt32Float_.CalculateSize(_map_mapInt32Float_codec); - size += mapInt32Double_.CalculateSize(_map_mapInt32Double_codec); - size += mapBoolBool_.CalculateSize(_map_mapBoolBool_codec); - size += mapStringString_.CalculateSize(_map_mapStringString_codec); - size += mapStringBytes_.CalculateSize(_map_mapStringBytes_codec); - size += mapStringNestedMessage_.CalculateSize(_map_mapStringNestedMessage_codec); - size += mapStringForeignMessage_.CalculateSize(_map_mapStringForeignMessage_codec); - size += mapStringNestedEnum_.CalculateSize(_map_mapStringNestedEnum_codec); - size += mapStringForeignEnum_.CalculateSize(_map_mapStringForeignEnum_codec); + repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); + repeatedInt64_.WriteTo(ref output, _repeated_repeatedInt64_codec); + repeatedUint32_.WriteTo(ref output, _repeated_repeatedUint32_codec); + repeatedUint64_.WriteTo(ref output, _repeated_repeatedUint64_codec); + repeatedSint32_.WriteTo(ref output, _repeated_repeatedSint32_codec); + repeatedSint64_.WriteTo(ref output, _repeated_repeatedSint64_codec); + repeatedFixed32_.WriteTo(ref output, _repeated_repeatedFixed32_codec); + repeatedFixed64_.WriteTo(ref output, _repeated_repeatedFixed64_codec); + repeatedSfixed32_.WriteTo(ref output, _repeated_repeatedSfixed32_codec); + repeatedSfixed64_.WriteTo(ref output, _repeated_repeatedSfixed64_codec); + repeatedFloat_.WriteTo(ref output, _repeated_repeatedFloat_codec); + repeatedDouble_.WriteTo(ref output, _repeated_repeatedDouble_codec); + repeatedBool_.WriteTo(ref output, _repeated_repeatedBool_codec); + repeatedString_.WriteTo(ref output, _repeated_repeatedString_codec); + repeatedBytes_.WriteTo(ref output, _repeated_repeatedBytes_codec); + repeatedNestedMessage_.WriteTo(ref output, _repeated_repeatedNestedMessage_codec); + repeatedForeignMessage_.WriteTo(ref output, _repeated_repeatedForeignMessage_codec); + repeatedNestedEnum_.WriteTo(ref output, _repeated_repeatedNestedEnum_codec); + repeatedForeignEnum_.WriteTo(ref output, _repeated_repeatedForeignEnum_codec); + repeatedStringPiece_.WriteTo(ref output, _repeated_repeatedStringPiece_codec); + repeatedCord_.WriteTo(ref output, _repeated_repeatedCord_codec); + mapInt32Int32_.WriteTo(ref output, _map_mapInt32Int32_codec); + mapInt64Int64_.WriteTo(ref output, _map_mapInt64Int64_codec); + mapUint32Uint32_.WriteTo(ref output, _map_mapUint32Uint32_codec); + mapUint64Uint64_.WriteTo(ref output, _map_mapUint64Uint64_codec); + mapSint32Sint32_.WriteTo(ref output, _map_mapSint32Sint32_codec); + mapSint64Sint64_.WriteTo(ref output, _map_mapSint64Sint64_codec); + mapFixed32Fixed32_.WriteTo(ref output, _map_mapFixed32Fixed32_codec); + mapFixed64Fixed64_.WriteTo(ref output, _map_mapFixed64Fixed64_codec); + mapSfixed32Sfixed32_.WriteTo(ref output, _map_mapSfixed32Sfixed32_codec); + mapSfixed64Sfixed64_.WriteTo(ref output, _map_mapSfixed64Sfixed64_codec); + mapInt32Float_.WriteTo(ref output, _map_mapInt32Float_codec); + mapInt32Double_.WriteTo(ref output, _map_mapInt32Double_codec); + mapBoolBool_.WriteTo(ref output, _map_mapBoolBool_codec); + mapStringString_.WriteTo(ref output, _map_mapStringString_codec); + mapStringBytes_.WriteTo(ref output, _map_mapStringBytes_codec); + mapStringNestedMessage_.WriteTo(ref output, _map_mapStringNestedMessage_codec); + mapStringForeignMessage_.WriteTo(ref output, _map_mapStringForeignMessage_codec); + mapStringNestedEnum_.WriteTo(ref output, _map_mapStringNestedEnum_codec); + mapStringForeignEnum_.WriteTo(ref output, _map_mapStringForeignEnum_codec); + packedInt32_.WriteTo(ref output, _repeated_packedInt32_codec); + packedInt64_.WriteTo(ref output, _repeated_packedInt64_codec); + packedUint32_.WriteTo(ref output, _repeated_packedUint32_codec); + packedUint64_.WriteTo(ref output, _repeated_packedUint64_codec); + packedSint32_.WriteTo(ref output, _repeated_packedSint32_codec); + packedSint64_.WriteTo(ref output, _repeated_packedSint64_codec); + packedFixed32_.WriteTo(ref output, _repeated_packedFixed32_codec); + packedFixed64_.WriteTo(ref output, _repeated_packedFixed64_codec); + packedSfixed32_.WriteTo(ref output, _repeated_packedSfixed32_codec); + packedSfixed64_.WriteTo(ref output, _repeated_packedSfixed64_codec); + packedFloat_.WriteTo(ref output, _repeated_packedFloat_codec); + packedDouble_.WriteTo(ref output, _repeated_packedDouble_codec); + packedBool_.WriteTo(ref output, _repeated_packedBool_codec); + packedNestedEnum_.WriteTo(ref output, _repeated_packedNestedEnum_codec); + unpackedInt32_.WriteTo(ref output, _repeated_unpackedInt32_codec); + unpackedInt64_.WriteTo(ref output, _repeated_unpackedInt64_codec); + unpackedUint32_.WriteTo(ref output, _repeated_unpackedUint32_codec); + unpackedUint64_.WriteTo(ref output, _repeated_unpackedUint64_codec); + unpackedSint32_.WriteTo(ref output, _repeated_unpackedSint32_codec); + unpackedSint64_.WriteTo(ref output, _repeated_unpackedSint64_codec); + unpackedFixed32_.WriteTo(ref output, _repeated_unpackedFixed32_codec); + unpackedFixed64_.WriteTo(ref output, _repeated_unpackedFixed64_codec); + unpackedSfixed32_.WriteTo(ref output, _repeated_unpackedSfixed32_codec); + unpackedSfixed64_.WriteTo(ref output, _repeated_unpackedSfixed64_codec); + unpackedFloat_.WriteTo(ref output, _repeated_unpackedFloat_codec); + unpackedDouble_.WriteTo(ref output, _repeated_unpackedDouble_codec); + unpackedBool_.WriteTo(ref output, _repeated_unpackedBool_codec); + unpackedNestedEnum_.WriteTo(ref output, _repeated_unpackedNestedEnum_codec); if (HasOneofUint32) { - size += 2 + pb::CodedOutputStream.ComputeUInt32Size(OneofUint32); + output.WriteRawTag(248, 6); + output.WriteUInt32(OneofUint32); } - if (HasOneofNestedMessage) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OneofNestedMessage); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + output.WriteRawTag(130, 7); + output.WriteMessage(OneofNestedMessage); } if (HasOneofString) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(OneofString); + output.WriteRawTag(138, 7); + output.WriteString(OneofString); } if (HasOneofBytes) { - size += 2 + pb::CodedOutputStream.ComputeBytesSize(OneofBytes); + output.WriteRawTag(146, 7); + output.WriteBytes(OneofBytes); } if (HasOneofBool) { - size += 2 + 1; + output.WriteRawTag(152, 7); + output.WriteBool(OneofBool); } if (HasOneofUint64) { - size += 2 + pb::CodedOutputStream.ComputeUInt64Size(OneofUint64); + output.WriteRawTag(160, 7); + output.WriteUInt64(OneofUint64); } if (HasOneofFloat) { - size += 2 + 4; + output.WriteRawTag(173, 7); + output.WriteFloat(OneofFloat); } if (HasOneofDouble) { - size += 2 + 8; + output.WriteRawTag(177, 7); + output.WriteDouble(OneofDouble); } if (HasOneofEnum) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OneofEnum); + output.WriteRawTag(184, 7); + output.WriteEnum((int) OneofEnum); } if (HasData) { - size += 4 + pb::CodedOutputStream.ComputeGroupSize(Data); - } - if (HasFieldname1) { + output.WriteRawTag(203, 12); + output.WriteGroup(Data); + output.WriteRawTag(204, 12); + } + if (HasFieldname1) { + output.WriteRawTag(136, 25); + output.WriteInt32(Fieldname1); + } + if (HasFieldName2) { + output.WriteRawTag(144, 25); + output.WriteInt32(FieldName2); + } + if (HasFieldName3) { + output.WriteRawTag(152, 25); + output.WriteInt32(FieldName3); + } + if (HasFieldName4) { + output.WriteRawTag(160, 25); + output.WriteInt32(FieldName4); + } + if (HasField0Name5) { + output.WriteRawTag(168, 25); + output.WriteInt32(Field0Name5); + } + if (HasField0Name6) { + output.WriteRawTag(176, 25); + output.WriteInt32(Field0Name6); + } + if (HasFieldName7) { + output.WriteRawTag(184, 25); + output.WriteInt32(FieldName7); + } + if (HasFieldName8) { + output.WriteRawTag(192, 25); + output.WriteInt32(FieldName8); + } + if (HasFieldName9) { + output.WriteRawTag(200, 25); + output.WriteInt32(FieldName9); + } + if (HasFieldName10) { + output.WriteRawTag(208, 25); + output.WriteInt32(FieldName10); + } + if (HasFIELDNAME11) { + output.WriteRawTag(216, 25); + output.WriteInt32(FIELDNAME11); + } + if (HasFIELDName12) { + output.WriteRawTag(224, 25); + output.WriteInt32(FIELDName12); + } + if (HasFieldName13) { + output.WriteRawTag(232, 25); + output.WriteInt32(FieldName13); + } + if (HasFieldName14) { + output.WriteRawTag(240, 25); + output.WriteInt32(FieldName14); + } + if (HasFieldName15) { + output.WriteRawTag(248, 25); + output.WriteInt32(FieldName15); + } + if (HasFieldName16) { + output.WriteRawTag(128, 26); + output.WriteInt32(FieldName16); + } + if (HasFieldName17) { + output.WriteRawTag(136, 26); + output.WriteInt32(FieldName17); + } + if (HasFieldName18) { + output.WriteRawTag(144, 26); + output.WriteInt32(FieldName18); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOptionalInt32) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32); + } + if (HasOptionalInt64) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OptionalInt64); + } + if (HasOptionalUint32) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(OptionalUint32); + } + if (HasOptionalUint64) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(OptionalUint64); + } + if (HasOptionalSint32) { + size += 1 + pb::CodedOutputStream.ComputeSInt32Size(OptionalSint32); + } + if (HasOptionalSint64) { + size += 1 + pb::CodedOutputStream.ComputeSInt64Size(OptionalSint64); + } + if (HasOptionalFixed32) { + size += 1 + 4; + } + if (HasOptionalFixed64) { + size += 1 + 8; + } + if (HasOptionalSfixed32) { + size += 1 + 4; + } + if (HasOptionalSfixed64) { + size += 1 + 8; + } + if (HasOptionalFloat) { + size += 1 + 4; + } + if (HasOptionalDouble) { + size += 1 + 8; + } + if (HasOptionalBool) { + size += 1 + 1; + } + if (HasOptionalString) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OptionalString); + } + if (HasOptionalBytes) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(OptionalBytes); + } + if (optionalNestedMessage_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); + } + if (optionalForeignMessage_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalForeignMessage); + } + if (HasOptionalNestedEnum) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalNestedEnum); + } + if (HasOptionalForeignEnum) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalForeignEnum); + } + if (HasOptionalStringPiece) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalStringPiece); + } + if (HasOptionalCord) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalCord); + } + if (recursiveMessage_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(RecursiveMessage); + } + size += repeatedInt32_.CalculateSize(_repeated_repeatedInt32_codec); + size += repeatedInt64_.CalculateSize(_repeated_repeatedInt64_codec); + size += repeatedUint32_.CalculateSize(_repeated_repeatedUint32_codec); + size += repeatedUint64_.CalculateSize(_repeated_repeatedUint64_codec); + size += repeatedSint32_.CalculateSize(_repeated_repeatedSint32_codec); + size += repeatedSint64_.CalculateSize(_repeated_repeatedSint64_codec); + size += repeatedFixed32_.CalculateSize(_repeated_repeatedFixed32_codec); + size += repeatedFixed64_.CalculateSize(_repeated_repeatedFixed64_codec); + size += repeatedSfixed32_.CalculateSize(_repeated_repeatedSfixed32_codec); + size += repeatedSfixed64_.CalculateSize(_repeated_repeatedSfixed64_codec); + size += repeatedFloat_.CalculateSize(_repeated_repeatedFloat_codec); + size += repeatedDouble_.CalculateSize(_repeated_repeatedDouble_codec); + size += repeatedBool_.CalculateSize(_repeated_repeatedBool_codec); + size += repeatedString_.CalculateSize(_repeated_repeatedString_codec); + size += repeatedBytes_.CalculateSize(_repeated_repeatedBytes_codec); + size += repeatedNestedMessage_.CalculateSize(_repeated_repeatedNestedMessage_codec); + size += repeatedForeignMessage_.CalculateSize(_repeated_repeatedForeignMessage_codec); + size += repeatedNestedEnum_.CalculateSize(_repeated_repeatedNestedEnum_codec); + size += repeatedForeignEnum_.CalculateSize(_repeated_repeatedForeignEnum_codec); + size += repeatedStringPiece_.CalculateSize(_repeated_repeatedStringPiece_codec); + size += repeatedCord_.CalculateSize(_repeated_repeatedCord_codec); + size += packedInt32_.CalculateSize(_repeated_packedInt32_codec); + size += packedInt64_.CalculateSize(_repeated_packedInt64_codec); + size += packedUint32_.CalculateSize(_repeated_packedUint32_codec); + size += packedUint64_.CalculateSize(_repeated_packedUint64_codec); + size += packedSint32_.CalculateSize(_repeated_packedSint32_codec); + size += packedSint64_.CalculateSize(_repeated_packedSint64_codec); + size += packedFixed32_.CalculateSize(_repeated_packedFixed32_codec); + size += packedFixed64_.CalculateSize(_repeated_packedFixed64_codec); + size += packedSfixed32_.CalculateSize(_repeated_packedSfixed32_codec); + size += packedSfixed64_.CalculateSize(_repeated_packedSfixed64_codec); + size += packedFloat_.CalculateSize(_repeated_packedFloat_codec); + size += packedDouble_.CalculateSize(_repeated_packedDouble_codec); + size += packedBool_.CalculateSize(_repeated_packedBool_codec); + size += packedNestedEnum_.CalculateSize(_repeated_packedNestedEnum_codec); + size += unpackedInt32_.CalculateSize(_repeated_unpackedInt32_codec); + size += unpackedInt64_.CalculateSize(_repeated_unpackedInt64_codec); + size += unpackedUint32_.CalculateSize(_repeated_unpackedUint32_codec); + size += unpackedUint64_.CalculateSize(_repeated_unpackedUint64_codec); + size += unpackedSint32_.CalculateSize(_repeated_unpackedSint32_codec); + size += unpackedSint64_.CalculateSize(_repeated_unpackedSint64_codec); + size += unpackedFixed32_.CalculateSize(_repeated_unpackedFixed32_codec); + size += unpackedFixed64_.CalculateSize(_repeated_unpackedFixed64_codec); + size += unpackedSfixed32_.CalculateSize(_repeated_unpackedSfixed32_codec); + size += unpackedSfixed64_.CalculateSize(_repeated_unpackedSfixed64_codec); + size += unpackedFloat_.CalculateSize(_repeated_unpackedFloat_codec); + size += unpackedDouble_.CalculateSize(_repeated_unpackedDouble_codec); + size += unpackedBool_.CalculateSize(_repeated_unpackedBool_codec); + size += unpackedNestedEnum_.CalculateSize(_repeated_unpackedNestedEnum_codec); + size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); + size += mapInt64Int64_.CalculateSize(_map_mapInt64Int64_codec); + size += mapUint32Uint32_.CalculateSize(_map_mapUint32Uint32_codec); + size += mapUint64Uint64_.CalculateSize(_map_mapUint64Uint64_codec); + size += mapSint32Sint32_.CalculateSize(_map_mapSint32Sint32_codec); + size += mapSint64Sint64_.CalculateSize(_map_mapSint64Sint64_codec); + size += mapFixed32Fixed32_.CalculateSize(_map_mapFixed32Fixed32_codec); + size += mapFixed64Fixed64_.CalculateSize(_map_mapFixed64Fixed64_codec); + size += mapSfixed32Sfixed32_.CalculateSize(_map_mapSfixed32Sfixed32_codec); + size += mapSfixed64Sfixed64_.CalculateSize(_map_mapSfixed64Sfixed64_codec); + size += mapInt32Float_.CalculateSize(_map_mapInt32Float_codec); + size += mapInt32Double_.CalculateSize(_map_mapInt32Double_codec); + size += mapBoolBool_.CalculateSize(_map_mapBoolBool_codec); + size += mapStringString_.CalculateSize(_map_mapStringString_codec); + size += mapStringBytes_.CalculateSize(_map_mapStringBytes_codec); + size += mapStringNestedMessage_.CalculateSize(_map_mapStringNestedMessage_codec); + size += mapStringForeignMessage_.CalculateSize(_map_mapStringForeignMessage_codec); + size += mapStringNestedEnum_.CalculateSize(_map_mapStringNestedEnum_codec); + size += mapStringForeignEnum_.CalculateSize(_map_mapStringForeignEnum_codec); + if (HasOneofUint32) { + size += 2 + pb::CodedOutputStream.ComputeUInt32Size(OneofUint32); + } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OneofNestedMessage); + } + if (HasOneofString) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(OneofString); + } + if (HasOneofBytes) { + size += 2 + pb::CodedOutputStream.ComputeBytesSize(OneofBytes); + } + if (HasOneofBool) { + size += 2 + 1; + } + if (HasOneofUint64) { + size += 2 + pb::CodedOutputStream.ComputeUInt64Size(OneofUint64); + } + if (HasOneofFloat) { + size += 2 + 4; + } + if (HasOneofDouble) { + size += 2 + 8; + } + if (HasOneofEnum) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OneofEnum); + } + if (HasData) { + size += 4 + pb::CodedOutputStream.ComputeGroupSize(Data); + } + if (HasFieldname1) { size += 2 + pb::CodedOutputStream.ComputeInt32Size(Fieldname1); } if (HasFieldName2) { @@ -3107,6 +3579,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestAllTypesProto2 other) { if (other == null) { return; @@ -3156,14 +3629,14 @@ namespace ProtobufTestMessages.Proto2 { if (other.HasOptionalBytes) { OptionalBytes = other.OptionalBytes; } - if (other.HasOptionalNestedMessage) { - if (!HasOptionalNestedMessage) { + if (other.optionalNestedMessage_ != null) { + if (optionalNestedMessage_ == null) { OptionalNestedMessage = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage(); } OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); } - if (other.HasOptionalForeignMessage) { - if (!HasOptionalForeignMessage) { + if (other.optionalForeignMessage_ != null) { + if (optionalForeignMessage_ == null) { OptionalForeignMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); } OptionalForeignMessage.MergeFrom(other.OptionalForeignMessage); @@ -3180,8 +3653,8 @@ namespace ProtobufTestMessages.Proto2 { if (other.HasOptionalCord) { OptionalCord = other.OptionalCord; } - if (other.HasRecursiveMessage) { - if (!HasRecursiveMessage) { + if (other.recursiveMessage_ != null) { + if (recursiveMessage_ == null) { RecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2(); } RecursiveMessage.MergeFrom(other.RecursiveMessage); @@ -3352,7 +3825,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3422,14 +3899,14 @@ namespace ProtobufTestMessages.Proto2 { break; } case 146: { - if (!HasOptionalNestedMessage) { + if (optionalNestedMessage_ == null) { OptionalNestedMessage = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage(); } input.ReadMessage(OptionalNestedMessage); break; } case 154: { - if (!HasOptionalForeignMessage) { + if (optionalForeignMessage_ == null) { OptionalForeignMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); } input.ReadMessage(OptionalForeignMessage); @@ -3452,7 +3929,7 @@ namespace ProtobufTestMessages.Proto2 { break; } case 218: { - if (!HasRecursiveMessage) { + if (recursiveMessage_ == null) { RecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2(); } input.ReadMessage(RecursiveMessage); @@ -3740,37 +4217,587 @@ namespace ProtobufTestMessages.Proto2 { } case 770: case 769: { - unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + break; + } + case 778: + case 781: { + unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + break; + } + case 786: + case 785: { + unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + break; + } + case 794: + case 797: { + unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + break; + } + case 802: + case 801: { + unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + break; + } + case 810: + case 808: { + unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + break; + } + case 818: + case 816: { + unpackedNestedEnum_.AddEntriesFrom(input, _repeated_unpackedNestedEnum_codec); + break; + } + case 888: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 898: { + global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage subBuilder = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder); + OneofNestedMessage = subBuilder; + break; + } + case 906: { + OneofString = input.ReadString(); + break; + } + case 914: { + OneofBytes = input.ReadBytes(); + break; + } + case 920: { + OneofBool = input.ReadBool(); + break; + } + case 928: { + OneofUint64 = input.ReadUInt64(); + break; + } + case 941: { + OneofFloat = input.ReadFloat(); + break; + } + case 945: { + OneofDouble = input.ReadDouble(); + break; + } + case 952: { + oneofField_ = input.ReadEnum(); + oneofFieldCase_ = OneofFieldOneofCase.OneofEnum; + break; + } + case 1611: { + if (!HasData) { + Data = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.Data(); + } + input.ReadGroup(Data); + break; + } + case 3208: { + Fieldname1 = input.ReadInt32(); + break; + } + case 3216: { + FieldName2 = input.ReadInt32(); + break; + } + case 3224: { + FieldName3 = input.ReadInt32(); + break; + } + case 3232: { + FieldName4 = input.ReadInt32(); + break; + } + case 3240: { + Field0Name5 = input.ReadInt32(); + break; + } + case 3248: { + Field0Name6 = input.ReadInt32(); + break; + } + case 3256: { + FieldName7 = input.ReadInt32(); + break; + } + case 3264: { + FieldName8 = input.ReadInt32(); + break; + } + case 3272: { + FieldName9 = input.ReadInt32(); + break; + } + case 3280: { + FieldName10 = input.ReadInt32(); + break; + } + case 3288: { + FIELDNAME11 = input.ReadInt32(); + break; + } + case 3296: { + FIELDName12 = input.ReadInt32(); + break; + } + case 3304: { + FieldName13 = input.ReadInt32(); + break; + } + case 3312: { + FieldName14 = input.ReadInt32(); + break; + } + case 3320: { + FieldName15 = input.ReadInt32(); + break; + } + case 3328: { + FieldName16 = input.ReadInt32(); + break; + } + case 3336: { + FieldName17 = input.ReadInt32(); + break; + } + case 3344: { + FieldName18 = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 16: { + OptionalInt64 = input.ReadInt64(); + break; + } + case 24: { + OptionalUint32 = input.ReadUInt32(); + break; + } + case 32: { + OptionalUint64 = input.ReadUInt64(); + break; + } + case 40: { + OptionalSint32 = input.ReadSInt32(); + break; + } + case 48: { + OptionalSint64 = input.ReadSInt64(); + break; + } + case 61: { + OptionalFixed32 = input.ReadFixed32(); + break; + } + case 65: { + OptionalFixed64 = input.ReadFixed64(); + break; + } + case 77: { + OptionalSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + OptionalSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + OptionalFloat = input.ReadFloat(); + break; + } + case 97: { + OptionalDouble = input.ReadDouble(); + break; + } + case 104: { + OptionalBool = input.ReadBool(); + break; + } + case 114: { + OptionalString = input.ReadString(); + break; + } + case 122: { + OptionalBytes = input.ReadBytes(); + break; + } + case 146: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + case 154: { + if (optionalForeignMessage_ == null) { + OptionalForeignMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); + } + input.ReadMessage(OptionalForeignMessage); + break; + } + case 168: { + OptionalNestedEnum = (global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + OptionalForeignEnum = (global::ProtobufTestMessages.Proto2.ForeignEnumProto2) input.ReadEnum(); + break; + } + case 194: { + OptionalStringPiece = input.ReadString(); + break; + } + case 202: { + OptionalCord = input.ReadString(); + break; + } + case 218: { + if (recursiveMessage_ == null) { + RecursiveMessage = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2(); + } + input.ReadMessage(RecursiveMessage); + break; + } + case 250: + case 248: { + repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec); + break; + } + case 258: + case 256: { + repeatedInt64_.AddEntriesFrom(ref input, _repeated_repeatedInt64_codec); + break; + } + case 266: + case 264: { + repeatedUint32_.AddEntriesFrom(ref input, _repeated_repeatedUint32_codec); + break; + } + case 274: + case 272: { + repeatedUint64_.AddEntriesFrom(ref input, _repeated_repeatedUint64_codec); + break; + } + case 282: + case 280: { + repeatedSint32_.AddEntriesFrom(ref input, _repeated_repeatedSint32_codec); + break; + } + case 290: + case 288: { + repeatedSint64_.AddEntriesFrom(ref input, _repeated_repeatedSint64_codec); + break; + } + case 298: + case 301: { + repeatedFixed32_.AddEntriesFrom(ref input, _repeated_repeatedFixed32_codec); + break; + } + case 306: + case 305: { + repeatedFixed64_.AddEntriesFrom(ref input, _repeated_repeatedFixed64_codec); + break; + } + case 314: + case 317: { + repeatedSfixed32_.AddEntriesFrom(ref input, _repeated_repeatedSfixed32_codec); + break; + } + case 322: + case 321: { + repeatedSfixed64_.AddEntriesFrom(ref input, _repeated_repeatedSfixed64_codec); + break; + } + case 330: + case 333: { + repeatedFloat_.AddEntriesFrom(ref input, _repeated_repeatedFloat_codec); + break; + } + case 338: + case 337: { + repeatedDouble_.AddEntriesFrom(ref input, _repeated_repeatedDouble_codec); + break; + } + case 346: + case 344: { + repeatedBool_.AddEntriesFrom(ref input, _repeated_repeatedBool_codec); + break; + } + case 354: { + repeatedString_.AddEntriesFrom(ref input, _repeated_repeatedString_codec); + break; + } + case 362: { + repeatedBytes_.AddEntriesFrom(ref input, _repeated_repeatedBytes_codec); + break; + } + case 386: { + repeatedNestedMessage_.AddEntriesFrom(ref input, _repeated_repeatedNestedMessage_codec); + break; + } + case 394: { + repeatedForeignMessage_.AddEntriesFrom(ref input, _repeated_repeatedForeignMessage_codec); + break; + } + case 410: + case 408: { + repeatedNestedEnum_.AddEntriesFrom(ref input, _repeated_repeatedNestedEnum_codec); + break; + } + case 418: + case 416: { + repeatedForeignEnum_.AddEntriesFrom(ref input, _repeated_repeatedForeignEnum_codec); + break; + } + case 434: { + repeatedStringPiece_.AddEntriesFrom(ref input, _repeated_repeatedStringPiece_codec); + break; + } + case 442: { + repeatedCord_.AddEntriesFrom(ref input, _repeated_repeatedCord_codec); + break; + } + case 450: { + mapInt32Int32_.AddEntriesFrom(ref input, _map_mapInt32Int32_codec); + break; + } + case 458: { + mapInt64Int64_.AddEntriesFrom(ref input, _map_mapInt64Int64_codec); + break; + } + case 466: { + mapUint32Uint32_.AddEntriesFrom(ref input, _map_mapUint32Uint32_codec); + break; + } + case 474: { + mapUint64Uint64_.AddEntriesFrom(ref input, _map_mapUint64Uint64_codec); + break; + } + case 482: { + mapSint32Sint32_.AddEntriesFrom(ref input, _map_mapSint32Sint32_codec); + break; + } + case 490: { + mapSint64Sint64_.AddEntriesFrom(ref input, _map_mapSint64Sint64_codec); + break; + } + case 498: { + mapFixed32Fixed32_.AddEntriesFrom(ref input, _map_mapFixed32Fixed32_codec); + break; + } + case 506: { + mapFixed64Fixed64_.AddEntriesFrom(ref input, _map_mapFixed64Fixed64_codec); + break; + } + case 514: { + mapSfixed32Sfixed32_.AddEntriesFrom(ref input, _map_mapSfixed32Sfixed32_codec); + break; + } + case 522: { + mapSfixed64Sfixed64_.AddEntriesFrom(ref input, _map_mapSfixed64Sfixed64_codec); + break; + } + case 530: { + mapInt32Float_.AddEntriesFrom(ref input, _map_mapInt32Float_codec); + break; + } + case 538: { + mapInt32Double_.AddEntriesFrom(ref input, _map_mapInt32Double_codec); + break; + } + case 546: { + mapBoolBool_.AddEntriesFrom(ref input, _map_mapBoolBool_codec); + break; + } + case 554: { + mapStringString_.AddEntriesFrom(ref input, _map_mapStringString_codec); + break; + } + case 562: { + mapStringBytes_.AddEntriesFrom(ref input, _map_mapStringBytes_codec); + break; + } + case 570: { + mapStringNestedMessage_.AddEntriesFrom(ref input, _map_mapStringNestedMessage_codec); + break; + } + case 578: { + mapStringForeignMessage_.AddEntriesFrom(ref input, _map_mapStringForeignMessage_codec); + break; + } + case 586: { + mapStringNestedEnum_.AddEntriesFrom(ref input, _map_mapStringNestedEnum_codec); + break; + } + case 594: { + mapStringForeignEnum_.AddEntriesFrom(ref input, _map_mapStringForeignEnum_codec); + break; + } + case 602: + case 600: { + packedInt32_.AddEntriesFrom(ref input, _repeated_packedInt32_codec); + break; + } + case 610: + case 608: { + packedInt64_.AddEntriesFrom(ref input, _repeated_packedInt64_codec); + break; + } + case 618: + case 616: { + packedUint32_.AddEntriesFrom(ref input, _repeated_packedUint32_codec); + break; + } + case 626: + case 624: { + packedUint64_.AddEntriesFrom(ref input, _repeated_packedUint64_codec); + break; + } + case 634: + case 632: { + packedSint32_.AddEntriesFrom(ref input, _repeated_packedSint32_codec); + break; + } + case 642: + case 640: { + packedSint64_.AddEntriesFrom(ref input, _repeated_packedSint64_codec); + break; + } + case 650: + case 653: { + packedFixed32_.AddEntriesFrom(ref input, _repeated_packedFixed32_codec); + break; + } + case 658: + case 657: { + packedFixed64_.AddEntriesFrom(ref input, _repeated_packedFixed64_codec); + break; + } + case 666: + case 669: { + packedSfixed32_.AddEntriesFrom(ref input, _repeated_packedSfixed32_codec); + break; + } + case 674: + case 673: { + packedSfixed64_.AddEntriesFrom(ref input, _repeated_packedSfixed64_codec); + break; + } + case 682: + case 685: { + packedFloat_.AddEntriesFrom(ref input, _repeated_packedFloat_codec); + break; + } + case 690: + case 689: { + packedDouble_.AddEntriesFrom(ref input, _repeated_packedDouble_codec); + break; + } + case 698: + case 696: { + packedBool_.AddEntriesFrom(ref input, _repeated_packedBool_codec); + break; + } + case 706: + case 704: { + packedNestedEnum_.AddEntriesFrom(ref input, _repeated_packedNestedEnum_codec); + break; + } + case 714: + case 712: { + unpackedInt32_.AddEntriesFrom(ref input, _repeated_unpackedInt32_codec); + break; + } + case 722: + case 720: { + unpackedInt64_.AddEntriesFrom(ref input, _repeated_unpackedInt64_codec); + break; + } + case 730: + case 728: { + unpackedUint32_.AddEntriesFrom(ref input, _repeated_unpackedUint32_codec); + break; + } + case 738: + case 736: { + unpackedUint64_.AddEntriesFrom(ref input, _repeated_unpackedUint64_codec); + break; + } + case 746: + case 744: { + unpackedSint32_.AddEntriesFrom(ref input, _repeated_unpackedSint32_codec); + break; + } + case 754: + case 752: { + unpackedSint64_.AddEntriesFrom(ref input, _repeated_unpackedSint64_codec); + break; + } + case 762: + case 765: { + unpackedFixed32_.AddEntriesFrom(ref input, _repeated_unpackedFixed32_codec); + break; + } + case 770: + case 769: { + unpackedFixed64_.AddEntriesFrom(ref input, _repeated_unpackedFixed64_codec); break; } case 778: case 781: { - unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + unpackedSfixed32_.AddEntriesFrom(ref input, _repeated_unpackedSfixed32_codec); break; } case 786: case 785: { - unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + unpackedSfixed64_.AddEntriesFrom(ref input, _repeated_unpackedSfixed64_codec); break; } case 794: case 797: { - unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + unpackedFloat_.AddEntriesFrom(ref input, _repeated_unpackedFloat_codec); break; } case 802: case 801: { - unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + unpackedDouble_.AddEntriesFrom(ref input, _repeated_unpackedDouble_codec); break; } case 810: case 808: { - unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + unpackedBool_.AddEntriesFrom(ref input, _repeated_unpackedBool_codec); break; } case 818: case 816: { - unpackedNestedEnum_.AddEntriesFrom(input, _repeated_unpackedNestedEnum_codec); + unpackedNestedEnum_.AddEntriesFrom(ref input, _repeated_unpackedNestedEnum_codec); break; } case 888: { @@ -3779,7 +4806,7 @@ namespace ProtobufTestMessages.Proto2 { } case 898: { global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage subBuilder = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.NestedMessage(); - if (HasOneofNestedMessage) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { subBuilder.MergeFrom(OneofNestedMessage); } input.ReadMessage(subBuilder); @@ -3897,6 +4924,7 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -3923,6 +4951,7 @@ namespace ProtobufTestMessages.Proto2 { #region Nested types /// Container for nested types declared in the TestAllTypesProto2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("FOO")] Foo = 0, @@ -3934,24 +4963,32 @@ namespace ProtobufTestMessages.Proto2 { [pbr::OriginalName("NEG")] Neg = -1, } - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -3959,14 +4996,16 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; - corecursive_ = other.HasCorecursive ? other.corecursive_.Clone() : null; + corecursive_ = other.corecursive_ != null ? other.corecursive_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -3977,6 +5016,7 @@ namespace ProtobufTestMessages.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -3986,11 +5026,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -3999,29 +5041,22 @@ namespace ProtobufTestMessages.Proto2 { public const int CorecursiveFieldNumber = 2; private global::ProtobufTestMessages.Proto2.TestAllTypesProto2 corecursive_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.TestAllTypesProto2 Corecursive { get { return corecursive_; } set { corecursive_ = value; } } - /// Gets whether the corecursive field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasCorecursive { - get { return corecursive_ != null; } - } - /// Clears the value of the corecursive field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearCorecursive() { - corecursive_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -4035,10 +5070,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); - if (HasCorecursive) hash ^= Corecursive.GetHashCode(); + if (corecursive_ != null) hash ^= Corecursive.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -4046,32 +5082,57 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(8); output.WriteInt32(A); } - if (HasCorecursive) { + if (corecursive_ != null) { output.WriteRawTag(18); output.WriteMessage(Corecursive); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(8); + output.WriteInt32(A); + } + if (corecursive_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Corecursive); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(A); } - if (HasCorecursive) { + if (corecursive_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Corecursive); } if (_unknownFields != null) { @@ -4081,6 +5142,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -4088,8 +5150,8 @@ namespace ProtobufTestMessages.Proto2 { if (other.HasA) { A = other.A; } - if (other.HasCorecursive) { - if (!HasCorecursive) { + if (other.corecursive_ != null) { + if (corecursive_ == null) { Corecursive = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2(); } Corecursive.MergeFrom(other.Corecursive); @@ -4098,7 +5160,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4110,7 +5176,33 @@ namespace ProtobufTestMessages.Proto2 { break; } case 18: { - if (!HasCorecursive) { + if (corecursive_ == null) { + Corecursive = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2(); + } + input.ReadMessage(Corecursive); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 18: { + if (corecursive_ == null) { Corecursive = new global::ProtobufTestMessages.Proto2.TestAllTypesProto2(); } input.ReadMessage(Corecursive); @@ -4119,30 +5211,39 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif } /// /// groups /// - public sealed partial class Data : pb::IMessage { + public sealed partial class Data : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Data()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[20]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Data() { OnConstruction(); } @@ -4150,6 +5251,7 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Data(Data other) : this() { _hasBits0 = other._hasBits0; groupInt32_ = other.groupInt32_; @@ -4158,6 +5260,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Data Clone() { return new Data(this); } @@ -4168,6 +5271,7 @@ namespace ProtobufTestMessages.Proto2 { private int groupInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int GroupInt32 { get { if ((_hasBits0 & 1) != 0) { return groupInt32_; } else { return GroupInt32DefaultValue; } } set { @@ -4177,11 +5281,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "group_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasGroupInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "group_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearGroupInt32() { _hasBits0 &= ~1; } @@ -4192,6 +5298,7 @@ namespace ProtobufTestMessages.Proto2 { private uint groupUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint GroupUint32 { get { if ((_hasBits0 & 2) != 0) { return groupUint32_; } else { return GroupUint32DefaultValue; } } set { @@ -4201,21 +5308,25 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "group_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasGroupUint32 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "group_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearGroupUint32() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Data); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Data other) { if (ReferenceEquals(other, null)) { return false; @@ -4229,6 +5340,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasGroupInt32) hash ^= GroupInt32.GetHashCode(); @@ -4240,12 +5352,17 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasGroupInt32) { output.WriteRawTag(208, 12); output.WriteInt32(GroupInt32); @@ -4257,9 +5374,29 @@ namespace ProtobufTestMessages.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasGroupInt32) { + output.WriteRawTag(208, 12); + output.WriteInt32(GroupInt32); + } + if (HasGroupUint32) { + output.WriteRawTag(216, 12); + output.WriteUInt32(GroupUint32); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasGroupInt32) { @@ -4275,6 +5412,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Data other) { if (other == null) { return; @@ -4289,7 +5427,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4308,32 +5450,66 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 1612: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 1616: { + GroupInt32 = input.ReadInt32(); + break; + } + case 1624: { + GroupUint32 = input.ReadUInt32(); + break; + } + } + } } + #endif } /// /// message_set test case. /// - public sealed partial class MessageSetCorrect : pb::IExtendableMessage { + public sealed partial class MessageSetCorrect : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrect()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[21]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrect() { OnConstruction(); } @@ -4341,22 +5517,26 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrect(MessageSetCorrect other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrect Clone() { return new MessageSetCorrect(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageSetCorrect); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageSetCorrect other) { if (ReferenceEquals(other, null)) { return false; @@ -4371,6 +5551,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -4383,21 +5564,41 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_extensions != null) { _extensions.WriteTo(output); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -4410,6 +5611,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageSetCorrect other) { if (other == null) { return; @@ -4419,7 +5621,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4430,7 +5636,25 @@ namespace ProtobufTestMessages.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -4456,23 +5680,31 @@ namespace ProtobufTestMessages.Proto2 { } - public sealed partial class MessageSetCorrectExtension1 : pb::IMessage { + public sealed partial class MessageSetCorrectExtension1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrectExtension1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[22]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension1() { OnConstruction(); } @@ -4480,12 +5712,14 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension1(MessageSetCorrectExtension1 other) : this() { str_ = other.str_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension1 Clone() { return new MessageSetCorrectExtension1(this); } @@ -4496,6 +5730,7 @@ namespace ProtobufTestMessages.Proto2 { private string str_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Str { get { return str_ ?? StrDefaultValue; } set { @@ -4504,21 +5739,25 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "str" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStr { get { return str_ != null; } } /// Clears the value of the "str" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStr() { str_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageSetCorrectExtension1); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageSetCorrectExtension1 other) { if (ReferenceEquals(other, null)) { return false; @@ -4531,6 +5770,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasStr) hash ^= Str.GetHashCode(); @@ -4541,12 +5781,17 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasStr) { output.WriteRawTag(202, 1); output.WriteString(Str); @@ -4554,9 +5799,25 @@ namespace ProtobufTestMessages.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasStr) { + output.WriteRawTag(202, 1); + output.WriteString(Str); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasStr) { @@ -4569,6 +5830,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageSetCorrectExtension1 other) { if (other == null) { return; @@ -4580,7 +5842,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4593,11 +5859,32 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 202: { + Str = input.ReadString(); + break; + } + } + } } + #endif #region Extensions /// Container for extensions for other messages declared in the MessageSetCorrectExtension1 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension MessageSetExtension = new pb::Extension(1547769, pb::FieldCodec.ForMessage(12382154, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Parser)); @@ -4606,24 +5893,32 @@ namespace ProtobufTestMessages.Proto2 { } - public sealed partial class MessageSetCorrectExtension2 : pb::IMessage { + public sealed partial class MessageSetCorrectExtension2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrectExtension2()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Descriptor.NestedTypes[23]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension2() { OnConstruction(); } @@ -4631,6 +5926,7 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension2(MessageSetCorrectExtension2 other) : this() { _hasBits0 = other._hasBits0; i_ = other.i_; @@ -4638,6 +5934,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageSetCorrectExtension2 Clone() { return new MessageSetCorrectExtension2(this); } @@ -4648,6 +5945,7 @@ namespace ProtobufTestMessages.Proto2 { private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { if ((_hasBits0 & 1) != 0) { return i_; } else { return IDefaultValue; } } set { @@ -4657,21 +5955,25 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "i" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasI { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "i" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearI() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageSetCorrectExtension2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageSetCorrectExtension2 other) { if (ReferenceEquals(other, null)) { return false; @@ -4684,6 +5986,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasI) hash ^= I.GetHashCode(); @@ -4694,12 +5997,17 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasI) { output.WriteRawTag(72); output.WriteInt32(I); @@ -4707,9 +6015,25 @@ namespace ProtobufTestMessages.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasI) { + output.WriteRawTag(72); + output.WriteInt32(I); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasI) { @@ -4722,6 +6046,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageSetCorrectExtension2 other) { if (other == null) { return; @@ -4733,7 +6058,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4746,11 +6075,32 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 72: { + I = input.ReadInt32(); + break; + } + } + } } + #endif #region Extensions /// Container for extensions for other messages declared in the MessageSetCorrectExtension2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension MessageSetExtension = new pb::Extension(4135312, pb::FieldCodec.ForMessage(33082498, global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Parser)); @@ -4764,24 +6114,32 @@ namespace ProtobufTestMessages.Proto2 { } - public sealed partial class ForeignMessageProto2 : pb::IMessage { + public sealed partial class ForeignMessageProto2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessageProto2()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessageProto2() { OnConstruction(); } @@ -4789,6 +6147,7 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessageProto2(ForeignMessageProto2 other) : this() { _hasBits0 = other._hasBits0; c_ = other.c_; @@ -4796,6 +6155,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessageProto2 Clone() { return new ForeignMessageProto2(this); } @@ -4806,6 +6166,7 @@ namespace ProtobufTestMessages.Proto2 { private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { if ((_hasBits0 & 1) != 0) { return c_; } else { return CDefaultValue; } } set { @@ -4815,21 +6176,25 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "c" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasC { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "c" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearC() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ForeignMessageProto2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ForeignMessageProto2 other) { if (ReferenceEquals(other, null)) { return false; @@ -4842,6 +6207,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasC) hash ^= C.GetHashCode(); @@ -4852,12 +6218,17 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasC) { output.WriteRawTag(8); output.WriteInt32(C); @@ -4865,9 +6236,25 @@ namespace ProtobufTestMessages.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasC) { + output.WriteRawTag(8); + output.WriteInt32(C); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasC) { @@ -4880,6 +6267,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ForeignMessageProto2 other) { if (other == null) { return; @@ -4891,7 +6279,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4904,28 +6296,56 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + C = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class UnknownToTestAllTypes : pb::IMessage { + public sealed partial class UnknownToTestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UnknownToTestAllTypes()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public UnknownToTestAllTypes() { OnConstruction(); } @@ -4933,11 +6353,12 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public UnknownToTestAllTypes(UnknownToTestAllTypes other) : this() { _hasBits0 = other._hasBits0; optionalInt32_ = other.optionalInt32_; optionalString_ = other.optionalString_; - nestedMessage_ = other.HasNestedMessage ? other.nestedMessage_.Clone() : null; + nestedMessage_ = other.nestedMessage_ != null ? other.nestedMessage_.Clone() : null; optionalGroup_ = other.HasOptionalGroup ? other.optionalGroup_.Clone() : null; optionalBool_ = other.optionalBool_; repeatedInt32_ = other.repeatedInt32_.Clone(); @@ -4945,6 +6366,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public UnknownToTestAllTypes Clone() { return new UnknownToTestAllTypes(this); } @@ -4955,6 +6377,7 @@ namespace ProtobufTestMessages.Proto2 { private int optionalInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -4964,11 +6387,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } @@ -4979,6 +6404,7 @@ namespace ProtobufTestMessages.Proto2 { private string optionalString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_ ?? OptionalStringDefaultValue; } set { @@ -4987,11 +6413,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalString { get { return optionalString_ != null; } } /// Clears the value of the "optional_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalString() { optionalString_ = null; } @@ -5000,27 +6428,19 @@ namespace ProtobufTestMessages.Proto2 { public const int NestedMessageFieldNumber = 1003; private global::ProtobufTestMessages.Proto2.ForeignMessageProto2 nestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.ForeignMessageProto2 NestedMessage { get { return nestedMessage_; } set { nestedMessage_ = value; } } - /// Gets whether the nested_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasNestedMessage { - get { return nestedMessage_ != null; } - } - /// Clears the value of the nested_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearNestedMessage() { - nestedMessage_ = null; - } /// Field number for the "optionalgroup" field. public const int OptionalGroupFieldNumber = 1004; private global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -5029,11 +6449,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -5044,6 +6466,7 @@ namespace ProtobufTestMessages.Proto2 { private bool optionalBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OptionalBool { get { if ((_hasBits0 & 2) != 0) { return optionalBool_; } else { return OptionalBoolDefaultValue; } } set { @@ -5053,11 +6476,13 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "optional_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBool { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "optional_bool" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBool() { _hasBits0 &= ~2; } @@ -5068,16 +6493,19 @@ namespace ProtobufTestMessages.Proto2 { = pb::FieldCodec.ForInt32(8088); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as UnknownToTestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(UnknownToTestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -5095,11 +6523,12 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); if (HasOptionalString) hash ^= OptionalString.GetHashCode(); - if (HasNestedMessage) hash ^= NestedMessage.GetHashCode(); + if (nestedMessage_ != null) hash ^= NestedMessage.GetHashCode(); if (HasOptionalGroup) hash ^= OptionalGroup.GetHashCode(); if (HasOptionalBool) hash ^= OptionalBool.GetHashCode(); hash ^= repeatedInt32_.GetHashCode(); @@ -5110,12 +6539,17 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasOptionalInt32) { output.WriteRawTag(200, 62); output.WriteInt32(OptionalInt32); @@ -5124,7 +6558,7 @@ namespace ProtobufTestMessages.Proto2 { output.WriteRawTag(210, 62); output.WriteString(OptionalString); } - if (HasNestedMessage) { + if (nestedMessage_ != null) { output.WriteRawTag(218, 62); output.WriteMessage(NestedMessage); } @@ -5141,9 +6575,43 @@ namespace ProtobufTestMessages.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOptionalInt32) { + output.WriteRawTag(200, 62); + output.WriteInt32(OptionalInt32); + } + if (HasOptionalString) { + output.WriteRawTag(210, 62); + output.WriteString(OptionalString); + } + if (nestedMessage_ != null) { + output.WriteRawTag(218, 62); + output.WriteMessage(NestedMessage); + } + if (HasOptionalGroup) { + output.WriteRawTag(227, 62); + output.WriteGroup(OptionalGroup); + output.WriteRawTag(228, 62); + } + if (HasOptionalBool) { + output.WriteRawTag(240, 62); + output.WriteBool(OptionalBool); + } + repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalInt32) { @@ -5152,7 +6620,7 @@ namespace ProtobufTestMessages.Proto2 { if (HasOptionalString) { size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalString); } - if (HasNestedMessage) { + if (nestedMessage_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(NestedMessage); } if (HasOptionalGroup) { @@ -5169,6 +6637,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(UnknownToTestAllTypes other) { if (other == null) { return; @@ -5179,8 +6648,8 @@ namespace ProtobufTestMessages.Proto2 { if (other.HasOptionalString) { OptionalString = other.OptionalString; } - if (other.HasNestedMessage) { - if (!HasNestedMessage) { + if (other.nestedMessage_ != null) { + if (nestedMessage_ == null) { NestedMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); } NestedMessage.MergeFrom(other.NestedMessage); @@ -5199,7 +6668,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5215,7 +6688,7 @@ namespace ProtobufTestMessages.Proto2 { break; } case 8026: { - if (!HasNestedMessage) { + if (nestedMessage_ == null) { NestedMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); } input.ReadMessage(NestedMessage); @@ -5239,30 +6712,86 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8008: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 8018: { + OptionalString = input.ReadString(); + break; + } + case 8026: { + if (nestedMessage_ == null) { + NestedMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2(); + } + input.ReadMessage(NestedMessage); + break; + } + case 8035: { + if (!HasOptionalGroup) { + OptionalGroup = new global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 8048: { + OptionalBool = input.ReadBool(); + break; + } + case 8090: + case 8088: { + repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec); + break; + } + } + } + } + #endif + #region Nested types /// Container for nested types declared in the UnknownToTestAllTypes message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class OptionalGroup : pb::IMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -5270,6 +6799,7 @@ namespace ProtobufTestMessages.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -5277,6 +6807,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -5287,6 +6818,7 @@ namespace ProtobufTestMessages.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -5296,21 +6828,25 @@ namespace ProtobufTestMessages.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -5323,6 +6859,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -5333,12 +6870,17 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(8); output.WriteInt32(A); @@ -5346,9 +6888,25 @@ namespace ProtobufTestMessages.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(8); + output.WriteInt32(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -5361,6 +6919,7 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; @@ -5372,7 +6931,11 @@ namespace ProtobufTestMessages.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5387,7 +6950,29 @@ namespace ProtobufTestMessages.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 8036: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs index 064d0c0ace..0e0015010d 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs @@ -29,7 +29,7 @@ namespace ProtobufTestMessages.Proto3 { "dWYvYW55LnByb3RvGh5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8a", "IGdvb2dsZS9wcm90b2J1Zi9maWVsZF9tYXNrLnByb3RvGhxnb29nbGUvcHJv", "dG9idWYvc3RydWN0LnByb3RvGh9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1w", - "LnByb3RvGh5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8iv0QKElRl", + "LnByb3RvGh5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8isUUKElRl", "c3RBbGxUeXBlc1Byb3RvMxIWCg5vcHRpb25hbF9pbnQzMhgBIAEoBRIWCg5v", "cHRpb25hbF9pbnQ2NBgCIAEoAxIXCg9vcHRpb25hbF91aW50MzIYAyABKA0S", "FwoPb3B0aW9uYWxfdWludDY0GAQgASgEEhcKD29wdGlvbmFsX3NpbnQzMhgF", @@ -140,99 +140,101 @@ namespace ProtobufTestMessages.Proto3 { "IAEoBEgAEhUKC29uZW9mX2Zsb2F0GHUgASgCSAASFgoMb25lb2ZfZG91Ymxl", "GHYgASgBSAASUgoKb25lb2ZfZW51bRh3IAEoDjI8LnByb3RvYnVmX3Rlc3Rf", "bWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlc1Byb3RvMy5OZXN0ZWRFbnVt", - "SAASOgoVb3B0aW9uYWxfYm9vbF93cmFwcGVyGMkBIAEoCzIaLmdvb2dsZS5w", - "cm90b2J1Zi5Cb29sVmFsdWUSPAoWb3B0aW9uYWxfaW50MzJfd3JhcHBlchjK", - "ASABKAsyGy5nb29nbGUucHJvdG9idWYuSW50MzJWYWx1ZRI8ChZvcHRpb25h", - "bF9pbnQ2NF93cmFwcGVyGMsBIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2", - "NFZhbHVlEj4KF29wdGlvbmFsX3VpbnQzMl93cmFwcGVyGMwBIAEoCzIcLmdv", - "b2dsZS5wcm90b2J1Zi5VSW50MzJWYWx1ZRI+ChdvcHRpb25hbF91aW50NjRf", - "d3JhcHBlchjNASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDY0VmFsdWUS", - "PAoWb3B0aW9uYWxfZmxvYXRfd3JhcHBlchjOASABKAsyGy5nb29nbGUucHJv", - "dG9idWYuRmxvYXRWYWx1ZRI+ChdvcHRpb25hbF9kb3VibGVfd3JhcHBlchjP", - "ASABKAsyHC5nb29nbGUucHJvdG9idWYuRG91YmxlVmFsdWUSPgoXb3B0aW9u", - "YWxfc3RyaW5nX3dyYXBwZXIY0AEgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlN0", - "cmluZ1ZhbHVlEjwKFm9wdGlvbmFsX2J5dGVzX3dyYXBwZXIY0QEgASgLMhsu", - "Z29vZ2xlLnByb3RvYnVmLkJ5dGVzVmFsdWUSOgoVcmVwZWF0ZWRfYm9vbF93", - "cmFwcGVyGNMBIAMoCzIaLmdvb2dsZS5wcm90b2J1Zi5Cb29sVmFsdWUSPAoW", - "cmVwZWF0ZWRfaW50MzJfd3JhcHBlchjUASADKAsyGy5nb29nbGUucHJvdG9i", - "dWYuSW50MzJWYWx1ZRI8ChZyZXBlYXRlZF9pbnQ2NF93cmFwcGVyGNUBIAMo", - "CzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVlEj4KF3JlcGVhdGVkX3Vp", - "bnQzMl93cmFwcGVyGNYBIAMoCzIcLmdvb2dsZS5wcm90b2J1Zi5VSW50MzJW", - "YWx1ZRI+ChdyZXBlYXRlZF91aW50NjRfd3JhcHBlchjXASADKAsyHC5nb29n", - "bGUucHJvdG9idWYuVUludDY0VmFsdWUSPAoWcmVwZWF0ZWRfZmxvYXRfd3Jh", - "cHBlchjYASADKAsyGy5nb29nbGUucHJvdG9idWYuRmxvYXRWYWx1ZRI+Chdy", - "ZXBlYXRlZF9kb3VibGVfd3JhcHBlchjZASADKAsyHC5nb29nbGUucHJvdG9i", - "dWYuRG91YmxlVmFsdWUSPgoXcmVwZWF0ZWRfc3RyaW5nX3dyYXBwZXIY2gEg", - "AygLMhwuZ29vZ2xlLnByb3RvYnVmLlN0cmluZ1ZhbHVlEjwKFnJlcGVhdGVk", - "X2J5dGVzX3dyYXBwZXIY2wEgAygLMhsuZ29vZ2xlLnByb3RvYnVmLkJ5dGVz", - "VmFsdWUSNQoRb3B0aW9uYWxfZHVyYXRpb24YrQIgASgLMhkuZ29vZ2xlLnBy", - "b3RvYnVmLkR1cmF0aW9uEjcKEm9wdGlvbmFsX3RpbWVzdGFtcBiuAiABKAsy", - "Gi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEjgKE29wdGlvbmFsX2ZpZWxk", - "X21hc2sYrwIgASgLMhouZ29vZ2xlLnByb3RvYnVmLkZpZWxkTWFzaxIxCg9v", - "cHRpb25hbF9zdHJ1Y3QYsAIgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVj", - "dBIrCgxvcHRpb25hbF9hbnkYsQIgASgLMhQuZ29vZ2xlLnByb3RvYnVmLkFu", - "eRIvCg5vcHRpb25hbF92YWx1ZRiyAiABKAsyFi5nb29nbGUucHJvdG9idWYu", - "VmFsdWUSNQoRcmVwZWF0ZWRfZHVyYXRpb24YtwIgAygLMhkuZ29vZ2xlLnBy", - "b3RvYnVmLkR1cmF0aW9uEjcKEnJlcGVhdGVkX3RpbWVzdGFtcBi4AiADKAsy", - "Gi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEjcKEnJlcGVhdGVkX2ZpZWxk", - "bWFzaxi5AiADKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrEjEKD3Jl", - "cGVhdGVkX3N0cnVjdBjEAiADKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0", - "EisKDHJlcGVhdGVkX2FueRi7AiADKAsyFC5nb29nbGUucHJvdG9idWYuQW55", - "Ei8KDnJlcGVhdGVkX3ZhbHVlGLwCIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5W", - "YWx1ZRI4ChNyZXBlYXRlZF9saXN0X3ZhbHVlGL0CIAMoCzIaLmdvb2dsZS5w", - "cm90b2J1Zi5MaXN0VmFsdWUSEwoKZmllbGRuYW1lMRiRAyABKAUSFAoLZmll", - "bGRfbmFtZTIYkgMgASgFEhUKDF9maWVsZF9uYW1lMxiTAyABKAUSFgoNZmll", - "bGRfX25hbWU0XxiUAyABKAUSFAoLZmllbGQwbmFtZTUYlQMgASgFEhYKDWZp", - "ZWxkXzBfbmFtZTYYlgMgASgFEhMKCmZpZWxkTmFtZTcYlwMgASgFEhMKCkZp", - "ZWxkTmFtZTgYmAMgASgFEhQKC2ZpZWxkX05hbWU5GJkDIAEoBRIVCgxGaWVs", - "ZF9OYW1lMTAYmgMgASgFEhUKDEZJRUxEX05BTUUxMRibAyABKAUSFQoMRklF", - "TERfbmFtZTEyGJwDIAEoBRIXCg5fX2ZpZWxkX25hbWUxMxidAyABKAUSFwoO", - "X19GaWVsZF9uYW1lMTQYngMgASgFEhYKDWZpZWxkX19uYW1lMTUYnwMgASgF", - "EhYKDWZpZWxkX19OYW1lMTYYoAMgASgFEhcKDmZpZWxkX25hbWUxN19fGKED", - "IAEoBRIXCg5GaWVsZF9uYW1lMThfXxiiAyABKAUaYgoNTmVzdGVkTWVzc2Fn", - "ZRIJCgFhGAEgASgFEkYKC2NvcmVjdXJzaXZlGAIgASgLMjEucHJvdG9idWZf", - "dGVzdF9tZXNzYWdlcy5wcm90bzMuVGVzdEFsbFR5cGVzUHJvdG8zGjQKEk1h", - "cEludDMySW50MzJFbnRyeRILCgNrZXkYASABKAUSDQoFdmFsdWUYAiABKAU6", - "AjgBGjQKEk1hcEludDY0SW50NjRFbnRyeRILCgNrZXkYASABKAMSDQoFdmFs", - "dWUYAiABKAM6AjgBGjYKFE1hcFVpbnQzMlVpbnQzMkVudHJ5EgsKA2tleRgB", - "IAEoDRINCgV2YWx1ZRgCIAEoDToCOAEaNgoUTWFwVWludDY0VWludDY0RW50", - "cnkSCwoDa2V5GAEgASgEEg0KBXZhbHVlGAIgASgEOgI4ARo2ChRNYXBTaW50", - "MzJTaW50MzJFbnRyeRILCgNrZXkYASABKBESDQoFdmFsdWUYAiABKBE6AjgB", - "GjYKFE1hcFNpbnQ2NFNpbnQ2NEVudHJ5EgsKA2tleRgBIAEoEhINCgV2YWx1", - "ZRgCIAEoEjoCOAEaOAoWTWFwRml4ZWQzMkZpeGVkMzJFbnRyeRILCgNrZXkY", - "ASABKAcSDQoFdmFsdWUYAiABKAc6AjgBGjgKFk1hcEZpeGVkNjRGaXhlZDY0", - "RW50cnkSCwoDa2V5GAEgASgGEg0KBXZhbHVlGAIgASgGOgI4ARo6ChhNYXBT", - "Zml4ZWQzMlNmaXhlZDMyRW50cnkSCwoDa2V5GAEgASgPEg0KBXZhbHVlGAIg", - "ASgPOgI4ARo6ChhNYXBTZml4ZWQ2NFNmaXhlZDY0RW50cnkSCwoDa2V5GAEg", - "ASgQEg0KBXZhbHVlGAIgASgQOgI4ARo0ChJNYXBJbnQzMkZsb2F0RW50cnkS", - "CwoDa2V5GAEgASgFEg0KBXZhbHVlGAIgASgCOgI4ARo1ChNNYXBJbnQzMkRv", - "dWJsZUVudHJ5EgsKA2tleRgBIAEoBRINCgV2YWx1ZRgCIAEoAToCOAEaMgoQ", - "TWFwQm9vbEJvb2xFbnRyeRILCgNrZXkYASABKAgSDQoFdmFsdWUYAiABKAg6", - "AjgBGjYKFE1hcFN0cmluZ1N0cmluZ0VudHJ5EgsKA2tleRgBIAEoCRINCgV2", - "YWx1ZRgCIAEoCToCOAEaNQoTTWFwU3RyaW5nQnl0ZXNFbnRyeRILCgNrZXkY", - "ASABKAkSDQoFdmFsdWUYAiABKAw6AjgBGn4KG01hcFN0cmluZ05lc3RlZE1l", - "c3NhZ2VFbnRyeRILCgNrZXkYASABKAkSTgoFdmFsdWUYAiABKAsyPy5wcm90", - "b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5UZXN0QWxsVHlwZXNQcm90bzMu", - "TmVzdGVkTWVzc2FnZToCOAEabQocTWFwU3RyaW5nRm9yZWlnbk1lc3NhZ2VF", - "bnRyeRILCgNrZXkYASABKAkSPAoFdmFsdWUYAiABKAsyLS5wcm90b2J1Zl90", - "ZXN0X21lc3NhZ2VzLnByb3RvMy5Gb3JlaWduTWVzc2FnZToCOAEaeAoYTWFw", - "U3RyaW5nTmVzdGVkRW51bUVudHJ5EgsKA2tleRgBIAEoCRJLCgV2YWx1ZRgC", - "IAEoDjI8LnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLlRlc3RBbGxU", - "eXBlc1Byb3RvMy5OZXN0ZWRFbnVtOgI4ARpnChlNYXBTdHJpbmdGb3JlaWdu", - "RW51bUVudHJ5EgsKA2tleRgBIAEoCRI5CgV2YWx1ZRgCIAEoDjIqLnByb3Rv", - "YnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8zLkZvcmVpZ25FbnVtOgI4ASI5CgpO", - "ZXN0ZWRFbnVtEgcKA0ZPTxAAEgcKA0JBUhABEgcKA0JBWhACEhAKA05FRxD/", - "//////////8BIlkKC0FsaWFzZWRFbnVtEg0KCUFMSUFTX0ZPTxAAEg0KCUFM", - "SUFTX0JBUhABEg0KCUFMSUFTX0JBWhACEgcKA1FVWBACEgcKA3F1eBACEgcK", - "A2JBehACGgIQAUINCgtvbmVvZl9maWVsZEoGCPUDEP8DIhsKDkZvcmVpZ25N", - "ZXNzYWdlEgkKAWMYASABKAUqQAoLRm9yZWlnbkVudW0SDwoLRk9SRUlHTl9G", - "T08QABIPCgtGT1JFSUdOX0JBUhABEg8KC0ZPUkVJR05fQkFaEAJCOAooY29t", - "Lmdvb2dsZS5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvM0gB+AEBogIG", - "UHJvdG8zYgZwcm90bzM=")); + "SAASNgoQb25lb2ZfbnVsbF92YWx1ZRh4IAEoDjIaLmdvb2dsZS5wcm90b2J1", + "Zi5OdWxsVmFsdWVIABI6ChVvcHRpb25hbF9ib29sX3dyYXBwZXIYyQEgASgL", + "MhouZ29vZ2xlLnByb3RvYnVmLkJvb2xWYWx1ZRI8ChZvcHRpb25hbF9pbnQz", + "Ml93cmFwcGVyGMoBIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQzMlZhbHVl", + "EjwKFm9wdGlvbmFsX2ludDY0X3dyYXBwZXIYywEgASgLMhsuZ29vZ2xlLnBy", + "b3RvYnVmLkludDY0VmFsdWUSPgoXb3B0aW9uYWxfdWludDMyX3dyYXBwZXIY", + "zAEgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEj4KF29wdGlv", + "bmFsX3VpbnQ2NF93cmFwcGVyGM0BIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5V", + "SW50NjRWYWx1ZRI8ChZvcHRpb25hbF9mbG9hdF93cmFwcGVyGM4BIAEoCzIb", + "Lmdvb2dsZS5wcm90b2J1Zi5GbG9hdFZhbHVlEj4KF29wdGlvbmFsX2RvdWJs", + "ZV93cmFwcGVyGM8BIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1", + "ZRI+ChdvcHRpb25hbF9zdHJpbmdfd3JhcHBlchjQASABKAsyHC5nb29nbGUu", + "cHJvdG9idWYuU3RyaW5nVmFsdWUSPAoWb3B0aW9uYWxfYnl0ZXNfd3JhcHBl", + "chjRASABKAsyGy5nb29nbGUucHJvdG9idWYuQnl0ZXNWYWx1ZRI6ChVyZXBl", + "YXRlZF9ib29sX3dyYXBwZXIY0wEgAygLMhouZ29vZ2xlLnByb3RvYnVmLkJv", + "b2xWYWx1ZRI8ChZyZXBlYXRlZF9pbnQzMl93cmFwcGVyGNQBIAMoCzIbLmdv", + "b2dsZS5wcm90b2J1Zi5JbnQzMlZhbHVlEjwKFnJlcGVhdGVkX2ludDY0X3dy", + "YXBwZXIY1QEgAygLMhsuZ29vZ2xlLnByb3RvYnVmLkludDY0VmFsdWUSPgoX", + "cmVwZWF0ZWRfdWludDMyX3dyYXBwZXIY1gEgAygLMhwuZ29vZ2xlLnByb3Rv", + "YnVmLlVJbnQzMlZhbHVlEj4KF3JlcGVhdGVkX3VpbnQ2NF93cmFwcGVyGNcB", + "IAMoCzIcLmdvb2dsZS5wcm90b2J1Zi5VSW50NjRWYWx1ZRI8ChZyZXBlYXRl", + "ZF9mbG9hdF93cmFwcGVyGNgBIAMoCzIbLmdvb2dsZS5wcm90b2J1Zi5GbG9h", + "dFZhbHVlEj4KF3JlcGVhdGVkX2RvdWJsZV93cmFwcGVyGNkBIAMoCzIcLmdv", + "b2dsZS5wcm90b2J1Zi5Eb3VibGVWYWx1ZRI+ChdyZXBlYXRlZF9zdHJpbmdf", + "d3JhcHBlchjaASADKAsyHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWUS", + "PAoWcmVwZWF0ZWRfYnl0ZXNfd3JhcHBlchjbASADKAsyGy5nb29nbGUucHJv", + "dG9idWYuQnl0ZXNWYWx1ZRI1ChFvcHRpb25hbF9kdXJhdGlvbhitAiABKAsy", + "GS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SNwoSb3B0aW9uYWxfdGltZXN0", + "YW1wGK4CIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASOAoTb3B0", + "aW9uYWxfZmllbGRfbWFzaxivAiABKAsyGi5nb29nbGUucHJvdG9idWYuRmll", + "bGRNYXNrEjEKD29wdGlvbmFsX3N0cnVjdBiwAiABKAsyFy5nb29nbGUucHJv", + "dG9idWYuU3RydWN0EisKDG9wdGlvbmFsX2FueRixAiABKAsyFC5nb29nbGUu", + "cHJvdG9idWYuQW55Ei8KDm9wdGlvbmFsX3ZhbHVlGLICIAEoCzIWLmdvb2ds", + "ZS5wcm90b2J1Zi5WYWx1ZRI4ChNvcHRpb25hbF9udWxsX3ZhbHVlGLMCIAEo", + "DjIaLmdvb2dsZS5wcm90b2J1Zi5OdWxsVmFsdWUSNQoRcmVwZWF0ZWRfZHVy", + "YXRpb24YtwIgAygLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEjcKEnJl", + "cGVhdGVkX3RpbWVzdGFtcBi4AiADKAsyGi5nb29nbGUucHJvdG9idWYuVGlt", + "ZXN0YW1wEjcKEnJlcGVhdGVkX2ZpZWxkbWFzaxi5AiADKAsyGi5nb29nbGUu", + "cHJvdG9idWYuRmllbGRNYXNrEjEKD3JlcGVhdGVkX3N0cnVjdBjEAiADKAsy", + "Fy5nb29nbGUucHJvdG9idWYuU3RydWN0EisKDHJlcGVhdGVkX2FueRi7AiAD", + "KAsyFC5nb29nbGUucHJvdG9idWYuQW55Ei8KDnJlcGVhdGVkX3ZhbHVlGLwC", + "IAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZRI4ChNyZXBlYXRlZF9saXN0", + "X3ZhbHVlGL0CIAMoCzIaLmdvb2dsZS5wcm90b2J1Zi5MaXN0VmFsdWUSEwoK", + "ZmllbGRuYW1lMRiRAyABKAUSFAoLZmllbGRfbmFtZTIYkgMgASgFEhUKDF9m", + "aWVsZF9uYW1lMxiTAyABKAUSFgoNZmllbGRfX25hbWU0XxiUAyABKAUSFAoL", + "ZmllbGQwbmFtZTUYlQMgASgFEhYKDWZpZWxkXzBfbmFtZTYYlgMgASgFEhMK", + "CmZpZWxkTmFtZTcYlwMgASgFEhMKCkZpZWxkTmFtZTgYmAMgASgFEhQKC2Zp", + "ZWxkX05hbWU5GJkDIAEoBRIVCgxGaWVsZF9OYW1lMTAYmgMgASgFEhUKDEZJ", + "RUxEX05BTUUxMRibAyABKAUSFQoMRklFTERfbmFtZTEyGJwDIAEoBRIXCg5f", + "X2ZpZWxkX25hbWUxMxidAyABKAUSFwoOX19GaWVsZF9uYW1lMTQYngMgASgF", + "EhYKDWZpZWxkX19uYW1lMTUYnwMgASgFEhYKDWZpZWxkX19OYW1lMTYYoAMg", + "ASgFEhcKDmZpZWxkX25hbWUxN19fGKEDIAEoBRIXCg5GaWVsZF9uYW1lMThf", + "XxiiAyABKAUaYgoNTmVzdGVkTWVzc2FnZRIJCgFhGAEgASgFEkYKC2NvcmVj", + "dXJzaXZlGAIgASgLMjEucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzMu", + "VGVzdEFsbFR5cGVzUHJvdG8zGjQKEk1hcEludDMySW50MzJFbnRyeRILCgNr", + "ZXkYASABKAUSDQoFdmFsdWUYAiABKAU6AjgBGjQKEk1hcEludDY0SW50NjRF", + "bnRyeRILCgNrZXkYASABKAMSDQoFdmFsdWUYAiABKAM6AjgBGjYKFE1hcFVp", + "bnQzMlVpbnQzMkVudHJ5EgsKA2tleRgBIAEoDRINCgV2YWx1ZRgCIAEoDToC", + "OAEaNgoUTWFwVWludDY0VWludDY0RW50cnkSCwoDa2V5GAEgASgEEg0KBXZh", + "bHVlGAIgASgEOgI4ARo2ChRNYXBTaW50MzJTaW50MzJFbnRyeRILCgNrZXkY", + "ASABKBESDQoFdmFsdWUYAiABKBE6AjgBGjYKFE1hcFNpbnQ2NFNpbnQ2NEVu", + "dHJ5EgsKA2tleRgBIAEoEhINCgV2YWx1ZRgCIAEoEjoCOAEaOAoWTWFwRml4", + "ZWQzMkZpeGVkMzJFbnRyeRILCgNrZXkYASABKAcSDQoFdmFsdWUYAiABKAc6", + "AjgBGjgKFk1hcEZpeGVkNjRGaXhlZDY0RW50cnkSCwoDa2V5GAEgASgGEg0K", + "BXZhbHVlGAIgASgGOgI4ARo6ChhNYXBTZml4ZWQzMlNmaXhlZDMyRW50cnkS", + "CwoDa2V5GAEgASgPEg0KBXZhbHVlGAIgASgPOgI4ARo6ChhNYXBTZml4ZWQ2", + "NFNmaXhlZDY0RW50cnkSCwoDa2V5GAEgASgQEg0KBXZhbHVlGAIgASgQOgI4", + "ARo0ChJNYXBJbnQzMkZsb2F0RW50cnkSCwoDa2V5GAEgASgFEg0KBXZhbHVl", + "GAIgASgCOgI4ARo1ChNNYXBJbnQzMkRvdWJsZUVudHJ5EgsKA2tleRgBIAEo", + "BRINCgV2YWx1ZRgCIAEoAToCOAEaMgoQTWFwQm9vbEJvb2xFbnRyeRILCgNr", + "ZXkYASABKAgSDQoFdmFsdWUYAiABKAg6AjgBGjYKFE1hcFN0cmluZ1N0cmlu", + "Z0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaNQoTTWFw", + "U3RyaW5nQnl0ZXNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAw6", + "AjgBGn4KG01hcFN0cmluZ05lc3RlZE1lc3NhZ2VFbnRyeRILCgNrZXkYASAB", + "KAkSTgoFdmFsdWUYAiABKAsyPy5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnBy", + "b3RvMy5UZXN0QWxsVHlwZXNQcm90bzMuTmVzdGVkTWVzc2FnZToCOAEabQoc", + "TWFwU3RyaW5nRm9yZWlnbk1lc3NhZ2VFbnRyeRILCgNrZXkYASABKAkSPAoF", + "dmFsdWUYAiABKAsyLS5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMy5G", + "b3JlaWduTWVzc2FnZToCOAEaeAoYTWFwU3RyaW5nTmVzdGVkRW51bUVudHJ5", + "EgsKA2tleRgBIAEoCRJLCgV2YWx1ZRgCIAEoDjI8LnByb3RvYnVmX3Rlc3Rf", + "bWVzc2FnZXMucHJvdG8zLlRlc3RBbGxUeXBlc1Byb3RvMy5OZXN0ZWRFbnVt", + "OgI4ARpnChlNYXBTdHJpbmdGb3JlaWduRW51bUVudHJ5EgsKA2tleRgBIAEo", + "CRI5CgV2YWx1ZRgCIAEoDjIqLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJv", + "dG8zLkZvcmVpZ25FbnVtOgI4ASI5CgpOZXN0ZWRFbnVtEgcKA0ZPTxAAEgcK", + "A0JBUhABEgcKA0JBWhACEhAKA05FRxD///////////8BIlkKC0FsaWFzZWRF", + "bnVtEg0KCUFMSUFTX0ZPTxAAEg0KCUFMSUFTX0JBUhABEg0KCUFMSUFTX0JB", + "WhACEgcKA1FVWBACEgcKA3F1eBACEgcKA2JBehACGgIQAUINCgtvbmVvZl9m", + "aWVsZEoGCPUDEP8DIhsKDkZvcmVpZ25NZXNzYWdlEgkKAWMYASABKAUqQAoL", + "Rm9yZWlnbkVudW0SDwoLRk9SRUlHTl9GT08QABIPCgtGT1JFSUdOX0JBUhAB", + "Eg8KC0ZPUkVJR05fQkFaEAJCOAooY29tLmdvb2dsZS5wcm90b2J1Zl90ZXN0", + "X21lc3NhZ2VzLnByb3RvM0gB+AEBogIGUHJvdG8zYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ProtobufTestMessages.Proto3.ForeignEnum), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3), global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalAliasedEnum", "OptionalStringPiece", "OptionalCord", "RecursiveMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedNestedEnum", "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedNestedEnum", "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapStringBytes", "MapStringNestedMessage", "MapStringForeignMessage", "MapStringNestedEnum", "MapStringForeignEnum", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", "OneofBool", "OneofUint64", "OneofFloat", "OneofDouble", "OneofEnum", "OptionalBoolWrapper", "OptionalInt32Wrapper", "OptionalInt64Wrapper", "OptionalUint32Wrapper", "OptionalUint64Wrapper", "OptionalFloatWrapper", "OptionalDoubleWrapper", "OptionalStringWrapper", "OptionalBytesWrapper", "RepeatedBoolWrapper", "RepeatedInt32Wrapper", "RepeatedInt64Wrapper", "RepeatedUint32Wrapper", "RepeatedUint64Wrapper", "RepeatedFloatWrapper", "RepeatedDoubleWrapper", "RepeatedStringWrapper", "RepeatedBytesWrapper", "OptionalDuration", "OptionalTimestamp", "OptionalFieldMask", "OptionalStruct", "OptionalAny", "OptionalValue", "RepeatedDuration", "RepeatedTimestamp", "RepeatedFieldmask", "RepeatedStruct", "RepeatedAny", "RepeatedValue", "RepeatedListValue", "Fieldname1", "FieldName2", "FieldName3", "FieldName4", "Field0Name5", "Field0Name6", "FieldName7", "FieldName8", "FieldName9", "FieldName10", "FIELDNAME11", "FIELDName12", "FieldName13", "FieldName14", "FieldName15", "FieldName16", "FieldName17", "FieldName18" }, new[]{ "OneofField" }, new[]{ typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum), typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage), global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser, new[]{ "A", "Corecursive" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3), global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalAliasedEnum", "OptionalStringPiece", "OptionalCord", "RecursiveMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedStringPiece", "RepeatedCord", "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedNestedEnum", "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedNestedEnum", "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapStringBytes", "MapStringNestedMessage", "MapStringForeignMessage", "MapStringNestedEnum", "MapStringForeignEnum", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", "OneofBool", "OneofUint64", "OneofFloat", "OneofDouble", "OneofEnum", "OneofNullValue", "OptionalBoolWrapper", "OptionalInt32Wrapper", "OptionalInt64Wrapper", "OptionalUint32Wrapper", "OptionalUint64Wrapper", "OptionalFloatWrapper", "OptionalDoubleWrapper", "OptionalStringWrapper", "OptionalBytesWrapper", "RepeatedBoolWrapper", "RepeatedInt32Wrapper", "RepeatedInt64Wrapper", "RepeatedUint32Wrapper", "RepeatedUint64Wrapper", "RepeatedFloatWrapper", "RepeatedDoubleWrapper", "RepeatedStringWrapper", "RepeatedBytesWrapper", "OptionalDuration", "OptionalTimestamp", "OptionalFieldMask", "OptionalStruct", "OptionalAny", "OptionalValue", "OptionalNullValue", "RepeatedDuration", "RepeatedTimestamp", "RepeatedFieldmask", "RepeatedStruct", "RepeatedAny", "RepeatedValue", "RepeatedListValue", "Fieldname1", "FieldName2", "FieldName3", "FieldName4", "Field0Name5", "Field0Name6", "FieldName7", "FieldName8", "FieldName9", "FieldName10", "FIELDNAME11", "FIELDName12", "FieldName13", "FieldName14", "FieldName15", "FieldName16", "FieldName17", "FieldName18" }, new[]{ "OneofField" }, new[]{ typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum), typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage), global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser, new[]{ "A", "Corecursive" }, null, null, null, null), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }), new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto3.ForeignMessage), global::ProtobufTestMessages.Proto3.ForeignMessage.Parser, new[]{ "C" }, null, null, null, null) })); @@ -259,23 +261,31 @@ namespace ProtobufTestMessages.Proto3 { /// could trigger bugs that occur in any message type in this file. We verify /// this stays true in a unit test. /// - public sealed partial class TestAllTypesProto3 : pb::IMessage { + public sealed partial class TestAllTypesProto3 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypesProto3()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto3.TestMessagesProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto3() { OnConstruction(); } @@ -283,6 +293,7 @@ namespace ProtobufTestMessages.Proto3 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto3(TestAllTypesProto3 other) : this() { optionalInt32_ = other.optionalInt32_; optionalInt64_ = other.optionalInt64_; @@ -399,6 +410,7 @@ namespace ProtobufTestMessages.Proto3 { optionalStruct_ = other.optionalStruct_ != null ? other.optionalStruct_.Clone() : null; optionalAny_ = other.optionalAny_ != null ? other.optionalAny_.Clone() : null; optionalValue_ = other.optionalValue_ != null ? other.optionalValue_.Clone() : null; + optionalNullValue_ = other.optionalNullValue_; repeatedDuration_ = other.repeatedDuration_.Clone(); repeatedTimestamp_ = other.repeatedTimestamp_.Clone(); repeatedFieldmask_ = other.repeatedFieldmask_.Clone(); @@ -452,12 +464,16 @@ namespace ProtobufTestMessages.Proto3 { case OneofFieldOneofCase.OneofEnum: OneofEnum = other.OneofEnum; break; + case OneofFieldOneofCase.OneofNullValue: + OneofNullValue = other.OneofNullValue; + break; } _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypesProto3 Clone() { return new TestAllTypesProto3(this); } @@ -469,6 +485,7 @@ namespace ProtobufTestMessages.Proto3 { /// Singular /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { return optionalInt32_; } set { @@ -480,6 +497,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalInt64FieldNumber = 2; private long optionalInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalInt64 { get { return optionalInt64_; } set { @@ -491,6 +509,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalUint32FieldNumber = 3; private uint optionalUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalUint32 { get { return optionalUint32_; } set { @@ -502,6 +521,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalUint64FieldNumber = 4; private ulong optionalUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalUint64 { get { return optionalUint64_; } set { @@ -513,6 +533,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalSint32FieldNumber = 5; private int optionalSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSint32 { get { return optionalSint32_; } set { @@ -524,6 +545,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalSint64FieldNumber = 6; private long optionalSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSint64 { get { return optionalSint64_; } set { @@ -535,6 +557,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalFixed32FieldNumber = 7; private uint optionalFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalFixed32 { get { return optionalFixed32_; } set { @@ -546,6 +569,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalFixed64FieldNumber = 8; private ulong optionalFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalFixed64 { get { return optionalFixed64_; } set { @@ -557,6 +581,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalSfixed32FieldNumber = 9; private int optionalSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSfixed32 { get { return optionalSfixed32_; } set { @@ -568,6 +593,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalSfixed64FieldNumber = 10; private long optionalSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSfixed64 { get { return optionalSfixed64_; } set { @@ -579,6 +605,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalFloatFieldNumber = 11; private float optionalFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OptionalFloat { get { return optionalFloat_; } set { @@ -590,6 +617,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalDoubleFieldNumber = 12; private double optionalDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OptionalDouble { get { return optionalDouble_; } set { @@ -601,6 +629,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalBoolFieldNumber = 13; private bool optionalBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OptionalBool { get { return optionalBool_; } set { @@ -612,6 +641,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalStringFieldNumber = 14; private string optionalString_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_; } set { @@ -623,6 +653,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalBytesFieldNumber = 15; private pb::ByteString optionalBytes_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytes { get { return optionalBytes_; } set { @@ -634,6 +665,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalNestedMessageFieldNumber = 18; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { @@ -645,6 +677,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalForeignMessageFieldNumber = 19; private global::ProtobufTestMessages.Proto3.ForeignMessage optionalForeignMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.ForeignMessage OptionalForeignMessage { get { return optionalForeignMessage_; } set { @@ -656,6 +689,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalNestedEnumFieldNumber = 21; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum optionalNestedEnum_ = global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum OptionalNestedEnum { get { return optionalNestedEnum_; } set { @@ -667,6 +701,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalForeignEnumFieldNumber = 22; private global::ProtobufTestMessages.Proto3.ForeignEnum optionalForeignEnum_ = global::ProtobufTestMessages.Proto3.ForeignEnum.ForeignFoo; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.ForeignEnum OptionalForeignEnum { get { return optionalForeignEnum_; } set { @@ -678,6 +713,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalAliasedEnumFieldNumber = 23; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum optionalAliasedEnum_ = global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum.AliasFoo; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum OptionalAliasedEnum { get { return optionalAliasedEnum_; } set { @@ -689,6 +725,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalStringPieceFieldNumber = 24; private string optionalStringPiece_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalStringPiece { get { return optionalStringPiece_; } set { @@ -700,6 +737,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalCordFieldNumber = 25; private string optionalCord_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalCord { get { return optionalCord_; } set { @@ -711,6 +749,7 @@ namespace ProtobufTestMessages.Proto3 { public const int RecursiveMessageFieldNumber = 27; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3 recursiveMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3 RecursiveMessage { get { return recursiveMessage_; } set { @@ -727,6 +766,7 @@ namespace ProtobufTestMessages.Proto3 { /// Repeated /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -737,6 +777,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForInt64(258); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -747,6 +788,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt32(266); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -757,6 +799,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt64(274); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -767,6 +810,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt32(282); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -777,6 +821,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt64(290); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -787,6 +832,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed32(298); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -797,6 +843,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed64(306); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -807,6 +854,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed32(314); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -817,6 +865,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed64(322); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -827,6 +876,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFloat(330); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -837,6 +887,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForDouble(338); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -847,6 +898,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForBool(346); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -857,6 +909,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -867,6 +920,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -877,6 +931,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(386, global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -887,6 +942,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(394, global::ProtobufTestMessages.Proto3.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -897,6 +953,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x); private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -907,6 +964,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::ProtobufTestMessages.Proto3.ForeignEnum) x); private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } @@ -917,6 +975,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForString(434); private readonly pbc::RepeatedField repeatedStringPiece_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringPiece { get { return repeatedStringPiece_; } } @@ -927,6 +986,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForString(442); private readonly pbc::RepeatedField repeatedCord_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedCord { get { return repeatedCord_; } } @@ -940,6 +1000,7 @@ namespace ProtobufTestMessages.Proto3 { /// Packed /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -950,6 +1011,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForInt64(610); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -960,6 +1022,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt32(618); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -970,6 +1033,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt64(626); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -980,6 +1044,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt32(634); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -990,6 +1055,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt64(642); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -1000,6 +1066,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed32(650); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -1010,6 +1077,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed64(658); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -1020,6 +1088,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed32(666); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -1030,6 +1099,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed64(674); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -1040,6 +1110,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFloat(682); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -1050,6 +1121,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForDouble(690); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -1060,6 +1132,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForBool(698); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedBool { get { return packedBool_; } } @@ -1070,6 +1143,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForEnum(706, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x); private readonly pbc::RepeatedField packedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedNestedEnum { get { return packedNestedEnum_; } } @@ -1083,6 +1157,7 @@ namespace ProtobufTestMessages.Proto3 { /// Unpacked /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -1093,6 +1168,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForInt64(720); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -1103,6 +1179,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt32(728); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -1113,6 +1190,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForUInt64(736); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -1123,6 +1201,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt32(744); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -1133,6 +1212,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSInt64(752); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -1143,6 +1223,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed32(765); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -1153,6 +1234,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFixed64(769); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -1163,6 +1245,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed32(781); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -1173,6 +1256,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForSFixed64(785); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -1183,6 +1267,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForFloat(797); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -1193,6 +1278,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForDouble(801); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -1203,6 +1289,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForBool(808); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } @@ -1213,6 +1300,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForEnum(816, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x); private readonly pbc::RepeatedField unpackedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedNestedEnum { get { return unpackedNestedEnum_; } } @@ -1226,6 +1314,7 @@ namespace ProtobufTestMessages.Proto3 { /// Map /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -1236,6 +1325,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8, 0L), pb::FieldCodec.ForInt64(16, 0L), 458); private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -1246,6 +1336,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForUInt32(16, 0), 466); private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -1256,6 +1347,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8, 0UL), pb::FieldCodec.ForUInt64(16, 0UL), 474); private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -1266,6 +1358,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8, 0), pb::FieldCodec.ForSInt32(16, 0), 482); private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -1276,6 +1369,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8, 0L), pb::FieldCodec.ForSInt64(16, 0L), 490); private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -1286,6 +1380,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13, 0), pb::FieldCodec.ForFixed32(21, 0), 498); private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -1296,6 +1391,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9, 0UL), pb::FieldCodec.ForFixed64(17, 0UL), 506); private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -1306,6 +1402,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13, 0), pb::FieldCodec.ForSFixed32(21, 0), 514); private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -1316,6 +1413,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9, 0L), pb::FieldCodec.ForSFixed64(17, 0L), 522); private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -1326,6 +1424,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForFloat(21, 0F), 530); private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -1336,6 +1435,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForDouble(17, 0D), 538); private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -1346,6 +1446,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8, false), pb::FieldCodec.ForBool(16, false), 546); private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -1356,6 +1457,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 554); private readonly pbc::MapField mapStringString_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringString { get { return mapStringString_; } } @@ -1366,6 +1468,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForBytes(18, pb::ByteString.Empty), 562); private readonly pbc::MapField mapStringBytes_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringBytes { get { return mapStringBytes_; } } @@ -1376,6 +1479,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage.Parser), 570); private readonly pbc::MapField mapStringNestedMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringNestedMessage { get { return mapStringNestedMessage_; } } @@ -1386,6 +1490,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::ProtobufTestMessages.Proto3.ForeignMessage.Parser), 578); private readonly pbc::MapField mapStringForeignMessage_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringForeignMessage { get { return mapStringForeignMessage_; } } @@ -1396,6 +1501,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) x, global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo), 586); private readonly pbc::MapField mapStringNestedEnum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringNestedEnum { get { return mapStringNestedEnum_; } } @@ -1406,6 +1512,7 @@ namespace ProtobufTestMessages.Proto3 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::ProtobufTestMessages.Proto3.ForeignEnum) x, global::ProtobufTestMessages.Proto3.ForeignEnum.ForeignFoo), 594); private readonly pbc::MapField mapStringForeignEnum_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField MapStringForeignEnum { get { return mapStringForeignEnum_; } } @@ -1413,6 +1520,7 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } set { @@ -1424,6 +1532,7 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage) oneofField_ : null; } set { @@ -1435,6 +1544,7 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } set { @@ -1446,6 +1556,7 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -1457,6 +1568,7 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_bool" field. public const int OneofBoolFieldNumber = 115; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OneofBool { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBool ? (bool) oneofField_ : false; } set { @@ -1468,6 +1580,7 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_uint64" field. public const int OneofUint64FieldNumber = 116; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OneofUint64 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint64 ? (ulong) oneofField_ : 0UL; } set { @@ -1479,6 +1592,7 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_float" field. public const int OneofFloatFieldNumber = 117; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OneofFloat { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofFloat ? (float) oneofField_ : 0F; } set { @@ -1490,6 +1604,7 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_double" field. public const int OneofDoubleFieldNumber = 118; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OneofDouble { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofDouble ? (double) oneofField_ : 0D; } set { @@ -1501,6 +1616,7 @@ namespace ProtobufTestMessages.Proto3 { /// Field number for the "oneof_enum" field. public const int OneofEnumFieldNumber = 119; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum OneofEnum { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofEnum ? (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) oneofField_ : global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo; } set { @@ -1509,6 +1625,18 @@ namespace ProtobufTestMessages.Proto3 { } } + /// Field number for the "oneof_null_value" field. + public const int OneofNullValueFieldNumber = 120; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Protobuf.WellKnownTypes.NullValue OneofNullValue { + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) oneofField_ : global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; } + set { + oneofField_ = value; + oneofFieldCase_ = OneofFieldOneofCase.OneofNullValue; + } + } + /// Field number for the "optional_bool_wrapper" field. public const int OptionalBoolWrapperFieldNumber = 201; private static readonly pb::FieldCodec _single_optionalBoolWrapper_codec = pb::FieldCodec.ForStructWrapper(1610); @@ -1517,6 +1645,7 @@ namespace ProtobufTestMessages.Proto3 { /// Well-known types /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool? OptionalBoolWrapper { get { return optionalBoolWrapper_; } set { @@ -1530,6 +1659,7 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalInt32Wrapper_codec = pb::FieldCodec.ForStructWrapper(1618); private int? optionalInt32Wrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int? OptionalInt32Wrapper { get { return optionalInt32Wrapper_; } set { @@ -1543,6 +1673,7 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalInt64Wrapper_codec = pb::FieldCodec.ForStructWrapper(1626); private long? optionalInt64Wrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? OptionalInt64Wrapper { get { return optionalInt64Wrapper_; } set { @@ -1556,6 +1687,7 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalUint32Wrapper_codec = pb::FieldCodec.ForStructWrapper(1634); private uint? optionalUint32Wrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint? OptionalUint32Wrapper { get { return optionalUint32Wrapper_; } set { @@ -1569,6 +1701,7 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalUint64Wrapper_codec = pb::FieldCodec.ForStructWrapper(1642); private ulong? optionalUint64Wrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong? OptionalUint64Wrapper { get { return optionalUint64Wrapper_; } set { @@ -1582,6 +1715,7 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalFloatWrapper_codec = pb::FieldCodec.ForStructWrapper(1650); private float? optionalFloatWrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float? OptionalFloatWrapper { get { return optionalFloatWrapper_; } set { @@ -1595,6 +1729,7 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalDoubleWrapper_codec = pb::FieldCodec.ForStructWrapper(1658); private double? optionalDoubleWrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? OptionalDoubleWrapper { get { return optionalDoubleWrapper_; } set { @@ -1608,6 +1743,7 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalStringWrapper_codec = pb::FieldCodec.ForClassWrapper(1666); private string optionalStringWrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalStringWrapper { get { return optionalStringWrapper_; } set { @@ -1621,6 +1757,7 @@ namespace ProtobufTestMessages.Proto3 { private static readonly pb::FieldCodec _single_optionalBytesWrapper_codec = pb::FieldCodec.ForClassWrapper(1674); private pb::ByteString optionalBytesWrapper_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytesWrapper { get { return optionalBytesWrapper_; } set { @@ -1635,6 +1772,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1690); private readonly pbc::RepeatedField repeatedBoolWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBoolWrapper { get { return repeatedBoolWrapper_; } } @@ -1645,6 +1783,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1698); private readonly pbc::RepeatedField repeatedInt32Wrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32Wrapper { get { return repeatedInt32Wrapper_; } } @@ -1655,6 +1794,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1706); private readonly pbc::RepeatedField repeatedInt64Wrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64Wrapper { get { return repeatedInt64Wrapper_; } } @@ -1665,6 +1805,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1714); private readonly pbc::RepeatedField repeatedUint32Wrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32Wrapper { get { return repeatedUint32Wrapper_; } } @@ -1675,6 +1816,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1722); private readonly pbc::RepeatedField repeatedUint64Wrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64Wrapper { get { return repeatedUint64Wrapper_; } } @@ -1685,6 +1827,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1730); private readonly pbc::RepeatedField repeatedFloatWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloatWrapper { get { return repeatedFloatWrapper_; } } @@ -1695,6 +1838,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForStructWrapper(1738); private readonly pbc::RepeatedField repeatedDoubleWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDoubleWrapper { get { return repeatedDoubleWrapper_; } } @@ -1705,6 +1849,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForClassWrapper(1746); private readonly pbc::RepeatedField repeatedStringWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringWrapper { get { return repeatedStringWrapper_; } } @@ -1715,6 +1860,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForClassWrapper(1754); private readonly pbc::RepeatedField repeatedBytesWrapper_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytesWrapper { get { return repeatedBytesWrapper_; } } @@ -1723,6 +1869,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalDurationFieldNumber = 301; private global::Google.Protobuf.WellKnownTypes.Duration optionalDuration_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Duration OptionalDuration { get { return optionalDuration_; } set { @@ -1734,6 +1881,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalTimestampFieldNumber = 302; private global::Google.Protobuf.WellKnownTypes.Timestamp optionalTimestamp_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp OptionalTimestamp { get { return optionalTimestamp_; } set { @@ -1745,6 +1893,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalFieldMaskFieldNumber = 303; private global::Google.Protobuf.WellKnownTypes.FieldMask optionalFieldMask_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.FieldMask OptionalFieldMask { get { return optionalFieldMask_; } set { @@ -1756,6 +1905,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalStructFieldNumber = 304; private global::Google.Protobuf.WellKnownTypes.Struct optionalStruct_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Struct OptionalStruct { get { return optionalStruct_; } set { @@ -1767,6 +1917,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalAnyFieldNumber = 305; private global::Google.Protobuf.WellKnownTypes.Any optionalAny_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Any OptionalAny { get { return optionalAny_; } set { @@ -1778,6 +1929,7 @@ namespace ProtobufTestMessages.Proto3 { public const int OptionalValueFieldNumber = 306; private global::Google.Protobuf.WellKnownTypes.Value optionalValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Value OptionalValue { get { return optionalValue_; } set { @@ -1785,12 +1937,25 @@ namespace ProtobufTestMessages.Proto3 { } } + /// Field number for the "optional_null_value" field. + public const int OptionalNullValueFieldNumber = 307; + private global::Google.Protobuf.WellKnownTypes.NullValue optionalNullValue_ = global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Protobuf.WellKnownTypes.NullValue OptionalNullValue { + get { return optionalNullValue_; } + set { + optionalNullValue_ = value; + } + } + /// Field number for the "repeated_duration" field. public const int RepeatedDurationFieldNumber = 311; private static readonly pb::FieldCodec _repeated_repeatedDuration_codec = pb::FieldCodec.ForMessage(2490, global::Google.Protobuf.WellKnownTypes.Duration.Parser); private readonly pbc::RepeatedField repeatedDuration_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDuration { get { return repeatedDuration_; } } @@ -1801,6 +1966,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2498, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser); private readonly pbc::RepeatedField repeatedTimestamp_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedTimestamp { get { return repeatedTimestamp_; } } @@ -1811,6 +1977,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2506, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser); private readonly pbc::RepeatedField repeatedFieldmask_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFieldmask { get { return repeatedFieldmask_; } } @@ -1821,6 +1988,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2594, global::Google.Protobuf.WellKnownTypes.Struct.Parser); private readonly pbc::RepeatedField repeatedStruct_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStruct { get { return repeatedStruct_; } } @@ -1831,6 +1999,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2522, global::Google.Protobuf.WellKnownTypes.Any.Parser); private readonly pbc::RepeatedField repeatedAny_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedAny { get { return repeatedAny_; } } @@ -1841,6 +2010,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2530, global::Google.Protobuf.WellKnownTypes.Value.Parser); private readonly pbc::RepeatedField repeatedValue_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedValue { get { return repeatedValue_; } } @@ -1851,6 +2021,7 @@ namespace ProtobufTestMessages.Proto3 { = pb::FieldCodec.ForMessage(2538, global::Google.Protobuf.WellKnownTypes.ListValue.Parser); private readonly pbc::RepeatedField repeatedListValue_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedListValue { get { return repeatedListValue_; } } @@ -1863,6 +2034,7 @@ namespace ProtobufTestMessages.Proto3 { /// (protobuf says names can be any valid C/C++ identifier.) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Fieldname1 { get { return fieldname1_; } set { @@ -1874,6 +2046,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName2FieldNumber = 402; private int fieldName2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName2 { get { return fieldName2_; } set { @@ -1885,6 +2058,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName3FieldNumber = 403; private int FieldName3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName3 { get { return FieldName3_; } set { @@ -1896,6 +2070,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName4FieldNumber = 404; private int fieldName4_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName4 { get { return fieldName4_; } set { @@ -1907,6 +2082,7 @@ namespace ProtobufTestMessages.Proto3 { public const int Field0Name5FieldNumber = 405; private int field0Name5_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field0Name5 { get { return field0Name5_; } set { @@ -1918,6 +2094,7 @@ namespace ProtobufTestMessages.Proto3 { public const int Field0Name6FieldNumber = 406; private int field0Name6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field0Name6 { get { return field0Name6_; } set { @@ -1929,6 +2106,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName7FieldNumber = 407; private int fieldName7_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName7 { get { return fieldName7_; } set { @@ -1940,6 +2118,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName8FieldNumber = 408; private int fieldName8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName8 { get { return fieldName8_; } set { @@ -1951,6 +2130,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName9FieldNumber = 409; private int fieldName9_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName9 { get { return fieldName9_; } set { @@ -1962,6 +2142,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName10FieldNumber = 410; private int fieldName10_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName10 { get { return fieldName10_; } set { @@ -1973,6 +2154,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FIELDNAME11FieldNumber = 411; private int fIELDNAME11_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDNAME11 { get { return fIELDNAME11_; } set { @@ -1984,6 +2166,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FIELDName12FieldNumber = 412; private int fIELDName12_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDName12 { get { return fIELDName12_; } set { @@ -1995,6 +2178,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName13FieldNumber = 413; private int FieldName13_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName13 { get { return FieldName13_; } set { @@ -2006,6 +2190,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName14FieldNumber = 414; private int FieldName14_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName14 { get { return FieldName14_; } set { @@ -2017,6 +2202,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName15FieldNumber = 415; private int fieldName15_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName15 { get { return fieldName15_; } set { @@ -2028,6 +2214,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName16FieldNumber = 416; private int fieldName16_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName16 { get { return fieldName16_; } set { @@ -2039,6 +2226,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName17FieldNumber = 417; private int fieldName17_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName17 { get { return fieldName17_; } set { @@ -2050,6 +2238,7 @@ namespace ProtobufTestMessages.Proto3 { public const int FieldName18FieldNumber = 418; private int fieldName18_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName18 { get { return fieldName18_; } set { @@ -2070,25 +2259,30 @@ namespace ProtobufTestMessages.Proto3 { OneofFloat = 117, OneofDouble = 118, OneofEnum = 119, + OneofNullValue = 120, } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllTypesProto3); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllTypesProto3 other) { if (ReferenceEquals(other, null)) { return false; @@ -2196,6 +2390,7 @@ namespace ProtobufTestMessages.Proto3 { if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OneofFloat, other.OneofFloat)) return false; if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OneofDouble, other.OneofDouble)) return false; if (OneofEnum != other.OneofEnum) return false; + if (OneofNullValue != other.OneofNullValue) return false; if (OptionalBoolWrapper != other.OptionalBoolWrapper) return false; if (OptionalInt32Wrapper != other.OptionalInt32Wrapper) return false; if (OptionalInt64Wrapper != other.OptionalInt64Wrapper) return false; @@ -2220,6 +2415,7 @@ namespace ProtobufTestMessages.Proto3 { if (!object.Equals(OptionalStruct, other.OptionalStruct)) return false; if (!object.Equals(OptionalAny, other.OptionalAny)) return false; if (!object.Equals(OptionalValue, other.OptionalValue)) return false; + if (OptionalNullValue != other.OptionalNullValue) return false; if(!repeatedDuration_.Equals(other.repeatedDuration_)) return false; if(!repeatedTimestamp_.Equals(other.repeatedTimestamp_)) return false; if(!repeatedFieldmask_.Equals(other.repeatedFieldmask_)) return false; @@ -2250,6 +2446,7 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (OptionalInt32 != 0) hash ^= OptionalInt32.GetHashCode(); @@ -2352,6 +2549,7 @@ namespace ProtobufTestMessages.Proto3 { if (oneofFieldCase_ == OneofFieldOneofCase.OneofFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OneofFloat); if (oneofFieldCase_ == OneofFieldOneofCase.OneofDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OneofDouble); if (oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) hash ^= OneofEnum.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue) hash ^= OneofNullValue.GetHashCode(); if (optionalBoolWrapper_ != null) hash ^= OptionalBoolWrapper.GetHashCode(); if (optionalInt32Wrapper_ != null) hash ^= OptionalInt32Wrapper.GetHashCode(); if (optionalInt64Wrapper_ != null) hash ^= OptionalInt64Wrapper.GetHashCode(); @@ -2376,6 +2574,7 @@ namespace ProtobufTestMessages.Proto3 { if (optionalStruct_ != null) hash ^= OptionalStruct.GetHashCode(); if (optionalAny_ != null) hash ^= OptionalAny.GetHashCode(); if (optionalValue_ != null) hash ^= OptionalValue.GetHashCode(); + if (OptionalNullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) hash ^= OptionalNullValue.GetHashCode(); hash ^= repeatedDuration_.GetHashCode(); hash ^= repeatedTimestamp_.GetHashCode(); hash ^= repeatedFieldmask_.GetHashCode(); @@ -2409,12 +2608,17 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (OptionalInt32 != 0) { output.WriteRawTag(8); output.WriteInt32(OptionalInt32); @@ -2611,6 +2815,10 @@ namespace ProtobufTestMessages.Proto3 { output.WriteRawTag(184, 7); output.WriteEnum((int) OneofEnum); } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue) { + output.WriteRawTag(192, 7); + output.WriteEnum((int) OneofNullValue); + } if (optionalBoolWrapper_ != null) { _single_optionalBoolWrapper_codec.WriteTagAndValue(output, OptionalBoolWrapper); } @@ -2671,6 +2879,10 @@ namespace ProtobufTestMessages.Proto3 { output.WriteRawTag(146, 19); output.WriteMessage(OptionalValue); } + if (OptionalNullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { + output.WriteRawTag(152, 19); + output.WriteEnum((int) OptionalNullValue); + } repeatedDuration_.WriteTo(output, _repeated_repeatedDuration_codec); repeatedTimestamp_.WriteTo(output, _repeated_repeatedTimestamp_codec); repeatedFieldmask_.WriteTo(output, _repeated_repeatedFieldmask_codec); @@ -2753,641 +2965,1736 @@ namespace ProtobufTestMessages.Proto3 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (OptionalInt32 != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32); + output.WriteRawTag(8); + output.WriteInt32(OptionalInt32); } if (OptionalInt64 != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(OptionalInt64); + output.WriteRawTag(16); + output.WriteInt64(OptionalInt64); } if (OptionalUint32 != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(OptionalUint32); + output.WriteRawTag(24); + output.WriteUInt32(OptionalUint32); } if (OptionalUint64 != 0UL) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(OptionalUint64); + output.WriteRawTag(32); + output.WriteUInt64(OptionalUint64); } if (OptionalSint32 != 0) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(OptionalSint32); + output.WriteRawTag(40); + output.WriteSInt32(OptionalSint32); } if (OptionalSint64 != 0L) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(OptionalSint64); + output.WriteRawTag(48); + output.WriteSInt64(OptionalSint64); } if (OptionalFixed32 != 0) { - size += 1 + 4; + output.WriteRawTag(61); + output.WriteFixed32(OptionalFixed32); } if (OptionalFixed64 != 0UL) { - size += 1 + 8; + output.WriteRawTag(65); + output.WriteFixed64(OptionalFixed64); } if (OptionalSfixed32 != 0) { - size += 1 + 4; + output.WriteRawTag(77); + output.WriteSFixed32(OptionalSfixed32); } if (OptionalSfixed64 != 0L) { - size += 1 + 8; + output.WriteRawTag(81); + output.WriteSFixed64(OptionalSfixed64); } if (OptionalFloat != 0F) { - size += 1 + 4; + output.WriteRawTag(93); + output.WriteFloat(OptionalFloat); } if (OptionalDouble != 0D) { - size += 1 + 8; + output.WriteRawTag(97); + output.WriteDouble(OptionalDouble); } if (OptionalBool != false) { - size += 1 + 1; + output.WriteRawTag(104); + output.WriteBool(OptionalBool); } if (OptionalString.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(OptionalString); + output.WriteRawTag(114); + output.WriteString(OptionalString); } if (OptionalBytes.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(OptionalBytes); + output.WriteRawTag(122); + output.WriteBytes(OptionalBytes); } if (optionalNestedMessage_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); + output.WriteRawTag(146, 1); + output.WriteMessage(OptionalNestedMessage); } if (optionalForeignMessage_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalForeignMessage); + output.WriteRawTag(154, 1); + output.WriteMessage(OptionalForeignMessage); } if (OptionalNestedEnum != global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalNestedEnum); + output.WriteRawTag(168, 1); + output.WriteEnum((int) OptionalNestedEnum); } if (OptionalForeignEnum != global::ProtobufTestMessages.Proto3.ForeignEnum.ForeignFoo) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalForeignEnum); + output.WriteRawTag(176, 1); + output.WriteEnum((int) OptionalForeignEnum); } if (OptionalAliasedEnum != global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum.AliasFoo) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalAliasedEnum); + output.WriteRawTag(184, 1); + output.WriteEnum((int) OptionalAliasedEnum); } if (OptionalStringPiece.Length != 0) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalStringPiece); + output.WriteRawTag(194, 1); + output.WriteString(OptionalStringPiece); } if (OptionalCord.Length != 0) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalCord); + output.WriteRawTag(202, 1); + output.WriteString(OptionalCord); } if (recursiveMessage_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RecursiveMessage); + output.WriteRawTag(218, 1); + output.WriteMessage(RecursiveMessage); } - size += repeatedInt32_.CalculateSize(_repeated_repeatedInt32_codec); - size += repeatedInt64_.CalculateSize(_repeated_repeatedInt64_codec); - size += repeatedUint32_.CalculateSize(_repeated_repeatedUint32_codec); - size += repeatedUint64_.CalculateSize(_repeated_repeatedUint64_codec); - size += repeatedSint32_.CalculateSize(_repeated_repeatedSint32_codec); - size += repeatedSint64_.CalculateSize(_repeated_repeatedSint64_codec); - size += repeatedFixed32_.CalculateSize(_repeated_repeatedFixed32_codec); - size += repeatedFixed64_.CalculateSize(_repeated_repeatedFixed64_codec); - size += repeatedSfixed32_.CalculateSize(_repeated_repeatedSfixed32_codec); - size += repeatedSfixed64_.CalculateSize(_repeated_repeatedSfixed64_codec); - size += repeatedFloat_.CalculateSize(_repeated_repeatedFloat_codec); - size += repeatedDouble_.CalculateSize(_repeated_repeatedDouble_codec); - size += repeatedBool_.CalculateSize(_repeated_repeatedBool_codec); - size += repeatedString_.CalculateSize(_repeated_repeatedString_codec); - size += repeatedBytes_.CalculateSize(_repeated_repeatedBytes_codec); - size += repeatedNestedMessage_.CalculateSize(_repeated_repeatedNestedMessage_codec); - size += repeatedForeignMessage_.CalculateSize(_repeated_repeatedForeignMessage_codec); - size += repeatedNestedEnum_.CalculateSize(_repeated_repeatedNestedEnum_codec); - size += repeatedForeignEnum_.CalculateSize(_repeated_repeatedForeignEnum_codec); - size += repeatedStringPiece_.CalculateSize(_repeated_repeatedStringPiece_codec); - size += repeatedCord_.CalculateSize(_repeated_repeatedCord_codec); - size += packedInt32_.CalculateSize(_repeated_packedInt32_codec); - size += packedInt64_.CalculateSize(_repeated_packedInt64_codec); - size += packedUint32_.CalculateSize(_repeated_packedUint32_codec); - size += packedUint64_.CalculateSize(_repeated_packedUint64_codec); - size += packedSint32_.CalculateSize(_repeated_packedSint32_codec); - size += packedSint64_.CalculateSize(_repeated_packedSint64_codec); - size += packedFixed32_.CalculateSize(_repeated_packedFixed32_codec); - size += packedFixed64_.CalculateSize(_repeated_packedFixed64_codec); - size += packedSfixed32_.CalculateSize(_repeated_packedSfixed32_codec); - size += packedSfixed64_.CalculateSize(_repeated_packedSfixed64_codec); - size += packedFloat_.CalculateSize(_repeated_packedFloat_codec); - size += packedDouble_.CalculateSize(_repeated_packedDouble_codec); - size += packedBool_.CalculateSize(_repeated_packedBool_codec); - size += packedNestedEnum_.CalculateSize(_repeated_packedNestedEnum_codec); - size += unpackedInt32_.CalculateSize(_repeated_unpackedInt32_codec); - size += unpackedInt64_.CalculateSize(_repeated_unpackedInt64_codec); - size += unpackedUint32_.CalculateSize(_repeated_unpackedUint32_codec); - size += unpackedUint64_.CalculateSize(_repeated_unpackedUint64_codec); - size += unpackedSint32_.CalculateSize(_repeated_unpackedSint32_codec); - size += unpackedSint64_.CalculateSize(_repeated_unpackedSint64_codec); - size += unpackedFixed32_.CalculateSize(_repeated_unpackedFixed32_codec); - size += unpackedFixed64_.CalculateSize(_repeated_unpackedFixed64_codec); - size += unpackedSfixed32_.CalculateSize(_repeated_unpackedSfixed32_codec); - size += unpackedSfixed64_.CalculateSize(_repeated_unpackedSfixed64_codec); - size += unpackedFloat_.CalculateSize(_repeated_unpackedFloat_codec); - size += unpackedDouble_.CalculateSize(_repeated_unpackedDouble_codec); - size += unpackedBool_.CalculateSize(_repeated_unpackedBool_codec); - size += unpackedNestedEnum_.CalculateSize(_repeated_unpackedNestedEnum_codec); - size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); - size += mapInt64Int64_.CalculateSize(_map_mapInt64Int64_codec); - size += mapUint32Uint32_.CalculateSize(_map_mapUint32Uint32_codec); - size += mapUint64Uint64_.CalculateSize(_map_mapUint64Uint64_codec); - size += mapSint32Sint32_.CalculateSize(_map_mapSint32Sint32_codec); - size += mapSint64Sint64_.CalculateSize(_map_mapSint64Sint64_codec); - size += mapFixed32Fixed32_.CalculateSize(_map_mapFixed32Fixed32_codec); - size += mapFixed64Fixed64_.CalculateSize(_map_mapFixed64Fixed64_codec); - size += mapSfixed32Sfixed32_.CalculateSize(_map_mapSfixed32Sfixed32_codec); - size += mapSfixed64Sfixed64_.CalculateSize(_map_mapSfixed64Sfixed64_codec); - size += mapInt32Float_.CalculateSize(_map_mapInt32Float_codec); - size += mapInt32Double_.CalculateSize(_map_mapInt32Double_codec); - size += mapBoolBool_.CalculateSize(_map_mapBoolBool_codec); - size += mapStringString_.CalculateSize(_map_mapStringString_codec); - size += mapStringBytes_.CalculateSize(_map_mapStringBytes_codec); - size += mapStringNestedMessage_.CalculateSize(_map_mapStringNestedMessage_codec); - size += mapStringForeignMessage_.CalculateSize(_map_mapStringForeignMessage_codec); - size += mapStringNestedEnum_.CalculateSize(_map_mapStringNestedEnum_codec); - size += mapStringForeignEnum_.CalculateSize(_map_mapStringForeignEnum_codec); + repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); + repeatedInt64_.WriteTo(ref output, _repeated_repeatedInt64_codec); + repeatedUint32_.WriteTo(ref output, _repeated_repeatedUint32_codec); + repeatedUint64_.WriteTo(ref output, _repeated_repeatedUint64_codec); + repeatedSint32_.WriteTo(ref output, _repeated_repeatedSint32_codec); + repeatedSint64_.WriteTo(ref output, _repeated_repeatedSint64_codec); + repeatedFixed32_.WriteTo(ref output, _repeated_repeatedFixed32_codec); + repeatedFixed64_.WriteTo(ref output, _repeated_repeatedFixed64_codec); + repeatedSfixed32_.WriteTo(ref output, _repeated_repeatedSfixed32_codec); + repeatedSfixed64_.WriteTo(ref output, _repeated_repeatedSfixed64_codec); + repeatedFloat_.WriteTo(ref output, _repeated_repeatedFloat_codec); + repeatedDouble_.WriteTo(ref output, _repeated_repeatedDouble_codec); + repeatedBool_.WriteTo(ref output, _repeated_repeatedBool_codec); + repeatedString_.WriteTo(ref output, _repeated_repeatedString_codec); + repeatedBytes_.WriteTo(ref output, _repeated_repeatedBytes_codec); + repeatedNestedMessage_.WriteTo(ref output, _repeated_repeatedNestedMessage_codec); + repeatedForeignMessage_.WriteTo(ref output, _repeated_repeatedForeignMessage_codec); + repeatedNestedEnum_.WriteTo(ref output, _repeated_repeatedNestedEnum_codec); + repeatedForeignEnum_.WriteTo(ref output, _repeated_repeatedForeignEnum_codec); + repeatedStringPiece_.WriteTo(ref output, _repeated_repeatedStringPiece_codec); + repeatedCord_.WriteTo(ref output, _repeated_repeatedCord_codec); + mapInt32Int32_.WriteTo(ref output, _map_mapInt32Int32_codec); + mapInt64Int64_.WriteTo(ref output, _map_mapInt64Int64_codec); + mapUint32Uint32_.WriteTo(ref output, _map_mapUint32Uint32_codec); + mapUint64Uint64_.WriteTo(ref output, _map_mapUint64Uint64_codec); + mapSint32Sint32_.WriteTo(ref output, _map_mapSint32Sint32_codec); + mapSint64Sint64_.WriteTo(ref output, _map_mapSint64Sint64_codec); + mapFixed32Fixed32_.WriteTo(ref output, _map_mapFixed32Fixed32_codec); + mapFixed64Fixed64_.WriteTo(ref output, _map_mapFixed64Fixed64_codec); + mapSfixed32Sfixed32_.WriteTo(ref output, _map_mapSfixed32Sfixed32_codec); + mapSfixed64Sfixed64_.WriteTo(ref output, _map_mapSfixed64Sfixed64_codec); + mapInt32Float_.WriteTo(ref output, _map_mapInt32Float_codec); + mapInt32Double_.WriteTo(ref output, _map_mapInt32Double_codec); + mapBoolBool_.WriteTo(ref output, _map_mapBoolBool_codec); + mapStringString_.WriteTo(ref output, _map_mapStringString_codec); + mapStringBytes_.WriteTo(ref output, _map_mapStringBytes_codec); + mapStringNestedMessage_.WriteTo(ref output, _map_mapStringNestedMessage_codec); + mapStringForeignMessage_.WriteTo(ref output, _map_mapStringForeignMessage_codec); + mapStringNestedEnum_.WriteTo(ref output, _map_mapStringNestedEnum_codec); + mapStringForeignEnum_.WriteTo(ref output, _map_mapStringForeignEnum_codec); + packedInt32_.WriteTo(ref output, _repeated_packedInt32_codec); + packedInt64_.WriteTo(ref output, _repeated_packedInt64_codec); + packedUint32_.WriteTo(ref output, _repeated_packedUint32_codec); + packedUint64_.WriteTo(ref output, _repeated_packedUint64_codec); + packedSint32_.WriteTo(ref output, _repeated_packedSint32_codec); + packedSint64_.WriteTo(ref output, _repeated_packedSint64_codec); + packedFixed32_.WriteTo(ref output, _repeated_packedFixed32_codec); + packedFixed64_.WriteTo(ref output, _repeated_packedFixed64_codec); + packedSfixed32_.WriteTo(ref output, _repeated_packedSfixed32_codec); + packedSfixed64_.WriteTo(ref output, _repeated_packedSfixed64_codec); + packedFloat_.WriteTo(ref output, _repeated_packedFloat_codec); + packedDouble_.WriteTo(ref output, _repeated_packedDouble_codec); + packedBool_.WriteTo(ref output, _repeated_packedBool_codec); + packedNestedEnum_.WriteTo(ref output, _repeated_packedNestedEnum_codec); + unpackedInt32_.WriteTo(ref output, _repeated_unpackedInt32_codec); + unpackedInt64_.WriteTo(ref output, _repeated_unpackedInt64_codec); + unpackedUint32_.WriteTo(ref output, _repeated_unpackedUint32_codec); + unpackedUint64_.WriteTo(ref output, _repeated_unpackedUint64_codec); + unpackedSint32_.WriteTo(ref output, _repeated_unpackedSint32_codec); + unpackedSint64_.WriteTo(ref output, _repeated_unpackedSint64_codec); + unpackedFixed32_.WriteTo(ref output, _repeated_unpackedFixed32_codec); + unpackedFixed64_.WriteTo(ref output, _repeated_unpackedFixed64_codec); + unpackedSfixed32_.WriteTo(ref output, _repeated_unpackedSfixed32_codec); + unpackedSfixed64_.WriteTo(ref output, _repeated_unpackedSfixed64_codec); + unpackedFloat_.WriteTo(ref output, _repeated_unpackedFloat_codec); + unpackedDouble_.WriteTo(ref output, _repeated_unpackedDouble_codec); + unpackedBool_.WriteTo(ref output, _repeated_unpackedBool_codec); + unpackedNestedEnum_.WriteTo(ref output, _repeated_unpackedNestedEnum_codec); if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { - size += 2 + pb::CodedOutputStream.ComputeUInt32Size(OneofUint32); + output.WriteRawTag(248, 6); + output.WriteUInt32(OneofUint32); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OneofNestedMessage); + output.WriteRawTag(130, 7); + output.WriteMessage(OneofNestedMessage); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(OneofString); + output.WriteRawTag(138, 7); + output.WriteString(OneofString); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) { - size += 2 + pb::CodedOutputStream.ComputeBytesSize(OneofBytes); + output.WriteRawTag(146, 7); + output.WriteBytes(OneofBytes); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofBool) { - size += 2 + 1; + output.WriteRawTag(152, 7); + output.WriteBool(OneofBool); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint64) { - size += 2 + pb::CodedOutputStream.ComputeUInt64Size(OneofUint64); + output.WriteRawTag(160, 7); + output.WriteUInt64(OneofUint64); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofFloat) { - size += 2 + 4; + output.WriteRawTag(173, 7); + output.WriteFloat(OneofFloat); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofDouble) { - size += 2 + 8; + output.WriteRawTag(177, 7); + output.WriteDouble(OneofDouble); } if (oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) { - size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OneofEnum); + output.WriteRawTag(184, 7); + output.WriteEnum((int) OneofEnum); + } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue) { + output.WriteRawTag(192, 7); + output.WriteEnum((int) OneofNullValue); } if (optionalBoolWrapper_ != null) { - size += _single_optionalBoolWrapper_codec.CalculateSizeWithTag(OptionalBoolWrapper); + _single_optionalBoolWrapper_codec.WriteTagAndValue(ref output, OptionalBoolWrapper); } if (optionalInt32Wrapper_ != null) { - size += _single_optionalInt32Wrapper_codec.CalculateSizeWithTag(OptionalInt32Wrapper); + _single_optionalInt32Wrapper_codec.WriteTagAndValue(ref output, OptionalInt32Wrapper); } if (optionalInt64Wrapper_ != null) { - size += _single_optionalInt64Wrapper_codec.CalculateSizeWithTag(OptionalInt64Wrapper); + _single_optionalInt64Wrapper_codec.WriteTagAndValue(ref output, OptionalInt64Wrapper); } if (optionalUint32Wrapper_ != null) { - size += _single_optionalUint32Wrapper_codec.CalculateSizeWithTag(OptionalUint32Wrapper); + _single_optionalUint32Wrapper_codec.WriteTagAndValue(ref output, OptionalUint32Wrapper); } if (optionalUint64Wrapper_ != null) { - size += _single_optionalUint64Wrapper_codec.CalculateSizeWithTag(OptionalUint64Wrapper); + _single_optionalUint64Wrapper_codec.WriteTagAndValue(ref output, OptionalUint64Wrapper); } if (optionalFloatWrapper_ != null) { - size += _single_optionalFloatWrapper_codec.CalculateSizeWithTag(OptionalFloatWrapper); + _single_optionalFloatWrapper_codec.WriteTagAndValue(ref output, OptionalFloatWrapper); } if (optionalDoubleWrapper_ != null) { - size += _single_optionalDoubleWrapper_codec.CalculateSizeWithTag(OptionalDoubleWrapper); + _single_optionalDoubleWrapper_codec.WriteTagAndValue(ref output, OptionalDoubleWrapper); } if (optionalStringWrapper_ != null) { - size += _single_optionalStringWrapper_codec.CalculateSizeWithTag(OptionalStringWrapper); + _single_optionalStringWrapper_codec.WriteTagAndValue(ref output, OptionalStringWrapper); } if (optionalBytesWrapper_ != null) { - size += _single_optionalBytesWrapper_codec.CalculateSizeWithTag(OptionalBytesWrapper); - } - size += repeatedBoolWrapper_.CalculateSize(_repeated_repeatedBoolWrapper_codec); - size += repeatedInt32Wrapper_.CalculateSize(_repeated_repeatedInt32Wrapper_codec); - size += repeatedInt64Wrapper_.CalculateSize(_repeated_repeatedInt64Wrapper_codec); - size += repeatedUint32Wrapper_.CalculateSize(_repeated_repeatedUint32Wrapper_codec); - size += repeatedUint64Wrapper_.CalculateSize(_repeated_repeatedUint64Wrapper_codec); - size += repeatedFloatWrapper_.CalculateSize(_repeated_repeatedFloatWrapper_codec); - size += repeatedDoubleWrapper_.CalculateSize(_repeated_repeatedDoubleWrapper_codec); - size += repeatedStringWrapper_.CalculateSize(_repeated_repeatedStringWrapper_codec); - size += repeatedBytesWrapper_.CalculateSize(_repeated_repeatedBytesWrapper_codec); + _single_optionalBytesWrapper_codec.WriteTagAndValue(ref output, OptionalBytesWrapper); + } + repeatedBoolWrapper_.WriteTo(ref output, _repeated_repeatedBoolWrapper_codec); + repeatedInt32Wrapper_.WriteTo(ref output, _repeated_repeatedInt32Wrapper_codec); + repeatedInt64Wrapper_.WriteTo(ref output, _repeated_repeatedInt64Wrapper_codec); + repeatedUint32Wrapper_.WriteTo(ref output, _repeated_repeatedUint32Wrapper_codec); + repeatedUint64Wrapper_.WriteTo(ref output, _repeated_repeatedUint64Wrapper_codec); + repeatedFloatWrapper_.WriteTo(ref output, _repeated_repeatedFloatWrapper_codec); + repeatedDoubleWrapper_.WriteTo(ref output, _repeated_repeatedDoubleWrapper_codec); + repeatedStringWrapper_.WriteTo(ref output, _repeated_repeatedStringWrapper_codec); + repeatedBytesWrapper_.WriteTo(ref output, _repeated_repeatedBytesWrapper_codec); if (optionalDuration_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalDuration); + output.WriteRawTag(234, 18); + output.WriteMessage(OptionalDuration); } if (optionalTimestamp_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalTimestamp); + output.WriteRawTag(242, 18); + output.WriteMessage(OptionalTimestamp); } if (optionalFieldMask_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalFieldMask); + output.WriteRawTag(250, 18); + output.WriteMessage(OptionalFieldMask); } if (optionalStruct_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalStruct); + output.WriteRawTag(130, 19); + output.WriteMessage(OptionalStruct); } if (optionalAny_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalAny); + output.WriteRawTag(138, 19); + output.WriteMessage(OptionalAny); } if (optionalValue_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalValue); + output.WriteRawTag(146, 19); + output.WriteMessage(OptionalValue); } - size += repeatedDuration_.CalculateSize(_repeated_repeatedDuration_codec); - size += repeatedTimestamp_.CalculateSize(_repeated_repeatedTimestamp_codec); - size += repeatedFieldmask_.CalculateSize(_repeated_repeatedFieldmask_codec); - size += repeatedStruct_.CalculateSize(_repeated_repeatedStruct_codec); - size += repeatedAny_.CalculateSize(_repeated_repeatedAny_codec); - size += repeatedValue_.CalculateSize(_repeated_repeatedValue_codec); - size += repeatedListValue_.CalculateSize(_repeated_repeatedListValue_codec); + if (OptionalNullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { + output.WriteRawTag(152, 19); + output.WriteEnum((int) OptionalNullValue); + } + repeatedDuration_.WriteTo(ref output, _repeated_repeatedDuration_codec); + repeatedTimestamp_.WriteTo(ref output, _repeated_repeatedTimestamp_codec); + repeatedFieldmask_.WriteTo(ref output, _repeated_repeatedFieldmask_codec); + repeatedAny_.WriteTo(ref output, _repeated_repeatedAny_codec); + repeatedValue_.WriteTo(ref output, _repeated_repeatedValue_codec); + repeatedListValue_.WriteTo(ref output, _repeated_repeatedListValue_codec); + repeatedStruct_.WriteTo(ref output, _repeated_repeatedStruct_codec); if (Fieldname1 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(Fieldname1); + output.WriteRawTag(136, 25); + output.WriteInt32(Fieldname1); } if (FieldName2 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName2); + output.WriteRawTag(144, 25); + output.WriteInt32(FieldName2); } if (FieldName3 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName3); + output.WriteRawTag(152, 25); + output.WriteInt32(FieldName3); } if (FieldName4 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName4); + output.WriteRawTag(160, 25); + output.WriteInt32(FieldName4); } if (Field0Name5 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field0Name5); + output.WriteRawTag(168, 25); + output.WriteInt32(Field0Name5); } if (Field0Name6 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field0Name6); + output.WriteRawTag(176, 25); + output.WriteInt32(Field0Name6); } if (FieldName7 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName7); + output.WriteRawTag(184, 25); + output.WriteInt32(FieldName7); } if (FieldName8 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName8); + output.WriteRawTag(192, 25); + output.WriteInt32(FieldName8); } if (FieldName9 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName9); + output.WriteRawTag(200, 25); + output.WriteInt32(FieldName9); } if (FieldName10 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName10); - } + output.WriteRawTag(208, 25); + output.WriteInt32(FieldName10); + } if (FIELDNAME11 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FIELDNAME11); + output.WriteRawTag(216, 25); + output.WriteInt32(FIELDNAME11); } if (FIELDName12 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FIELDName12); + output.WriteRawTag(224, 25); + output.WriteInt32(FIELDName12); } if (FieldName13 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName13); + output.WriteRawTag(232, 25); + output.WriteInt32(FieldName13); } if (FieldName14 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName14); + output.WriteRawTag(240, 25); + output.WriteInt32(FieldName14); } if (FieldName15 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName15); + output.WriteRawTag(248, 25); + output.WriteInt32(FieldName15); } if (FieldName16 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName16); + output.WriteRawTag(128, 26); + output.WriteInt32(FieldName16); } if (FieldName17 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName17); + output.WriteRawTag(136, 26); + output.WriteInt32(FieldName17); } if (FieldName18 != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName18); + output.WriteRawTag(144, 26); + output.WriteInt32(FieldName18); } if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); + _unknownFields.WriteTo(ref output); } - return size; } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TestAllTypesProto3 other) { - if (other == null) { - return; + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (OptionalInt32 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32); } - if (other.OptionalInt32 != 0) { - OptionalInt32 = other.OptionalInt32; + if (OptionalInt64 != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OptionalInt64); } - if (other.OptionalInt64 != 0L) { - OptionalInt64 = other.OptionalInt64; + if (OptionalUint32 != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(OptionalUint32); } - if (other.OptionalUint32 != 0) { - OptionalUint32 = other.OptionalUint32; + if (OptionalUint64 != 0UL) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(OptionalUint64); } - if (other.OptionalUint64 != 0UL) { - OptionalUint64 = other.OptionalUint64; + if (OptionalSint32 != 0) { + size += 1 + pb::CodedOutputStream.ComputeSInt32Size(OptionalSint32); } - if (other.OptionalSint32 != 0) { - OptionalSint32 = other.OptionalSint32; + if (OptionalSint64 != 0L) { + size += 1 + pb::CodedOutputStream.ComputeSInt64Size(OptionalSint64); } - if (other.OptionalSint64 != 0L) { - OptionalSint64 = other.OptionalSint64; + if (OptionalFixed32 != 0) { + size += 1 + 4; } - if (other.OptionalFixed32 != 0) { - OptionalFixed32 = other.OptionalFixed32; + if (OptionalFixed64 != 0UL) { + size += 1 + 8; } - if (other.OptionalFixed64 != 0UL) { - OptionalFixed64 = other.OptionalFixed64; + if (OptionalSfixed32 != 0) { + size += 1 + 4; } - if (other.OptionalSfixed32 != 0) { - OptionalSfixed32 = other.OptionalSfixed32; + if (OptionalSfixed64 != 0L) { + size += 1 + 8; } - if (other.OptionalSfixed64 != 0L) { - OptionalSfixed64 = other.OptionalSfixed64; + if (OptionalFloat != 0F) { + size += 1 + 4; } - if (other.OptionalFloat != 0F) { - OptionalFloat = other.OptionalFloat; + if (OptionalDouble != 0D) { + size += 1 + 8; } - if (other.OptionalDouble != 0D) { - OptionalDouble = other.OptionalDouble; + if (OptionalBool != false) { + size += 1 + 1; } - if (other.OptionalBool != false) { - OptionalBool = other.OptionalBool; + if (OptionalString.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OptionalString); } - if (other.OptionalString.Length != 0) { - OptionalString = other.OptionalString; + if (OptionalBytes.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(OptionalBytes); } - if (other.OptionalBytes.Length != 0) { - OptionalBytes = other.OptionalBytes; + if (optionalNestedMessage_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); } - if (other.optionalNestedMessage_ != null) { - if (optionalNestedMessage_ == null) { - OptionalNestedMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); - } - OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); + if (optionalForeignMessage_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalForeignMessage); } - if (other.optionalForeignMessage_ != null) { - if (optionalForeignMessage_ == null) { - OptionalForeignMessage = new global::ProtobufTestMessages.Proto3.ForeignMessage(); - } - OptionalForeignMessage.MergeFrom(other.OptionalForeignMessage); + if (OptionalNestedEnum != global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalNestedEnum); } - if (other.OptionalNestedEnum != global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo) { - OptionalNestedEnum = other.OptionalNestedEnum; + if (OptionalForeignEnum != global::ProtobufTestMessages.Proto3.ForeignEnum.ForeignFoo) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalForeignEnum); } - if (other.OptionalForeignEnum != global::ProtobufTestMessages.Proto3.ForeignEnum.ForeignFoo) { - OptionalForeignEnum = other.OptionalForeignEnum; + if (OptionalAliasedEnum != global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum.AliasFoo) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalAliasedEnum); } - if (other.OptionalAliasedEnum != global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum.AliasFoo) { - OptionalAliasedEnum = other.OptionalAliasedEnum; + if (OptionalStringPiece.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalStringPiece); } - if (other.OptionalStringPiece.Length != 0) { - OptionalStringPiece = other.OptionalStringPiece; + if (OptionalCord.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalCord); } - if (other.OptionalCord.Length != 0) { - OptionalCord = other.OptionalCord; + if (recursiveMessage_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(RecursiveMessage); } - if (other.recursiveMessage_ != null) { - if (recursiveMessage_ == null) { - RecursiveMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); - } - RecursiveMessage.MergeFrom(other.RecursiveMessage); + size += repeatedInt32_.CalculateSize(_repeated_repeatedInt32_codec); + size += repeatedInt64_.CalculateSize(_repeated_repeatedInt64_codec); + size += repeatedUint32_.CalculateSize(_repeated_repeatedUint32_codec); + size += repeatedUint64_.CalculateSize(_repeated_repeatedUint64_codec); + size += repeatedSint32_.CalculateSize(_repeated_repeatedSint32_codec); + size += repeatedSint64_.CalculateSize(_repeated_repeatedSint64_codec); + size += repeatedFixed32_.CalculateSize(_repeated_repeatedFixed32_codec); + size += repeatedFixed64_.CalculateSize(_repeated_repeatedFixed64_codec); + size += repeatedSfixed32_.CalculateSize(_repeated_repeatedSfixed32_codec); + size += repeatedSfixed64_.CalculateSize(_repeated_repeatedSfixed64_codec); + size += repeatedFloat_.CalculateSize(_repeated_repeatedFloat_codec); + size += repeatedDouble_.CalculateSize(_repeated_repeatedDouble_codec); + size += repeatedBool_.CalculateSize(_repeated_repeatedBool_codec); + size += repeatedString_.CalculateSize(_repeated_repeatedString_codec); + size += repeatedBytes_.CalculateSize(_repeated_repeatedBytes_codec); + size += repeatedNestedMessage_.CalculateSize(_repeated_repeatedNestedMessage_codec); + size += repeatedForeignMessage_.CalculateSize(_repeated_repeatedForeignMessage_codec); + size += repeatedNestedEnum_.CalculateSize(_repeated_repeatedNestedEnum_codec); + size += repeatedForeignEnum_.CalculateSize(_repeated_repeatedForeignEnum_codec); + size += repeatedStringPiece_.CalculateSize(_repeated_repeatedStringPiece_codec); + size += repeatedCord_.CalculateSize(_repeated_repeatedCord_codec); + size += packedInt32_.CalculateSize(_repeated_packedInt32_codec); + size += packedInt64_.CalculateSize(_repeated_packedInt64_codec); + size += packedUint32_.CalculateSize(_repeated_packedUint32_codec); + size += packedUint64_.CalculateSize(_repeated_packedUint64_codec); + size += packedSint32_.CalculateSize(_repeated_packedSint32_codec); + size += packedSint64_.CalculateSize(_repeated_packedSint64_codec); + size += packedFixed32_.CalculateSize(_repeated_packedFixed32_codec); + size += packedFixed64_.CalculateSize(_repeated_packedFixed64_codec); + size += packedSfixed32_.CalculateSize(_repeated_packedSfixed32_codec); + size += packedSfixed64_.CalculateSize(_repeated_packedSfixed64_codec); + size += packedFloat_.CalculateSize(_repeated_packedFloat_codec); + size += packedDouble_.CalculateSize(_repeated_packedDouble_codec); + size += packedBool_.CalculateSize(_repeated_packedBool_codec); + size += packedNestedEnum_.CalculateSize(_repeated_packedNestedEnum_codec); + size += unpackedInt32_.CalculateSize(_repeated_unpackedInt32_codec); + size += unpackedInt64_.CalculateSize(_repeated_unpackedInt64_codec); + size += unpackedUint32_.CalculateSize(_repeated_unpackedUint32_codec); + size += unpackedUint64_.CalculateSize(_repeated_unpackedUint64_codec); + size += unpackedSint32_.CalculateSize(_repeated_unpackedSint32_codec); + size += unpackedSint64_.CalculateSize(_repeated_unpackedSint64_codec); + size += unpackedFixed32_.CalculateSize(_repeated_unpackedFixed32_codec); + size += unpackedFixed64_.CalculateSize(_repeated_unpackedFixed64_codec); + size += unpackedSfixed32_.CalculateSize(_repeated_unpackedSfixed32_codec); + size += unpackedSfixed64_.CalculateSize(_repeated_unpackedSfixed64_codec); + size += unpackedFloat_.CalculateSize(_repeated_unpackedFloat_codec); + size += unpackedDouble_.CalculateSize(_repeated_unpackedDouble_codec); + size += unpackedBool_.CalculateSize(_repeated_unpackedBool_codec); + size += unpackedNestedEnum_.CalculateSize(_repeated_unpackedNestedEnum_codec); + size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); + size += mapInt64Int64_.CalculateSize(_map_mapInt64Int64_codec); + size += mapUint32Uint32_.CalculateSize(_map_mapUint32Uint32_codec); + size += mapUint64Uint64_.CalculateSize(_map_mapUint64Uint64_codec); + size += mapSint32Sint32_.CalculateSize(_map_mapSint32Sint32_codec); + size += mapSint64Sint64_.CalculateSize(_map_mapSint64Sint64_codec); + size += mapFixed32Fixed32_.CalculateSize(_map_mapFixed32Fixed32_codec); + size += mapFixed64Fixed64_.CalculateSize(_map_mapFixed64Fixed64_codec); + size += mapSfixed32Sfixed32_.CalculateSize(_map_mapSfixed32Sfixed32_codec); + size += mapSfixed64Sfixed64_.CalculateSize(_map_mapSfixed64Sfixed64_codec); + size += mapInt32Float_.CalculateSize(_map_mapInt32Float_codec); + size += mapInt32Double_.CalculateSize(_map_mapInt32Double_codec); + size += mapBoolBool_.CalculateSize(_map_mapBoolBool_codec); + size += mapStringString_.CalculateSize(_map_mapStringString_codec); + size += mapStringBytes_.CalculateSize(_map_mapStringBytes_codec); + size += mapStringNestedMessage_.CalculateSize(_map_mapStringNestedMessage_codec); + size += mapStringForeignMessage_.CalculateSize(_map_mapStringForeignMessage_codec); + size += mapStringNestedEnum_.CalculateSize(_map_mapStringNestedEnum_codec); + size += mapStringForeignEnum_.CalculateSize(_map_mapStringForeignEnum_codec); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { + size += 2 + pb::CodedOutputStream.ComputeUInt32Size(OneofUint32); } - repeatedInt32_.Add(other.repeatedInt32_); - repeatedInt64_.Add(other.repeatedInt64_); - repeatedUint32_.Add(other.repeatedUint32_); - repeatedUint64_.Add(other.repeatedUint64_); - repeatedSint32_.Add(other.repeatedSint32_); - repeatedSint64_.Add(other.repeatedSint64_); - repeatedFixed32_.Add(other.repeatedFixed32_); - repeatedFixed64_.Add(other.repeatedFixed64_); - repeatedSfixed32_.Add(other.repeatedSfixed32_); - repeatedSfixed64_.Add(other.repeatedSfixed64_); - repeatedFloat_.Add(other.repeatedFloat_); - repeatedDouble_.Add(other.repeatedDouble_); - repeatedBool_.Add(other.repeatedBool_); - repeatedString_.Add(other.repeatedString_); - repeatedBytes_.Add(other.repeatedBytes_); - repeatedNestedMessage_.Add(other.repeatedNestedMessage_); - repeatedForeignMessage_.Add(other.repeatedForeignMessage_); - repeatedNestedEnum_.Add(other.repeatedNestedEnum_); - repeatedForeignEnum_.Add(other.repeatedForeignEnum_); - repeatedStringPiece_.Add(other.repeatedStringPiece_); - repeatedCord_.Add(other.repeatedCord_); - packedInt32_.Add(other.packedInt32_); - packedInt64_.Add(other.packedInt64_); - packedUint32_.Add(other.packedUint32_); - packedUint64_.Add(other.packedUint64_); - packedSint32_.Add(other.packedSint32_); - packedSint64_.Add(other.packedSint64_); - packedFixed32_.Add(other.packedFixed32_); - packedFixed64_.Add(other.packedFixed64_); - packedSfixed32_.Add(other.packedSfixed32_); - packedSfixed64_.Add(other.packedSfixed64_); - packedFloat_.Add(other.packedFloat_); - packedDouble_.Add(other.packedDouble_); - packedBool_.Add(other.packedBool_); - packedNestedEnum_.Add(other.packedNestedEnum_); - unpackedInt32_.Add(other.unpackedInt32_); - unpackedInt64_.Add(other.unpackedInt64_); - unpackedUint32_.Add(other.unpackedUint32_); - unpackedUint64_.Add(other.unpackedUint64_); - unpackedSint32_.Add(other.unpackedSint32_); - unpackedSint64_.Add(other.unpackedSint64_); - unpackedFixed32_.Add(other.unpackedFixed32_); - unpackedFixed64_.Add(other.unpackedFixed64_); - unpackedSfixed32_.Add(other.unpackedSfixed32_); - unpackedSfixed64_.Add(other.unpackedSfixed64_); - unpackedFloat_.Add(other.unpackedFloat_); - unpackedDouble_.Add(other.unpackedDouble_); - unpackedBool_.Add(other.unpackedBool_); - unpackedNestedEnum_.Add(other.unpackedNestedEnum_); - mapInt32Int32_.Add(other.mapInt32Int32_); - mapInt64Int64_.Add(other.mapInt64Int64_); - mapUint32Uint32_.Add(other.mapUint32Uint32_); - mapUint64Uint64_.Add(other.mapUint64Uint64_); - mapSint32Sint32_.Add(other.mapSint32Sint32_); - mapSint64Sint64_.Add(other.mapSint64Sint64_); - mapFixed32Fixed32_.Add(other.mapFixed32Fixed32_); - mapFixed64Fixed64_.Add(other.mapFixed64Fixed64_); - mapSfixed32Sfixed32_.Add(other.mapSfixed32Sfixed32_); - mapSfixed64Sfixed64_.Add(other.mapSfixed64Sfixed64_); - mapInt32Float_.Add(other.mapInt32Float_); - mapInt32Double_.Add(other.mapInt32Double_); - mapBoolBool_.Add(other.mapBoolBool_); - mapStringString_.Add(other.mapStringString_); - mapStringBytes_.Add(other.mapStringBytes_); - mapStringNestedMessage_.Add(other.mapStringNestedMessage_); - mapStringForeignMessage_.Add(other.mapStringForeignMessage_); - mapStringNestedEnum_.Add(other.mapStringNestedEnum_); - mapStringForeignEnum_.Add(other.mapStringForeignEnum_); - if (other.optionalBoolWrapper_ != null) { - if (optionalBoolWrapper_ == null || other.OptionalBoolWrapper != false) { - OptionalBoolWrapper = other.OptionalBoolWrapper; - } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OneofNestedMessage); } - if (other.optionalInt32Wrapper_ != null) { - if (optionalInt32Wrapper_ == null || other.OptionalInt32Wrapper != 0) { - OptionalInt32Wrapper = other.OptionalInt32Wrapper; - } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(OneofString); } - if (other.optionalInt64Wrapper_ != null) { - if (optionalInt64Wrapper_ == null || other.OptionalInt64Wrapper != 0L) { - OptionalInt64Wrapper = other.OptionalInt64Wrapper; - } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) { + size += 2 + pb::CodedOutputStream.ComputeBytesSize(OneofBytes); } - if (other.optionalUint32Wrapper_ != null) { - if (optionalUint32Wrapper_ == null || other.OptionalUint32Wrapper != 0) { - OptionalUint32Wrapper = other.OptionalUint32Wrapper; - } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBool) { + size += 2 + 1; } - if (other.optionalUint64Wrapper_ != null) { - if (optionalUint64Wrapper_ == null || other.OptionalUint64Wrapper != 0UL) { - OptionalUint64Wrapper = other.OptionalUint64Wrapper; - } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint64) { + size += 2 + pb::CodedOutputStream.ComputeUInt64Size(OneofUint64); } - if (other.optionalFloatWrapper_ != null) { - if (optionalFloatWrapper_ == null || other.OptionalFloatWrapper != 0F) { - OptionalFloatWrapper = other.OptionalFloatWrapper; - } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofFloat) { + size += 2 + 4; } - if (other.optionalDoubleWrapper_ != null) { - if (optionalDoubleWrapper_ == null || other.OptionalDoubleWrapper != 0D) { - OptionalDoubleWrapper = other.OptionalDoubleWrapper; - } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofDouble) { + size += 2 + 8; } - if (other.optionalStringWrapper_ != null) { - if (optionalStringWrapper_ == null || other.OptionalStringWrapper != "") { - OptionalStringWrapper = other.OptionalStringWrapper; - } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofEnum) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OneofEnum); } - if (other.optionalBytesWrapper_ != null) { - if (optionalBytesWrapper_ == null || other.OptionalBytesWrapper != pb::ByteString.Empty) { - OptionalBytesWrapper = other.OptionalBytesWrapper; - } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNullValue) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OneofNullValue); } - repeatedBoolWrapper_.Add(other.repeatedBoolWrapper_); - repeatedInt32Wrapper_.Add(other.repeatedInt32Wrapper_); - repeatedInt64Wrapper_.Add(other.repeatedInt64Wrapper_); - repeatedUint32Wrapper_.Add(other.repeatedUint32Wrapper_); - repeatedUint64Wrapper_.Add(other.repeatedUint64Wrapper_); - repeatedFloatWrapper_.Add(other.repeatedFloatWrapper_); - repeatedDoubleWrapper_.Add(other.repeatedDoubleWrapper_); - repeatedStringWrapper_.Add(other.repeatedStringWrapper_); - repeatedBytesWrapper_.Add(other.repeatedBytesWrapper_); - if (other.optionalDuration_ != null) { - if (optionalDuration_ == null) { - OptionalDuration = new global::Google.Protobuf.WellKnownTypes.Duration(); - } - OptionalDuration.MergeFrom(other.OptionalDuration); + if (optionalBoolWrapper_ != null) { + size += _single_optionalBoolWrapper_codec.CalculateSizeWithTag(OptionalBoolWrapper); } - if (other.optionalTimestamp_ != null) { - if (optionalTimestamp_ == null) { - OptionalTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); - } - OptionalTimestamp.MergeFrom(other.OptionalTimestamp); + if (optionalInt32Wrapper_ != null) { + size += _single_optionalInt32Wrapper_codec.CalculateSizeWithTag(OptionalInt32Wrapper); } - if (other.optionalFieldMask_ != null) { - if (optionalFieldMask_ == null) { - OptionalFieldMask = new global::Google.Protobuf.WellKnownTypes.FieldMask(); - } - OptionalFieldMask.MergeFrom(other.OptionalFieldMask); + if (optionalInt64Wrapper_ != null) { + size += _single_optionalInt64Wrapper_codec.CalculateSizeWithTag(OptionalInt64Wrapper); } - if (other.optionalStruct_ != null) { - if (optionalStruct_ == null) { - OptionalStruct = new global::Google.Protobuf.WellKnownTypes.Struct(); - } - OptionalStruct.MergeFrom(other.OptionalStruct); + if (optionalUint32Wrapper_ != null) { + size += _single_optionalUint32Wrapper_codec.CalculateSizeWithTag(OptionalUint32Wrapper); } - if (other.optionalAny_ != null) { - if (optionalAny_ == null) { - OptionalAny = new global::Google.Protobuf.WellKnownTypes.Any(); - } - OptionalAny.MergeFrom(other.OptionalAny); + if (optionalUint64Wrapper_ != null) { + size += _single_optionalUint64Wrapper_codec.CalculateSizeWithTag(OptionalUint64Wrapper); } - if (other.optionalValue_ != null) { - if (optionalValue_ == null) { - OptionalValue = new global::Google.Protobuf.WellKnownTypes.Value(); - } - OptionalValue.MergeFrom(other.OptionalValue); + if (optionalFloatWrapper_ != null) { + size += _single_optionalFloatWrapper_codec.CalculateSizeWithTag(OptionalFloatWrapper); } - repeatedDuration_.Add(other.repeatedDuration_); - repeatedTimestamp_.Add(other.repeatedTimestamp_); - repeatedFieldmask_.Add(other.repeatedFieldmask_); - repeatedStruct_.Add(other.repeatedStruct_); - repeatedAny_.Add(other.repeatedAny_); - repeatedValue_.Add(other.repeatedValue_); - repeatedListValue_.Add(other.repeatedListValue_); - if (other.Fieldname1 != 0) { - Fieldname1 = other.Fieldname1; + if (optionalDoubleWrapper_ != null) { + size += _single_optionalDoubleWrapper_codec.CalculateSizeWithTag(OptionalDoubleWrapper); } - if (other.FieldName2 != 0) { - FieldName2 = other.FieldName2; + if (optionalStringWrapper_ != null) { + size += _single_optionalStringWrapper_codec.CalculateSizeWithTag(OptionalStringWrapper); } - if (other.FieldName3 != 0) { - FieldName3 = other.FieldName3; + if (optionalBytesWrapper_ != null) { + size += _single_optionalBytesWrapper_codec.CalculateSizeWithTag(OptionalBytesWrapper); } - if (other.FieldName4 != 0) { - FieldName4 = other.FieldName4; + size += repeatedBoolWrapper_.CalculateSize(_repeated_repeatedBoolWrapper_codec); + size += repeatedInt32Wrapper_.CalculateSize(_repeated_repeatedInt32Wrapper_codec); + size += repeatedInt64Wrapper_.CalculateSize(_repeated_repeatedInt64Wrapper_codec); + size += repeatedUint32Wrapper_.CalculateSize(_repeated_repeatedUint32Wrapper_codec); + size += repeatedUint64Wrapper_.CalculateSize(_repeated_repeatedUint64Wrapper_codec); + size += repeatedFloatWrapper_.CalculateSize(_repeated_repeatedFloatWrapper_codec); + size += repeatedDoubleWrapper_.CalculateSize(_repeated_repeatedDoubleWrapper_codec); + size += repeatedStringWrapper_.CalculateSize(_repeated_repeatedStringWrapper_codec); + size += repeatedBytesWrapper_.CalculateSize(_repeated_repeatedBytesWrapper_codec); + if (optionalDuration_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalDuration); } - if (other.Field0Name5 != 0) { - Field0Name5 = other.Field0Name5; + if (optionalTimestamp_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalTimestamp); } - if (other.Field0Name6 != 0) { - Field0Name6 = other.Field0Name6; + if (optionalFieldMask_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalFieldMask); } - if (other.FieldName7 != 0) { - FieldName7 = other.FieldName7; + if (optionalStruct_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalStruct); } - if (other.FieldName8 != 0) { - FieldName8 = other.FieldName8; + if (optionalAny_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalAny); } - if (other.FieldName9 != 0) { - FieldName9 = other.FieldName9; + if (optionalValue_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalValue); } - if (other.FieldName10 != 0) { - FieldName10 = other.FieldName10; + if (OptionalNullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalNullValue); } - if (other.FIELDNAME11 != 0) { - FIELDNAME11 = other.FIELDNAME11; + size += repeatedDuration_.CalculateSize(_repeated_repeatedDuration_codec); + size += repeatedTimestamp_.CalculateSize(_repeated_repeatedTimestamp_codec); + size += repeatedFieldmask_.CalculateSize(_repeated_repeatedFieldmask_codec); + size += repeatedStruct_.CalculateSize(_repeated_repeatedStruct_codec); + size += repeatedAny_.CalculateSize(_repeated_repeatedAny_codec); + size += repeatedValue_.CalculateSize(_repeated_repeatedValue_codec); + size += repeatedListValue_.CalculateSize(_repeated_repeatedListValue_codec); + if (Fieldname1 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Fieldname1); } - if (other.FIELDName12 != 0) { - FIELDName12 = other.FIELDName12; + if (FieldName2 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName2); } - if (other.FieldName13 != 0) { - FieldName13 = other.FieldName13; + if (FieldName3 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName3); } - if (other.FieldName14 != 0) { - FieldName14 = other.FieldName14; + if (FieldName4 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName4); } - if (other.FieldName15 != 0) { - FieldName15 = other.FieldName15; + if (Field0Name5 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field0Name5); } - if (other.FieldName16 != 0) { - FieldName16 = other.FieldName16; + if (Field0Name6 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(Field0Name6); } - if (other.FieldName17 != 0) { - FieldName17 = other.FieldName17; + if (FieldName7 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName7); } - if (other.FieldName18 != 0) { - FieldName18 = other.FieldName18; + if (FieldName8 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName8); } - switch (other.OneofFieldCase) { - case OneofFieldOneofCase.OneofUint32: - OneofUint32 = other.OneofUint32; - break; - case OneofFieldOneofCase.OneofNestedMessage: - if (OneofNestedMessage == null) { - OneofNestedMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); + if (FieldName9 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName9); + } + if (FieldName10 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName10); + } + if (FIELDNAME11 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FIELDNAME11); + } + if (FIELDName12 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FIELDName12); + } + if (FieldName13 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName13); + } + if (FieldName14 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName14); + } + if (FieldName15 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName15); + } + if (FieldName16 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName16); + } + if (FieldName17 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName17); + } + if (FieldName18 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(FieldName18); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TestAllTypesProto3 other) { + if (other == null) { + return; + } + if (other.OptionalInt32 != 0) { + OptionalInt32 = other.OptionalInt32; + } + if (other.OptionalInt64 != 0L) { + OptionalInt64 = other.OptionalInt64; + } + if (other.OptionalUint32 != 0) { + OptionalUint32 = other.OptionalUint32; + } + if (other.OptionalUint64 != 0UL) { + OptionalUint64 = other.OptionalUint64; + } + if (other.OptionalSint32 != 0) { + OptionalSint32 = other.OptionalSint32; + } + if (other.OptionalSint64 != 0L) { + OptionalSint64 = other.OptionalSint64; + } + if (other.OptionalFixed32 != 0) { + OptionalFixed32 = other.OptionalFixed32; + } + if (other.OptionalFixed64 != 0UL) { + OptionalFixed64 = other.OptionalFixed64; + } + if (other.OptionalSfixed32 != 0) { + OptionalSfixed32 = other.OptionalSfixed32; + } + if (other.OptionalSfixed64 != 0L) { + OptionalSfixed64 = other.OptionalSfixed64; + } + if (other.OptionalFloat != 0F) { + OptionalFloat = other.OptionalFloat; + } + if (other.OptionalDouble != 0D) { + OptionalDouble = other.OptionalDouble; + } + if (other.OptionalBool != false) { + OptionalBool = other.OptionalBool; + } + if (other.OptionalString.Length != 0) { + OptionalString = other.OptionalString; + } + if (other.OptionalBytes.Length != 0) { + OptionalBytes = other.OptionalBytes; + } + if (other.optionalNestedMessage_ != null) { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); + } + OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); + } + if (other.optionalForeignMessage_ != null) { + if (optionalForeignMessage_ == null) { + OptionalForeignMessage = new global::ProtobufTestMessages.Proto3.ForeignMessage(); + } + OptionalForeignMessage.MergeFrom(other.OptionalForeignMessage); + } + if (other.OptionalNestedEnum != global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum.Foo) { + OptionalNestedEnum = other.OptionalNestedEnum; + } + if (other.OptionalForeignEnum != global::ProtobufTestMessages.Proto3.ForeignEnum.ForeignFoo) { + OptionalForeignEnum = other.OptionalForeignEnum; + } + if (other.OptionalAliasedEnum != global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum.AliasFoo) { + OptionalAliasedEnum = other.OptionalAliasedEnum; + } + if (other.OptionalStringPiece.Length != 0) { + OptionalStringPiece = other.OptionalStringPiece; + } + if (other.OptionalCord.Length != 0) { + OptionalCord = other.OptionalCord; + } + if (other.recursiveMessage_ != null) { + if (recursiveMessage_ == null) { + RecursiveMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); + } + RecursiveMessage.MergeFrom(other.RecursiveMessage); + } + repeatedInt32_.Add(other.repeatedInt32_); + repeatedInt64_.Add(other.repeatedInt64_); + repeatedUint32_.Add(other.repeatedUint32_); + repeatedUint64_.Add(other.repeatedUint64_); + repeatedSint32_.Add(other.repeatedSint32_); + repeatedSint64_.Add(other.repeatedSint64_); + repeatedFixed32_.Add(other.repeatedFixed32_); + repeatedFixed64_.Add(other.repeatedFixed64_); + repeatedSfixed32_.Add(other.repeatedSfixed32_); + repeatedSfixed64_.Add(other.repeatedSfixed64_); + repeatedFloat_.Add(other.repeatedFloat_); + repeatedDouble_.Add(other.repeatedDouble_); + repeatedBool_.Add(other.repeatedBool_); + repeatedString_.Add(other.repeatedString_); + repeatedBytes_.Add(other.repeatedBytes_); + repeatedNestedMessage_.Add(other.repeatedNestedMessage_); + repeatedForeignMessage_.Add(other.repeatedForeignMessage_); + repeatedNestedEnum_.Add(other.repeatedNestedEnum_); + repeatedForeignEnum_.Add(other.repeatedForeignEnum_); + repeatedStringPiece_.Add(other.repeatedStringPiece_); + repeatedCord_.Add(other.repeatedCord_); + packedInt32_.Add(other.packedInt32_); + packedInt64_.Add(other.packedInt64_); + packedUint32_.Add(other.packedUint32_); + packedUint64_.Add(other.packedUint64_); + packedSint32_.Add(other.packedSint32_); + packedSint64_.Add(other.packedSint64_); + packedFixed32_.Add(other.packedFixed32_); + packedFixed64_.Add(other.packedFixed64_); + packedSfixed32_.Add(other.packedSfixed32_); + packedSfixed64_.Add(other.packedSfixed64_); + packedFloat_.Add(other.packedFloat_); + packedDouble_.Add(other.packedDouble_); + packedBool_.Add(other.packedBool_); + packedNestedEnum_.Add(other.packedNestedEnum_); + unpackedInt32_.Add(other.unpackedInt32_); + unpackedInt64_.Add(other.unpackedInt64_); + unpackedUint32_.Add(other.unpackedUint32_); + unpackedUint64_.Add(other.unpackedUint64_); + unpackedSint32_.Add(other.unpackedSint32_); + unpackedSint64_.Add(other.unpackedSint64_); + unpackedFixed32_.Add(other.unpackedFixed32_); + unpackedFixed64_.Add(other.unpackedFixed64_); + unpackedSfixed32_.Add(other.unpackedSfixed32_); + unpackedSfixed64_.Add(other.unpackedSfixed64_); + unpackedFloat_.Add(other.unpackedFloat_); + unpackedDouble_.Add(other.unpackedDouble_); + unpackedBool_.Add(other.unpackedBool_); + unpackedNestedEnum_.Add(other.unpackedNestedEnum_); + mapInt32Int32_.Add(other.mapInt32Int32_); + mapInt64Int64_.Add(other.mapInt64Int64_); + mapUint32Uint32_.Add(other.mapUint32Uint32_); + mapUint64Uint64_.Add(other.mapUint64Uint64_); + mapSint32Sint32_.Add(other.mapSint32Sint32_); + mapSint64Sint64_.Add(other.mapSint64Sint64_); + mapFixed32Fixed32_.Add(other.mapFixed32Fixed32_); + mapFixed64Fixed64_.Add(other.mapFixed64Fixed64_); + mapSfixed32Sfixed32_.Add(other.mapSfixed32Sfixed32_); + mapSfixed64Sfixed64_.Add(other.mapSfixed64Sfixed64_); + mapInt32Float_.Add(other.mapInt32Float_); + mapInt32Double_.Add(other.mapInt32Double_); + mapBoolBool_.Add(other.mapBoolBool_); + mapStringString_.Add(other.mapStringString_); + mapStringBytes_.Add(other.mapStringBytes_); + mapStringNestedMessage_.Add(other.mapStringNestedMessage_); + mapStringForeignMessage_.Add(other.mapStringForeignMessage_); + mapStringNestedEnum_.Add(other.mapStringNestedEnum_); + mapStringForeignEnum_.Add(other.mapStringForeignEnum_); + if (other.optionalBoolWrapper_ != null) { + if (optionalBoolWrapper_ == null || other.OptionalBoolWrapper != false) { + OptionalBoolWrapper = other.OptionalBoolWrapper; + } + } + if (other.optionalInt32Wrapper_ != null) { + if (optionalInt32Wrapper_ == null || other.OptionalInt32Wrapper != 0) { + OptionalInt32Wrapper = other.OptionalInt32Wrapper; + } + } + if (other.optionalInt64Wrapper_ != null) { + if (optionalInt64Wrapper_ == null || other.OptionalInt64Wrapper != 0L) { + OptionalInt64Wrapper = other.OptionalInt64Wrapper; + } + } + if (other.optionalUint32Wrapper_ != null) { + if (optionalUint32Wrapper_ == null || other.OptionalUint32Wrapper != 0) { + OptionalUint32Wrapper = other.OptionalUint32Wrapper; + } + } + if (other.optionalUint64Wrapper_ != null) { + if (optionalUint64Wrapper_ == null || other.OptionalUint64Wrapper != 0UL) { + OptionalUint64Wrapper = other.OptionalUint64Wrapper; + } + } + if (other.optionalFloatWrapper_ != null) { + if (optionalFloatWrapper_ == null || other.OptionalFloatWrapper != 0F) { + OptionalFloatWrapper = other.OptionalFloatWrapper; + } + } + if (other.optionalDoubleWrapper_ != null) { + if (optionalDoubleWrapper_ == null || other.OptionalDoubleWrapper != 0D) { + OptionalDoubleWrapper = other.OptionalDoubleWrapper; + } + } + if (other.optionalStringWrapper_ != null) { + if (optionalStringWrapper_ == null || other.OptionalStringWrapper != "") { + OptionalStringWrapper = other.OptionalStringWrapper; + } + } + if (other.optionalBytesWrapper_ != null) { + if (optionalBytesWrapper_ == null || other.OptionalBytesWrapper != pb::ByteString.Empty) { + OptionalBytesWrapper = other.OptionalBytesWrapper; + } + } + repeatedBoolWrapper_.Add(other.repeatedBoolWrapper_); + repeatedInt32Wrapper_.Add(other.repeatedInt32Wrapper_); + repeatedInt64Wrapper_.Add(other.repeatedInt64Wrapper_); + repeatedUint32Wrapper_.Add(other.repeatedUint32Wrapper_); + repeatedUint64Wrapper_.Add(other.repeatedUint64Wrapper_); + repeatedFloatWrapper_.Add(other.repeatedFloatWrapper_); + repeatedDoubleWrapper_.Add(other.repeatedDoubleWrapper_); + repeatedStringWrapper_.Add(other.repeatedStringWrapper_); + repeatedBytesWrapper_.Add(other.repeatedBytesWrapper_); + if (other.optionalDuration_ != null) { + if (optionalDuration_ == null) { + OptionalDuration = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + OptionalDuration.MergeFrom(other.OptionalDuration); + } + if (other.optionalTimestamp_ != null) { + if (optionalTimestamp_ == null) { + OptionalTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + OptionalTimestamp.MergeFrom(other.OptionalTimestamp); + } + if (other.optionalFieldMask_ != null) { + if (optionalFieldMask_ == null) { + OptionalFieldMask = new global::Google.Protobuf.WellKnownTypes.FieldMask(); + } + OptionalFieldMask.MergeFrom(other.OptionalFieldMask); + } + if (other.optionalStruct_ != null) { + if (optionalStruct_ == null) { + OptionalStruct = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + OptionalStruct.MergeFrom(other.OptionalStruct); + } + if (other.optionalAny_ != null) { + if (optionalAny_ == null) { + OptionalAny = new global::Google.Protobuf.WellKnownTypes.Any(); + } + OptionalAny.MergeFrom(other.OptionalAny); + } + if (other.optionalValue_ != null) { + if (optionalValue_ == null) { + OptionalValue = new global::Google.Protobuf.WellKnownTypes.Value(); + } + OptionalValue.MergeFrom(other.OptionalValue); + } + if (other.OptionalNullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { + OptionalNullValue = other.OptionalNullValue; + } + repeatedDuration_.Add(other.repeatedDuration_); + repeatedTimestamp_.Add(other.repeatedTimestamp_); + repeatedFieldmask_.Add(other.repeatedFieldmask_); + repeatedStruct_.Add(other.repeatedStruct_); + repeatedAny_.Add(other.repeatedAny_); + repeatedValue_.Add(other.repeatedValue_); + repeatedListValue_.Add(other.repeatedListValue_); + if (other.Fieldname1 != 0) { + Fieldname1 = other.Fieldname1; + } + if (other.FieldName2 != 0) { + FieldName2 = other.FieldName2; + } + if (other.FieldName3 != 0) { + FieldName3 = other.FieldName3; + } + if (other.FieldName4 != 0) { + FieldName4 = other.FieldName4; + } + if (other.Field0Name5 != 0) { + Field0Name5 = other.Field0Name5; + } + if (other.Field0Name6 != 0) { + Field0Name6 = other.Field0Name6; + } + if (other.FieldName7 != 0) { + FieldName7 = other.FieldName7; + } + if (other.FieldName8 != 0) { + FieldName8 = other.FieldName8; + } + if (other.FieldName9 != 0) { + FieldName9 = other.FieldName9; + } + if (other.FieldName10 != 0) { + FieldName10 = other.FieldName10; + } + if (other.FIELDNAME11 != 0) { + FIELDNAME11 = other.FIELDNAME11; + } + if (other.FIELDName12 != 0) { + FIELDName12 = other.FIELDName12; + } + if (other.FieldName13 != 0) { + FieldName13 = other.FieldName13; + } + if (other.FieldName14 != 0) { + FieldName14 = other.FieldName14; + } + if (other.FieldName15 != 0) { + FieldName15 = other.FieldName15; + } + if (other.FieldName16 != 0) { + FieldName16 = other.FieldName16; + } + if (other.FieldName17 != 0) { + FieldName17 = other.FieldName17; + } + if (other.FieldName18 != 0) { + FieldName18 = other.FieldName18; + } + switch (other.OneofFieldCase) { + case OneofFieldOneofCase.OneofUint32: + OneofUint32 = other.OneofUint32; + break; + case OneofFieldOneofCase.OneofNestedMessage: + if (OneofNestedMessage == null) { + OneofNestedMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); + } + OneofNestedMessage.MergeFrom(other.OneofNestedMessage); + break; + case OneofFieldOneofCase.OneofString: + OneofString = other.OneofString; + break; + case OneofFieldOneofCase.OneofBytes: + OneofBytes = other.OneofBytes; + break; + case OneofFieldOneofCase.OneofBool: + OneofBool = other.OneofBool; + break; + case OneofFieldOneofCase.OneofUint64: + OneofUint64 = other.OneofUint64; + break; + case OneofFieldOneofCase.OneofFloat: + OneofFloat = other.OneofFloat; + break; + case OneofFieldOneofCase.OneofDouble: + OneofDouble = other.OneofDouble; + break; + case OneofFieldOneofCase.OneofEnum: + OneofEnum = other.OneofEnum; + break; + case OneofFieldOneofCase.OneofNullValue: + OneofNullValue = other.OneofNullValue; + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 16: { + OptionalInt64 = input.ReadInt64(); + break; + } + case 24: { + OptionalUint32 = input.ReadUInt32(); + break; + } + case 32: { + OptionalUint64 = input.ReadUInt64(); + break; + } + case 40: { + OptionalSint32 = input.ReadSInt32(); + break; + } + case 48: { + OptionalSint64 = input.ReadSInt64(); + break; + } + case 61: { + OptionalFixed32 = input.ReadFixed32(); + break; + } + case 65: { + OptionalFixed64 = input.ReadFixed64(); + break; + } + case 77: { + OptionalSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + OptionalSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + OptionalFloat = input.ReadFloat(); + break; + } + case 97: { + OptionalDouble = input.ReadDouble(); + break; + } + case 104: { + OptionalBool = input.ReadBool(); + break; + } + case 114: { + OptionalString = input.ReadString(); + break; + } + case 122: { + OptionalBytes = input.ReadBytes(); + break; + } + case 146: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + case 154: { + if (optionalForeignMessage_ == null) { + OptionalForeignMessage = new global::ProtobufTestMessages.Proto3.ForeignMessage(); + } + input.ReadMessage(OptionalForeignMessage); + break; + } + case 168: { + OptionalNestedEnum = (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + OptionalForeignEnum = (global::ProtobufTestMessages.Proto3.ForeignEnum) input.ReadEnum(); + break; + } + case 184: { + OptionalAliasedEnum = (global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.AliasedEnum) input.ReadEnum(); + break; + } + case 194: { + OptionalStringPiece = input.ReadString(); + break; + } + case 202: { + OptionalCord = input.ReadString(); + break; + } + case 218: { + if (recursiveMessage_ == null) { + RecursiveMessage = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); + } + input.ReadMessage(RecursiveMessage); + break; + } + case 250: + case 248: { + repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + break; + } + case 258: + case 256: { + repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec); + break; + } + case 266: + case 264: { + repeatedUint32_.AddEntriesFrom(input, _repeated_repeatedUint32_codec); + break; + } + case 274: + case 272: { + repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec); + break; + } + case 282: + case 280: { + repeatedSint32_.AddEntriesFrom(input, _repeated_repeatedSint32_codec); + break; + } + case 290: + case 288: { + repeatedSint64_.AddEntriesFrom(input, _repeated_repeatedSint64_codec); + break; + } + case 298: + case 301: { + repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec); + break; + } + case 306: + case 305: { + repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec); + break; + } + case 314: + case 317: { + repeatedSfixed32_.AddEntriesFrom(input, _repeated_repeatedSfixed32_codec); + break; + } + case 322: + case 321: { + repeatedSfixed64_.AddEntriesFrom(input, _repeated_repeatedSfixed64_codec); + break; + } + case 330: + case 333: { + repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec); + break; + } + case 338: + case 337: { + repeatedDouble_.AddEntriesFrom(input, _repeated_repeatedDouble_codec); + break; + } + case 346: + case 344: { + repeatedBool_.AddEntriesFrom(input, _repeated_repeatedBool_codec); + break; + } + case 354: { + repeatedString_.AddEntriesFrom(input, _repeated_repeatedString_codec); + break; + } + case 362: { + repeatedBytes_.AddEntriesFrom(input, _repeated_repeatedBytes_codec); + break; + } + case 386: { + repeatedNestedMessage_.AddEntriesFrom(input, _repeated_repeatedNestedMessage_codec); + break; + } + case 394: { + repeatedForeignMessage_.AddEntriesFrom(input, _repeated_repeatedForeignMessage_codec); + break; + } + case 410: + case 408: { + repeatedNestedEnum_.AddEntriesFrom(input, _repeated_repeatedNestedEnum_codec); + break; + } + case 418: + case 416: { + repeatedForeignEnum_.AddEntriesFrom(input, _repeated_repeatedForeignEnum_codec); + break; + } + case 434: { + repeatedStringPiece_.AddEntriesFrom(input, _repeated_repeatedStringPiece_codec); + break; + } + case 442: { + repeatedCord_.AddEntriesFrom(input, _repeated_repeatedCord_codec); + break; + } + case 450: { + mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec); + break; + } + case 458: { + mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec); + break; + } + case 466: { + mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec); + break; + } + case 474: { + mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec); + break; + } + case 482: { + mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec); + break; + } + case 490: { + mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec); + break; + } + case 498: { + mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec); + break; + } + case 506: { + mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec); + break; + } + case 514: { + mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec); + break; + } + case 522: { + mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec); + break; + } + case 530: { + mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec); + break; + } + case 538: { + mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec); + break; + } + case 546: { + mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec); + break; + } + case 554: { + mapStringString_.AddEntriesFrom(input, _map_mapStringString_codec); + break; + } + case 562: { + mapStringBytes_.AddEntriesFrom(input, _map_mapStringBytes_codec); + break; + } + case 570: { + mapStringNestedMessage_.AddEntriesFrom(input, _map_mapStringNestedMessage_codec); + break; + } + case 578: { + mapStringForeignMessage_.AddEntriesFrom(input, _map_mapStringForeignMessage_codec); + break; + } + case 586: { + mapStringNestedEnum_.AddEntriesFrom(input, _map_mapStringNestedEnum_codec); + break; + } + case 594: { + mapStringForeignEnum_.AddEntriesFrom(input, _map_mapStringForeignEnum_codec); + break; + } + case 602: + case 600: { + packedInt32_.AddEntriesFrom(input, _repeated_packedInt32_codec); + break; + } + case 610: + case 608: { + packedInt64_.AddEntriesFrom(input, _repeated_packedInt64_codec); + break; + } + case 618: + case 616: { + packedUint32_.AddEntriesFrom(input, _repeated_packedUint32_codec); + break; + } + case 626: + case 624: { + packedUint64_.AddEntriesFrom(input, _repeated_packedUint64_codec); + break; + } + case 634: + case 632: { + packedSint32_.AddEntriesFrom(input, _repeated_packedSint32_codec); + break; + } + case 642: + case 640: { + packedSint64_.AddEntriesFrom(input, _repeated_packedSint64_codec); + break; + } + case 650: + case 653: { + packedFixed32_.AddEntriesFrom(input, _repeated_packedFixed32_codec); + break; + } + case 658: + case 657: { + packedFixed64_.AddEntriesFrom(input, _repeated_packedFixed64_codec); + break; + } + case 666: + case 669: { + packedSfixed32_.AddEntriesFrom(input, _repeated_packedSfixed32_codec); + break; + } + case 674: + case 673: { + packedSfixed64_.AddEntriesFrom(input, _repeated_packedSfixed64_codec); + break; + } + case 682: + case 685: { + packedFloat_.AddEntriesFrom(input, _repeated_packedFloat_codec); + break; + } + case 690: + case 689: { + packedDouble_.AddEntriesFrom(input, _repeated_packedDouble_codec); + break; + } + case 698: + case 696: { + packedBool_.AddEntriesFrom(input, _repeated_packedBool_codec); + break; + } + case 706: + case 704: { + packedNestedEnum_.AddEntriesFrom(input, _repeated_packedNestedEnum_codec); + break; + } + case 714: + case 712: { + unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec); + break; + } + case 722: + case 720: { + unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec); + break; + } + case 730: + case 728: { + unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec); + break; + } + case 738: + case 736: { + unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec); + break; + } + case 746: + case 744: { + unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec); + break; + } + case 754: + case 752: { + unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec); + break; + } + case 762: + case 765: { + unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec); + break; + } + case 770: + case 769: { + unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + break; + } + case 778: + case 781: { + unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + break; + } + case 786: + case 785: { + unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + break; + } + case 794: + case 797: { + unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + break; + } + case 802: + case 801: { + unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + break; + } + case 810: + case 808: { + unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + break; + } + case 818: + case 816: { + unpackedNestedEnum_.AddEntriesFrom(input, _repeated_unpackedNestedEnum_codec); + break; + } + case 888: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 898: { + global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage subBuilder = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Types.NestedMessage(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder); + OneofNestedMessage = subBuilder; + break; + } + case 906: { + OneofString = input.ReadString(); + break; + } + case 914: { + OneofBytes = input.ReadBytes(); + break; + } + case 920: { + OneofBool = input.ReadBool(); + break; + } + case 928: { + OneofUint64 = input.ReadUInt64(); + break; + } + case 941: { + OneofFloat = input.ReadFloat(); + break; + } + case 945: { + OneofDouble = input.ReadDouble(); + break; + } + case 952: { + oneofField_ = input.ReadEnum(); + oneofFieldCase_ = OneofFieldOneofCase.OneofEnum; + break; + } + case 960: { + oneofField_ = input.ReadEnum(); + oneofFieldCase_ = OneofFieldOneofCase.OneofNullValue; + break; + } + case 1610: { + bool? value = _single_optionalBoolWrapper_codec.Read(input); + if (optionalBoolWrapper_ == null || value != false) { + OptionalBoolWrapper = value; + } + break; + } + case 1618: { + int? value = _single_optionalInt32Wrapper_codec.Read(input); + if (optionalInt32Wrapper_ == null || value != 0) { + OptionalInt32Wrapper = value; + } + break; + } + case 1626: { + long? value = _single_optionalInt64Wrapper_codec.Read(input); + if (optionalInt64Wrapper_ == null || value != 0L) { + OptionalInt64Wrapper = value; + } + break; + } + case 1634: { + uint? value = _single_optionalUint32Wrapper_codec.Read(input); + if (optionalUint32Wrapper_ == null || value != 0) { + OptionalUint32Wrapper = value; + } + break; + } + case 1642: { + ulong? value = _single_optionalUint64Wrapper_codec.Read(input); + if (optionalUint64Wrapper_ == null || value != 0UL) { + OptionalUint64Wrapper = value; + } + break; + } + case 1650: { + float? value = _single_optionalFloatWrapper_codec.Read(input); + if (optionalFloatWrapper_ == null || value != 0F) { + OptionalFloatWrapper = value; + } + break; + } + case 1658: { + double? value = _single_optionalDoubleWrapper_codec.Read(input); + if (optionalDoubleWrapper_ == null || value != 0D) { + OptionalDoubleWrapper = value; + } + break; + } + case 1666: { + string value = _single_optionalStringWrapper_codec.Read(input); + if (optionalStringWrapper_ == null || value != "") { + OptionalStringWrapper = value; + } + break; + } + case 1674: { + pb::ByteString value = _single_optionalBytesWrapper_codec.Read(input); + if (optionalBytesWrapper_ == null || value != pb::ByteString.Empty) { + OptionalBytesWrapper = value; + } + break; + } + case 1690: { + repeatedBoolWrapper_.AddEntriesFrom(input, _repeated_repeatedBoolWrapper_codec); + break; + } + case 1698: { + repeatedInt32Wrapper_.AddEntriesFrom(input, _repeated_repeatedInt32Wrapper_codec); + break; + } + case 1706: { + repeatedInt64Wrapper_.AddEntriesFrom(input, _repeated_repeatedInt64Wrapper_codec); + break; + } + case 1714: { + repeatedUint32Wrapper_.AddEntriesFrom(input, _repeated_repeatedUint32Wrapper_codec); + break; + } + case 1722: { + repeatedUint64Wrapper_.AddEntriesFrom(input, _repeated_repeatedUint64Wrapper_codec); + break; + } + case 1730: { + repeatedFloatWrapper_.AddEntriesFrom(input, _repeated_repeatedFloatWrapper_codec); + break; + } + case 1738: { + repeatedDoubleWrapper_.AddEntriesFrom(input, _repeated_repeatedDoubleWrapper_codec); + break; + } + case 1746: { + repeatedStringWrapper_.AddEntriesFrom(input, _repeated_repeatedStringWrapper_codec); + break; + } + case 1754: { + repeatedBytesWrapper_.AddEntriesFrom(input, _repeated_repeatedBytesWrapper_codec); + break; + } + case 2410: { + if (optionalDuration_ == null) { + OptionalDuration = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + input.ReadMessage(OptionalDuration); + break; + } + case 2418: { + if (optionalTimestamp_ == null) { + OptionalTimestamp = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(OptionalTimestamp); + break; + } + case 2426: { + if (optionalFieldMask_ == null) { + OptionalFieldMask = new global::Google.Protobuf.WellKnownTypes.FieldMask(); + } + input.ReadMessage(OptionalFieldMask); + break; + } + case 2434: { + if (optionalStruct_ == null) { + OptionalStruct = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(OptionalStruct); + break; + } + case 2442: { + if (optionalAny_ == null) { + OptionalAny = new global::Google.Protobuf.WellKnownTypes.Any(); + } + input.ReadMessage(OptionalAny); + break; + } + case 2450: { + if (optionalValue_ == null) { + OptionalValue = new global::Google.Protobuf.WellKnownTypes.Value(); + } + input.ReadMessage(OptionalValue); + break; + } + case 2456: { + OptionalNullValue = (global::Google.Protobuf.WellKnownTypes.NullValue) input.ReadEnum(); + break; + } + case 2490: { + repeatedDuration_.AddEntriesFrom(input, _repeated_repeatedDuration_codec); + break; + } + case 2498: { + repeatedTimestamp_.AddEntriesFrom(input, _repeated_repeatedTimestamp_codec); + break; + } + case 2506: { + repeatedFieldmask_.AddEntriesFrom(input, _repeated_repeatedFieldmask_codec); + break; + } + case 2522: { + repeatedAny_.AddEntriesFrom(input, _repeated_repeatedAny_codec); + break; + } + case 2530: { + repeatedValue_.AddEntriesFrom(input, _repeated_repeatedValue_codec); + break; + } + case 2538: { + repeatedListValue_.AddEntriesFrom(input, _repeated_repeatedListValue_codec); + break; + } + case 2594: { + repeatedStruct_.AddEntriesFrom(input, _repeated_repeatedStruct_codec); + break; } - OneofNestedMessage.MergeFrom(other.OneofNestedMessage); - break; - case OneofFieldOneofCase.OneofString: - OneofString = other.OneofString; - break; - case OneofFieldOneofCase.OneofBytes: - OneofBytes = other.OneofBytes; - break; - case OneofFieldOneofCase.OneofBool: - OneofBool = other.OneofBool; - break; - case OneofFieldOneofCase.OneofUint64: - OneofUint64 = other.OneofUint64; - break; - case OneofFieldOneofCase.OneofFloat: - OneofFloat = other.OneofFloat; - break; - case OneofFieldOneofCase.OneofDouble: - OneofDouble = other.OneofDouble; - break; - case OneofFieldOneofCase.OneofEnum: - OneofEnum = other.OneofEnum; - break; + case 3208: { + Fieldname1 = input.ReadInt32(); + break; + } + case 3216: { + FieldName2 = input.ReadInt32(); + break; + } + case 3224: { + FieldName3 = input.ReadInt32(); + break; + } + case 3232: { + FieldName4 = input.ReadInt32(); + break; + } + case 3240: { + Field0Name5 = input.ReadInt32(); + break; + } + case 3248: { + Field0Name6 = input.ReadInt32(); + break; + } + case 3256: { + FieldName7 = input.ReadInt32(); + break; + } + case 3264: { + FieldName8 = input.ReadInt32(); + break; + } + case 3272: { + FieldName9 = input.ReadInt32(); + break; + } + case 3280: { + FieldName10 = input.ReadInt32(); + break; + } + case 3288: { + FIELDNAME11 = input.ReadInt32(); + break; + } + case 3296: { + FIELDName12 = input.ReadInt32(); + break; + } + case 3304: { + FieldName13 = input.ReadInt32(); + break; + } + case 3312: { + FieldName14 = input.ReadInt32(); + break; + } + case 3320: { + FieldName15 = input.ReadInt32(); + break; + } + case 3328: { + FieldName16 = input.ReadInt32(); + break; + } + case 3336: { + FieldName17 = input.ReadInt32(); + break; + } + case 3344: { + FieldName18 = input.ReadInt32(); + break; + } + } } - - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { OptionalInt32 = input.ReadInt32(); @@ -3492,317 +4799,317 @@ namespace ProtobufTestMessages.Proto3 { } case 250: case 248: { - repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec); + repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec); break; } case 258: case 256: { - repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec); + repeatedInt64_.AddEntriesFrom(ref input, _repeated_repeatedInt64_codec); break; } case 266: case 264: { - repeatedUint32_.AddEntriesFrom(input, _repeated_repeatedUint32_codec); + repeatedUint32_.AddEntriesFrom(ref input, _repeated_repeatedUint32_codec); break; } case 274: case 272: { - repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec); + repeatedUint64_.AddEntriesFrom(ref input, _repeated_repeatedUint64_codec); break; } case 282: case 280: { - repeatedSint32_.AddEntriesFrom(input, _repeated_repeatedSint32_codec); + repeatedSint32_.AddEntriesFrom(ref input, _repeated_repeatedSint32_codec); break; } case 290: case 288: { - repeatedSint64_.AddEntriesFrom(input, _repeated_repeatedSint64_codec); + repeatedSint64_.AddEntriesFrom(ref input, _repeated_repeatedSint64_codec); break; } case 298: case 301: { - repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec); + repeatedFixed32_.AddEntriesFrom(ref input, _repeated_repeatedFixed32_codec); break; } case 306: case 305: { - repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec); + repeatedFixed64_.AddEntriesFrom(ref input, _repeated_repeatedFixed64_codec); break; } case 314: case 317: { - repeatedSfixed32_.AddEntriesFrom(input, _repeated_repeatedSfixed32_codec); + repeatedSfixed32_.AddEntriesFrom(ref input, _repeated_repeatedSfixed32_codec); break; } case 322: case 321: { - repeatedSfixed64_.AddEntriesFrom(input, _repeated_repeatedSfixed64_codec); + repeatedSfixed64_.AddEntriesFrom(ref input, _repeated_repeatedSfixed64_codec); break; } case 330: case 333: { - repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec); + repeatedFloat_.AddEntriesFrom(ref input, _repeated_repeatedFloat_codec); break; } case 338: case 337: { - repeatedDouble_.AddEntriesFrom(input, _repeated_repeatedDouble_codec); + repeatedDouble_.AddEntriesFrom(ref input, _repeated_repeatedDouble_codec); break; } case 346: case 344: { - repeatedBool_.AddEntriesFrom(input, _repeated_repeatedBool_codec); + repeatedBool_.AddEntriesFrom(ref input, _repeated_repeatedBool_codec); break; } case 354: { - repeatedString_.AddEntriesFrom(input, _repeated_repeatedString_codec); + repeatedString_.AddEntriesFrom(ref input, _repeated_repeatedString_codec); break; } case 362: { - repeatedBytes_.AddEntriesFrom(input, _repeated_repeatedBytes_codec); + repeatedBytes_.AddEntriesFrom(ref input, _repeated_repeatedBytes_codec); break; } case 386: { - repeatedNestedMessage_.AddEntriesFrom(input, _repeated_repeatedNestedMessage_codec); + repeatedNestedMessage_.AddEntriesFrom(ref input, _repeated_repeatedNestedMessage_codec); break; } case 394: { - repeatedForeignMessage_.AddEntriesFrom(input, _repeated_repeatedForeignMessage_codec); + repeatedForeignMessage_.AddEntriesFrom(ref input, _repeated_repeatedForeignMessage_codec); break; } case 410: case 408: { - repeatedNestedEnum_.AddEntriesFrom(input, _repeated_repeatedNestedEnum_codec); + repeatedNestedEnum_.AddEntriesFrom(ref input, _repeated_repeatedNestedEnum_codec); break; } case 418: case 416: { - repeatedForeignEnum_.AddEntriesFrom(input, _repeated_repeatedForeignEnum_codec); + repeatedForeignEnum_.AddEntriesFrom(ref input, _repeated_repeatedForeignEnum_codec); break; } case 434: { - repeatedStringPiece_.AddEntriesFrom(input, _repeated_repeatedStringPiece_codec); + repeatedStringPiece_.AddEntriesFrom(ref input, _repeated_repeatedStringPiece_codec); break; } case 442: { - repeatedCord_.AddEntriesFrom(input, _repeated_repeatedCord_codec); + repeatedCord_.AddEntriesFrom(ref input, _repeated_repeatedCord_codec); break; } case 450: { - mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec); + mapInt32Int32_.AddEntriesFrom(ref input, _map_mapInt32Int32_codec); break; } case 458: { - mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec); + mapInt64Int64_.AddEntriesFrom(ref input, _map_mapInt64Int64_codec); break; } case 466: { - mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec); + mapUint32Uint32_.AddEntriesFrom(ref input, _map_mapUint32Uint32_codec); break; } case 474: { - mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec); + mapUint64Uint64_.AddEntriesFrom(ref input, _map_mapUint64Uint64_codec); break; } case 482: { - mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec); + mapSint32Sint32_.AddEntriesFrom(ref input, _map_mapSint32Sint32_codec); break; } case 490: { - mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec); + mapSint64Sint64_.AddEntriesFrom(ref input, _map_mapSint64Sint64_codec); break; } case 498: { - mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec); + mapFixed32Fixed32_.AddEntriesFrom(ref input, _map_mapFixed32Fixed32_codec); break; } case 506: { - mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec); + mapFixed64Fixed64_.AddEntriesFrom(ref input, _map_mapFixed64Fixed64_codec); break; } case 514: { - mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec); + mapSfixed32Sfixed32_.AddEntriesFrom(ref input, _map_mapSfixed32Sfixed32_codec); break; } case 522: { - mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec); + mapSfixed64Sfixed64_.AddEntriesFrom(ref input, _map_mapSfixed64Sfixed64_codec); break; } case 530: { - mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec); + mapInt32Float_.AddEntriesFrom(ref input, _map_mapInt32Float_codec); break; } case 538: { - mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec); + mapInt32Double_.AddEntriesFrom(ref input, _map_mapInt32Double_codec); break; } case 546: { - mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec); + mapBoolBool_.AddEntriesFrom(ref input, _map_mapBoolBool_codec); break; } case 554: { - mapStringString_.AddEntriesFrom(input, _map_mapStringString_codec); + mapStringString_.AddEntriesFrom(ref input, _map_mapStringString_codec); break; } case 562: { - mapStringBytes_.AddEntriesFrom(input, _map_mapStringBytes_codec); + mapStringBytes_.AddEntriesFrom(ref input, _map_mapStringBytes_codec); break; } case 570: { - mapStringNestedMessage_.AddEntriesFrom(input, _map_mapStringNestedMessage_codec); + mapStringNestedMessage_.AddEntriesFrom(ref input, _map_mapStringNestedMessage_codec); break; } case 578: { - mapStringForeignMessage_.AddEntriesFrom(input, _map_mapStringForeignMessage_codec); + mapStringForeignMessage_.AddEntriesFrom(ref input, _map_mapStringForeignMessage_codec); break; } case 586: { - mapStringNestedEnum_.AddEntriesFrom(input, _map_mapStringNestedEnum_codec); + mapStringNestedEnum_.AddEntriesFrom(ref input, _map_mapStringNestedEnum_codec); break; } case 594: { - mapStringForeignEnum_.AddEntriesFrom(input, _map_mapStringForeignEnum_codec); + mapStringForeignEnum_.AddEntriesFrom(ref input, _map_mapStringForeignEnum_codec); break; } case 602: case 600: { - packedInt32_.AddEntriesFrom(input, _repeated_packedInt32_codec); + packedInt32_.AddEntriesFrom(ref input, _repeated_packedInt32_codec); break; } case 610: case 608: { - packedInt64_.AddEntriesFrom(input, _repeated_packedInt64_codec); + packedInt64_.AddEntriesFrom(ref input, _repeated_packedInt64_codec); break; } case 618: case 616: { - packedUint32_.AddEntriesFrom(input, _repeated_packedUint32_codec); + packedUint32_.AddEntriesFrom(ref input, _repeated_packedUint32_codec); break; } case 626: case 624: { - packedUint64_.AddEntriesFrom(input, _repeated_packedUint64_codec); + packedUint64_.AddEntriesFrom(ref input, _repeated_packedUint64_codec); break; } case 634: case 632: { - packedSint32_.AddEntriesFrom(input, _repeated_packedSint32_codec); + packedSint32_.AddEntriesFrom(ref input, _repeated_packedSint32_codec); break; } case 642: case 640: { - packedSint64_.AddEntriesFrom(input, _repeated_packedSint64_codec); + packedSint64_.AddEntriesFrom(ref input, _repeated_packedSint64_codec); break; } case 650: case 653: { - packedFixed32_.AddEntriesFrom(input, _repeated_packedFixed32_codec); + packedFixed32_.AddEntriesFrom(ref input, _repeated_packedFixed32_codec); break; } case 658: case 657: { - packedFixed64_.AddEntriesFrom(input, _repeated_packedFixed64_codec); + packedFixed64_.AddEntriesFrom(ref input, _repeated_packedFixed64_codec); break; } case 666: case 669: { - packedSfixed32_.AddEntriesFrom(input, _repeated_packedSfixed32_codec); + packedSfixed32_.AddEntriesFrom(ref input, _repeated_packedSfixed32_codec); break; } case 674: case 673: { - packedSfixed64_.AddEntriesFrom(input, _repeated_packedSfixed64_codec); + packedSfixed64_.AddEntriesFrom(ref input, _repeated_packedSfixed64_codec); break; } case 682: case 685: { - packedFloat_.AddEntriesFrom(input, _repeated_packedFloat_codec); + packedFloat_.AddEntriesFrom(ref input, _repeated_packedFloat_codec); break; } case 690: case 689: { - packedDouble_.AddEntriesFrom(input, _repeated_packedDouble_codec); + packedDouble_.AddEntriesFrom(ref input, _repeated_packedDouble_codec); break; } case 698: case 696: { - packedBool_.AddEntriesFrom(input, _repeated_packedBool_codec); + packedBool_.AddEntriesFrom(ref input, _repeated_packedBool_codec); break; } case 706: case 704: { - packedNestedEnum_.AddEntriesFrom(input, _repeated_packedNestedEnum_codec); + packedNestedEnum_.AddEntriesFrom(ref input, _repeated_packedNestedEnum_codec); break; } case 714: case 712: { - unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec); + unpackedInt32_.AddEntriesFrom(ref input, _repeated_unpackedInt32_codec); break; } case 722: case 720: { - unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec); + unpackedInt64_.AddEntriesFrom(ref input, _repeated_unpackedInt64_codec); break; } case 730: case 728: { - unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec); + unpackedUint32_.AddEntriesFrom(ref input, _repeated_unpackedUint32_codec); break; } case 738: case 736: { - unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec); + unpackedUint64_.AddEntriesFrom(ref input, _repeated_unpackedUint64_codec); break; } case 746: case 744: { - unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec); + unpackedSint32_.AddEntriesFrom(ref input, _repeated_unpackedSint32_codec); break; } case 754: case 752: { - unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec); + unpackedSint64_.AddEntriesFrom(ref input, _repeated_unpackedSint64_codec); break; } case 762: case 765: { - unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec); + unpackedFixed32_.AddEntriesFrom(ref input, _repeated_unpackedFixed32_codec); break; } case 770: case 769: { - unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + unpackedFixed64_.AddEntriesFrom(ref input, _repeated_unpackedFixed64_codec); break; } case 778: case 781: { - unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + unpackedSfixed32_.AddEntriesFrom(ref input, _repeated_unpackedSfixed32_codec); break; } case 786: case 785: { - unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + unpackedSfixed64_.AddEntriesFrom(ref input, _repeated_unpackedSfixed64_codec); break; } case 794: case 797: { - unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + unpackedFloat_.AddEntriesFrom(ref input, _repeated_unpackedFloat_codec); break; } case 802: case 801: { - unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + unpackedDouble_.AddEntriesFrom(ref input, _repeated_unpackedDouble_codec); break; } case 810: case 808: { - unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + unpackedBool_.AddEntriesFrom(ref input, _repeated_unpackedBool_codec); break; } case 818: case 816: { - unpackedNestedEnum_.AddEntriesFrom(input, _repeated_unpackedNestedEnum_codec); + unpackedNestedEnum_.AddEntriesFrom(ref input, _repeated_unpackedNestedEnum_codec); break; } case 888: { @@ -3847,103 +5154,108 @@ namespace ProtobufTestMessages.Proto3 { oneofFieldCase_ = OneofFieldOneofCase.OneofEnum; break; } + case 960: { + oneofField_ = input.ReadEnum(); + oneofFieldCase_ = OneofFieldOneofCase.OneofNullValue; + break; + } case 1610: { - bool? value = _single_optionalBoolWrapper_codec.Read(input); + bool? value = _single_optionalBoolWrapper_codec.Read(ref input); if (optionalBoolWrapper_ == null || value != false) { OptionalBoolWrapper = value; } break; } case 1618: { - int? value = _single_optionalInt32Wrapper_codec.Read(input); + int? value = _single_optionalInt32Wrapper_codec.Read(ref input); if (optionalInt32Wrapper_ == null || value != 0) { OptionalInt32Wrapper = value; } break; } case 1626: { - long? value = _single_optionalInt64Wrapper_codec.Read(input); + long? value = _single_optionalInt64Wrapper_codec.Read(ref input); if (optionalInt64Wrapper_ == null || value != 0L) { OptionalInt64Wrapper = value; } break; } case 1634: { - uint? value = _single_optionalUint32Wrapper_codec.Read(input); + uint? value = _single_optionalUint32Wrapper_codec.Read(ref input); if (optionalUint32Wrapper_ == null || value != 0) { OptionalUint32Wrapper = value; } break; } case 1642: { - ulong? value = _single_optionalUint64Wrapper_codec.Read(input); + ulong? value = _single_optionalUint64Wrapper_codec.Read(ref input); if (optionalUint64Wrapper_ == null || value != 0UL) { OptionalUint64Wrapper = value; } break; } case 1650: { - float? value = _single_optionalFloatWrapper_codec.Read(input); + float? value = _single_optionalFloatWrapper_codec.Read(ref input); if (optionalFloatWrapper_ == null || value != 0F) { OptionalFloatWrapper = value; } break; } case 1658: { - double? value = _single_optionalDoubleWrapper_codec.Read(input); + double? value = _single_optionalDoubleWrapper_codec.Read(ref input); if (optionalDoubleWrapper_ == null || value != 0D) { OptionalDoubleWrapper = value; } break; } case 1666: { - string value = _single_optionalStringWrapper_codec.Read(input); + string value = _single_optionalStringWrapper_codec.Read(ref input); if (optionalStringWrapper_ == null || value != "") { OptionalStringWrapper = value; } break; } case 1674: { - pb::ByteString value = _single_optionalBytesWrapper_codec.Read(input); + pb::ByteString value = _single_optionalBytesWrapper_codec.Read(ref input); if (optionalBytesWrapper_ == null || value != pb::ByteString.Empty) { OptionalBytesWrapper = value; } break; } case 1690: { - repeatedBoolWrapper_.AddEntriesFrom(input, _repeated_repeatedBoolWrapper_codec); + repeatedBoolWrapper_.AddEntriesFrom(ref input, _repeated_repeatedBoolWrapper_codec); break; } case 1698: { - repeatedInt32Wrapper_.AddEntriesFrom(input, _repeated_repeatedInt32Wrapper_codec); + repeatedInt32Wrapper_.AddEntriesFrom(ref input, _repeated_repeatedInt32Wrapper_codec); break; } case 1706: { - repeatedInt64Wrapper_.AddEntriesFrom(input, _repeated_repeatedInt64Wrapper_codec); + repeatedInt64Wrapper_.AddEntriesFrom(ref input, _repeated_repeatedInt64Wrapper_codec); break; } case 1714: { - repeatedUint32Wrapper_.AddEntriesFrom(input, _repeated_repeatedUint32Wrapper_codec); + repeatedUint32Wrapper_.AddEntriesFrom(ref input, _repeated_repeatedUint32Wrapper_codec); break; } case 1722: { - repeatedUint64Wrapper_.AddEntriesFrom(input, _repeated_repeatedUint64Wrapper_codec); + repeatedUint64Wrapper_.AddEntriesFrom(ref input, _repeated_repeatedUint64Wrapper_codec); break; } case 1730: { - repeatedFloatWrapper_.AddEntriesFrom(input, _repeated_repeatedFloatWrapper_codec); + repeatedFloatWrapper_.AddEntriesFrom(ref input, _repeated_repeatedFloatWrapper_codec); break; } case 1738: { - repeatedDoubleWrapper_.AddEntriesFrom(input, _repeated_repeatedDoubleWrapper_codec); + repeatedDoubleWrapper_.AddEntriesFrom(ref input, _repeated_repeatedDoubleWrapper_codec); break; } case 1746: { - repeatedStringWrapper_.AddEntriesFrom(input, _repeated_repeatedStringWrapper_codec); + repeatedStringWrapper_.AddEntriesFrom(ref input, _repeated_repeatedStringWrapper_codec); break; } case 1754: { - repeatedBytesWrapper_.AddEntriesFrom(input, _repeated_repeatedBytesWrapper_codec); + repeatedBytesWrapper_.AddEntriesFrom(ref input, _repeated_repeatedBytesWrapper_codec); break; } case 2410: { @@ -3988,32 +5300,36 @@ namespace ProtobufTestMessages.Proto3 { input.ReadMessage(OptionalValue); break; } + case 2456: { + OptionalNullValue = (global::Google.Protobuf.WellKnownTypes.NullValue) input.ReadEnum(); + break; + } case 2490: { - repeatedDuration_.AddEntriesFrom(input, _repeated_repeatedDuration_codec); + repeatedDuration_.AddEntriesFrom(ref input, _repeated_repeatedDuration_codec); break; } case 2498: { - repeatedTimestamp_.AddEntriesFrom(input, _repeated_repeatedTimestamp_codec); + repeatedTimestamp_.AddEntriesFrom(ref input, _repeated_repeatedTimestamp_codec); break; } case 2506: { - repeatedFieldmask_.AddEntriesFrom(input, _repeated_repeatedFieldmask_codec); + repeatedFieldmask_.AddEntriesFrom(ref input, _repeated_repeatedFieldmask_codec); break; } case 2522: { - repeatedAny_.AddEntriesFrom(input, _repeated_repeatedAny_codec); + repeatedAny_.AddEntriesFrom(ref input, _repeated_repeatedAny_codec); break; } case 2530: { - repeatedValue_.AddEntriesFrom(input, _repeated_repeatedValue_codec); + repeatedValue_.AddEntriesFrom(ref input, _repeated_repeatedValue_codec); break; } case 2538: { - repeatedListValue_.AddEntriesFrom(input, _repeated_repeatedListValue_codec); + repeatedListValue_.AddEntriesFrom(ref input, _repeated_repeatedListValue_codec); break; } case 2594: { - repeatedStruct_.AddEntriesFrom(input, _repeated_repeatedStruct_codec); + repeatedStruct_.AddEntriesFrom(ref input, _repeated_repeatedStruct_codec); break; } case 3208: { @@ -4091,10 +5407,12 @@ namespace ProtobufTestMessages.Proto3 { } } } + #endif #region Nested types /// Container for nested types declared in the TestAllTypesProto3 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("FOO")] Foo = 0, @@ -4115,23 +5433,31 @@ namespace ProtobufTestMessages.Proto3 { [pbr::OriginalName("bAz", PreferredAlias = false)] BAz = 2, } - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto3.TestAllTypesProto3.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -4139,6 +5465,7 @@ namespace ProtobufTestMessages.Proto3 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { a_ = other.a_; corecursive_ = other.corecursive_ != null ? other.corecursive_.Clone() : null; @@ -4146,6 +5473,7 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -4154,6 +5482,7 @@ namespace ProtobufTestMessages.Proto3 { public const int AFieldNumber = 1; private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { return a_; } set { @@ -4165,6 +5494,7 @@ namespace ProtobufTestMessages.Proto3 { public const int CorecursiveFieldNumber = 2; private global::ProtobufTestMessages.Proto3.TestAllTypesProto3 corecursive_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::ProtobufTestMessages.Proto3.TestAllTypesProto3 Corecursive { get { return corecursive_; } set { @@ -4173,11 +5503,13 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -4191,6 +5523,7 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (A != 0) hash ^= A.GetHashCode(); @@ -4202,12 +5535,17 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (A != 0) { output.WriteRawTag(8); output.WriteInt32(A); @@ -4219,9 +5557,29 @@ namespace ProtobufTestMessages.Proto3 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (A != 0) { + output.WriteRawTag(8); + output.WriteInt32(A); + } + if (corecursive_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Corecursive); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (A != 0) { @@ -4237,6 +5595,7 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -4254,7 +5613,11 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4274,7 +5637,34 @@ namespace ProtobufTestMessages.Proto3 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 18: { + if (corecursive_ == null) { + Corecursive = new global::ProtobufTestMessages.Proto3.TestAllTypesProto3(); + } + input.ReadMessage(Corecursive); + break; + } + } + } } + #endif } @@ -4283,23 +5673,31 @@ namespace ProtobufTestMessages.Proto3 { } - public sealed partial class ForeignMessage : pb::IMessage { + public sealed partial class ForeignMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::ProtobufTestMessages.Proto3.TestMessagesProto3Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage() { OnConstruction(); } @@ -4307,12 +5705,14 @@ namespace ProtobufTestMessages.Proto3 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage(ForeignMessage other) : this() { c_ = other.c_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage Clone() { return new ForeignMessage(this); } @@ -4321,6 +5721,7 @@ namespace ProtobufTestMessages.Proto3 { public const int CFieldNumber = 1; private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { return c_; } set { @@ -4329,11 +5730,13 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ForeignMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ForeignMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -4346,6 +5749,7 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (C != 0) hash ^= C.GetHashCode(); @@ -4356,12 +5760,17 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (C != 0) { output.WriteRawTag(8); output.WriteInt32(C); @@ -4369,9 +5778,25 @@ namespace ProtobufTestMessages.Proto3 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (C != 0) { + output.WriteRawTag(8); + output.WriteInt32(C); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (C != 0) { @@ -4384,6 +5809,7 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ForeignMessage other) { if (other == null) { return; @@ -4395,7 +5821,11 @@ namespace ProtobufTestMessages.Proto3 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4408,7 +5838,27 @@ namespace ProtobufTestMessages.Proto3 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + C = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs index a35b6e0fe3..706b7c4736 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs @@ -1120,25 +1120,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// This proto includes every type of field in both singular and repeated /// forms. /// - public sealed partial class TestAllTypes : pb::IMessage { + public sealed partial class TestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; private int _hasBits1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes() { OnConstruction(); } @@ -1146,6 +1154,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes(TestAllTypes other) : this() { _hasBits0 = other._hasBits0; _hasBits1 = other._hasBits1; @@ -1165,16 +1174,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { optionalString_ = other.optionalString_; optionalBytes_ = other.optionalBytes_; optionalGroup_ = other.HasOptionalGroup ? other.optionalGroup_.Clone() : null; - optionalNestedMessage_ = other.HasOptionalNestedMessage ? other.optionalNestedMessage_.Clone() : null; - optionalForeignMessage_ = other.HasOptionalForeignMessage ? other.optionalForeignMessage_.Clone() : null; - optionalImportMessage_ = other.HasOptionalImportMessage ? other.optionalImportMessage_.Clone() : null; + optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; + optionalForeignMessage_ = other.optionalForeignMessage_ != null ? other.optionalForeignMessage_.Clone() : null; + optionalImportMessage_ = other.optionalImportMessage_ != null ? other.optionalImportMessage_.Clone() : null; optionalNestedEnum_ = other.optionalNestedEnum_; optionalForeignEnum_ = other.optionalForeignEnum_; optionalImportEnum_ = other.optionalImportEnum_; optionalStringPiece_ = other.optionalStringPiece_; optionalCord_ = other.optionalCord_; - optionalPublicImportMessage_ = other.HasOptionalPublicImportMessage ? other.optionalPublicImportMessage_.Clone() : null; - optionalLazyMessage_ = other.HasOptionalLazyMessage ? other.optionalLazyMessage_.Clone() : null; + optionalPublicImportMessage_ = other.optionalPublicImportMessage_ != null ? other.optionalPublicImportMessage_.Clone() : null; + optionalLazyMessage_ = other.optionalLazyMessage_ != null ? other.optionalLazyMessage_.Clone() : null; repeatedInt32_ = other.repeatedInt32_.Clone(); repeatedInt64_ = other.repeatedInt64_.Clone(); repeatedUint32_ = other.repeatedUint32_.Clone(); @@ -1239,6 +1248,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes Clone() { return new TestAllTypes(this); } @@ -1252,6 +1262,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Singular /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -1261,11 +1272,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } @@ -1276,6 +1289,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long optionalInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalInt64 { get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return OptionalInt64DefaultValue; } } set { @@ -1285,11 +1299,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt64 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "optional_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt64() { _hasBits0 &= ~2; } @@ -1300,6 +1316,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint optionalUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalUint32 { get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return OptionalUint32DefaultValue; } } set { @@ -1309,11 +1326,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint32 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "optional_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint32() { _hasBits0 &= ~4; } @@ -1324,6 +1343,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong optionalUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalUint64 { get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return OptionalUint64DefaultValue; } } set { @@ -1333,11 +1353,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalUint64 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "optional_uint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalUint64() { _hasBits0 &= ~8; } @@ -1348,6 +1370,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int optionalSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSint32 { get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return OptionalSint32DefaultValue; } } set { @@ -1357,11 +1380,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_sint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint32 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "optional_sint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint32() { _hasBits0 &= ~16; } @@ -1372,6 +1397,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long optionalSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSint64 { get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return OptionalSint64DefaultValue; } } set { @@ -1381,11 +1407,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_sint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSint64 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "optional_sint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSint64() { _hasBits0 &= ~32; } @@ -1396,6 +1424,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint optionalFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OptionalFixed32 { get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return OptionalFixed32DefaultValue; } } set { @@ -1405,11 +1434,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_fixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed32 { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "optional_fixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed32() { _hasBits0 &= ~64; } @@ -1420,6 +1451,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong optionalFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong OptionalFixed64 { get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return OptionalFixed64DefaultValue; } } set { @@ -1429,11 +1461,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_fixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFixed64 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "optional_fixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFixed64() { _hasBits0 &= ~128; } @@ -1444,6 +1478,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int optionalSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalSfixed32 { get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return OptionalSfixed32DefaultValue; } } set { @@ -1453,11 +1488,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_sfixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed32 { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "optional_sfixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed32() { _hasBits0 &= ~256; } @@ -1468,6 +1505,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long optionalSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long OptionalSfixed64 { get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return OptionalSfixed64DefaultValue; } } set { @@ -1477,11 +1515,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_sfixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalSfixed64 { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "optional_sfixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalSfixed64() { _hasBits0 &= ~512; } @@ -1492,6 +1532,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float optionalFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OptionalFloat { get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return OptionalFloatDefaultValue; } } set { @@ -1501,11 +1542,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalFloat { get { return (_hasBits0 & 1024) != 0; } } /// Clears the value of the "optional_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalFloat() { _hasBits0 &= ~1024; } @@ -1516,6 +1559,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double optionalDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double OptionalDouble { get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return OptionalDoubleDefaultValue; } } set { @@ -1525,11 +1569,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalDouble { get { return (_hasBits0 & 2048) != 0; } } /// Clears the value of the "optional_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalDouble() { _hasBits0 &= ~2048; } @@ -1540,6 +1586,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private bool optionalBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool OptionalBool { get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return OptionalBoolDefaultValue; } } set { @@ -1549,11 +1596,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBool { get { return (_hasBits0 & 4096) != 0; } } /// Clears the value of the "optional_bool" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBool() { _hasBits0 &= ~4096; } @@ -1564,6 +1613,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string optionalString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_ ?? OptionalStringDefaultValue; } set { @@ -1572,11 +1622,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalString { get { return optionalString_ != null; } } /// Clears the value of the "optional_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalString() { optionalString_ = null; } @@ -1587,6 +1639,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString optionalBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytes { get { return optionalBytes_ ?? OptionalBytesDefaultValue; } set { @@ -1595,11 +1648,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBytes { get { return optionalBytes_ != null; } } /// Clears the value of the "optional_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBytes() { optionalBytes_ = null; } @@ -1608,6 +1663,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalGroupFieldNumber = 16; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -1616,11 +1672,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -1629,64 +1687,37 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalNestedMessageFieldNumber = 18; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { optionalNestedMessage_ = value; } } - /// Gets whether the optional_nested_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalNestedMessage { - get { return optionalNestedMessage_ != null; } - } - /// Clears the value of the optional_nested_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalNestedMessage() { - optionalNestedMessage_ = null; - } /// Field number for the "optional_foreign_message" field. public const int OptionalForeignMessageFieldNumber = 19; private global::Google.Protobuf.TestProtos.Proto2.ForeignMessage optionalForeignMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignMessage OptionalForeignMessage { get { return optionalForeignMessage_; } set { optionalForeignMessage_ = value; } } - /// Gets whether the optional_foreign_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalForeignMessage { - get { return optionalForeignMessage_ != null; } - } - /// Clears the value of the optional_foreign_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalForeignMessage() { - optionalForeignMessage_ = null; - } /// Field number for the "optional_import_message" field. public const int OptionalImportMessageFieldNumber = 20; private global::Google.Protobuf.TestProtos.Proto2.ImportMessage optionalImportMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ImportMessage OptionalImportMessage { get { return optionalImportMessage_; } set { optionalImportMessage_ = value; } } - /// Gets whether the optional_import_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalImportMessage { - get { return optionalImportMessage_ != null; } - } - /// Clears the value of the optional_import_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalImportMessage() { - optionalImportMessage_ = null; - } /// Field number for the "optional_nested_enum" field. public const int OptionalNestedEnumFieldNumber = 21; @@ -1694,6 +1725,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum optionalNestedEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum OptionalNestedEnum { get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return OptionalNestedEnumDefaultValue; } } set { @@ -1703,11 +1735,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_nested_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalNestedEnum { get { return (_hasBits0 & 8192) != 0; } } /// Clears the value of the "optional_nested_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalNestedEnum() { _hasBits0 &= ~8192; } @@ -1718,6 +1752,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum optionalForeignEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum OptionalForeignEnum { get { if ((_hasBits0 & 16384) != 0) { return optionalForeignEnum_; } else { return OptionalForeignEnumDefaultValue; } } set { @@ -1727,11 +1762,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_foreign_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalForeignEnum { get { return (_hasBits0 & 16384) != 0; } } /// Clears the value of the "optional_foreign_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalForeignEnum() { _hasBits0 &= ~16384; } @@ -1742,6 +1779,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ImportEnum optionalImportEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ImportEnum OptionalImportEnum { get { if ((_hasBits0 & 32768) != 0) { return optionalImportEnum_; } else { return OptionalImportEnumDefaultValue; } } set { @@ -1751,11 +1789,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_import_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalImportEnum { get { return (_hasBits0 & 32768) != 0; } } /// Clears the value of the "optional_import_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalImportEnum() { _hasBits0 &= ~32768; } @@ -1766,6 +1806,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string optionalStringPiece_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalStringPiece { get { return optionalStringPiece_ ?? OptionalStringPieceDefaultValue; } set { @@ -1774,11 +1815,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalStringPiece { get { return optionalStringPiece_ != null; } } /// Clears the value of the "optional_string_piece" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalStringPiece() { optionalStringPiece_ = null; } @@ -1789,6 +1832,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string optionalCord_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalCord { get { return optionalCord_ ?? OptionalCordDefaultValue; } set { @@ -1797,11 +1841,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalCord { get { return optionalCord_ != null; } } /// Clears the value of the "optional_cord" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalCord() { optionalCord_ = null; } @@ -1813,43 +1859,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Defined in unittest_import_public.proto /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.PublicImportMessage OptionalPublicImportMessage { get { return optionalPublicImportMessage_; } set { optionalPublicImportMessage_ = value; } } - /// Gets whether the optional_public_import_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalPublicImportMessage { - get { return optionalPublicImportMessage_ != null; } - } - /// Clears the value of the optional_public_import_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalPublicImportMessage() { - optionalPublicImportMessage_ = null; - } /// Field number for the "optional_lazy_message" field. public const int OptionalLazyMessageFieldNumber = 27; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage optionalLazyMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage OptionalLazyMessage { get { return optionalLazyMessage_; } set { optionalLazyMessage_ = value; } } - /// Gets whether the optional_lazy_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalLazyMessage { - get { return optionalLazyMessage_ != null; } - } - /// Clears the value of the optional_lazy_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalLazyMessage() { - optionalLazyMessage_ = null; - } /// Field number for the "repeated_int32" field. public const int RepeatedInt32FieldNumber = 31; @@ -1860,6 +1888,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Repeated /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -1870,6 +1899,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt64(256); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -1880,6 +1910,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt32(264); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -1890,6 +1921,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt64(272); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -1900,6 +1932,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt32(280); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -1910,6 +1943,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt64(288); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -1920,6 +1954,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed32(301); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -1930,6 +1965,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed64(305); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -1940,6 +1976,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed32(317); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -1950,6 +1987,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed64(321); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -1960,6 +1998,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFloat(333); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -1970,6 +2009,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForDouble(337); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -1980,6 +2020,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBool(344); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -1990,6 +2031,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -2000,6 +2042,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -2010,6 +2053,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForGroup(371, 372, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.RepeatedGroup.Parser); private readonly pbc::RepeatedField repeatedGroup_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedGroup { get { return repeatedGroup_; } } @@ -2020,6 +2064,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(386, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -2030,6 +2075,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(394, global::Google.Protobuf.TestProtos.Proto2.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -2040,6 +2086,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(402, global::Google.Protobuf.TestProtos.Proto2.ImportMessage.Parser); private readonly pbc::RepeatedField repeatedImportMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedImportMessage { get { return repeatedImportMessage_; } } @@ -2050,6 +2097,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(408, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum) x); private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -2060,6 +2108,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(416, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) x); private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } @@ -2070,6 +2119,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(424, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ImportEnum) x); private readonly pbc::RepeatedField repeatedImportEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedImportEnum { get { return repeatedImportEnum_; } } @@ -2080,6 +2130,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(434); private readonly pbc::RepeatedField repeatedStringPiece_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringPiece { get { return repeatedStringPiece_; } } @@ -2090,6 +2141,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(442); private readonly pbc::RepeatedField repeatedCord_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedCord { get { return repeatedCord_; } } @@ -2100,6 +2152,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(458, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedLazyMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedLazyMessage { get { return repeatedLazyMessage_; } } @@ -2113,6 +2166,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Singular with defaults /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DefaultInt32 { get { if ((_hasBits0 & 65536) != 0) { return defaultInt32_; } else { return DefaultInt32DefaultValue; } } set { @@ -2122,11 +2176,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultInt32 { get { return (_hasBits0 & 65536) != 0; } } /// Clears the value of the "default_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultInt32() { _hasBits0 &= ~65536; } @@ -2137,6 +2193,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long defaultInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long DefaultInt64 { get { if ((_hasBits0 & 131072) != 0) { return defaultInt64_; } else { return DefaultInt64DefaultValue; } } set { @@ -2146,11 +2203,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultInt64 { get { return (_hasBits0 & 131072) != 0; } } /// Clears the value of the "default_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultInt64() { _hasBits0 &= ~131072; } @@ -2161,6 +2220,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint defaultUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint DefaultUint32 { get { if ((_hasBits0 & 262144) != 0) { return defaultUint32_; } else { return DefaultUint32DefaultValue; } } set { @@ -2170,11 +2230,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultUint32 { get { return (_hasBits0 & 262144) != 0; } } /// Clears the value of the "default_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultUint32() { _hasBits0 &= ~262144; } @@ -2185,6 +2247,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong defaultUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong DefaultUint64 { get { if ((_hasBits0 & 524288) != 0) { return defaultUint64_; } else { return DefaultUint64DefaultValue; } } set { @@ -2194,11 +2257,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultUint64 { get { return (_hasBits0 & 524288) != 0; } } /// Clears the value of the "default_uint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultUint64() { _hasBits0 &= ~524288; } @@ -2209,6 +2274,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int defaultSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DefaultSint32 { get { if ((_hasBits0 & 1048576) != 0) { return defaultSint32_; } else { return DefaultSint32DefaultValue; } } set { @@ -2218,11 +2284,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_sint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultSint32 { get { return (_hasBits0 & 1048576) != 0; } } /// Clears the value of the "default_sint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultSint32() { _hasBits0 &= ~1048576; } @@ -2233,6 +2301,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long defaultSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long DefaultSint64 { get { if ((_hasBits0 & 2097152) != 0) { return defaultSint64_; } else { return DefaultSint64DefaultValue; } } set { @@ -2242,11 +2311,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_sint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultSint64 { get { return (_hasBits0 & 2097152) != 0; } } /// Clears the value of the "default_sint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultSint64() { _hasBits0 &= ~2097152; } @@ -2257,6 +2328,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint defaultFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint DefaultFixed32 { get { if ((_hasBits0 & 4194304) != 0) { return defaultFixed32_; } else { return DefaultFixed32DefaultValue; } } set { @@ -2266,11 +2338,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_fixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultFixed32 { get { return (_hasBits0 & 4194304) != 0; } } /// Clears the value of the "default_fixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultFixed32() { _hasBits0 &= ~4194304; } @@ -2281,6 +2355,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong defaultFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong DefaultFixed64 { get { if ((_hasBits0 & 8388608) != 0) { return defaultFixed64_; } else { return DefaultFixed64DefaultValue; } } set { @@ -2290,11 +2365,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_fixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultFixed64 { get { return (_hasBits0 & 8388608) != 0; } } /// Clears the value of the "default_fixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultFixed64() { _hasBits0 &= ~8388608; } @@ -2305,6 +2382,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int defaultSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DefaultSfixed32 { get { if ((_hasBits0 & 16777216) != 0) { return defaultSfixed32_; } else { return DefaultSfixed32DefaultValue; } } set { @@ -2314,11 +2392,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_sfixed32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultSfixed32 { get { return (_hasBits0 & 16777216) != 0; } } /// Clears the value of the "default_sfixed32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultSfixed32() { _hasBits0 &= ~16777216; } @@ -2329,6 +2409,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long defaultSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long DefaultSfixed64 { get { if ((_hasBits0 & 33554432) != 0) { return defaultSfixed64_; } else { return DefaultSfixed64DefaultValue; } } set { @@ -2338,11 +2419,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_sfixed64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultSfixed64 { get { return (_hasBits0 & 33554432) != 0; } } /// Clears the value of the "default_sfixed64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultSfixed64() { _hasBits0 &= ~33554432; } @@ -2353,6 +2436,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float defaultFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float DefaultFloat { get { if ((_hasBits0 & 67108864) != 0) { return defaultFloat_; } else { return DefaultFloatDefaultValue; } } set { @@ -2362,11 +2446,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultFloat { get { return (_hasBits0 & 67108864) != 0; } } /// Clears the value of the "default_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultFloat() { _hasBits0 &= ~67108864; } @@ -2377,6 +2463,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double defaultDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double DefaultDouble { get { if ((_hasBits0 & 134217728) != 0) { return defaultDouble_; } else { return DefaultDoubleDefaultValue; } } set { @@ -2386,11 +2473,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultDouble { get { return (_hasBits0 & 134217728) != 0; } } /// Clears the value of the "default_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultDouble() { _hasBits0 &= ~134217728; } @@ -2401,6 +2490,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private bool defaultBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool DefaultBool { get { if ((_hasBits0 & 268435456) != 0) { return defaultBool_; } else { return DefaultBoolDefaultValue; } } set { @@ -2410,11 +2500,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_bool" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultBool { get { return (_hasBits0 & 268435456) != 0; } } /// Clears the value of the "default_bool" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultBool() { _hasBits0 &= ~268435456; } @@ -2425,6 +2517,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string defaultString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DefaultString { get { return defaultString_ ?? DefaultStringDefaultValue; } set { @@ -2433,11 +2526,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultString { get { return defaultString_ != null; } } /// Clears the value of the "default_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultString() { defaultString_ = null; } @@ -2448,6 +2543,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString defaultBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString DefaultBytes { get { return defaultBytes_ ?? DefaultBytesDefaultValue; } set { @@ -2456,11 +2552,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultBytes { get { return defaultBytes_ != null; } } /// Clears the value of the "default_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultBytes() { defaultBytes_ = null; } @@ -2471,6 +2569,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum defaultNestedEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum DefaultNestedEnum { get { if ((_hasBits0 & 536870912) != 0) { return defaultNestedEnum_; } else { return DefaultNestedEnumDefaultValue; } } set { @@ -2480,11 +2579,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_nested_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultNestedEnum { get { return (_hasBits0 & 536870912) != 0; } } /// Clears the value of the "default_nested_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultNestedEnum() { _hasBits0 &= ~536870912; } @@ -2495,6 +2596,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum defaultForeignEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum DefaultForeignEnum { get { if ((_hasBits0 & 1073741824) != 0) { return defaultForeignEnum_; } else { return DefaultForeignEnumDefaultValue; } } set { @@ -2504,11 +2606,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_foreign_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultForeignEnum { get { return (_hasBits0 & 1073741824) != 0; } } /// Clears the value of the "default_foreign_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultForeignEnum() { _hasBits0 &= ~1073741824; } @@ -2519,6 +2623,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ImportEnum defaultImportEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ImportEnum DefaultImportEnum { get { if ((_hasBits0 & -2147483648) != 0) { return defaultImportEnum_; } else { return DefaultImportEnumDefaultValue; } } set { @@ -2528,11 +2633,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_import_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultImportEnum { get { return (_hasBits0 & -2147483648) != 0; } } /// Clears the value of the "default_import_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultImportEnum() { _hasBits0 &= ~-2147483648; } @@ -2543,6 +2650,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string defaultStringPiece_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DefaultStringPiece { get { return defaultStringPiece_ ?? DefaultStringPieceDefaultValue; } set { @@ -2551,11 +2659,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultStringPiece { get { return defaultStringPiece_ != null; } } /// Clears the value of the "default_string_piece" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultStringPiece() { defaultStringPiece_ = null; } @@ -2566,6 +2676,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string defaultCord_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DefaultCord { get { return defaultCord_ ?? DefaultCordDefaultValue; } set { @@ -2574,11 +2685,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "default_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultCord { get { return defaultCord_ != null; } } /// Clears the value of the "default_cord" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultCord() { defaultCord_ = null; } @@ -2586,6 +2699,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { get { return HasOneofUint32 ? (uint) oneofField_ : 0; } set { @@ -2595,11 +2709,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32; } } /// Clears the value of the oneof if it's currently set to "oneof_uint32" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofUint32() { if (HasOneofUint32) { ClearOneofField(); @@ -2609,29 +2725,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage OneofNestedMessage { - get { return HasOneofNestedMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage) oneofField_ : null; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage) oneofField_ : null; } set { oneofField_ = value; oneofFieldCase_ = value == null ? OneofFieldOneofCase.None : OneofFieldOneofCase.OneofNestedMessage; } } - /// Gets whether the "oneof_nested_message" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOneofNestedMessage { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage; } - } - /// Clears the value of the oneof if it's currently set to "oneof_nested_message" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOneofNestedMessage() { - if (HasOneofNestedMessage) { - ClearOneofField(); - } - } /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { get { return HasOneofString ? (string) oneofField_ : ""; } set { @@ -2641,11 +2747,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString; } } /// Clears the value of the oneof if it's currently set to "oneof_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofString() { if (HasOneofString) { ClearOneofField(); @@ -2655,6 +2763,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { get { return HasOneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -2664,11 +2773,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes; } } /// Clears the value of the oneof if it's currently set to "oneof_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofBytes() { if (HasOneofBytes) { ClearOneofField(); @@ -2686,22 +2797,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -2789,6 +2904,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); @@ -2807,16 +2923,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasOptionalString) hash ^= OptionalString.GetHashCode(); if (HasOptionalBytes) hash ^= OptionalBytes.GetHashCode(); if (HasOptionalGroup) hash ^= OptionalGroup.GetHashCode(); - if (HasOptionalNestedMessage) hash ^= OptionalNestedMessage.GetHashCode(); - if (HasOptionalForeignMessage) hash ^= OptionalForeignMessage.GetHashCode(); - if (HasOptionalImportMessage) hash ^= OptionalImportMessage.GetHashCode(); + if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode(); + if (optionalForeignMessage_ != null) hash ^= OptionalForeignMessage.GetHashCode(); + if (optionalImportMessage_ != null) hash ^= OptionalImportMessage.GetHashCode(); if (HasOptionalNestedEnum) hash ^= OptionalNestedEnum.GetHashCode(); if (HasOptionalForeignEnum) hash ^= OptionalForeignEnum.GetHashCode(); if (HasOptionalImportEnum) hash ^= OptionalImportEnum.GetHashCode(); if (HasOptionalStringPiece) hash ^= OptionalStringPiece.GetHashCode(); if (HasOptionalCord) hash ^= OptionalCord.GetHashCode(); - if (HasOptionalPublicImportMessage) hash ^= OptionalPublicImportMessage.GetHashCode(); - if (HasOptionalLazyMessage) hash ^= OptionalLazyMessage.GetHashCode(); + if (optionalPublicImportMessage_ != null) hash ^= OptionalPublicImportMessage.GetHashCode(); + if (optionalLazyMessage_ != null) hash ^= OptionalLazyMessage.GetHashCode(); hash ^= repeatedInt32_.GetHashCode(); hash ^= repeatedInt64_.GetHashCode(); hash ^= repeatedUint32_.GetHashCode(); @@ -2863,7 +2979,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasDefaultStringPiece) hash ^= DefaultStringPiece.GetHashCode(); if (HasDefaultCord) hash ^= DefaultCord.GetHashCode(); if (HasOneofUint32) hash ^= OneofUint32.GetHashCode(); - if (HasOneofNestedMessage) hash ^= OneofNestedMessage.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) hash ^= OneofNestedMessage.GetHashCode(); if (HasOneofString) hash ^= OneofString.GetHashCode(); if (HasOneofBytes) hash ^= OneofBytes.GetHashCode(); hash ^= (int) oneofFieldCase_; @@ -2874,12 +2990,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasOptionalInt32) { output.WriteRawTag(8); output.WriteInt32(OptionalInt32); @@ -2945,15 +3066,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteGroup(OptionalGroup); output.WriteRawTag(132, 1); } - if (HasOptionalNestedMessage) { + if (optionalNestedMessage_ != null) { output.WriteRawTag(146, 1); output.WriteMessage(OptionalNestedMessage); } - if (HasOptionalForeignMessage) { + if (optionalForeignMessage_ != null) { output.WriteRawTag(154, 1); output.WriteMessage(OptionalForeignMessage); } - if (HasOptionalImportMessage) { + if (optionalImportMessage_ != null) { output.WriteRawTag(162, 1); output.WriteMessage(OptionalImportMessage); } @@ -2977,11 +3098,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(202, 1); output.WriteString(OptionalCord); } - if (HasOptionalPublicImportMessage) { + if (optionalPublicImportMessage_ != null) { output.WriteRawTag(210, 1); output.WriteMessage(OptionalPublicImportMessage); } - if (HasOptionalLazyMessage) { + if (optionalLazyMessage_ != null) { output.WriteRawTag(218, 1); output.WriteMessage(OptionalLazyMessage); } @@ -3094,7 +3215,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(248, 6); output.WriteUInt32(OneofUint32); } - if (HasOneofNestedMessage) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { output.WriteRawTag(130, 7); output.WriteMessage(OneofNestedMessage); } @@ -3109,9 +3230,247 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOptionalInt32) { + output.WriteRawTag(8); + output.WriteInt32(OptionalInt32); + } + if (HasOptionalInt64) { + output.WriteRawTag(16); + output.WriteInt64(OptionalInt64); + } + if (HasOptionalUint32) { + output.WriteRawTag(24); + output.WriteUInt32(OptionalUint32); + } + if (HasOptionalUint64) { + output.WriteRawTag(32); + output.WriteUInt64(OptionalUint64); + } + if (HasOptionalSint32) { + output.WriteRawTag(40); + output.WriteSInt32(OptionalSint32); + } + if (HasOptionalSint64) { + output.WriteRawTag(48); + output.WriteSInt64(OptionalSint64); + } + if (HasOptionalFixed32) { + output.WriteRawTag(61); + output.WriteFixed32(OptionalFixed32); + } + if (HasOptionalFixed64) { + output.WriteRawTag(65); + output.WriteFixed64(OptionalFixed64); + } + if (HasOptionalSfixed32) { + output.WriteRawTag(77); + output.WriteSFixed32(OptionalSfixed32); + } + if (HasOptionalSfixed64) { + output.WriteRawTag(81); + output.WriteSFixed64(OptionalSfixed64); + } + if (HasOptionalFloat) { + output.WriteRawTag(93); + output.WriteFloat(OptionalFloat); + } + if (HasOptionalDouble) { + output.WriteRawTag(97); + output.WriteDouble(OptionalDouble); + } + if (HasOptionalBool) { + output.WriteRawTag(104); + output.WriteBool(OptionalBool); + } + if (HasOptionalString) { + output.WriteRawTag(114); + output.WriteString(OptionalString); + } + if (HasOptionalBytes) { + output.WriteRawTag(122); + output.WriteBytes(OptionalBytes); + } + if (HasOptionalGroup) { + output.WriteRawTag(131, 1); + output.WriteGroup(OptionalGroup); + output.WriteRawTag(132, 1); + } + if (optionalNestedMessage_ != null) { + output.WriteRawTag(146, 1); + output.WriteMessage(OptionalNestedMessage); + } + if (optionalForeignMessage_ != null) { + output.WriteRawTag(154, 1); + output.WriteMessage(OptionalForeignMessage); + } + if (optionalImportMessage_ != null) { + output.WriteRawTag(162, 1); + output.WriteMessage(OptionalImportMessage); + } + if (HasOptionalNestedEnum) { + output.WriteRawTag(168, 1); + output.WriteEnum((int) OptionalNestedEnum); + } + if (HasOptionalForeignEnum) { + output.WriteRawTag(176, 1); + output.WriteEnum((int) OptionalForeignEnum); + } + if (HasOptionalImportEnum) { + output.WriteRawTag(184, 1); + output.WriteEnum((int) OptionalImportEnum); + } + if (HasOptionalStringPiece) { + output.WriteRawTag(194, 1); + output.WriteString(OptionalStringPiece); + } + if (HasOptionalCord) { + output.WriteRawTag(202, 1); + output.WriteString(OptionalCord); + } + if (optionalPublicImportMessage_ != null) { + output.WriteRawTag(210, 1); + output.WriteMessage(OptionalPublicImportMessage); + } + if (optionalLazyMessage_ != null) { + output.WriteRawTag(218, 1); + output.WriteMessage(OptionalLazyMessage); + } + repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); + repeatedInt64_.WriteTo(ref output, _repeated_repeatedInt64_codec); + repeatedUint32_.WriteTo(ref output, _repeated_repeatedUint32_codec); + repeatedUint64_.WriteTo(ref output, _repeated_repeatedUint64_codec); + repeatedSint32_.WriteTo(ref output, _repeated_repeatedSint32_codec); + repeatedSint64_.WriteTo(ref output, _repeated_repeatedSint64_codec); + repeatedFixed32_.WriteTo(ref output, _repeated_repeatedFixed32_codec); + repeatedFixed64_.WriteTo(ref output, _repeated_repeatedFixed64_codec); + repeatedSfixed32_.WriteTo(ref output, _repeated_repeatedSfixed32_codec); + repeatedSfixed64_.WriteTo(ref output, _repeated_repeatedSfixed64_codec); + repeatedFloat_.WriteTo(ref output, _repeated_repeatedFloat_codec); + repeatedDouble_.WriteTo(ref output, _repeated_repeatedDouble_codec); + repeatedBool_.WriteTo(ref output, _repeated_repeatedBool_codec); + repeatedString_.WriteTo(ref output, _repeated_repeatedString_codec); + repeatedBytes_.WriteTo(ref output, _repeated_repeatedBytes_codec); + repeatedGroup_.WriteTo(ref output, _repeated_repeatedGroup_codec); + repeatedNestedMessage_.WriteTo(ref output, _repeated_repeatedNestedMessage_codec); + repeatedForeignMessage_.WriteTo(ref output, _repeated_repeatedForeignMessage_codec); + repeatedImportMessage_.WriteTo(ref output, _repeated_repeatedImportMessage_codec); + repeatedNestedEnum_.WriteTo(ref output, _repeated_repeatedNestedEnum_codec); + repeatedForeignEnum_.WriteTo(ref output, _repeated_repeatedForeignEnum_codec); + repeatedImportEnum_.WriteTo(ref output, _repeated_repeatedImportEnum_codec); + repeatedStringPiece_.WriteTo(ref output, _repeated_repeatedStringPiece_codec); + repeatedCord_.WriteTo(ref output, _repeated_repeatedCord_codec); + repeatedLazyMessage_.WriteTo(ref output, _repeated_repeatedLazyMessage_codec); + if (HasDefaultInt32) { + output.WriteRawTag(232, 3); + output.WriteInt32(DefaultInt32); + } + if (HasDefaultInt64) { + output.WriteRawTag(240, 3); + output.WriteInt64(DefaultInt64); + } + if (HasDefaultUint32) { + output.WriteRawTag(248, 3); + output.WriteUInt32(DefaultUint32); + } + if (HasDefaultUint64) { + output.WriteRawTag(128, 4); + output.WriteUInt64(DefaultUint64); + } + if (HasDefaultSint32) { + output.WriteRawTag(136, 4); + output.WriteSInt32(DefaultSint32); + } + if (HasDefaultSint64) { + output.WriteRawTag(144, 4); + output.WriteSInt64(DefaultSint64); + } + if (HasDefaultFixed32) { + output.WriteRawTag(157, 4); + output.WriteFixed32(DefaultFixed32); + } + if (HasDefaultFixed64) { + output.WriteRawTag(161, 4); + output.WriteFixed64(DefaultFixed64); + } + if (HasDefaultSfixed32) { + output.WriteRawTag(173, 4); + output.WriteSFixed32(DefaultSfixed32); + } + if (HasDefaultSfixed64) { + output.WriteRawTag(177, 4); + output.WriteSFixed64(DefaultSfixed64); + } + if (HasDefaultFloat) { + output.WriteRawTag(189, 4); + output.WriteFloat(DefaultFloat); + } + if (HasDefaultDouble) { + output.WriteRawTag(193, 4); + output.WriteDouble(DefaultDouble); + } + if (HasDefaultBool) { + output.WriteRawTag(200, 4); + output.WriteBool(DefaultBool); + } + if (HasDefaultString) { + output.WriteRawTag(210, 4); + output.WriteString(DefaultString); + } + if (HasDefaultBytes) { + output.WriteRawTag(218, 4); + output.WriteBytes(DefaultBytes); + } + if (HasDefaultNestedEnum) { + output.WriteRawTag(136, 5); + output.WriteEnum((int) DefaultNestedEnum); + } + if (HasDefaultForeignEnum) { + output.WriteRawTag(144, 5); + output.WriteEnum((int) DefaultForeignEnum); + } + if (HasDefaultImportEnum) { + output.WriteRawTag(152, 5); + output.WriteEnum((int) DefaultImportEnum); + } + if (HasDefaultStringPiece) { + output.WriteRawTag(162, 5); + output.WriteString(DefaultStringPiece); + } + if (HasDefaultCord) { + output.WriteRawTag(170, 5); + output.WriteString(DefaultCord); + } + if (HasOneofUint32) { + output.WriteRawTag(248, 6); + output.WriteUInt32(OneofUint32); + } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + output.WriteRawTag(130, 7); + output.WriteMessage(OneofNestedMessage); + } + if (HasOneofString) { + output.WriteRawTag(138, 7); + output.WriteString(OneofString); + } + if (HasOneofBytes) { + output.WriteRawTag(146, 7); + output.WriteBytes(OneofBytes); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalInt32) { @@ -3162,13 +3521,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasOptionalGroup) { size += 4 + pb::CodedOutputStream.ComputeGroupSize(OptionalGroup); } - if (HasOptionalNestedMessage) { + if (optionalNestedMessage_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); } - if (HasOptionalForeignMessage) { + if (optionalForeignMessage_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalForeignMessage); } - if (HasOptionalImportMessage) { + if (optionalImportMessage_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalImportMessage); } if (HasOptionalNestedEnum) { @@ -3186,10 +3545,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasOptionalCord) { size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalCord); } - if (HasOptionalPublicImportMessage) { + if (optionalPublicImportMessage_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalPublicImportMessage); } - if (HasOptionalLazyMessage) { + if (optionalLazyMessage_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalLazyMessage); } size += repeatedInt32_.CalculateSize(_repeated_repeatedInt32_codec); @@ -3280,7 +3639,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasOneofUint32) { size += 2 + pb::CodedOutputStream.ComputeUInt32Size(OneofUint32); } - if (HasOneofNestedMessage) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(OneofNestedMessage); } if (HasOneofString) { @@ -3296,6 +3655,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestAllTypes other) { if (other == null) { return; @@ -3351,20 +3711,20 @@ namespace Google.Protobuf.TestProtos.Proto2 { } OptionalGroup.MergeFrom(other.OptionalGroup); } - if (other.HasOptionalNestedMessage) { - if (!HasOptionalNestedMessage) { + if (other.optionalNestedMessage_ != null) { + if (optionalNestedMessage_ == null) { OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); } OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); } - if (other.HasOptionalForeignMessage) { - if (!HasOptionalForeignMessage) { + if (other.optionalForeignMessage_ != null) { + if (optionalForeignMessage_ == null) { OptionalForeignMessage = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); } OptionalForeignMessage.MergeFrom(other.OptionalForeignMessage); } - if (other.HasOptionalImportMessage) { - if (!HasOptionalImportMessage) { + if (other.optionalImportMessage_ != null) { + if (optionalImportMessage_ == null) { OptionalImportMessage = new global::Google.Protobuf.TestProtos.Proto2.ImportMessage(); } OptionalImportMessage.MergeFrom(other.OptionalImportMessage); @@ -3384,14 +3744,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasOptionalCord) { OptionalCord = other.OptionalCord; } - if (other.HasOptionalPublicImportMessage) { - if (!HasOptionalPublicImportMessage) { + if (other.optionalPublicImportMessage_ != null) { + if (optionalPublicImportMessage_ == null) { OptionalPublicImportMessage = new global::Google.Protobuf.TestProtos.Proto2.PublicImportMessage(); } OptionalPublicImportMessage.MergeFrom(other.OptionalPublicImportMessage); } - if (other.HasOptionalLazyMessage) { - if (!HasOptionalLazyMessage) { + if (other.optionalLazyMessage_ != null) { + if (optionalLazyMessage_ == null) { OptionalLazyMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); } OptionalLazyMessage.MergeFrom(other.OptionalLazyMessage); @@ -3503,7 +3863,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3578,21 +3942,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } case 146: { - if (!HasOptionalNestedMessage) { + if (optionalNestedMessage_ == null) { OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); } input.ReadMessage(OptionalNestedMessage); break; } case 154: { - if (!HasOptionalForeignMessage) { + if (optionalForeignMessage_ == null) { OptionalForeignMessage = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); } input.ReadMessage(OptionalForeignMessage); break; } case 162: { - if (!HasOptionalImportMessage) { + if (optionalImportMessage_ == null) { OptionalImportMessage = new global::Google.Protobuf.TestProtos.Proto2.ImportMessage(); } input.ReadMessage(OptionalImportMessage); @@ -3619,14 +3983,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } case 210: { - if (!HasOptionalPublicImportMessage) { + if (optionalPublicImportMessage_ == null) { OptionalPublicImportMessage = new global::Google.Protobuf.TestProtos.Proto2.PublicImportMessage(); } input.ReadMessage(OptionalPublicImportMessage); break; } case 218: { - if (!HasOptionalLazyMessage) { + if (optionalLazyMessage_ == null) { OptionalLazyMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); } input.ReadMessage(OptionalLazyMessage); @@ -3834,7 +4198,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } case 898: { global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); - if (HasOneofNestedMessage) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { subBuilder.MergeFrom(OneofNestedMessage); } input.ReadMessage(subBuilder); @@ -3851,40 +4215,404 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - #region Nested types - /// Container for nested types declared in the TestAllTypes message type. + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static partial class Types { - public enum NestedEnum { - [pbr::OriginalName("FOO")] Foo = 1, - [pbr::OriginalName("BAR")] Bar = 2, - [pbr::OriginalName("BAZ")] Baz = 3, - /// - /// Intentionally negative. - /// - [pbr::OriginalName("NEG")] Neg = -1, - } - - public sealed partial class NestedMessage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); - private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 16: { + OptionalInt64 = input.ReadInt64(); + break; + } + case 24: { + OptionalUint32 = input.ReadUInt32(); + break; + } + case 32: { + OptionalUint64 = input.ReadUInt64(); + break; + } + case 40: { + OptionalSint32 = input.ReadSInt32(); + break; + } + case 48: { + OptionalSint64 = input.ReadSInt64(); + break; + } + case 61: { + OptionalFixed32 = input.ReadFixed32(); + break; + } + case 65: { + OptionalFixed64 = input.ReadFixed64(); + break; + } + case 77: { + OptionalSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + OptionalSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + OptionalFloat = input.ReadFloat(); + break; + } + case 97: { + OptionalDouble = input.ReadDouble(); + break; + } + case 104: { + OptionalBool = input.ReadBool(); + break; + } + case 114: { + OptionalString = input.ReadString(); + break; + } + case 122: { + OptionalBytes = input.ReadBytes(); + break; + } + case 131: { + if (!HasOptionalGroup) { + OptionalGroup = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 146: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + case 154: { + if (optionalForeignMessage_ == null) { + OptionalForeignMessage = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); + } + input.ReadMessage(OptionalForeignMessage); + break; + } + case 162: { + if (optionalImportMessage_ == null) { + OptionalImportMessage = new global::Google.Protobuf.TestProtos.Proto2.ImportMessage(); + } + input.ReadMessage(OptionalImportMessage); + break; + } + case 168: { + OptionalNestedEnum = (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + OptionalForeignEnum = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 184: { + OptionalImportEnum = (global::Google.Protobuf.TestProtos.Proto2.ImportEnum) input.ReadEnum(); + break; + } + case 194: { + OptionalStringPiece = input.ReadString(); + break; + } + case 202: { + OptionalCord = input.ReadString(); + break; + } + case 210: { + if (optionalPublicImportMessage_ == null) { + OptionalPublicImportMessage = new global::Google.Protobuf.TestProtos.Proto2.PublicImportMessage(); + } + input.ReadMessage(OptionalPublicImportMessage); + break; + } + case 218: { + if (optionalLazyMessage_ == null) { + OptionalLazyMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(OptionalLazyMessage); + break; + } + case 250: + case 248: { + repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec); + break; + } + case 258: + case 256: { + repeatedInt64_.AddEntriesFrom(ref input, _repeated_repeatedInt64_codec); + break; + } + case 266: + case 264: { + repeatedUint32_.AddEntriesFrom(ref input, _repeated_repeatedUint32_codec); + break; + } + case 274: + case 272: { + repeatedUint64_.AddEntriesFrom(ref input, _repeated_repeatedUint64_codec); + break; + } + case 282: + case 280: { + repeatedSint32_.AddEntriesFrom(ref input, _repeated_repeatedSint32_codec); + break; + } + case 290: + case 288: { + repeatedSint64_.AddEntriesFrom(ref input, _repeated_repeatedSint64_codec); + break; + } + case 298: + case 301: { + repeatedFixed32_.AddEntriesFrom(ref input, _repeated_repeatedFixed32_codec); + break; + } + case 306: + case 305: { + repeatedFixed64_.AddEntriesFrom(ref input, _repeated_repeatedFixed64_codec); + break; + } + case 314: + case 317: { + repeatedSfixed32_.AddEntriesFrom(ref input, _repeated_repeatedSfixed32_codec); + break; + } + case 322: + case 321: { + repeatedSfixed64_.AddEntriesFrom(ref input, _repeated_repeatedSfixed64_codec); + break; + } + case 330: + case 333: { + repeatedFloat_.AddEntriesFrom(ref input, _repeated_repeatedFloat_codec); + break; + } + case 338: + case 337: { + repeatedDouble_.AddEntriesFrom(ref input, _repeated_repeatedDouble_codec); + break; + } + case 346: + case 344: { + repeatedBool_.AddEntriesFrom(ref input, _repeated_repeatedBool_codec); + break; + } + case 354: { + repeatedString_.AddEntriesFrom(ref input, _repeated_repeatedString_codec); + break; + } + case 362: { + repeatedBytes_.AddEntriesFrom(ref input, _repeated_repeatedBytes_codec); + break; + } + case 371: { + repeatedGroup_.AddEntriesFrom(ref input, _repeated_repeatedGroup_codec); + break; + } + case 386: { + repeatedNestedMessage_.AddEntriesFrom(ref input, _repeated_repeatedNestedMessage_codec); + break; + } + case 394: { + repeatedForeignMessage_.AddEntriesFrom(ref input, _repeated_repeatedForeignMessage_codec); + break; + } + case 402: { + repeatedImportMessage_.AddEntriesFrom(ref input, _repeated_repeatedImportMessage_codec); + break; + } + case 410: + case 408: { + repeatedNestedEnum_.AddEntriesFrom(ref input, _repeated_repeatedNestedEnum_codec); + break; + } + case 418: + case 416: { + repeatedForeignEnum_.AddEntriesFrom(ref input, _repeated_repeatedForeignEnum_codec); + break; + } + case 426: + case 424: { + repeatedImportEnum_.AddEntriesFrom(ref input, _repeated_repeatedImportEnum_codec); + break; + } + case 434: { + repeatedStringPiece_.AddEntriesFrom(ref input, _repeated_repeatedStringPiece_codec); + break; + } + case 442: { + repeatedCord_.AddEntriesFrom(ref input, _repeated_repeatedCord_codec); + break; + } + case 458: { + repeatedLazyMessage_.AddEntriesFrom(ref input, _repeated_repeatedLazyMessage_codec); + break; + } + case 488: { + DefaultInt32 = input.ReadInt32(); + break; + } + case 496: { + DefaultInt64 = input.ReadInt64(); + break; + } + case 504: { + DefaultUint32 = input.ReadUInt32(); + break; + } + case 512: { + DefaultUint64 = input.ReadUInt64(); + break; + } + case 520: { + DefaultSint32 = input.ReadSInt32(); + break; + } + case 528: { + DefaultSint64 = input.ReadSInt64(); + break; + } + case 541: { + DefaultFixed32 = input.ReadFixed32(); + break; + } + case 545: { + DefaultFixed64 = input.ReadFixed64(); + break; + } + case 557: { + DefaultSfixed32 = input.ReadSFixed32(); + break; + } + case 561: { + DefaultSfixed64 = input.ReadSFixed64(); + break; + } + case 573: { + DefaultFloat = input.ReadFloat(); + break; + } + case 577: { + DefaultDouble = input.ReadDouble(); + break; + } + case 584: { + DefaultBool = input.ReadBool(); + break; + } + case 594: { + DefaultString = input.ReadString(); + break; + } + case 602: { + DefaultBytes = input.ReadBytes(); + break; + } + case 648: { + DefaultNestedEnum = (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedEnum) input.ReadEnum(); + break; + } + case 656: { + DefaultForeignEnum = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 664: { + DefaultImportEnum = (global::Google.Protobuf.TestProtos.Proto2.ImportEnum) input.ReadEnum(); + break; + } + case 674: { + DefaultStringPiece = input.ReadString(); + break; + } + case 682: { + DefaultCord = input.ReadString(); + break; + } + case 888: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 898: { + global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder); + OneofNestedMessage = subBuilder; + break; + } + case 906: { + OneofString = input.ReadString(); + break; + } + case 914: { + OneofBytes = input.ReadBytes(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TestAllTypes message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum NestedEnum { + [pbr::OriginalName("FOO")] Foo = 1, + [pbr::OriginalName("BAR")] Bar = 2, + [pbr::OriginalName("BAZ")] Baz = 3, + /// + /// Intentionally negative. + /// + [pbr::OriginalName("NEG")] Neg = -1, + } + + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -3892,6 +4620,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; bb_ = other.bb_; @@ -3899,6 +4628,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -3914,6 +4644,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// This file needs to compile in proto1 to test backwards-compatibility. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return BbDefaultValue; } } set { @@ -3923,21 +4654,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bb" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBb { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "bb" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBb() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -3950,6 +4685,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasBb) hash ^= Bb.GetHashCode(); @@ -3960,12 +4696,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasBb) { output.WriteRawTag(8); output.WriteInt32(Bb); @@ -3973,9 +4714,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBb) { + output.WriteRawTag(8); + output.WriteInt32(Bb); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasBb) { @@ -3988,6 +4745,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -3999,7 +4757,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4012,28 +4774,56 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + } + } + } + #endif + } - public sealed partial class OptionalGroup : pb::IMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -4041,6 +4831,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -4048,6 +4839,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -4058,6 +4850,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -4067,21 +4860,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -4094,6 +4891,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -4104,12 +4902,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(136, 1); output.WriteInt32(A); @@ -4117,9 +4920,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(136, 1); + output.WriteInt32(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -4132,6 +4951,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; @@ -4143,7 +4963,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4158,28 +4982,58 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 132: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 136: { + A = input.ReadInt32(); + break; + } + } + } + } + #endif + } - public sealed partial class RepeatedGroup : pb::IMessage { + public sealed partial class RepeatedGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Descriptor.NestedTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup() { OnConstruction(); } @@ -4187,6 +5041,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup(RepeatedGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -4194,6 +5049,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup Clone() { return new RepeatedGroup(this); } @@ -4204,6 +5060,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -4213,21 +5070,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -4240,6 +5101,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -4250,12 +5112,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(248, 2); output.WriteInt32(A); @@ -4263,9 +5130,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(248, 2); + output.WriteInt32(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -4278,6 +5161,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedGroup other) { if (other == null) { return; @@ -4289,7 +5173,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4304,7 +5192,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 372: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 376: { + A = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -4316,23 +5226,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// This proto includes a recursively nested message. /// - public sealed partial class NestedTestAllTypes : pb::IMessage { + public sealed partial class NestedTestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTestAllTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes() { OnConstruction(); } @@ -4340,14 +5258,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes(NestedTestAllTypes other) : this() { - child_ = other.HasChild ? other.child_.Clone() : null; - payload_ = other.HasPayload ? other.payload_.Clone() : null; + child_ = other.child_ != null ? other.child_.Clone() : null; + payload_ = other.payload_ != null ? other.payload_.Clone() : null; repeatedChild_ = other.repeatedChild_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes Clone() { return new NestedTestAllTypes(this); } @@ -4356,43 +5276,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int ChildFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes child_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes Child { get { return child_; } set { child_ = value; } } - /// Gets whether the child field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasChild { - get { return child_ != null; } - } - /// Clears the value of the child field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearChild() { - child_ = null; - } /// Field number for the "payload" field. public const int PayloadFieldNumber = 2; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes payload_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes Payload { get { return payload_; } set { payload_ = value; } } - /// Gets whether the payload field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasPayload { - get { return payload_ != null; } - } - /// Clears the value of the payload field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearPayload() { - payload_ = null; - } /// Field number for the "repeated_child" field. public const int RepeatedChildFieldNumber = 3; @@ -4400,16 +5302,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes.Parser); private readonly pbc::RepeatedField repeatedChild_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedChild { get { return repeatedChild_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedTestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedTestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -4424,10 +5329,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasChild) hash ^= Child.GetHashCode(); - if (HasPayload) hash ^= Payload.GetHashCode(); + if (child_ != null) hash ^= Child.GetHashCode(); + if (payload_ != null) hash ^= Payload.GetHashCode(); hash ^= repeatedChild_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -4436,33 +5342,59 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - if (HasChild) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (child_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Child); + } + if (payload_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Payload); + } + repeatedChild_.WriteTo(output, _repeated_repeatedChild_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (child_ != null) { output.WriteRawTag(10); output.WriteMessage(Child); } - if (HasPayload) { + if (payload_ != null) { output.WriteRawTag(18); output.WriteMessage(Payload); } - repeatedChild_.WriteTo(output, _repeated_repeatedChild_codec); + repeatedChild_.WriteTo(ref output, _repeated_repeatedChild_codec); if (_unknownFields != null) { - _unknownFields.WriteTo(output); + _unknownFields.WriteTo(ref output); } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasChild) { + if (child_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Child); } - if (HasPayload) { + if (payload_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); } size += repeatedChild_.CalculateSize(_repeated_repeatedChild_codec); @@ -4473,18 +5405,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedTestAllTypes other) { if (other == null) { return; } - if (other.HasChild) { - if (!HasChild) { + if (other.child_ != null) { + if (child_ == null) { Child = new global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes(); } Child.MergeFrom(other.Child); } - if (other.HasPayload) { - if (!HasPayload) { + if (other.payload_ != null) { + if (payload_ == null) { Payload = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } Payload.MergeFrom(other.Payload); @@ -4494,7 +5427,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4502,14 +5439,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasChild) { + if (child_ == null) { Child = new global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes(); } input.ReadMessage(Child); break; } case 18: { - if (!HasPayload) { + if (payload_ == null) { Payload = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(Payload); @@ -4521,28 +5458,70 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (child_ == null) { + Child = new global::Google.Protobuf.TestProtos.Proto2.NestedTestAllTypes(); + } + input.ReadMessage(Child); + break; + } + case 18: { + if (payload_ == null) { + Payload = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(Payload); + break; + } + case 26: { + repeatedChild_.AddEntriesFrom(ref input, _repeated_repeatedChild_codec); + break; + } + } + } } + #endif } - public sealed partial class TestDeprecatedFields : pb::IMessage { + public sealed partial class TestDeprecatedFields : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedFields()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields() { OnConstruction(); } @@ -4550,6 +5529,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields(TestDeprecatedFields other) : this() { _hasBits0 = other._hasBits0; deprecatedInt32_ = other.deprecatedInt32_; @@ -4563,6 +5543,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields Clone() { return new TestDeprecatedFields(this); } @@ -4574,6 +5555,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int deprecatedInt32_; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DeprecatedInt32 { get { if ((_hasBits0 & 1) != 0) { return deprecatedInt32_; } else { return DeprecatedInt32DefaultValue; } } set { @@ -4584,12 +5566,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Gets whether the "deprecated_int32" field is set [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecatedInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "deprecated_int32" field [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecatedInt32() { _hasBits0 &= ~1; } @@ -4598,6 +5582,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int DeprecatedInt32InOneofFieldNumber = 2; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DeprecatedInt32InOneof { get { return HasDeprecatedInt32InOneof ? (int) oneofFields_ : 0; } set { @@ -4608,12 +5593,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Gets whether the "deprecated_int32_in_oneof" field is set [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecatedInt32InOneof { get { return oneofFieldsCase_ == OneofFieldsOneofCase.DeprecatedInt32InOneof; } } /// Clears the value of the oneof if it's currently set to "deprecated_int32_in_oneof" [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecatedInt32InOneof() { if (HasDeprecatedInt32InOneof) { ClearOneofFields(); @@ -4628,22 +5615,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private OneofFieldsOneofCase oneofFieldsCase_ = OneofFieldsOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldsOneofCase OneofFieldsCase { get { return oneofFieldsCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofFields() { oneofFieldsCase_ = OneofFieldsOneofCase.None; oneofFields_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDeprecatedFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDeprecatedFields other) { if (ReferenceEquals(other, null)) { return false; @@ -4658,6 +5649,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasDeprecatedInt32) hash ^= DeprecatedInt32.GetHashCode(); @@ -4670,12 +5662,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasDeprecatedInt32) { output.WriteRawTag(8); output.WriteInt32(DeprecatedInt32); @@ -4687,9 +5684,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDeprecatedInt32) { + output.WriteRawTag(8); + output.WriteInt32(DeprecatedInt32); + } + if (HasDeprecatedInt32InOneof) { + output.WriteRawTag(16); + output.WriteInt32(DeprecatedInt32InOneof); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasDeprecatedInt32) { @@ -4705,6 +5722,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDeprecatedFields other) { if (other == null) { return; @@ -4722,7 +5740,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4739,28 +5761,60 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + DeprecatedInt32 = input.ReadInt32(); + break; + } + case 16: { + DeprecatedInt32InOneof = input.ReadInt32(); + break; + } + } + } } + #endif } [global::System.ObsoleteAttribute] - public sealed partial class TestDeprecatedMessage : pb::IMessage { + public sealed partial class TestDeprecatedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedMessage() { OnConstruction(); } @@ -4768,21 +5822,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedMessage(TestDeprecatedMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedMessage Clone() { return new TestDeprecatedMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDeprecatedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDeprecatedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -4794,6 +5852,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -4803,18 +5862,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -4824,6 +5900,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDeprecatedMessage other) { if (other == null) { return; @@ -4832,7 +5909,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4841,7 +5922,23 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } @@ -4849,24 +5946,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Define these after TestAllTypes to make sure the compiler can handle /// that. /// - public sealed partial class ForeignMessage : pb::IMessage { + public sealed partial class ForeignMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage() { OnConstruction(); } @@ -4874,6 +5979,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage(ForeignMessage other) : this() { _hasBits0 = other._hasBits0; c_ = other.c_; @@ -4882,6 +5988,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage Clone() { return new ForeignMessage(this); } @@ -4892,6 +5999,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { if ((_hasBits0 & 1) != 0) { return c_; } else { return CDefaultValue; } } set { @@ -4901,11 +6009,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "c" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasC { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "c" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearC() { _hasBits0 &= ~1; } @@ -4916,6 +6026,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int d_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int D { get { if ((_hasBits0 & 2) != 0) { return d_; } else { return DDefaultValue; } } set { @@ -4925,21 +6036,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "d" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasD { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "d" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearD() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ForeignMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ForeignMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -4953,6 +6068,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasC) hash ^= C.GetHashCode(); @@ -4964,12 +6080,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasC) { output.WriteRawTag(8); output.WriteInt32(C); @@ -4981,9 +6102,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasC) { + output.WriteRawTag(8); + output.WriteInt32(C); + } + if (HasD) { + output.WriteRawTag(16); + output.WriteInt32(D); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasC) { @@ -4999,6 +6140,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ForeignMessage other) { if (other == null) { return; @@ -5013,7 +6155,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5030,27 +6176,59 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + C = input.ReadInt32(); + break; + } + case 16: { + D = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class TestReservedFields : pb::IMessage { + public sealed partial class TestReservedFields : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReservedFields()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields() { OnConstruction(); } @@ -5058,21 +6236,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields(TestReservedFields other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields Clone() { return new TestReservedFields(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestReservedFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestReservedFields other) { if (ReferenceEquals(other, null)) { return false; @@ -5084,6 +6266,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -5093,18 +6276,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -5114,6 +6314,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestReservedFields other) { if (other == null) { return; @@ -5122,7 +6323,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5131,29 +6336,53 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class TestAllExtensions : pb::IExtendableMessage { + public sealed partial class TestAllExtensions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllExtensions()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllExtensions() { OnConstruction(); } @@ -5161,22 +6390,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllExtensions(TestAllExtensions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllExtensions Clone() { return new TestAllExtensions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -5191,6 +6424,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -5203,21 +6437,41 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_extensions != null) { _extensions.WriteTo(output); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -5230,6 +6484,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestAllExtensions other) { if (other == null) { return; @@ -5239,7 +6494,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5250,7 +6509,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -5276,24 +6553,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class OptionalGroup_extension : pb::IMessage { + public sealed partial class OptionalGroup_extension : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup_extension()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension() { OnConstruction(); } @@ -5301,6 +6586,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension(OptionalGroup_extension other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -5308,6 +6594,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension Clone() { return new OptionalGroup_extension(this); } @@ -5318,6 +6605,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -5327,21 +6615,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup_extension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup_extension other) { if (ReferenceEquals(other, null)) { return false; @@ -5354,6 +6646,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -5364,12 +6657,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(136, 1); output.WriteInt32(A); @@ -5377,9 +6675,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(136, 1); + output.WriteInt32(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -5392,6 +6706,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup_extension other) { if (other == null) { return; @@ -5403,7 +6718,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5418,28 +6737,58 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 132: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 136: { + A = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class RepeatedGroup_extension : pb::IMessage { + public sealed partial class RepeatedGroup_extension : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedGroup_extension()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup_extension() { OnConstruction(); } @@ -5447,6 +6796,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup_extension(RepeatedGroup_extension other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -5454,6 +6804,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup_extension Clone() { return new RepeatedGroup_extension(this); } @@ -5464,6 +6815,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -5473,21 +6825,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedGroup_extension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedGroup_extension other) { if (ReferenceEquals(other, null)) { return false; @@ -5500,6 +6856,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -5510,12 +6867,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(248, 2); output.WriteInt32(A); @@ -5523,9 +6885,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(248, 2); + output.WriteInt32(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -5538,6 +6916,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedGroup_extension other) { if (other == null) { return; @@ -5549,7 +6928,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5564,28 +6947,58 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 372: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 376: { + A = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class TestGroup : pb::IMessage { + public sealed partial class TestGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroup() { OnConstruction(); } @@ -5593,6 +7006,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroup(TestGroup other) : this() { _hasBits0 = other._hasBits0; optionalGroup_ = other.HasOptionalGroup ? other.optionalGroup_.Clone() : null; @@ -5601,6 +7015,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroup Clone() { return new TestGroup(this); } @@ -5609,6 +7024,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalGroupFieldNumber = 16; private global::Google.Protobuf.TestProtos.Proto2.TestGroup.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestGroup.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -5617,11 +7033,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -5632,6 +7050,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum optionalForeignEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum OptionalForeignEnum { get { if ((_hasBits0 & 1) != 0) { return optionalForeignEnum_; } else { return OptionalForeignEnumDefaultValue; } } set { @@ -5641,21 +7060,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_foreign_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalForeignEnum { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_foreign_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalForeignEnum() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -5669,6 +7092,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalGroup) hash ^= OptionalGroup.GetHashCode(); @@ -5680,12 +7104,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasOptionalGroup) { output.WriteRawTag(131, 1); output.WriteGroup(OptionalGroup); @@ -5698,9 +7127,30 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOptionalGroup) { + output.WriteRawTag(131, 1); + output.WriteGroup(OptionalGroup); + output.WriteRawTag(132, 1); + } + if (HasOptionalForeignEnum) { + output.WriteRawTag(176, 1); + output.WriteEnum((int) OptionalForeignEnum); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalGroup) { @@ -5716,6 +7166,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestGroup other) { if (other == null) { return; @@ -5733,7 +7184,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5753,30 +7208,66 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 131: { + if (!HasOptionalGroup) { + OptionalGroup = new global::Google.Protobuf.TestProtos.Proto2.TestGroup.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 176: { + OptionalForeignEnum = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the TestGroup message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class OptionalGroup : pb::IMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestGroup.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -5784,6 +7275,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -5791,6 +7283,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -5801,6 +7294,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -5810,21 +7304,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -5837,6 +7335,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -5847,12 +7346,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(136, 1); output.WriteInt32(A); @@ -5860,9 +7364,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(136, 1); + output.WriteInt32(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -5875,6 +7395,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; @@ -5882,18 +7403,43 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasA) { A = other.A; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 132: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 136: { + A = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { case 132: return; default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 136: { A = input.ReadInt32(); @@ -5902,6 +7448,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -5910,25 +7457,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestGroupExtension : pb::IExtendableMessage { + public sealed partial class TestGroupExtension : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestGroupExtension()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroupExtension() { OnConstruction(); } @@ -5936,22 +7491,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroupExtension(TestGroupExtension other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestGroupExtension Clone() { return new TestGroupExtension(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestGroupExtension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestGroupExtension other) { if (ReferenceEquals(other, null)) { return false; @@ -5966,6 +7525,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -5978,21 +7538,41 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_extensions != null) { _extensions.WriteTo(output); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -6005,6 +7585,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestGroupExtension other) { if (other == null) { return; @@ -6014,7 +7595,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6025,7 +7610,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6051,23 +7654,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestNestedExtension : pb::IMessage { + public sealed partial class TestNestedExtension : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestNestedExtension()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedExtension() { OnConstruction(); } @@ -6075,21 +7686,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedExtension(TestNestedExtension other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedExtension Clone() { return new TestNestedExtension(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestNestedExtension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestNestedExtension other) { if (ReferenceEquals(other, null)) { return false; @@ -6101,6 +7716,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -6110,18 +7726,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -6131,6 +7764,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestNestedExtension other) { if (other == null) { return; @@ -6139,7 +7773,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6148,30 +7786,55 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif #region Nested types /// Container for nested types declared in the TestNestedExtension message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class OptionalGroup_extension : pb::IMessage { + public sealed partial class OptionalGroup_extension : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup_extension()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestNestedExtension.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension() { OnConstruction(); } @@ -6179,6 +7842,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension(OptionalGroup_extension other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -6186,6 +7850,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup_extension Clone() { return new OptionalGroup_extension(this); } @@ -6196,6 +7861,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -6205,21 +7871,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup_extension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup_extension other) { if (ReferenceEquals(other, null)) { return false; @@ -6232,6 +7902,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -6242,12 +7913,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(136, 1); output.WriteInt32(A); @@ -6255,9 +7931,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(136, 1); + output.WriteInt32(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -6270,6 +7962,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup_extension other) { if (other == null) { return; @@ -6281,7 +7974,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6296,7 +7993,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 132: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 136: { + A = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -6306,6 +8025,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Extensions /// Container for extensions for other messages declared in the TestNestedExtension message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { /// /// Check for bug where string extensions declared in tested scope did not @@ -6335,25 +8055,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// required filed because the code output is basically identical to /// optional fields for all types. /// - public sealed partial class TestRequired : pb::IMessage { + public sealed partial class TestRequired : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequired()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; private int _hasBits1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequired() { OnConstruction(); } @@ -6361,6 +8089,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequired(TestRequired other) : this() { _hasBits0 = other._hasBits0; _hasBits1 = other._hasBits1; @@ -6401,6 +8130,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequired Clone() { return new TestRequired(this); } @@ -6411,6 +8141,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -6420,11 +8151,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -6435,6 +8168,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy2 { get { if ((_hasBits0 & 2) != 0) { return dummy2_; } else { return Dummy2DefaultValue; } } set { @@ -6444,11 +8178,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy2" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy2 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "dummy2" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy2() { _hasBits0 &= ~2; } @@ -6459,6 +8195,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int B { get { if ((_hasBits0 & 4) != 0) { return b_; } else { return BDefaultValue; } } set { @@ -6468,11 +8205,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "b" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasB { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "b" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearB() { _hasBits0 &= ~4; } @@ -6487,6 +8226,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// properly checks multiple elements of has_bits_. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy4 { get { if ((_hasBits0 & 8) != 0) { return dummy4_; } else { return Dummy4DefaultValue; } } set { @@ -6496,11 +8236,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy4" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy4 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "dummy4" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy4() { _hasBits0 &= ~8; } @@ -6511,6 +8253,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy5_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy5 { get { if ((_hasBits0 & 16) != 0) { return dummy5_; } else { return Dummy5DefaultValue; } } set { @@ -6520,11 +8263,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy5" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy5 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "dummy5" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy5() { _hasBits0 &= ~16; } @@ -6535,6 +8280,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy6 { get { if ((_hasBits0 & 32) != 0) { return dummy6_; } else { return Dummy6DefaultValue; } } set { @@ -6544,11 +8290,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy6" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy6 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "dummy6" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy6() { _hasBits0 &= ~32; } @@ -6559,6 +8307,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy7_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy7 { get { if ((_hasBits0 & 64) != 0) { return dummy7_; } else { return Dummy7DefaultValue; } } set { @@ -6568,11 +8317,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy7" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy7 { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "dummy7" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy7() { _hasBits0 &= ~64; } @@ -6583,6 +8334,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy8 { get { if ((_hasBits0 & 128) != 0) { return dummy8_; } else { return Dummy8DefaultValue; } } set { @@ -6592,11 +8344,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy8" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy8 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "dummy8" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy8() { _hasBits0 &= ~128; } @@ -6607,6 +8361,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy9_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy9 { get { if ((_hasBits0 & 256) != 0) { return dummy9_; } else { return Dummy9DefaultValue; } } set { @@ -6616,11 +8371,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy9" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy9 { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "dummy9" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy9() { _hasBits0 &= ~256; } @@ -6631,6 +8388,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy10_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy10 { get { if ((_hasBits0 & 512) != 0) { return dummy10_; } else { return Dummy10DefaultValue; } } set { @@ -6640,11 +8398,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy10" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy10 { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "dummy10" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy10() { _hasBits0 &= ~512; } @@ -6655,6 +8415,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy11_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy11 { get { if ((_hasBits0 & 1024) != 0) { return dummy11_; } else { return Dummy11DefaultValue; } } set { @@ -6664,11 +8425,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy11" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy11 { get { return (_hasBits0 & 1024) != 0; } } /// Clears the value of the "dummy11" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy11() { _hasBits0 &= ~1024; } @@ -6679,6 +8442,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy12_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy12 { get { if ((_hasBits0 & 2048) != 0) { return dummy12_; } else { return Dummy12DefaultValue; } } set { @@ -6688,11 +8452,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy12" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy12 { get { return (_hasBits0 & 2048) != 0; } } /// Clears the value of the "dummy12" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy12() { _hasBits0 &= ~2048; } @@ -6703,6 +8469,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy13_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy13 { get { if ((_hasBits0 & 4096) != 0) { return dummy13_; } else { return Dummy13DefaultValue; } } set { @@ -6712,11 +8479,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy13" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy13 { get { return (_hasBits0 & 4096) != 0; } } /// Clears the value of the "dummy13" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy13() { _hasBits0 &= ~4096; } @@ -6727,6 +8496,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy14_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy14 { get { if ((_hasBits0 & 8192) != 0) { return dummy14_; } else { return Dummy14DefaultValue; } } set { @@ -6736,11 +8506,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy14" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy14 { get { return (_hasBits0 & 8192) != 0; } } /// Clears the value of the "dummy14" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy14() { _hasBits0 &= ~8192; } @@ -6751,6 +8523,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy15_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy15 { get { if ((_hasBits0 & 16384) != 0) { return dummy15_; } else { return Dummy15DefaultValue; } } set { @@ -6760,11 +8533,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy15" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy15 { get { return (_hasBits0 & 16384) != 0; } } /// Clears the value of the "dummy15" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy15() { _hasBits0 &= ~16384; } @@ -6775,6 +8550,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy16_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy16 { get { if ((_hasBits0 & 32768) != 0) { return dummy16_; } else { return Dummy16DefaultValue; } } set { @@ -6784,11 +8560,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy16" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy16 { get { return (_hasBits0 & 32768) != 0; } } /// Clears the value of the "dummy16" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy16() { _hasBits0 &= ~32768; } @@ -6799,6 +8577,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy17_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy17 { get { if ((_hasBits0 & 65536) != 0) { return dummy17_; } else { return Dummy17DefaultValue; } } set { @@ -6808,11 +8587,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy17" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy17 { get { return (_hasBits0 & 65536) != 0; } } /// Clears the value of the "dummy17" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy17() { _hasBits0 &= ~65536; } @@ -6823,6 +8604,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy18_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy18 { get { if ((_hasBits0 & 131072) != 0) { return dummy18_; } else { return Dummy18DefaultValue; } } set { @@ -6832,11 +8614,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy18" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy18 { get { return (_hasBits0 & 131072) != 0; } } /// Clears the value of the "dummy18" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy18() { _hasBits0 &= ~131072; } @@ -6847,6 +8631,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy19_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy19 { get { if ((_hasBits0 & 262144) != 0) { return dummy19_; } else { return Dummy19DefaultValue; } } set { @@ -6856,11 +8641,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy19" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy19 { get { return (_hasBits0 & 262144) != 0; } } /// Clears the value of the "dummy19" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy19() { _hasBits0 &= ~262144; } @@ -6871,6 +8658,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy20_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy20 { get { if ((_hasBits0 & 524288) != 0) { return dummy20_; } else { return Dummy20DefaultValue; } } set { @@ -6880,11 +8668,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy20" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy20 { get { return (_hasBits0 & 524288) != 0; } } /// Clears the value of the "dummy20" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy20() { _hasBits0 &= ~524288; } @@ -6895,6 +8685,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy21_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy21 { get { if ((_hasBits0 & 1048576) != 0) { return dummy21_; } else { return Dummy21DefaultValue; } } set { @@ -6904,11 +8695,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy21" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy21 { get { return (_hasBits0 & 1048576) != 0; } } /// Clears the value of the "dummy21" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy21() { _hasBits0 &= ~1048576; } @@ -6919,6 +8712,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy22_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy22 { get { if ((_hasBits0 & 2097152) != 0) { return dummy22_; } else { return Dummy22DefaultValue; } } set { @@ -6928,11 +8722,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy22" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy22 { get { return (_hasBits0 & 2097152) != 0; } } /// Clears the value of the "dummy22" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy22() { _hasBits0 &= ~2097152; } @@ -6943,6 +8739,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy23_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy23 { get { if ((_hasBits0 & 4194304) != 0) { return dummy23_; } else { return Dummy23DefaultValue; } } set { @@ -6952,11 +8749,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy23" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy23 { get { return (_hasBits0 & 4194304) != 0; } } /// Clears the value of the "dummy23" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy23() { _hasBits0 &= ~4194304; } @@ -6967,6 +8766,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy24_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy24 { get { if ((_hasBits0 & 8388608) != 0) { return dummy24_; } else { return Dummy24DefaultValue; } } set { @@ -6976,11 +8776,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy24" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy24 { get { return (_hasBits0 & 8388608) != 0; } } /// Clears the value of the "dummy24" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy24() { _hasBits0 &= ~8388608; } @@ -6991,6 +8793,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy25_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy25 { get { if ((_hasBits0 & 16777216) != 0) { return dummy25_; } else { return Dummy25DefaultValue; } } set { @@ -7000,11 +8803,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy25" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy25 { get { return (_hasBits0 & 16777216) != 0; } } /// Clears the value of the "dummy25" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy25() { _hasBits0 &= ~16777216; } @@ -7015,6 +8820,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy26_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy26 { get { if ((_hasBits0 & 33554432) != 0) { return dummy26_; } else { return Dummy26DefaultValue; } } set { @@ -7024,11 +8830,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy26" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy26 { get { return (_hasBits0 & 33554432) != 0; } } /// Clears the value of the "dummy26" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy26() { _hasBits0 &= ~33554432; } @@ -7039,6 +8847,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy27_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy27 { get { if ((_hasBits0 & 67108864) != 0) { return dummy27_; } else { return Dummy27DefaultValue; } } set { @@ -7048,11 +8857,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy27" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy27 { get { return (_hasBits0 & 67108864) != 0; } } /// Clears the value of the "dummy27" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy27() { _hasBits0 &= ~67108864; } @@ -7063,6 +8874,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy28_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy28 { get { if ((_hasBits0 & 134217728) != 0) { return dummy28_; } else { return Dummy28DefaultValue; } } set { @@ -7072,11 +8884,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy28" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy28 { get { return (_hasBits0 & 134217728) != 0; } } /// Clears the value of the "dummy28" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy28() { _hasBits0 &= ~134217728; } @@ -7087,6 +8901,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy29_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy29 { get { if ((_hasBits0 & 268435456) != 0) { return dummy29_; } else { return Dummy29DefaultValue; } } set { @@ -7096,11 +8911,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy29" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy29 { get { return (_hasBits0 & 268435456) != 0; } } /// Clears the value of the "dummy29" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy29() { _hasBits0 &= ~268435456; } @@ -7111,6 +8928,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy30_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy30 { get { if ((_hasBits0 & 536870912) != 0) { return dummy30_; } else { return Dummy30DefaultValue; } } set { @@ -7120,11 +8938,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy30" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy30 { get { return (_hasBits0 & 536870912) != 0; } } /// Clears the value of the "dummy30" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy30() { _hasBits0 &= ~536870912; } @@ -7135,6 +8955,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy31_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy31 { get { if ((_hasBits0 & 1073741824) != 0) { return dummy31_; } else { return Dummy31DefaultValue; } } set { @@ -7144,11 +8965,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy31" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy31 { get { return (_hasBits0 & 1073741824) != 0; } } /// Clears the value of the "dummy31" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy31() { _hasBits0 &= ~1073741824; } @@ -7159,6 +8982,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy32 { get { if ((_hasBits0 & -2147483648) != 0) { return dummy32_; } else { return Dummy32DefaultValue; } } set { @@ -7168,11 +8992,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy32 { get { return (_hasBits0 & -2147483648) != 0; } } /// Clears the value of the "dummy32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy32() { _hasBits0 &= ~-2147483648; } @@ -7183,6 +9009,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { if ((_hasBits1 & 1) != 0) { return c_; } else { return CDefaultValue; } } set { @@ -7192,21 +9019,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "c" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasC { get { return (_hasBits1 & 1) != 0; } } /// Clears the value of the "c" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearC() { _hasBits1 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequired); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequired other) { if (ReferenceEquals(other, null)) { return false; @@ -7251,6 +9082,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -7293,12 +9125,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(8); output.WriteInt32(A); @@ -7434,9 +9271,153 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(8); + output.WriteInt32(A); + } + if (HasDummy2) { + output.WriteRawTag(16); + output.WriteInt32(Dummy2); + } + if (HasB) { + output.WriteRawTag(24); + output.WriteInt32(B); + } + if (HasDummy4) { + output.WriteRawTag(32); + output.WriteInt32(Dummy4); + } + if (HasDummy5) { + output.WriteRawTag(40); + output.WriteInt32(Dummy5); + } + if (HasDummy6) { + output.WriteRawTag(48); + output.WriteInt32(Dummy6); + } + if (HasDummy7) { + output.WriteRawTag(56); + output.WriteInt32(Dummy7); + } + if (HasDummy8) { + output.WriteRawTag(64); + output.WriteInt32(Dummy8); + } + if (HasDummy9) { + output.WriteRawTag(72); + output.WriteInt32(Dummy9); + } + if (HasDummy10) { + output.WriteRawTag(80); + output.WriteInt32(Dummy10); + } + if (HasDummy11) { + output.WriteRawTag(88); + output.WriteInt32(Dummy11); + } + if (HasDummy12) { + output.WriteRawTag(96); + output.WriteInt32(Dummy12); + } + if (HasDummy13) { + output.WriteRawTag(104); + output.WriteInt32(Dummy13); + } + if (HasDummy14) { + output.WriteRawTag(112); + output.WriteInt32(Dummy14); + } + if (HasDummy15) { + output.WriteRawTag(120); + output.WriteInt32(Dummy15); + } + if (HasDummy16) { + output.WriteRawTag(128, 1); + output.WriteInt32(Dummy16); + } + if (HasDummy17) { + output.WriteRawTag(136, 1); + output.WriteInt32(Dummy17); + } + if (HasDummy18) { + output.WriteRawTag(144, 1); + output.WriteInt32(Dummy18); + } + if (HasDummy19) { + output.WriteRawTag(152, 1); + output.WriteInt32(Dummy19); + } + if (HasDummy20) { + output.WriteRawTag(160, 1); + output.WriteInt32(Dummy20); + } + if (HasDummy21) { + output.WriteRawTag(168, 1); + output.WriteInt32(Dummy21); + } + if (HasDummy22) { + output.WriteRawTag(176, 1); + output.WriteInt32(Dummy22); + } + if (HasDummy23) { + output.WriteRawTag(184, 1); + output.WriteInt32(Dummy23); + } + if (HasDummy24) { + output.WriteRawTag(192, 1); + output.WriteInt32(Dummy24); + } + if (HasDummy25) { + output.WriteRawTag(200, 1); + output.WriteInt32(Dummy25); + } + if (HasDummy26) { + output.WriteRawTag(208, 1); + output.WriteInt32(Dummy26); + } + if (HasDummy27) { + output.WriteRawTag(216, 1); + output.WriteInt32(Dummy27); + } + if (HasDummy28) { + output.WriteRawTag(224, 1); + output.WriteInt32(Dummy28); + } + if (HasDummy29) { + output.WriteRawTag(232, 1); + output.WriteInt32(Dummy29); + } + if (HasDummy30) { + output.WriteRawTag(240, 1); + output.WriteInt32(Dummy30); + } + if (HasDummy31) { + output.WriteRawTag(248, 1); + output.WriteInt32(Dummy31); + } + if (HasDummy32) { + output.WriteRawTag(128, 2); + output.WriteInt32(Dummy32); + } + if (HasC) { + output.WriteRawTag(136, 2); + output.WriteInt32(C); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -7545,6 +9526,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequired other) { if (other == null) { return; @@ -7648,16 +9630,167 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasC) { C = other.C; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 16: { + Dummy2 = input.ReadInt32(); + break; + } + case 24: { + B = input.ReadInt32(); + break; + } + case 32: { + Dummy4 = input.ReadInt32(); + break; + } + case 40: { + Dummy5 = input.ReadInt32(); + break; + } + case 48: { + Dummy6 = input.ReadInt32(); + break; + } + case 56: { + Dummy7 = input.ReadInt32(); + break; + } + case 64: { + Dummy8 = input.ReadInt32(); + break; + } + case 72: { + Dummy9 = input.ReadInt32(); + break; + } + case 80: { + Dummy10 = input.ReadInt32(); + break; + } + case 88: { + Dummy11 = input.ReadInt32(); + break; + } + case 96: { + Dummy12 = input.ReadInt32(); + break; + } + case 104: { + Dummy13 = input.ReadInt32(); + break; + } + case 112: { + Dummy14 = input.ReadInt32(); + break; + } + case 120: { + Dummy15 = input.ReadInt32(); + break; + } + case 128: { + Dummy16 = input.ReadInt32(); + break; + } + case 136: { + Dummy17 = input.ReadInt32(); + break; + } + case 144: { + Dummy18 = input.ReadInt32(); + break; + } + case 152: { + Dummy19 = input.ReadInt32(); + break; + } + case 160: { + Dummy20 = input.ReadInt32(); + break; + } + case 168: { + Dummy21 = input.ReadInt32(); + break; + } + case 176: { + Dummy22 = input.ReadInt32(); + break; + } + case 184: { + Dummy23 = input.ReadInt32(); + break; + } + case 192: { + Dummy24 = input.ReadInt32(); + break; + } + case 200: { + Dummy25 = input.ReadInt32(); + break; + } + case 208: { + Dummy26 = input.ReadInt32(); + break; + } + case 216: { + Dummy27 = input.ReadInt32(); + break; + } + case 224: { + Dummy28 = input.ReadInt32(); + break; + } + case 232: { + Dummy29 = input.ReadInt32(); + break; + } + case 240: { + Dummy30 = input.ReadInt32(); + break; + } + case 248: { + Dummy31 = input.ReadInt32(); + break; + } + case 256: { + Dummy32 = input.ReadInt32(); + break; + } + case 264: { + C = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { A = input.ReadInt32(); @@ -7794,10 +9927,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Extensions /// Container for extensions for other messages declared in the TestRequired message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension Single = new pb::Extension(1000, pb::FieldCodec.ForMessage(8002, global::Google.Protobuf.TestProtos.Proto2.TestRequired.Parser)); @@ -7808,24 +9943,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestRequiredForeign : pb::IMessage { + public sealed partial class TestRequiredForeign : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredForeign()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredForeign() { OnConstruction(); } @@ -7833,15 +9976,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredForeign(TestRequiredForeign other) : this() { _hasBits0 = other._hasBits0; - optionalMessage_ = other.HasOptionalMessage ? other.optionalMessage_.Clone() : null; + optionalMessage_ = other.optionalMessage_ != null ? other.optionalMessage_.Clone() : null; repeatedMessage_ = other.repeatedMessage_.Clone(); dummy_ = other.dummy_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredForeign Clone() { return new TestRequiredForeign(this); } @@ -7850,22 +9995,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestRequired optionalMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRequired OptionalMessage { get { return optionalMessage_; } set { optionalMessage_ = value; } } - /// Gets whether the optional_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalMessage { - get { return optionalMessage_ != null; } - } - /// Clears the value of the optional_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalMessage() { - optionalMessage_ = null; - } /// Field number for the "repeated_message" field. public const int RepeatedMessageFieldNumber = 2; @@ -7873,6 +10009,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.TestRequired.Parser); private readonly pbc::RepeatedField repeatedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedMessage { get { return repeatedMessage_; } } @@ -7883,6 +10020,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dummy_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Dummy { get { if ((_hasBits0 & 1) != 0) { return dummy_; } else { return DummyDefaultValue; } } set { @@ -7892,21 +10030,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dummy" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDummy { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "dummy" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDummy() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequiredForeign); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequiredForeign other) { if (ReferenceEquals(other, null)) { return false; @@ -7921,9 +10063,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasOptionalMessage) hash ^= OptionalMessage.GetHashCode(); + if (optionalMessage_ != null) hash ^= OptionalMessage.GetHashCode(); hash ^= repeatedMessage_.GetHashCode(); if (HasDummy) hash ^= Dummy.GetHashCode(); if (_unknownFields != null) { @@ -7933,13 +10076,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasOptionalMessage) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (optionalMessage_ != null) { output.WriteRawTag(10); output.WriteMessage(OptionalMessage); } @@ -7951,12 +10099,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (optionalMessage_ != null) { + output.WriteRawTag(10); + output.WriteMessage(OptionalMessage); + } + repeatedMessage_.WriteTo(ref output, _repeated_repeatedMessage_codec); + if (HasDummy) { + output.WriteRawTag(24); + output.WriteInt32(Dummy); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasOptionalMessage) { + if (optionalMessage_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(OptionalMessage); } size += repeatedMessage_.CalculateSize(_repeated_repeatedMessage_codec); @@ -7970,12 +10139,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequiredForeign other) { if (other == null) { return; } - if (other.HasOptionalMessage) { - if (!HasOptionalMessage) { + if (other.optionalMessage_ != null) { + if (optionalMessage_ == null) { OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); } OptionalMessage.MergeFrom(other.OptionalMessage); @@ -7988,7 +10158,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7996,7 +10170,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasOptionalMessage) { + if (optionalMessage_ == null) { OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); } input.ReadMessage(OptionalMessage); @@ -8012,27 +10186,66 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (optionalMessage_ == null) { + OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); + } + input.ReadMessage(OptionalMessage); + break; + } + case 18: { + repeatedMessage_.AddEntriesFrom(ref input, _repeated_repeatedMessage_codec); + break; + } + case 24: { + Dummy = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class TestRequiredMessage : pb::IMessage { + public sealed partial class TestRequiredMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMessage() { OnConstruction(); } @@ -8040,14 +10253,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMessage(TestRequiredMessage other) : this() { - optionalMessage_ = other.HasOptionalMessage ? other.optionalMessage_.Clone() : null; + optionalMessage_ = other.optionalMessage_ != null ? other.optionalMessage_.Clone() : null; repeatedMessage_ = other.repeatedMessage_.Clone(); - requiredMessage_ = other.HasRequiredMessage ? other.requiredMessage_.Clone() : null; + requiredMessage_ = other.requiredMessage_ != null ? other.requiredMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMessage Clone() { return new TestRequiredMessage(this); } @@ -8056,22 +10271,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestRequired optionalMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRequired OptionalMessage { get { return optionalMessage_; } set { optionalMessage_ = value; } } - /// Gets whether the optional_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalMessage { - get { return optionalMessage_ != null; } - } - /// Clears the value of the optional_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalMessage() { - optionalMessage_ = null; - } /// Field number for the "repeated_message" field. public const int RepeatedMessageFieldNumber = 2; @@ -8079,6 +10285,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.TestRequired.Parser); private readonly pbc::RepeatedField repeatedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedMessage { get { return repeatedMessage_; } } @@ -8087,29 +10294,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int RequiredMessageFieldNumber = 3; private global::Google.Protobuf.TestProtos.Proto2.TestRequired requiredMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRequired RequiredMessage { get { return requiredMessage_; } set { requiredMessage_ = value; } } - /// Gets whether the required_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasRequiredMessage { - get { return requiredMessage_ != null; } - } - /// Clears the value of the required_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearRequiredMessage() { - requiredMessage_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequiredMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequiredMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -8124,11 +10324,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasOptionalMessage) hash ^= OptionalMessage.GetHashCode(); + if (optionalMessage_ != null) hash ^= OptionalMessage.GetHashCode(); hash ^= repeatedMessage_.GetHashCode(); - if (HasRequiredMessage) hash ^= RequiredMessage.GetHashCode(); + if (requiredMessage_ != null) hash ^= RequiredMessage.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -8136,34 +10337,60 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasOptionalMessage) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (optionalMessage_ != null) { output.WriteRawTag(10); output.WriteMessage(OptionalMessage); } repeatedMessage_.WriteTo(output, _repeated_repeatedMessage_codec); - if (HasRequiredMessage) { + if (requiredMessage_ != null) { output.WriteRawTag(26); output.WriteMessage(RequiredMessage); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (optionalMessage_ != null) { + output.WriteRawTag(10); + output.WriteMessage(OptionalMessage); + } + repeatedMessage_.WriteTo(ref output, _repeated_repeatedMessage_codec); + if (requiredMessage_ != null) { + output.WriteRawTag(26); + output.WriteMessage(RequiredMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasOptionalMessage) { + if (optionalMessage_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(OptionalMessage); } size += repeatedMessage_.CalculateSize(_repeated_repeatedMessage_codec); - if (HasRequiredMessage) { + if (requiredMessage_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(RequiredMessage); } if (_unknownFields != null) { @@ -8173,19 +10400,20 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequiredMessage other) { if (other == null) { return; } - if (other.HasOptionalMessage) { - if (!HasOptionalMessage) { + if (other.optionalMessage_ != null) { + if (optionalMessage_ == null) { OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); } OptionalMessage.MergeFrom(other.OptionalMessage); } repeatedMessage_.Add(other.repeatedMessage_); - if (other.HasRequiredMessage) { - if (!HasRequiredMessage) { + if (other.requiredMessage_ != null) { + if (requiredMessage_ == null) { RequiredMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); } RequiredMessage.MergeFrom(other.RequiredMessage); @@ -8194,7 +10422,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -8202,7 +10434,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasOptionalMessage) { + if (optionalMessage_ == null) { OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); } input.ReadMessage(OptionalMessage); @@ -8213,7 +10445,40 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } case 26: { - if (!HasRequiredMessage) { + if (requiredMessage_ == null) { + RequiredMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); + } + input.ReadMessage(RequiredMessage); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (optionalMessage_ == null) { + OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); + } + input.ReadMessage(OptionalMessage); + break; + } + case 18: { + repeatedMessage_.AddEntriesFrom(ref input, _repeated_repeatedMessage_codec); + break; + } + case 26: { + if (requiredMessage_ == null) { RequiredMessage = new global::Google.Protobuf.TestProtos.Proto2.TestRequired(); } input.ReadMessage(RequiredMessage); @@ -8222,29 +10487,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Test that we can use NestedMessage from outside TestAllTypes. /// - public sealed partial class TestForeignNested : pb::IMessage { + public sealed partial class TestForeignNested : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestForeignNested()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested() { OnConstruction(); } @@ -8252,12 +10526,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested(TestForeignNested other) : this() { - foreignNested_ = other.HasForeignNested ? other.foreignNested_.Clone() : null; + foreignNested_ = other.foreignNested_ != null ? other.foreignNested_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested Clone() { return new TestForeignNested(this); } @@ -8266,29 +10542,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int ForeignNestedFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage foreignNested_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage ForeignNested { get { return foreignNested_; } set { foreignNested_ = value; } } - /// Gets whether the foreign_nested field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasForeignNested { - get { return foreignNested_ != null; } - } - /// Clears the value of the foreign_nested field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearForeignNested() { - foreignNested_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestForeignNested); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestForeignNested other) { if (ReferenceEquals(other, null)) { return false; @@ -8301,9 +10570,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasForeignNested) hash ^= ForeignNested.GetHashCode(); + if (foreignNested_ != null) hash ^= ForeignNested.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -8311,25 +10581,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasForeignNested) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (foreignNested_ != null) { output.WriteRawTag(10); output.WriteMessage(ForeignNested); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (foreignNested_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ForeignNested); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasForeignNested) { + if (foreignNested_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ForeignNested); } if (_unknownFields != null) { @@ -8339,12 +10630,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestForeignNested other) { if (other == null) { return; } - if (other.HasForeignNested) { - if (!HasForeignNested) { + if (other.foreignNested_ != null) { + if (foreignNested_ == null) { ForeignNested = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); } ForeignNested.MergeFrom(other.ForeignNested); @@ -8353,7 +10645,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -8361,7 +10657,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasForeignNested) { + if (foreignNested_ == null) { + ForeignNested = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(ForeignNested); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (foreignNested_ == null) { ForeignNested = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Types.NestedMessage(); } input.ReadMessage(ForeignNested); @@ -8370,29 +10688,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// TestEmptyMessage is used to test unknown field support. /// - public sealed partial class TestEmptyMessage : pb::IMessage { + public sealed partial class TestEmptyMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage() { OnConstruction(); } @@ -8400,21 +10727,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage(TestEmptyMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage Clone() { return new TestEmptyMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEmptyMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEmptyMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -8426,6 +10757,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -8435,18 +10767,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -8456,6 +10805,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEmptyMessage other) { if (other == null) { return; @@ -8464,7 +10814,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -8473,7 +10827,23 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } @@ -8481,25 +10851,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Like above, but declare all field numbers as potential extensions. No /// actual extensions should ever be defined for this type. /// - public sealed partial class TestEmptyMessageWithExtensions : pb::IExtendableMessage { + public sealed partial class TestEmptyMessageWithExtensions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessageWithExtensions()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[17]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessageWithExtensions() { OnConstruction(); } @@ -8507,22 +10885,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessageWithExtensions(TestEmptyMessageWithExtensions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessageWithExtensions Clone() { return new TestEmptyMessageWithExtensions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEmptyMessageWithExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEmptyMessageWithExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -8537,6 +10919,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -8549,21 +10932,41 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_extensions != null) { _extensions.WriteTo(output); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -8576,6 +10979,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEmptyMessageWithExtensions other) { if (other == null) { return; @@ -8585,7 +10989,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -8596,7 +11004,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -8622,25 +11048,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestMultipleExtensionRanges : pb::IExtendableMessage { + public sealed partial class TestMultipleExtensionRanges : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMultipleExtensionRanges()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMultipleExtensionRanges() { OnConstruction(); } @@ -8648,22 +11082,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMultipleExtensionRanges(TestMultipleExtensionRanges other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMultipleExtensionRanges Clone() { return new TestMultipleExtensionRanges(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMultipleExtensionRanges); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMultipleExtensionRanges other) { if (ReferenceEquals(other, null)) { return false; @@ -8678,6 +11116,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -8690,21 +11129,41 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_extensions != null) { _extensions.WriteTo(output); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -8717,27 +11176,50 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMultipleExtensionRanges other) { if (other == null) { return; } - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); } break; } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -8766,24 +11248,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Test that really large tag numbers don't break anything. /// - public sealed partial class TestReallyLargeTagNumber : pb::IMessage { + public sealed partial class TestReallyLargeTagNumber : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReallyLargeTagNumber()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[19]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber() { OnConstruction(); } @@ -8791,6 +11281,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber(TestReallyLargeTagNumber other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -8799,6 +11290,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber Clone() { return new TestReallyLargeTagNumber(this); } @@ -8813,6 +11305,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// three bits to communicate wire type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -8822,11 +11315,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -8837,6 +11332,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int bb_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { if ((_hasBits0 & 2) != 0) { return bb_; } else { return BbDefaultValue; } } set { @@ -8846,21 +11342,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bb" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBb { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "bb" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBb() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestReallyLargeTagNumber); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestReallyLargeTagNumber other) { if (ReferenceEquals(other, null)) { return false; @@ -8874,6 +11374,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -8885,12 +11386,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(8); output.WriteInt32(A); @@ -8902,9 +11408,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(8); + output.WriteInt32(A); + } + if (HasBb) { + output.WriteRawTag(248, 255, 255, 255, 7); + output.WriteInt32(Bb); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -8920,6 +11446,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestReallyLargeTagNumber other) { if (other == null) { return; @@ -8934,7 +11461,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -8951,28 +11482,60 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 2147483640: { + Bb = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class TestRecursiveMessage : pb::IMessage { + public sealed partial class TestRecursiveMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRecursiveMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[20]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage() { OnConstruction(); } @@ -8980,14 +11543,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage(TestRecursiveMessage other) : this() { _hasBits0 = other._hasBits0; - a_ = other.HasA ? other.a_.Clone() : null; + a_ = other.a_ != null ? other.a_.Clone() : null; i_ = other.i_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage Clone() { return new TestRecursiveMessage(this); } @@ -8996,22 +11561,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestRecursiveMessage a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRecursiveMessage A { get { return a_; } set { a_ = value; } } - /// Gets whether the a field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasA { - get { return a_ != null; } - } - /// Clears the value of the a field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearA() { - a_ = null; - } /// Field number for the "i" field. public const int IFieldNumber = 2; @@ -9019,6 +11575,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { if ((_hasBits0 & 1) != 0) { return i_; } else { return IDefaultValue; } } set { @@ -9028,21 +11585,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "i" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasI { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "i" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearI() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRecursiveMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRecursiveMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -9056,9 +11617,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasA) hash ^= A.GetHashCode(); + if (a_ != null) hash ^= A.GetHashCode(); if (HasI) hash ^= I.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -9067,13 +11629,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasA) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (a_ != null) { output.WriteRawTag(10); output.WriteMessage(A); } @@ -9084,12 +11651,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (a_ != null) { + output.WriteRawTag(10); + output.WriteMessage(A); + } + if (HasI) { + output.WriteRawTag(16); + output.WriteInt32(I); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasA) { + if (a_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(A); } if (HasI) { @@ -9102,12 +11689,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRecursiveMessage other) { if (other == null) { return; } - if (other.HasA) { - if (!HasA) { + if (other.a_ != null) { + if (a_ == null) { A = new global::Google.Protobuf.TestProtos.Proto2.TestRecursiveMessage(); } A.MergeFrom(other.A); @@ -9119,7 +11707,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -9127,7 +11719,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasA) { + if (a_ == null) { + A = new global::Google.Protobuf.TestProtos.Proto2.TestRecursiveMessage(); + } + input.ReadMessage(A); + break; + } + case 16: { + I = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (a_ == null) { A = new global::Google.Protobuf.TestProtos.Proto2.TestRecursiveMessage(); } input.ReadMessage(A); @@ -9140,29 +11758,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Test that mutual recursion works. /// - public sealed partial class TestMutualRecursionA : pb::IMessage { + public sealed partial class TestMutualRecursionA : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionA()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[21]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA() { OnConstruction(); } @@ -9170,13 +11797,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA(TestMutualRecursionA other) : this() { - bb_ = other.HasBb ? other.bb_.Clone() : null; + bb_ = other.bb_ != null ? other.bb_.Clone() : null; subGroup_ = other.HasSubGroup ? other.subGroup_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA Clone() { return new TestMutualRecursionA(this); } @@ -9185,27 +11814,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int BbFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB bb_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB Bb { get { return bb_; } set { bb_ = value; } } - /// Gets whether the bb field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasBb { - get { return bb_ != null; } - } - /// Clears the value of the bb field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearBb() { - bb_ = null; - } /// Field number for the "subgroup" field. public const int SubGroupFieldNumber = 2; private global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubGroup subGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubGroup SubGroup { get { return subGroup_; } set { @@ -9214,21 +11835,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the subgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSubGroup { get { return subGroup_ != null; } } /// Clears the value of the subgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSubGroup() { subGroup_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMutualRecursionA); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMutualRecursionA other) { if (ReferenceEquals(other, null)) { return false; @@ -9242,9 +11867,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasBb) hash ^= Bb.GetHashCode(); + if (bb_ != null) hash ^= Bb.GetHashCode(); if (HasSubGroup) hash ^= SubGroup.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -9253,13 +11879,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasBb) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (bb_ != null) { output.WriteRawTag(10); output.WriteMessage(Bb); } @@ -9271,12 +11902,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (bb_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Bb); + } + if (HasSubGroup) { + output.WriteRawTag(19); + output.WriteGroup(SubGroup); + output.WriteRawTag(20); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasBb) { + if (bb_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Bb); } if (HasSubGroup) { @@ -9289,12 +11941,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMutualRecursionA other) { if (other == null) { return; } - if (other.HasBb) { - if (!HasBb) { + if (other.bb_ != null) { + if (bb_ == null) { Bb = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB(); } Bb.MergeFrom(other.Bb); @@ -9309,7 +11962,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -9317,7 +11974,36 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasBb) { + if (bb_ == null) { + Bb = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB(); + } + input.ReadMessage(Bb); + break; + } + case 19: { + if (!HasSubGroup) { + SubGroup = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubGroup(); + } + input.ReadGroup(SubGroup); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (bb_ == null) { Bb = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB(); } input.ReadMessage(Bb); @@ -9333,28 +12019,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestMutualRecursionA message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class SubMessage : pb::IMessage { + public sealed partial class SubMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage() { OnConstruction(); } @@ -9362,12 +12058,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage(SubMessage other) : this() { - b_ = other.HasB ? other.b_.Clone() : null; + b_ = other.b_ != null ? other.b_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage Clone() { return new SubMessage(this); } @@ -9376,29 +12074,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int BFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB B { get { return b_; } set { b_ = value; } } - /// Gets whether the b field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasB { - get { return b_ != null; } - } - /// Clears the value of the b field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearB() { - b_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SubMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SubMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -9411,9 +12102,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasB) hash ^= B.GetHashCode(); + if (b_ != null) hash ^= B.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -9421,25 +12113,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasB) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (b_ != null) { output.WriteRawTag(10); output.WriteMessage(B); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (b_ != null) { + output.WriteRawTag(10); + output.WriteMessage(B); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasB) { + if (b_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(B); } if (_unknownFields != null) { @@ -9449,12 +12162,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SubMessage other) { if (other == null) { return; } - if (other.HasB) { - if (!HasB) { + if (other.b_ != null) { + if (b_ == null) { B = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB(); } B.MergeFrom(other.B); @@ -9463,7 +12177,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -9471,7 +12189,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasB) { + if (b_ == null) { + B = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB(); + } + input.ReadMessage(B); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (b_ == null) { B = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionB(); } input.ReadMessage(B); @@ -9480,26 +12220,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class SubGroup : pb::IMessage { + public sealed partial class SubGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubGroup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup() { OnConstruction(); } @@ -9507,13 +12256,15 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup(SubGroup other) : this() { - subMessage_ = other.HasSubMessage ? other.subMessage_.Clone() : null; - notInThisScc_ = other.HasNotInThisScc ? other.notInThisScc_.Clone() : null; + subMessage_ = other.subMessage_ != null ? other.subMessage_.Clone() : null; + notInThisScc_ = other.notInThisScc_ != null ? other.notInThisScc_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup Clone() { return new SubGroup(this); } @@ -9525,50 +12276,34 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Needed because of bug in javatest /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubMessage SubMessage { get { return subMessage_; } set { subMessage_ = value; } } - /// Gets whether the sub_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasSubMessage { - get { return subMessage_ != null; } - } - /// Clears the value of the sub_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearSubMessage() { - subMessage_ = null; - } /// Field number for the "not_in_this_scc" field. public const int NotInThisSccFieldNumber = 4; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes notInThisScc_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes NotInThisScc { get { return notInThisScc_; } set { notInThisScc_ = value; } } - /// Gets whether the not_in_this_scc field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasNotInThisScc { - get { return notInThisScc_ != null; } - } - /// Clears the value of the not_in_this_scc field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearNotInThisScc() { - notInThisScc_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SubGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SubGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -9582,10 +12317,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasSubMessage) hash ^= SubMessage.GetHashCode(); - if (HasNotInThisScc) hash ^= NotInThisScc.GetHashCode(); + if (subMessage_ != null) hash ^= SubMessage.GetHashCode(); + if (notInThisScc_ != null) hash ^= NotInThisScc.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -9593,32 +12329,57 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasSubMessage) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (subMessage_ != null) { output.WriteRawTag(26); output.WriteMessage(SubMessage); } - if (HasNotInThisScc) { + if (notInThisScc_ != null) { output.WriteRawTag(34); output.WriteMessage(NotInThisScc); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (subMessage_ != null) { + output.WriteRawTag(26); + output.WriteMessage(SubMessage); + } + if (notInThisScc_ != null) { + output.WriteRawTag(34); + output.WriteMessage(NotInThisScc); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasSubMessage) { + if (subMessage_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SubMessage); } - if (HasNotInThisScc) { + if (notInThisScc_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(NotInThisScc); } if (_unknownFields != null) { @@ -9628,18 +12389,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SubGroup other) { if (other == null) { return; } - if (other.HasSubMessage) { - if (!HasSubMessage) { + if (other.subMessage_ != null) { + if (subMessage_ == null) { SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubMessage(); } SubMessage.MergeFrom(other.SubMessage); } - if (other.HasNotInThisScc) { - if (!HasNotInThisScc) { + if (other.notInThisScc_ != null) { + if (notInThisScc_ == null) { NotInThisScc = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } NotInThisScc.MergeFrom(other.NotInThisScc); @@ -9648,7 +12410,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -9658,14 +12424,45 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 26: { - if (!HasSubMessage) { + if (subMessage_ == null) { + SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubMessage(); + } + input.ReadMessage(SubMessage); + break; + } + case 34: { + if (notInThisScc_ == null) { + NotInThisScc = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(NotInThisScc); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 20: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 26: { + if (subMessage_ == null) { SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA.Types.SubMessage(); } input.ReadMessage(SubMessage); break; } case 34: { - if (!HasNotInThisScc) { + if (notInThisScc_ == null) { NotInThisScc = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(NotInThisScc); @@ -9674,6 +12471,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -9682,24 +12480,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestMutualRecursionB : pb::IMessage { + public sealed partial class TestMutualRecursionB : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionB()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[22]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB() { OnConstruction(); } @@ -9707,14 +12513,16 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB(TestMutualRecursionB other) : this() { _hasBits0 = other._hasBits0; - a_ = other.HasA ? other.a_.Clone() : null; + a_ = other.a_ != null ? other.a_.Clone() : null; optionalInt32_ = other.optionalInt32_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB Clone() { return new TestMutualRecursionB(this); } @@ -9723,22 +12531,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA A { get { return a_; } set { a_ = value; } } - /// Gets whether the a field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasA { - get { return a_ != null; } - } - /// Clears the value of the a field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearA() { - a_ = null; - } /// Field number for the "optional_int32" field. public const int OptionalInt32FieldNumber = 2; @@ -9746,6 +12545,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int optionalInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -9755,21 +12555,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMutualRecursionB); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMutualRecursionB other) { if (ReferenceEquals(other, null)) { return false; @@ -9783,9 +12587,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasA) hash ^= A.GetHashCode(); + if (a_ != null) hash ^= A.GetHashCode(); if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -9794,13 +12599,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasA) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (a_ != null) { output.WriteRawTag(10); output.WriteMessage(A); } @@ -9811,12 +12621,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (a_ != null) { + output.WriteRawTag(10); + output.WriteMessage(A); + } + if (HasOptionalInt32) { + output.WriteRawTag(16); + output.WriteInt32(OptionalInt32); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasA) { + if (a_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(A); } if (HasOptionalInt32) { @@ -9829,12 +12659,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMutualRecursionB other) { if (other == null) { return; } - if (other.HasA) { - if (!HasA) { + if (other.a_ != null) { + if (a_ == null) { A = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA(); } A.MergeFrom(other.A); @@ -9846,7 +12677,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -9854,7 +12689,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasA) { + if (a_ == null) { + A = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA(); + } + input.ReadMessage(A); + break; + } + case 16: { + OptionalInt32 = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (a_ == null) { A = new global::Google.Protobuf.TestProtos.Proto2.TestMutualRecursionA(); } input.ReadMessage(A); @@ -9867,26 +12728,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestIsInitialized : pb::IMessage { + public sealed partial class TestIsInitialized : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestIsInitialized()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[23]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestIsInitialized() { OnConstruction(); } @@ -9894,12 +12764,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestIsInitialized(TestIsInitialized other) : this() { - subMessage_ = other.HasSubMessage ? other.subMessage_.Clone() : null; + subMessage_ = other.subMessage_ != null ? other.subMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestIsInitialized Clone() { return new TestIsInitialized(this); } @@ -9908,29 +12780,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int SubMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage subMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage SubMessage { get { return subMessage_; } set { - subMessage_ = value; - } - } - /// Gets whether the sub_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasSubMessage { - get { return subMessage_ != null; } - } - /// Clears the value of the sub_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearSubMessage() { - subMessage_ = null; + subMessage_ = value; + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestIsInitialized); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestIsInitialized other) { if (ReferenceEquals(other, null)) { return false; @@ -9943,9 +12808,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasSubMessage) hash ^= SubMessage.GetHashCode(); + if (subMessage_ != null) hash ^= SubMessage.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -9953,25 +12819,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasSubMessage) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (subMessage_ != null) { output.WriteRawTag(10); output.WriteMessage(SubMessage); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (subMessage_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SubMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasSubMessage) { + if (subMessage_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SubMessage); } if (_unknownFields != null) { @@ -9981,12 +12868,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestIsInitialized other) { if (other == null) { return; } - if (other.HasSubMessage) { - if (!HasSubMessage) { + if (other.subMessage_ != null) { + if (subMessage_ == null) { SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage(); } SubMessage.MergeFrom(other.SubMessage); @@ -9995,7 +12883,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -10003,7 +12895,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasSubMessage) { + if (subMessage_ == null) { + SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage(); + } + input.ReadMessage(SubMessage); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (subMessage_ == null) { SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage(); } input.ReadMessage(SubMessage); @@ -10012,28 +12926,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestIsInitialized message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class SubMessage : pb::IMessage { + public sealed partial class SubMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage() { OnConstruction(); } @@ -10041,12 +12965,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage(SubMessage other) : this() { subGroup_ = other.HasSubGroup ? other.subGroup_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubMessage Clone() { return new SubMessage(this); } @@ -10055,6 +12981,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int SubGroupFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage.Types.SubGroup subGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage.Types.SubGroup SubGroup { get { return subGroup_; } set { @@ -10063,21 +12990,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the subgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSubGroup { get { return subGroup_ != null; } } /// Clears the value of the subgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSubGroup() { subGroup_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SubMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SubMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -10090,6 +13021,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasSubGroup) hash ^= SubGroup.GetHashCode(); @@ -10100,12 +13032,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasSubGroup) { output.WriteRawTag(11); output.WriteGroup(SubGroup); @@ -10114,9 +13051,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasSubGroup) { + output.WriteRawTag(11); + output.WriteGroup(SubGroup); + output.WriteRawTag(12); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasSubGroup) { @@ -10129,6 +13083,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SubMessage other) { if (other == null) { return; @@ -10143,7 +13098,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -10159,30 +13118,62 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 11: { + if (!HasSubGroup) { + SubGroup = new global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage.Types.SubGroup(); + } + input.ReadGroup(SubGroup); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the SubMessage message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class SubGroup : pb::IMessage { + public sealed partial class SubGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestIsInitialized.Types.SubMessage.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup() { OnConstruction(); } @@ -10190,6 +13181,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup(SubGroup other) : this() { _hasBits0 = other._hasBits0; i_ = other.i_; @@ -10197,6 +13189,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SubGroup Clone() { return new SubGroup(this); } @@ -10207,6 +13200,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { if ((_hasBits0 & 1) != 0) { return i_; } else { return IDefaultValue; } } set { @@ -10216,21 +13210,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "i" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasI { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "i" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearI() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SubGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SubGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -10243,6 +13241,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasI) hash ^= I.GetHashCode(); @@ -10253,12 +13252,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasI) { output.WriteRawTag(16); output.WriteInt32(I); @@ -10266,9 +13270,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasI) { + output.WriteRawTag(16); + output.WriteInt32(I); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasI) { @@ -10281,6 +13301,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SubGroup other) { if (other == null) { return; @@ -10292,7 +13313,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -10307,7 +13332,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 12: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 16: { + I = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -10327,24 +13374,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// to compile with proto1, this will emit an error; so we only include it /// in protobuf_unittest_proto. /// - public sealed partial class TestDupFieldNumber : pb::IMessage { + public sealed partial class TestDupFieldNumber : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDupFieldNumber()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[24]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDupFieldNumber() { OnConstruction(); } @@ -10352,6 +13407,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDupFieldNumber(TestDupFieldNumber other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -10361,6 +13417,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDupFieldNumber Clone() { return new TestDupFieldNumber(this); } @@ -10374,6 +13431,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// NO_PROTO1 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -10383,11 +13441,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -10396,6 +13456,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int FooFieldNumber = 2; private global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Foo foo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Foo Foo { get { return foo_; } set { @@ -10404,11 +13465,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the foo field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFoo { get { return foo_ != null; } } /// Clears the value of the foo field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { foo_ = null; } @@ -10417,6 +13480,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int BarFieldNumber = 3; private global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Bar bar_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Bar Bar { get { return bar_; } set { @@ -10425,21 +13489,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the bar field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBar { get { return bar_ != null; } } /// Clears the value of the bar field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBar() { bar_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDupFieldNumber); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDupFieldNumber other) { if (ReferenceEquals(other, null)) { return false; @@ -10454,6 +13522,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -10466,12 +13535,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(8); output.WriteInt32(A); @@ -10489,9 +13563,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(8); + output.WriteInt32(A); + } + if (HasFoo) { + output.WriteRawTag(19); + output.WriteGroup(Foo); + output.WriteRawTag(20); + } + if (HasBar) { + output.WriteRawTag(27); + output.WriteGroup(Bar); + output.WriteRawTag(28); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -10510,6 +13610,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDupFieldNumber other) { if (other == null) { return; @@ -10533,7 +13634,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -10560,30 +13665,73 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 19: { + if (!HasFoo) { + Foo = new global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Foo(); + } + input.ReadGroup(Foo); + break; + } + case 27: { + if (!HasBar) { + Bar = new global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Types.Bar(); + } + input.ReadGroup(Bar); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the TestDupFieldNumber message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class Foo : pb::IMessage { + public sealed partial class Foo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Foo()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo() { OnConstruction(); } @@ -10591,6 +13739,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo(Foo other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -10598,6 +13747,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo Clone() { return new Foo(this); } @@ -10608,6 +13758,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -10617,21 +13768,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Foo); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Foo other) { if (ReferenceEquals(other, null)) { return false; @@ -10644,6 +13799,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -10654,12 +13810,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(8); output.WriteInt32(A); @@ -10667,9 +13828,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(8); + output.WriteInt32(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -10682,6 +13859,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Foo other) { if (other == null) { return; @@ -10693,7 +13871,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -10708,28 +13890,58 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 20: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class Bar : pb::IMessage { + public sealed partial class Bar : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Bar()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestDupFieldNumber.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar() { OnConstruction(); } @@ -10737,6 +13949,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar(Bar other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -10744,6 +13957,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar Clone() { return new Bar(this); } @@ -10754,6 +13968,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -10763,21 +13978,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Bar); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Bar other) { if (ReferenceEquals(other, null)) { return false; @@ -10790,6 +14009,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -10800,12 +14020,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(8); output.WriteInt32(A); @@ -10813,9 +14038,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(8); + output.WriteInt32(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -10828,6 +14069,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Bar other) { if (other == null) { return; @@ -10839,7 +14081,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -10854,7 +14100,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 28: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -10866,23 +14134,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// /// Additional messages for testing lazy fields. /// - public sealed partial class TestEagerMessage : pb::IMessage { + public sealed partial class TestEagerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEagerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[25]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEagerMessage() { OnConstruction(); } @@ -10890,12 +14166,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEagerMessage(TestEagerMessage other) : this() { - subMessage_ = other.HasSubMessage ? other.subMessage_.Clone() : null; + subMessage_ = other.subMessage_ != null ? other.subMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEagerMessage Clone() { return new TestEagerMessage(this); } @@ -10904,29 +14182,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int SubMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes SubMessage { get { return subMessage_; } set { subMessage_ = value; } } - /// Gets whether the sub_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasSubMessage { - get { return subMessage_ != null; } - } - /// Clears the value of the sub_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearSubMessage() { - subMessage_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEagerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEagerMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -10939,9 +14210,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasSubMessage) hash ^= SubMessage.GetHashCode(); + if (subMessage_ != null) hash ^= SubMessage.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -10949,25 +14221,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasSubMessage) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (subMessage_ != null) { output.WriteRawTag(10); output.WriteMessage(SubMessage); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (subMessage_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SubMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasSubMessage) { + if (subMessage_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SubMessage); } if (_unknownFields != null) { @@ -10977,12 +14270,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEagerMessage other) { if (other == null) { return; } - if (other.HasSubMessage) { - if (!HasSubMessage) { + if (other.subMessage_ != null) { + if (subMessage_ == null) { SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } SubMessage.MergeFrom(other.SubMessage); @@ -10991,7 +14285,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -10999,7 +14297,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasSubMessage) { + if (subMessage_ == null) { + SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(SubMessage); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (subMessage_ == null) { SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(SubMessage); @@ -11008,26 +14328,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestLazyMessage : pb::IMessage { + public sealed partial class TestLazyMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestLazyMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[26]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestLazyMessage() { OnConstruction(); } @@ -11035,12 +14364,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestLazyMessage(TestLazyMessage other) : this() { - subMessage_ = other.HasSubMessage ? other.subMessage_.Clone() : null; + subMessage_ = other.subMessage_ != null ? other.subMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestLazyMessage Clone() { return new TestLazyMessage(this); } @@ -11049,29 +14380,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int SubMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes SubMessage { get { return subMessage_; } set { subMessage_ = value; } } - /// Gets whether the sub_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasSubMessage { - get { return subMessage_ != null; } - } - /// Clears the value of the sub_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearSubMessage() { - subMessage_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestLazyMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestLazyMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -11084,9 +14408,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasSubMessage) hash ^= SubMessage.GetHashCode(); + if (subMessage_ != null) hash ^= SubMessage.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -11094,25 +14419,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasSubMessage) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (subMessage_ != null) { output.WriteRawTag(10); output.WriteMessage(SubMessage); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (subMessage_ != null) { + output.WriteRawTag(10); + output.WriteMessage(SubMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasSubMessage) { + if (subMessage_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SubMessage); } if (_unknownFields != null) { @@ -11122,12 +14468,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestLazyMessage other) { if (other == null) { return; } - if (other.HasSubMessage) { - if (!HasSubMessage) { + if (other.subMessage_ != null) { + if (subMessage_ == null) { SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } SubMessage.MergeFrom(other.SubMessage); @@ -11136,7 +14483,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -11144,7 +14495,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { - if (!HasSubMessage) { + if (subMessage_ == null) { + SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(SubMessage); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (subMessage_ == null) { SubMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(SubMessage); @@ -11153,29 +14526,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } /// /// Needed for a Python test. /// - public sealed partial class TestNestedMessageHasBits : pb::IMessage { + public sealed partial class TestNestedMessageHasBits : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestNestedMessageHasBits()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[27]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedMessageHasBits() { OnConstruction(); } @@ -11183,12 +14565,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedMessageHasBits(TestNestedMessageHasBits other) : this() { - optionalNestedMessage_ = other.HasOptionalNestedMessage ? other.optionalNestedMessage_.Clone() : null; + optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestNestedMessageHasBits Clone() { return new TestNestedMessageHasBits(this); } @@ -11197,29 +14581,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalNestedMessageFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { optionalNestedMessage_ = value; } } - /// Gets whether the optional_nested_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalNestedMessage { - get { return optionalNestedMessage_ != null; } - } - /// Clears the value of the optional_nested_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalNestedMessage() { - optionalNestedMessage_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestNestedMessageHasBits); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestNestedMessageHasBits other) { if (ReferenceEquals(other, null)) { return false; @@ -11232,9 +14609,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasOptionalNestedMessage) hash ^= OptionalNestedMessage.GetHashCode(); + if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -11242,25 +14620,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasOptionalNestedMessage) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (optionalNestedMessage_ != null) { output.WriteRawTag(10); output.WriteMessage(OptionalNestedMessage); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (optionalNestedMessage_ != null) { + output.WriteRawTag(10); + output.WriteMessage(OptionalNestedMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasOptionalNestedMessage) { + if (optionalNestedMessage_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); } if (_unknownFields != null) { @@ -11270,29 +14669,56 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestNestedMessageHasBits other) { if (other == null) { return; } - if (other.HasOptionalNestedMessage) { - if (!HasOptionalNestedMessage) { + if (other.optionalNestedMessage_ != null) { + if (optionalNestedMessage_ == null) { OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Types.NestedMessage(); } - OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); + OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + } } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { - if (!HasOptionalNestedMessage) { + if (optionalNestedMessage_ == null) { OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Types.NestedMessage(); } input.ReadMessage(OptionalNestedMessage); @@ -11301,28 +14727,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestNestedMessageHasBits message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestNestedMessageHasBits.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -11330,6 +14766,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { nestedmessageRepeatedInt32_ = other.nestedmessageRepeatedInt32_.Clone(); nestedmessageRepeatedForeignmessage_ = other.nestedmessageRepeatedForeignmessage_.Clone(); @@ -11337,6 +14774,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -11347,6 +14785,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(8); private readonly pbc::RepeatedField nestedmessageRepeatedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField NestedmessageRepeatedInt32 { get { return nestedmessageRepeatedInt32_; } } @@ -11357,16 +14796,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.ForeignMessage.Parser); private readonly pbc::RepeatedField nestedmessageRepeatedForeignmessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField NestedmessageRepeatedForeignmessage { get { return nestedmessageRepeatedForeignmessage_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -11380,6 +14822,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= nestedmessageRepeatedInt32_.GetHashCode(); @@ -11391,20 +14834,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else nestedmessageRepeatedInt32_.WriteTo(output, _repeated_nestedmessageRepeatedInt32_codec); nestedmessageRepeatedForeignmessage_.WriteTo(output, _repeated_nestedmessageRepeatedForeignmessage_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + nestedmessageRepeatedInt32_.WriteTo(ref output, _repeated_nestedmessageRepeatedInt32_codec); + nestedmessageRepeatedForeignmessage_.WriteTo(ref output, _repeated_nestedmessageRepeatedForeignmessage_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += nestedmessageRepeatedInt32_.CalculateSize(_repeated_nestedmessageRepeatedInt32_codec); @@ -11416,6 +14878,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -11426,7 +14889,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -11444,7 +14911,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 8: { + nestedmessageRepeatedInt32_.AddEntriesFrom(ref input, _repeated_nestedmessageRepeatedInt32_codec); + break; + } + case 18: { + nestedmessageRepeatedForeignmessage_.AddEntriesFrom(ref input, _repeated_nestedmessageRepeatedForeignmessage_codec); + break; + } + } + } } + #endif } @@ -11457,24 +14949,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Test message with CamelCase field names. This violates Protocol Buffer /// standard style. /// - public sealed partial class TestCamelCaseFieldNames : pb::IMessage { + public sealed partial class TestCamelCaseFieldNames : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCamelCaseFieldNames()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[28]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames() { OnConstruction(); } @@ -11482,12 +14982,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames(TestCamelCaseFieldNames other) : this() { _hasBits0 = other._hasBits0; primitiveField_ = other.primitiveField_; stringField_ = other.stringField_; enumField_ = other.enumField_; - messageField_ = other.HasMessageField ? other.messageField_.Clone() : null; + messageField_ = other.messageField_ != null ? other.messageField_.Clone() : null; stringPieceField_ = other.stringPieceField_; cordField_ = other.cordField_; repeatedPrimitiveField_ = other.repeatedPrimitiveField_.Clone(); @@ -11500,6 +15001,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames Clone() { return new TestCamelCaseFieldNames(this); } @@ -11510,6 +15012,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int primitiveField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int PrimitiveField { get { if ((_hasBits0 & 1) != 0) { return primitiveField_; } else { return PrimitiveFieldDefaultValue; } } set { @@ -11519,11 +15022,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "PrimitiveField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPrimitiveField { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "PrimitiveField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPrimitiveField() { _hasBits0 &= ~1; } @@ -11534,6 +15039,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string stringField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField { get { return stringField_ ?? StringFieldDefaultValue; } set { @@ -11542,11 +15048,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "StringField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStringField { get { return stringField_ != null; } } /// Clears the value of the "StringField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStringField() { stringField_ = null; } @@ -11557,6 +15065,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum enumField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum EnumField { get { if ((_hasBits0 & 2) != 0) { return enumField_; } else { return EnumFieldDefaultValue; } } set { @@ -11566,11 +15075,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "EnumField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEnumField { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "EnumField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEnumField() { _hasBits0 &= ~2; } @@ -11579,22 +15090,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int MessageFieldFieldNumber = 4; private global::Google.Protobuf.TestProtos.Proto2.ForeignMessage messageField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignMessage MessageField { get { return messageField_; } set { messageField_ = value; } } - /// Gets whether the MessageField field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMessageField { - get { return messageField_ != null; } - } - /// Clears the value of the MessageField field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMessageField() { - messageField_ = null; - } /// Field number for the "StringPieceField" field. public const int StringPieceFieldFieldNumber = 5; @@ -11602,6 +15104,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string stringPieceField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringPieceField { get { return stringPieceField_ ?? StringPieceFieldDefaultValue; } set { @@ -11610,11 +15113,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "StringPieceField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStringPieceField { get { return stringPieceField_ != null; } } /// Clears the value of the "StringPieceField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStringPieceField() { stringPieceField_ = null; } @@ -11625,6 +15130,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string cordField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string CordField { get { return cordField_ ?? CordFieldDefaultValue; } set { @@ -11633,11 +15139,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "CordField" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCordField { get { return cordField_ != null; } } /// Clears the value of the "CordField" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCordField() { cordField_ = null; } @@ -11648,6 +15156,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(56); private readonly pbc::RepeatedField repeatedPrimitiveField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedPrimitiveField { get { return repeatedPrimitiveField_; } } @@ -11658,6 +15167,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(66); private readonly pbc::RepeatedField repeatedStringField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringField { get { return repeatedStringField_; } } @@ -11668,6 +15178,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(72, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) x); private readonly pbc::RepeatedField repeatedEnumField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedEnumField { get { return repeatedEnumField_; } } @@ -11678,6 +15189,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(82, global::Google.Protobuf.TestProtos.Proto2.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedMessageField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedMessageField { get { return repeatedMessageField_; } } @@ -11688,6 +15200,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(90); private readonly pbc::RepeatedField repeatedStringPieceField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringPieceField { get { return repeatedStringPieceField_; } } @@ -11698,16 +15211,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(98); private readonly pbc::RepeatedField repeatedCordField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedCordField { get { return repeatedCordField_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestCamelCaseFieldNames); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestCamelCaseFieldNames other) { if (ReferenceEquals(other, null)) { return false; @@ -11731,12 +15247,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasPrimitiveField) hash ^= PrimitiveField.GetHashCode(); if (HasStringField) hash ^= StringField.GetHashCode(); if (HasEnumField) hash ^= EnumField.GetHashCode(); - if (HasMessageField) hash ^= MessageField.GetHashCode(); + if (messageField_ != null) hash ^= MessageField.GetHashCode(); if (HasStringPieceField) hash ^= StringPieceField.GetHashCode(); if (HasCordField) hash ^= CordField.GetHashCode(); hash ^= repeatedPrimitiveField_.GetHashCode(); @@ -11752,12 +15269,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasPrimitiveField) { output.WriteRawTag(8); output.WriteInt32(PrimitiveField); @@ -11770,7 +15292,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(24); output.WriteEnum((int) EnumField); } - if (HasMessageField) { + if (messageField_ != null) { output.WriteRawTag(34); output.WriteMessage(MessageField); } @@ -11791,9 +15313,51 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasPrimitiveField) { + output.WriteRawTag(8); + output.WriteInt32(PrimitiveField); + } + if (HasStringField) { + output.WriteRawTag(18); + output.WriteString(StringField); + } + if (HasEnumField) { + output.WriteRawTag(24); + output.WriteEnum((int) EnumField); + } + if (messageField_ != null) { + output.WriteRawTag(34); + output.WriteMessage(MessageField); + } + if (HasStringPieceField) { + output.WriteRawTag(42); + output.WriteString(StringPieceField); + } + if (HasCordField) { + output.WriteRawTag(50); + output.WriteString(CordField); + } + repeatedPrimitiveField_.WriteTo(ref output, _repeated_repeatedPrimitiveField_codec); + repeatedStringField_.WriteTo(ref output, _repeated_repeatedStringField_codec); + repeatedEnumField_.WriteTo(ref output, _repeated_repeatedEnumField_codec); + repeatedMessageField_.WriteTo(ref output, _repeated_repeatedMessageField_codec); + repeatedStringPieceField_.WriteTo(ref output, _repeated_repeatedStringPieceField_codec); + repeatedCordField_.WriteTo(ref output, _repeated_repeatedCordField_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasPrimitiveField) { @@ -11805,7 +15369,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasEnumField) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumField); } - if (HasMessageField) { + if (messageField_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageField); } if (HasStringPieceField) { @@ -11827,6 +15391,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestCamelCaseFieldNames other) { if (other == null) { return; @@ -11840,8 +15405,8 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasEnumField) { EnumField = other.EnumField; } - if (other.HasMessageField) { - if (!HasMessageField) { + if (other.messageField_ != null) { + if (messageField_ == null) { MessageField = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); } MessageField.MergeFrom(other.MessageField); @@ -11862,7 +15427,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -11882,7 +15451,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } case 34: { - if (!HasMessageField) { + if (messageField_ == null) { MessageField = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); } input.ReadMessage(MessageField); @@ -11924,7 +15493,76 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + PrimitiveField = input.ReadInt32(); + break; + } + case 18: { + StringField = input.ReadString(); + break; + } + case 24: { + EnumField = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 34: { + if (messageField_ == null) { + MessageField = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); + } + input.ReadMessage(MessageField); + break; + } + case 42: { + StringPieceField = input.ReadString(); + break; + } + case 50: { + CordField = input.ReadString(); + break; + } + case 58: + case 56: { + repeatedPrimitiveField_.AddEntriesFrom(ref input, _repeated_repeatedPrimitiveField_codec); + break; + } + case 66: { + repeatedStringField_.AddEntriesFrom(ref input, _repeated_repeatedStringField_codec); + break; + } + case 74: + case 72: { + repeatedEnumField_.AddEntriesFrom(ref input, _repeated_repeatedEnumField_codec); + break; + } + case 82: { + repeatedMessageField_.AddEntriesFrom(ref input, _repeated_repeatedMessageField_codec); + break; + } + case 90: { + repeatedStringPieceField_.AddEntriesFrom(ref input, _repeated_repeatedStringPieceField_codec); + break; + } + case 98: { + repeatedCordField_.AddEntriesFrom(ref input, _repeated_repeatedCordField_codec); + break; + } + } + } } + #endif } @@ -11932,26 +15570,34 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// We list fields out of order, to ensure that we're using field number and not /// field index to determine serialization order. /// - public sealed partial class TestFieldOrderings : pb::IExtendableMessage { + public sealed partial class TestFieldOrderings : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestFieldOrderings()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[29]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings() { OnConstruction(); } @@ -11959,17 +15605,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings(TestFieldOrderings other) : this() { _hasBits0 = other._hasBits0; myString_ = other.myString_; myInt_ = other.myInt_; myFloat_ = other.myFloat_; - optionalNestedMessage_ = other.HasOptionalNestedMessage ? other.optionalNestedMessage_.Clone() : null; + optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings Clone() { return new TestFieldOrderings(this); } @@ -11980,6 +15628,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string myString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_ ?? MyStringDefaultValue; } set { @@ -11988,11 +15637,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyString { get { return myString_ != null; } } /// Clears the value of the "my_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyString() { myString_ = null; } @@ -12003,6 +15654,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long myInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long MyInt { get { if ((_hasBits0 & 1) != 0) { return myInt_; } else { return MyIntDefaultValue; } } set { @@ -12012,11 +15664,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyInt { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "my_int" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyInt() { _hasBits0 &= ~1; } @@ -12027,6 +15681,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float myFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float MyFloat { get { if ((_hasBits0 & 2) != 0) { return myFloat_; } else { return MyFloatDefaultValue; } } set { @@ -12036,11 +15691,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyFloat { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "my_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyFloat() { _hasBits0 &= ~2; } @@ -12049,29 +15706,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalNestedMessageFieldNumber = 200; private global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Types.NestedMessage optionalNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Types.NestedMessage OptionalNestedMessage { get { return optionalNestedMessage_; } set { optionalNestedMessage_ = value; } } - /// Gets whether the optional_nested_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalNestedMessage { - get { return optionalNestedMessage_ != null; } - } - /// Clears the value of the optional_nested_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalNestedMessage() { - optionalNestedMessage_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestFieldOrderings); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestFieldOrderings other) { if (ReferenceEquals(other, null)) { return false; @@ -12090,12 +15740,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasMyString) hash ^= MyString.GetHashCode(); if (HasMyInt) hash ^= MyInt.GetHashCode(); if (HasMyFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MyFloat); - if (HasOptionalNestedMessage) hash ^= OptionalNestedMessage.GetHashCode(); + if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode(); if (_extensions != null) { hash ^= _extensions.GetHashCode(); } @@ -12106,12 +15757,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasMyInt) { output.WriteRawTag(8); output.WriteInt64(MyInt); @@ -12124,7 +15780,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(173, 6); output.WriteFloat(MyFloat); } - if (HasOptionalNestedMessage) { + if (optionalNestedMessage_ != null) { output.WriteRawTag(194, 12); output.WriteMessage(OptionalNestedMessage); } @@ -12134,9 +15790,40 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMyInt) { + output.WriteRawTag(8); + output.WriteInt64(MyInt); + } + if (HasMyString) { + output.WriteRawTag(90); + output.WriteString(MyString); + } + if (HasMyFloat) { + output.WriteRawTag(173, 6); + output.WriteFloat(MyFloat); + } + if (optionalNestedMessage_ != null) { + output.WriteRawTag(194, 12); + output.WriteMessage(OptionalNestedMessage); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasMyString) { @@ -12148,7 +15835,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasMyFloat) { size += 2 + 4; } - if (HasOptionalNestedMessage) { + if (optionalNestedMessage_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); } if (_extensions != null) { @@ -12161,6 +15848,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestFieldOrderings other) { if (other == null) { return; @@ -12174,8 +15862,8 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasMyFloat) { MyFloat = other.MyFloat; } - if (other.HasOptionalNestedMessage) { - if (!HasOptionalNestedMessage) { + if (other.optionalNestedMessage_ != null) { + if (optionalNestedMessage_ == null) { OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Types.NestedMessage(); } OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); @@ -12185,7 +15873,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -12207,7 +15899,43 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } case 1602: { - if (!HasOptionalNestedMessage) { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + MyInt = input.ReadInt64(); + break; + } + case 90: { + MyString = input.ReadString(); + break; + } + case 813: { + MyFloat = input.ReadFloat(); + break; + } + case 1602: { + if (optionalNestedMessage_ == null) { OptionalNestedMessage = new global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Types.NestedMessage(); } input.ReadMessage(OptionalNestedMessage); @@ -12216,6 +15944,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -12242,25 +15971,34 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestFieldOrderings message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestFieldOrderings.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -12268,6 +16006,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; oo_ = other.oo_; @@ -12276,6 +16015,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -12286,6 +16026,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long oo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Oo { get { if ((_hasBits0 & 2) != 0) { return oo_; } else { return OoDefaultValue; } } set { @@ -12295,11 +16036,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oo" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOo { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "oo" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOo() { _hasBits0 &= ~2; } @@ -12315,6 +16058,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// This file needs to compile in proto1 to test backwards-compatibility. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return BbDefaultValue; } } set { @@ -12324,21 +16068,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bb" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBb { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "bb" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBb() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -12352,6 +16100,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOo) hash ^= Oo.GetHashCode(); @@ -12363,12 +16112,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasBb) { output.WriteRawTag(8); output.WriteInt32(Bb); @@ -12380,9 +16134,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBb) { + output.WriteRawTag(8); + output.WriteInt32(Bb); + } + if (HasOo) { + output.WriteRawTag(16); + output.WriteInt64(Oo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOo) { @@ -12398,6 +16172,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -12412,7 +16187,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -12429,7 +16208,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + case 16: { + Oo = input.ReadInt64(); + break; + } + } + } } + #endif } @@ -12438,23 +16241,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestExtensionOrderings1 : pb::IMessage { + public sealed partial class TestExtensionOrderings1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionOrderings1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[30]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings1() { OnConstruction(); } @@ -12462,12 +16273,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings1(TestExtensionOrderings1 other) : this() { myString_ = other.myString_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings1 Clone() { return new TestExtensionOrderings1(this); } @@ -12478,6 +16291,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string myString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_ ?? MyStringDefaultValue; } set { @@ -12486,21 +16300,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyString { get { return myString_ != null; } } /// Clears the value of the "my_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyString() { myString_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtensionOrderings1); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtensionOrderings1 other) { if (ReferenceEquals(other, null)) { return false; @@ -12513,6 +16331,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasMyString) hash ^= MyString.GetHashCode(); @@ -12523,12 +16342,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasMyString) { output.WriteRawTag(10); output.WriteString(MyString); @@ -12536,9 +16360,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMyString) { + output.WriteRawTag(10); + output.WriteString(MyString); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasMyString) { @@ -12551,6 +16391,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtensionOrderings1 other) { if (other == null) { return; @@ -12562,7 +16403,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -12575,11 +16420,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + MyString = input.ReadString(); + break; + } + } + } } + #endif #region Extensions /// Container for extensions for other messages declared in the TestExtensionOrderings1 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension TestExtOrderings1 = new pb::Extension(13, pb::FieldCodec.ForMessage(106, global::Google.Protobuf.TestProtos.Proto2.TestExtensionOrderings1.Parser)); @@ -12588,23 +16454,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestExtensionOrderings2 : pb::IMessage { + public sealed partial class TestExtensionOrderings2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionOrderings2()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[31]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings2() { OnConstruction(); } @@ -12612,12 +16486,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings2(TestExtensionOrderings2 other) : this() { myString_ = other.myString_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings2 Clone() { return new TestExtensionOrderings2(this); } @@ -12628,6 +16504,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string myString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_ ?? MyStringDefaultValue; } set { @@ -12636,21 +16513,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyString { get { return myString_ != null; } } /// Clears the value of the "my_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyString() { myString_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtensionOrderings2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtensionOrderings2 other) { if (ReferenceEquals(other, null)) { return false; @@ -12663,6 +16544,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasMyString) hash ^= MyString.GetHashCode(); @@ -12673,12 +16555,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasMyString) { output.WriteRawTag(10); output.WriteString(MyString); @@ -12686,9 +16573,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMyString) { + output.WriteRawTag(10); + output.WriteString(MyString); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasMyString) { @@ -12701,6 +16604,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtensionOrderings2 other) { if (other == null) { return; @@ -12708,16 +16612,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasMyString) { MyString = other.MyString; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + MyString = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { MyString = input.ReadString(); @@ -12726,28 +16653,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestExtensionOrderings2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class TestExtensionOrderings3 : pb::IMessage { + public sealed partial class TestExtensionOrderings3 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionOrderings3()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestExtensionOrderings2.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings3() { OnConstruction(); } @@ -12755,12 +16692,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings3(TestExtensionOrderings3 other) : this() { myString_ = other.myString_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionOrderings3 Clone() { return new TestExtensionOrderings3(this); } @@ -12771,6 +16710,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string myString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_ ?? MyStringDefaultValue; } set { @@ -12779,21 +16719,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "my_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMyString { get { return myString_ != null; } } /// Clears the value of the "my_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMyString() { myString_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtensionOrderings3); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtensionOrderings3 other) { if (ReferenceEquals(other, null)) { return false; @@ -12806,6 +16750,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasMyString) hash ^= MyString.GetHashCode(); @@ -12816,12 +16761,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasMyString) { output.WriteRawTag(10); output.WriteString(MyString); @@ -12829,9 +16779,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMyString) { + output.WriteRawTag(10); + output.WriteString(MyString); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasMyString) { @@ -12844,6 +16810,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtensionOrderings3 other) { if (other == null) { return; @@ -12855,7 +16822,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -12868,11 +16839,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + MyString = input.ReadString(); + break; + } + } + } } + #endif #region Extensions /// Container for extensions for other messages declared in the TestExtensionOrderings3 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension TestExtOrderings3 = new pb::Extension(14, pb::FieldCodec.ForMessage(114, global::Google.Protobuf.TestProtos.Proto2.TestExtensionOrderings2.Types.TestExtensionOrderings3.Parser)); @@ -12887,6 +16879,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Extensions /// Container for extensions for other messages declared in the TestExtensionOrderings2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension TestExtOrderings2 = new pb::Extension(12, pb::FieldCodec.ForMessage(98, global::Google.Protobuf.TestProtos.Proto2.TestExtensionOrderings2.Parser)); @@ -12895,24 +16888,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestExtremeDefaultValues : pb::IMessage { + public sealed partial class TestExtremeDefaultValues : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtremeDefaultValues()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[32]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtremeDefaultValues() { OnConstruction(); } @@ -12920,6 +16921,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtremeDefaultValues(TestExtremeDefaultValues other) : this() { _hasBits0 = other._hasBits0; escapedBytes_ = other.escapedBytes_; @@ -12953,6 +16955,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtremeDefaultValues Clone() { return new TestExtremeDefaultValues(this); } @@ -12963,6 +16966,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString escapedBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString EscapedBytes { get { return escapedBytes_ ?? EscapedBytesDefaultValue; } set { @@ -12971,11 +16975,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "escaped_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEscapedBytes { get { return escapedBytes_ != null; } } /// Clears the value of the "escaped_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEscapedBytes() { escapedBytes_ = null; } @@ -12986,6 +16992,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint largeUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint LargeUint32 { get { if ((_hasBits0 & 1) != 0) { return largeUint32_; } else { return LargeUint32DefaultValue; } } set { @@ -12995,11 +17002,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "large_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasLargeUint32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "large_uint32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearLargeUint32() { _hasBits0 &= ~1; } @@ -13010,6 +17019,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong largeUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong LargeUint64 { get { if ((_hasBits0 & 2) != 0) { return largeUint64_; } else { return LargeUint64DefaultValue; } } set { @@ -13019,11 +17029,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "large_uint64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasLargeUint64 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "large_uint64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearLargeUint64() { _hasBits0 &= ~2; } @@ -13034,6 +17046,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int smallInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int SmallInt32 { get { if ((_hasBits0 & 4) != 0) { return smallInt32_; } else { return SmallInt32DefaultValue; } } set { @@ -13043,11 +17056,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "small_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSmallInt32 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "small_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSmallInt32() { _hasBits0 &= ~4; } @@ -13058,6 +17073,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long smallInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SmallInt64 { get { if ((_hasBits0 & 8) != 0) { return smallInt64_; } else { return SmallInt64DefaultValue; } } set { @@ -13067,11 +17083,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "small_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSmallInt64 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "small_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSmallInt64() { _hasBits0 &= ~8; } @@ -13082,6 +17100,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int reallySmallInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int ReallySmallInt32 { get { if ((_hasBits0 & 131072) != 0) { return reallySmallInt32_; } else { return ReallySmallInt32DefaultValue; } } set { @@ -13091,11 +17110,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "really_small_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasReallySmallInt32 { get { return (_hasBits0 & 131072) != 0; } } /// Clears the value of the "really_small_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearReallySmallInt32() { _hasBits0 &= ~131072; } @@ -13106,6 +17127,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long reallySmallInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long ReallySmallInt64 { get { if ((_hasBits0 & 262144) != 0) { return reallySmallInt64_; } else { return ReallySmallInt64DefaultValue; } } set { @@ -13115,11 +17137,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "really_small_int64" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasReallySmallInt64 { get { return (_hasBits0 & 262144) != 0; } } /// Clears the value of the "really_small_int64" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearReallySmallInt64() { _hasBits0 &= ~262144; } @@ -13135,6 +17159,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// lots of people use editors that would be confused by this.) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Utf8String { get { return utf8String_ ?? Utf8StringDefaultValue; } set { @@ -13143,11 +17168,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "utf8_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasUtf8String { get { return utf8String_ != null; } } /// Clears the value of the "utf8_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearUtf8String() { utf8String_ = null; } @@ -13161,6 +17188,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Tests for single-precision floating-point values. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float ZeroFloat { get { if ((_hasBits0 & 16) != 0) { return zeroFloat_; } else { return ZeroFloatDefaultValue; } } set { @@ -13170,11 +17198,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "zero_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasZeroFloat { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "zero_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearZeroFloat() { _hasBits0 &= ~16; } @@ -13185,6 +17215,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float oneFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float OneFloat { get { if ((_hasBits0 & 32) != 0) { return oneFloat_; } else { return OneFloatDefaultValue; } } set { @@ -13194,11 +17225,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "one_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneFloat { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "one_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneFloat() { _hasBits0 &= ~32; } @@ -13209,6 +17242,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float smallFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float SmallFloat { get { if ((_hasBits0 & 64) != 0) { return smallFloat_; } else { return SmallFloatDefaultValue; } } set { @@ -13218,11 +17252,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "small_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSmallFloat { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "small_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSmallFloat() { _hasBits0 &= ~64; } @@ -13233,6 +17269,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float negativeOneFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float NegativeOneFloat { get { if ((_hasBits0 & 128) != 0) { return negativeOneFloat_; } else { return NegativeOneFloatDefaultValue; } } set { @@ -13242,11 +17279,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "negative_one_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNegativeOneFloat { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "negative_one_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNegativeOneFloat() { _hasBits0 &= ~128; } @@ -13257,6 +17296,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float negativeFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float NegativeFloat { get { if ((_hasBits0 & 256) != 0) { return negativeFloat_; } else { return NegativeFloatDefaultValue; } } set { @@ -13266,11 +17306,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "negative_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNegativeFloat { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "negative_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNegativeFloat() { _hasBits0 &= ~256; } @@ -13284,6 +17326,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Using exponents /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float LargeFloat { get { if ((_hasBits0 & 512) != 0) { return largeFloat_; } else { return LargeFloatDefaultValue; } } set { @@ -13293,11 +17336,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "large_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasLargeFloat { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "large_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearLargeFloat() { _hasBits0 &= ~512; } @@ -13308,6 +17353,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float smallNegativeFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float SmallNegativeFloat { get { if ((_hasBits0 & 1024) != 0) { return smallNegativeFloat_; } else { return SmallNegativeFloatDefaultValue; } } set { @@ -13317,11 +17363,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "small_negative_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSmallNegativeFloat { get { return (_hasBits0 & 1024) != 0; } } /// Clears the value of the "small_negative_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSmallNegativeFloat() { _hasBits0 &= ~1024; } @@ -13335,6 +17383,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Text for nonfinite floating-point values. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double InfDouble { get { if ((_hasBits0 & 2048) != 0) { return infDouble_; } else { return InfDoubleDefaultValue; } } set { @@ -13344,11 +17393,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "inf_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasInfDouble { get { return (_hasBits0 & 2048) != 0; } } /// Clears the value of the "inf_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearInfDouble() { _hasBits0 &= ~2048; } @@ -13359,6 +17410,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double negInfDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double NegInfDouble { get { if ((_hasBits0 & 4096) != 0) { return negInfDouble_; } else { return NegInfDoubleDefaultValue; } } set { @@ -13368,11 +17420,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "neg_inf_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNegInfDouble { get { return (_hasBits0 & 4096) != 0; } } /// Clears the value of the "neg_inf_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNegInfDouble() { _hasBits0 &= ~4096; } @@ -13383,6 +17437,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double nanDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double NanDouble { get { if ((_hasBits0 & 8192) != 0) { return nanDouble_; } else { return NanDoubleDefaultValue; } } set { @@ -13392,11 +17447,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "nan_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNanDouble { get { return (_hasBits0 & 8192) != 0; } } /// Clears the value of the "nan_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNanDouble() { _hasBits0 &= ~8192; } @@ -13407,6 +17464,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float infFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float InfFloat { get { if ((_hasBits0 & 16384) != 0) { return infFloat_; } else { return InfFloatDefaultValue; } } set { @@ -13416,11 +17474,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "inf_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasInfFloat { get { return (_hasBits0 & 16384) != 0; } } /// Clears the value of the "inf_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearInfFloat() { _hasBits0 &= ~16384; } @@ -13431,6 +17491,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float negInfFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float NegInfFloat { get { if ((_hasBits0 & 32768) != 0) { return negInfFloat_; } else { return NegInfFloatDefaultValue; } } set { @@ -13440,11 +17501,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "neg_inf_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNegInfFloat { get { return (_hasBits0 & 32768) != 0; } } /// Clears the value of the "neg_inf_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNegInfFloat() { _hasBits0 &= ~32768; } @@ -13455,6 +17518,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private float nanFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float NanFloat { get { if ((_hasBits0 & 65536) != 0) { return nanFloat_; } else { return NanFloatDefaultValue; } } set { @@ -13464,11 +17528,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "nan_float" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNanFloat { get { return (_hasBits0 & 65536) != 0; } } /// Clears the value of the "nan_float" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNanFloat() { _hasBits0 &= ~65536; } @@ -13486,6 +17552,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// literals. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string CppTrigraph { get { return cppTrigraph_ ?? CppTrigraphDefaultValue; } set { @@ -13494,11 +17561,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "cpp_trigraph" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCppTrigraph { get { return cppTrigraph_ != null; } } /// Clears the value of the "cpp_trigraph" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCppTrigraph() { cppTrigraph_ = null; } @@ -13512,6 +17581,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// String defaults containing the character '\000' /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringWithZero { get { return stringWithZero_ ?? StringWithZeroDefaultValue; } set { @@ -13520,11 +17590,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "string_with_zero" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStringWithZero { get { return stringWithZero_ != null; } } /// Clears the value of the "string_with_zero" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStringWithZero() { stringWithZero_ = null; } @@ -13535,6 +17607,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString bytesWithZero_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString BytesWithZero { get { return bytesWithZero_ ?? BytesWithZeroDefaultValue; } set { @@ -13543,11 +17616,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bytes_with_zero" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBytesWithZero { get { return bytesWithZero_ != null; } } /// Clears the value of the "bytes_with_zero" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBytesWithZero() { bytesWithZero_ = null; } @@ -13558,6 +17633,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string stringPieceWithZero_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringPieceWithZero { get { return stringPieceWithZero_ ?? StringPieceWithZeroDefaultValue; } set { @@ -13566,11 +17642,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "string_piece_with_zero" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStringPieceWithZero { get { return stringPieceWithZero_ != null; } } /// Clears the value of the "string_piece_with_zero" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStringPieceWithZero() { stringPieceWithZero_ = null; } @@ -13581,6 +17659,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string cordWithZero_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string CordWithZero { get { return cordWithZero_ ?? CordWithZeroDefaultValue; } set { @@ -13589,11 +17668,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "cord_with_zero" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCordWithZero { get { return cordWithZero_ != null; } } /// Clears the value of the "cord_with_zero" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCordWithZero() { cordWithZero_ = null; } @@ -13604,6 +17685,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string replacementString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string ReplacementString { get { return replacementString_ ?? ReplacementStringDefaultValue; } set { @@ -13612,21 +17694,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "replacement_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasReplacementString { get { return replacementString_ != null; } } /// Clears the value of the "replacement_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearReplacementString() { replacementString_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtremeDefaultValues); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtremeDefaultValues other) { if (ReferenceEquals(other, null)) { return false; @@ -13665,6 +17751,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasEscapedBytes) hash ^= EscapedBytes.GetHashCode(); @@ -13701,12 +17788,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasEscapedBytes) { output.WriteRawTag(10); output.WriteBytes(EscapedBytes); @@ -13818,9 +17910,129 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasEscapedBytes) { + output.WriteRawTag(10); + output.WriteBytes(EscapedBytes); + } + if (HasLargeUint32) { + output.WriteRawTag(16); + output.WriteUInt32(LargeUint32); + } + if (HasLargeUint64) { + output.WriteRawTag(24); + output.WriteUInt64(LargeUint64); + } + if (HasSmallInt32) { + output.WriteRawTag(32); + output.WriteInt32(SmallInt32); + } + if (HasSmallInt64) { + output.WriteRawTag(40); + output.WriteInt64(SmallInt64); + } + if (HasUtf8String) { + output.WriteRawTag(50); + output.WriteString(Utf8String); + } + if (HasZeroFloat) { + output.WriteRawTag(61); + output.WriteFloat(ZeroFloat); + } + if (HasOneFloat) { + output.WriteRawTag(69); + output.WriteFloat(OneFloat); + } + if (HasSmallFloat) { + output.WriteRawTag(77); + output.WriteFloat(SmallFloat); + } + if (HasNegativeOneFloat) { + output.WriteRawTag(85); + output.WriteFloat(NegativeOneFloat); + } + if (HasNegativeFloat) { + output.WriteRawTag(93); + output.WriteFloat(NegativeFloat); + } + if (HasLargeFloat) { + output.WriteRawTag(101); + output.WriteFloat(LargeFloat); + } + if (HasSmallNegativeFloat) { + output.WriteRawTag(109); + output.WriteFloat(SmallNegativeFloat); + } + if (HasInfDouble) { + output.WriteRawTag(113); + output.WriteDouble(InfDouble); + } + if (HasNegInfDouble) { + output.WriteRawTag(121); + output.WriteDouble(NegInfDouble); + } + if (HasNanDouble) { + output.WriteRawTag(129, 1); + output.WriteDouble(NanDouble); + } + if (HasInfFloat) { + output.WriteRawTag(141, 1); + output.WriteFloat(InfFloat); + } + if (HasNegInfFloat) { + output.WriteRawTag(149, 1); + output.WriteFloat(NegInfFloat); + } + if (HasNanFloat) { + output.WriteRawTag(157, 1); + output.WriteFloat(NanFloat); + } + if (HasCppTrigraph) { + output.WriteRawTag(162, 1); + output.WriteString(CppTrigraph); + } + if (HasReallySmallInt32) { + output.WriteRawTag(168, 1); + output.WriteInt32(ReallySmallInt32); + } + if (HasReallySmallInt64) { + output.WriteRawTag(176, 1); + output.WriteInt64(ReallySmallInt64); + } + if (HasStringWithZero) { + output.WriteRawTag(186, 1); + output.WriteString(StringWithZero); + } + if (HasBytesWithZero) { + output.WriteRawTag(194, 1); + output.WriteBytes(BytesWithZero); + } + if (HasStringPieceWithZero) { + output.WriteRawTag(202, 1); + output.WriteString(StringPieceWithZero); + } + if (HasCordWithZero) { + output.WriteRawTag(210, 1); + output.WriteString(CordWithZero); + } + if (HasReplacementString) { + output.WriteRawTag(218, 1); + output.WriteString(ReplacementString); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasEscapedBytes) { @@ -13911,6 +18123,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtremeDefaultValues other) { if (other == null) { return; @@ -13996,16 +18209,143 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasReplacementString) { ReplacementString = other.ReplacementString; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + EscapedBytes = input.ReadBytes(); + break; + } + case 16: { + LargeUint32 = input.ReadUInt32(); + break; + } + case 24: { + LargeUint64 = input.ReadUInt64(); + break; + } + case 32: { + SmallInt32 = input.ReadInt32(); + break; + } + case 40: { + SmallInt64 = input.ReadInt64(); + break; + } + case 50: { + Utf8String = input.ReadString(); + break; + } + case 61: { + ZeroFloat = input.ReadFloat(); + break; + } + case 69: { + OneFloat = input.ReadFloat(); + break; + } + case 77: { + SmallFloat = input.ReadFloat(); + break; + } + case 85: { + NegativeOneFloat = input.ReadFloat(); + break; + } + case 93: { + NegativeFloat = input.ReadFloat(); + break; + } + case 101: { + LargeFloat = input.ReadFloat(); + break; + } + case 109: { + SmallNegativeFloat = input.ReadFloat(); + break; + } + case 113: { + InfDouble = input.ReadDouble(); + break; + } + case 121: { + NegInfDouble = input.ReadDouble(); + break; + } + case 129: { + NanDouble = input.ReadDouble(); + break; + } + case 141: { + InfFloat = input.ReadFloat(); + break; + } + case 149: { + NegInfFloat = input.ReadFloat(); + break; + } + case 157: { + NanFloat = input.ReadFloat(); + break; + } + case 162: { + CppTrigraph = input.ReadString(); + break; + } + case 168: { + ReallySmallInt32 = input.ReadInt32(); + break; + } + case 176: { + ReallySmallInt64 = input.ReadInt64(); + break; + } + case 186: { + StringWithZero = input.ReadString(); + break; + } + case 194: { + BytesWithZero = input.ReadBytes(); + break; + } + case 202: { + StringPieceWithZero = input.ReadString(); + break; + } + case 210: { + CordWithZero = input.ReadString(); + break; + } + case 218: { + ReplacementString = input.ReadString(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { EscapedBytes = input.ReadBytes(); @@ -14118,27 +18458,36 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class SparseEnumMessage : pb::IMessage { + public sealed partial class SparseEnumMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseEnumMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[33]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage() { OnConstruction(); } @@ -14146,6 +18495,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage(SparseEnumMessage other) : this() { _hasBits0 = other._hasBits0; sparseEnum_ = other.sparseEnum_; @@ -14153,6 +18503,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage Clone() { return new SparseEnumMessage(this); } @@ -14163,6 +18514,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.TestSparseEnum sparseEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestSparseEnum SparseEnum { get { if ((_hasBits0 & 1) != 0) { return sparseEnum_; } else { return SparseEnumDefaultValue; } } set { @@ -14172,21 +18524,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "sparse_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSparseEnum { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "sparse_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSparseEnum() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SparseEnumMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SparseEnumMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -14199,6 +18555,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasSparseEnum) hash ^= SparseEnum.GetHashCode(); @@ -14209,12 +18566,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasSparseEnum) { output.WriteRawTag(8); output.WriteEnum((int) SparseEnum); @@ -14222,9 +18584,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasSparseEnum) { + output.WriteRawTag(8); + output.WriteEnum((int) SparseEnum); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasSparseEnum) { @@ -14237,6 +18615,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SparseEnumMessage other) { if (other == null) { return; @@ -14248,7 +18627,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -14261,30 +18644,58 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + SparseEnum = (global::Google.Protobuf.TestProtos.Proto2.TestSparseEnum) input.ReadEnum(); + break; + } + } + } + } + #endif + } /// /// Test String and Bytes: string is for valid UTF-8 strings /// - public sealed partial class OneString : pb::IMessage { + public sealed partial class OneString : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[34]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString() { OnConstruction(); } @@ -14292,12 +18703,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString(OneString other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString Clone() { return new OneString(this); } @@ -14308,6 +18721,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Data { get { return data_ ?? DataDefaultValue; } set { @@ -14316,21 +18730,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return data_ != null; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { data_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneString); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneString other) { if (ReferenceEquals(other, null)) { return false; @@ -14343,6 +18761,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -14353,12 +18772,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasData) { output.WriteRawTag(10); output.WriteString(Data); @@ -14366,9 +18790,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasData) { + output.WriteRawTag(10); + output.WriteString(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -14381,6 +18821,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneString other) { if (other == null) { return; @@ -14392,7 +18833,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -14405,27 +18850,55 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Data = input.ReadString(); + break; + } + } + } } + #endif } - public sealed partial class MoreString : pb::IMessage { + public sealed partial class MoreString : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[35]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString() { OnConstruction(); } @@ -14433,12 +18906,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString(MoreString other) : this() { data_ = other.data_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString Clone() { return new MoreString(this); } @@ -14449,16 +18924,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField data_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Data { get { return data_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MoreString); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MoreString other) { if (ReferenceEquals(other, null)) { return false; @@ -14471,6 +18949,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= data_.GetHashCode(); @@ -14481,19 +18960,37 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else data_.WriteTo(output, _repeated_data_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + data_.WriteTo(ref output, _repeated_data_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += data_.CalculateSize(_repeated_data_codec); @@ -14504,6 +19001,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MoreString other) { if (other == null) { return; @@ -14513,7 +19011,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -14526,27 +19028,55 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + data_.AddEntriesFrom(ref input, _repeated_data_codec); + break; + } + } + } } + #endif } - public sealed partial class OneBytes : pb::IMessage { + public sealed partial class OneBytes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[36]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes() { OnConstruction(); } @@ -14554,12 +19084,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes(OneBytes other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes Clone() { return new OneBytes(this); } @@ -14570,6 +19102,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString Data { get { return data_ ?? DataDefaultValue; } set { @@ -14578,21 +19111,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return data_ != null; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { data_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneBytes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneBytes other) { if (ReferenceEquals(other, null)) { return false; @@ -14605,6 +19142,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -14615,12 +19153,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasData) { output.WriteRawTag(10); output.WriteBytes(Data); @@ -14628,9 +19171,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasData) { + output.WriteRawTag(10); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -14643,6 +19202,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneBytes other) { if (other == null) { return; @@ -14654,7 +19214,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -14667,27 +19231,55 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } + } + #endif + } - public sealed partial class MoreBytes : pb::IMessage { + public sealed partial class MoreBytes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[37]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes() { OnConstruction(); } @@ -14695,12 +19287,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes(MoreBytes other) : this() { data_ = other.data_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes Clone() { return new MoreBytes(this); } @@ -14711,16 +19305,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBytes(10); private readonly pbc::RepeatedField data_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Data { get { return data_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MoreBytes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MoreBytes other) { if (ReferenceEquals(other, null)) { return false; @@ -14733,6 +19330,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= data_.GetHashCode(); @@ -14743,19 +19341,37 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else data_.WriteTo(output, _repeated_data_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + data_.WriteTo(ref output, _repeated_data_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += data_.CalculateSize(_repeated_data_codec); @@ -14766,6 +19382,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MoreBytes other) { if (other == null) { return; @@ -14775,7 +19392,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -14788,31 +19409,59 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + data_.AddEntriesFrom(ref input, _repeated_data_codec); + break; + } + } + } } + #endif } /// /// Test int32, uint32, int64, uint64, and bool are all compatible /// - public sealed partial class Int32Message : pb::IMessage { + public sealed partial class Int32Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int32Message()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[38]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message() { OnConstruction(); } @@ -14820,6 +19469,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message(Int32Message other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -14827,6 +19477,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message Clone() { return new Int32Message(this); } @@ -14837,6 +19488,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -14846,21 +19498,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Int32Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Int32Message other) { if (ReferenceEquals(other, null)) { return false; @@ -14873,6 +19529,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -14883,12 +19540,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasData) { output.WriteRawTag(8); output.WriteInt32(Data); @@ -14896,9 +19558,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasData) { + output.WriteRawTag(8); + output.WriteInt32(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -14911,6 +19589,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Int32Message other) { if (other == null) { return; @@ -14922,7 +19601,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -14935,28 +19618,56 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Data = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class Uint32Message : pb::IMessage { + public sealed partial class Uint32Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint32Message()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[39]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message() { OnConstruction(); } @@ -14964,6 +19675,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message(Uint32Message other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -14971,6 +19683,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message Clone() { return new Uint32Message(this); } @@ -14981,6 +19694,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -14990,21 +19704,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Uint32Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Uint32Message other) { if (ReferenceEquals(other, null)) { return false; @@ -15017,6 +19735,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -15027,12 +19746,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasData) { output.WriteRawTag(8); output.WriteUInt32(Data); @@ -15040,9 +19764,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasData) { + output.WriteRawTag(8); + output.WriteUInt32(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -15055,6 +19795,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Uint32Message other) { if (other == null) { return; @@ -15066,7 +19807,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -15079,28 +19824,56 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Data = input.ReadUInt32(); + break; + } + } + } + } + #endif + } - public sealed partial class Int64Message : pb::IMessage { + public sealed partial class Int64Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int64Message()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[40]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message() { OnConstruction(); } @@ -15108,6 +19881,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message(Int64Message other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -15115,6 +19889,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message Clone() { return new Int64Message(this); } @@ -15125,6 +19900,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -15134,21 +19910,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Int64Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Int64Message other) { if (ReferenceEquals(other, null)) { return false; @@ -15161,6 +19941,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -15171,12 +19952,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasData) { output.WriteRawTag(8); output.WriteInt64(Data); @@ -15184,9 +19970,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasData) { + output.WriteRawTag(8); + output.WriteInt64(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -15199,6 +20001,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Int64Message other) { if (other == null) { return; @@ -15210,7 +20013,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -15223,28 +20030,56 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Data = input.ReadInt64(); + break; + } + } + } } + #endif } - public sealed partial class Uint64Message : pb::IMessage { + public sealed partial class Uint64Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint64Message()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[41]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message() { OnConstruction(); } @@ -15252,6 +20087,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message(Uint64Message other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -15259,6 +20095,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message Clone() { return new Uint64Message(this); } @@ -15269,6 +20106,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private ulong data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -15278,21 +20116,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Uint64Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Uint64Message other) { if (ReferenceEquals(other, null)) { return false; @@ -15305,6 +20147,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -15315,12 +20158,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasData) { output.WriteRawTag(8); output.WriteUInt64(Data); @@ -15328,9 +20176,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasData) { + output.WriteRawTag(8); + output.WriteUInt64(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -15343,6 +20207,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Uint64Message other) { if (other == null) { return; @@ -15354,7 +20219,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -15367,28 +20236,56 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Data = input.ReadUInt64(); + break; + } + } + } } + #endif } - public sealed partial class BoolMessage : pb::IMessage { + public sealed partial class BoolMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[42]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage() { OnConstruction(); } @@ -15396,6 +20293,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage(BoolMessage other) : this() { _hasBits0 = other._hasBits0; data_ = other.data_; @@ -15403,6 +20301,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage Clone() { return new BoolMessage(this); } @@ -15413,6 +20312,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private bool data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Data { get { if ((_hasBits0 & 1) != 0) { return data_; } else { return DataDefaultValue; } } set { @@ -15422,21 +20322,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "data" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasData { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "data" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearData() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BoolMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BoolMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -15449,6 +20353,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasData) hash ^= Data.GetHashCode(); @@ -15459,12 +20364,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasData) { output.WriteRawTag(8); output.WriteBool(Data); @@ -15472,9 +20382,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasData) { + output.WriteRawTag(8); + output.WriteBool(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasData) { @@ -15487,6 +20413,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BoolMessage other) { if (other == null) { return; @@ -15498,7 +20425,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -15511,31 +20442,58 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Data = input.ReadBool(); + break; + } + } + } } + #endif } /// /// Test oneofs. /// - public sealed partial class TestOneof : pb::IMessage { + public sealed partial class TestOneof : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof()); private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[43]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof() { OnConstruction(); } @@ -15543,8 +20501,8 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof(TestOneof other) : this() { - _hasBits0 = other._hasBits0; switch (other.FooCase) { case FooOneofCase.FooInt: FooInt = other.FooInt; @@ -15564,6 +20522,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof Clone() { return new TestOneof(this); } @@ -15571,6 +20530,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_int" field. public const int FooIntFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { get { return HasFooInt ? (int) foo_ : 0; } set { @@ -15580,11 +20540,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooInt { get { return fooCase_ == FooOneofCase.FooInt; } } /// Clears the value of the oneof if it's currently set to "foo_int" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooInt() { if (HasFooInt) { ClearFoo(); @@ -15594,6 +20556,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_string" field. public const int FooStringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { get { return HasFooString ? (string) foo_ : ""; } set { @@ -15603,11 +20566,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooString { get { return fooCase_ == FooOneofCase.FooString; } } /// Clears the value of the oneof if it's currently set to "foo_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooString() { if (HasFooString) { ClearFoo(); @@ -15617,29 +20582,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_message" field. public const int FooMessageFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes FooMessage { - get { return HasFooMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes) foo_ : null; } + get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes) foo_ : null; } set { foo_ = value; fooCase_ = value == null ? FooOneofCase.None : FooOneofCase.FooMessage; } } - /// Gets whether the "foo_message" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasFooMessage { - get { return fooCase_ == FooOneofCase.FooMessage; } - } - /// Clears the value of the oneof if it's currently set to "foo_message" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearFooMessage() { - if (HasFooMessage) { - ClearFoo(); - } - } /// Field number for the "foogroup" field. public const int FooGroupFieldNumber = 4; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof.Types.FooGroup FooGroup { get { return HasFooGroup ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof.Types.FooGroup) foo_ : null; } set { @@ -15649,11 +20604,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foogroup" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooGroup { get { return fooCase_ == FooOneofCase.FooGroup; } } /// Clears the value of the oneof if it's currently set to "foogroup" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooGroup() { if (HasFooGroup) { ClearFoo(); @@ -15671,22 +20628,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private FooOneofCase fooCase_ = FooOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOneofCase FooCase { get { return fooCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { fooCase_ = FooOneofCase.None; foo_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestOneof); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestOneof other) { if (ReferenceEquals(other, null)) { return false; @@ -15703,26 +20664,59 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFooInt) hash ^= FooInt.GetHashCode(); if (HasFooString) hash ^= FooString.GetHashCode(); - if (HasFooMessage) hash ^= FooMessage.GetHashCode(); + if (fooCase_ == FooOneofCase.FooMessage) hash ^= FooMessage.GetHashCode(); if (HasFooGroup) hash ^= FooGroup.GetHashCode(); hash ^= (int) fooCase_; if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFooInt) { + output.WriteRawTag(8); + output.WriteInt32(FooInt); + } + if (HasFooString) { + output.WriteRawTag(18); + output.WriteString(FooString); + } + if (fooCase_ == FooOneofCase.FooMessage) { + output.WriteRawTag(26); + output.WriteMessage(FooMessage); + } + if (HasFooGroup) { + output.WriteRawTag(35); + output.WriteGroup(FooGroup); + output.WriteRawTag(36); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasFooInt) { output.WriteRawTag(8); output.WriteInt32(FooInt); @@ -15731,7 +20725,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(18); output.WriteString(FooString); } - if (HasFooMessage) { + if (fooCase_ == FooOneofCase.FooMessage) { output.WriteRawTag(26); output.WriteMessage(FooMessage); } @@ -15741,11 +20735,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(36); } if (_unknownFields != null) { - _unknownFields.WriteTo(output); + _unknownFields.WriteTo(ref output); } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFooInt) { @@ -15754,7 +20750,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasFooString) { size += 1 + pb::CodedOutputStream.ComputeStringSize(FooString); } - if (HasFooMessage) { + if (fooCase_ == FooOneofCase.FooMessage) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(FooMessage); } if (HasFooGroup) { @@ -15767,6 +20763,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestOneof other) { if (other == null) { return; @@ -15796,7 +20793,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -15813,7 +20814,48 @@ namespace Google.Protobuf.TestProtos.Proto2 { } case 26: { global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); - if (HasFooMessage) { + if (fooCase_ == FooOneofCase.FooMessage) { + subBuilder.MergeFrom(FooMessage); + } + input.ReadMessage(subBuilder); + FooMessage = subBuilder; + break; + } + case 35: { + global::Google.Protobuf.TestProtos.Proto2.TestOneof.Types.FooGroup subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof.Types.FooGroup(); + if (HasFooGroup) { + subBuilder.MergeFrom(FooGroup); + } + input.ReadGroup(subBuilder); + FooGroup = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + if (fooCase_ == FooOneofCase.FooMessage) { subBuilder.MergeFrom(FooMessage); } input.ReadMessage(subBuilder); @@ -15832,29 +20874,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestOneof message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class FooGroup : pb::IMessage { + public sealed partial class FooGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestOneof.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup() { OnConstruction(); } @@ -15862,6 +20914,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup(FooGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -15870,6 +20923,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup Clone() { return new FooGroup(this); } @@ -15880,6 +20934,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -15889,11 +20944,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -15904,6 +20961,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string B { get { return b_ ?? BDefaultValue; } set { @@ -15912,21 +20970,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "b" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasB { get { return b_ != null; } } /// Clears the value of the "b" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearB() { b_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -15940,6 +21002,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -15951,12 +21014,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(40); output.WriteInt32(A); @@ -15968,9 +21036,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(40); + output.WriteInt32(A); + } + if (HasB) { + output.WriteRawTag(50); + output.WriteString(B); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -15986,6 +21074,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooGroup other) { if (other == null) { return; @@ -16000,7 +21089,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -16019,7 +21112,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 36: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 40: { + A = input.ReadInt32(); + break; + } + case 50: { + B = input.ReadString(); + break; + } + } + } } + #endif } @@ -16028,24 +21147,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestOneofBackwardsCompatible : pb::IMessage { + public sealed partial class TestOneofBackwardsCompatible : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneofBackwardsCompatible()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[44]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneofBackwardsCompatible() { OnConstruction(); } @@ -16053,16 +21180,18 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneofBackwardsCompatible(TestOneofBackwardsCompatible other) : this() { _hasBits0 = other._hasBits0; fooInt_ = other.fooInt_; fooString_ = other.fooString_; - fooMessage_ = other.HasFooMessage ? other.fooMessage_.Clone() : null; + fooMessage_ = other.fooMessage_ != null ? other.fooMessage_.Clone() : null; fooGroup_ = other.HasFooGroup ? other.fooGroup_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneofBackwardsCompatible Clone() { return new TestOneofBackwardsCompatible(this); } @@ -16073,6 +21202,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fooInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { get { if ((_hasBits0 & 1) != 0) { return fooInt_; } else { return FooIntDefaultValue; } } set { @@ -16082,11 +21212,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooInt { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "foo_int" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooInt() { _hasBits0 &= ~1; } @@ -16097,6 +21229,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string fooString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { get { return fooString_ ?? FooStringDefaultValue; } set { @@ -16105,11 +21238,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooString { get { return fooString_ != null; } } /// Clears the value of the "foo_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooString() { fooString_ = null; } @@ -16118,27 +21253,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int FooMessageFieldNumber = 3; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes fooMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes FooMessage { get { return fooMessage_; } set { fooMessage_ = value; } } - /// Gets whether the foo_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasFooMessage { - get { return fooMessage_ != null; } - } - /// Clears the value of the foo_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearFooMessage() { - fooMessage_ = null; - } /// Field number for the "foogroup" field. public const int FooGroupFieldNumber = 4; private global::Google.Protobuf.TestProtos.Proto2.TestOneofBackwardsCompatible.Types.FooGroup fooGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneofBackwardsCompatible.Types.FooGroup FooGroup { get { return fooGroup_; } set { @@ -16147,21 +21274,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the foogroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooGroup { get { return fooGroup_ != null; } } /// Clears the value of the foogroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooGroup() { fooGroup_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestOneofBackwardsCompatible); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestOneofBackwardsCompatible other) { if (ReferenceEquals(other, null)) { return false; @@ -16177,11 +21308,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFooInt) hash ^= FooInt.GetHashCode(); if (HasFooString) hash ^= FooString.GetHashCode(); - if (HasFooMessage) hash ^= FooMessage.GetHashCode(); + if (fooMessage_ != null) hash ^= FooMessage.GetHashCode(); if (HasFooGroup) hash ^= FooGroup.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -16190,12 +21322,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasFooInt) { output.WriteRawTag(8); output.WriteInt32(FooInt); @@ -16204,7 +21341,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(18); output.WriteString(FooString); } - if (HasFooMessage) { + if (fooMessage_ != null) { output.WriteRawTag(26); output.WriteMessage(FooMessage); } @@ -16216,9 +21353,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFooInt) { + output.WriteRawTag(8); + output.WriteInt32(FooInt); + } + if (HasFooString) { + output.WriteRawTag(18); + output.WriteString(FooString); + } + if (fooMessage_ != null) { + output.WriteRawTag(26); + output.WriteMessage(FooMessage); + } + if (HasFooGroup) { + output.WriteRawTag(35); + output.WriteGroup(FooGroup); + output.WriteRawTag(36); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFooInt) { @@ -16227,7 +21393,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasFooString) { size += 1 + pb::CodedOutputStream.ComputeStringSize(FooString); } - if (HasFooMessage) { + if (fooMessage_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(FooMessage); } if (HasFooGroup) { @@ -16240,6 +21406,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestOneofBackwardsCompatible other) { if (other == null) { return; @@ -16250,8 +21417,8 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasFooString) { FooString = other.FooString; } - if (other.HasFooMessage) { - if (!HasFooMessage) { + if (other.fooMessage_ != null) { + if (fooMessage_ == null) { FooMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } FooMessage.MergeFrom(other.FooMessage); @@ -16266,7 +21433,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -16282,7 +21453,44 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } case 26: { - if (!HasFooMessage) { + if (fooMessage_ == null) { + FooMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(FooMessage); + break; + } + case 35: { + if (!HasFooGroup) { + FooGroup = new global::Google.Protobuf.TestProtos.Proto2.TestOneofBackwardsCompatible.Types.FooGroup(); + } + input.ReadGroup(FooGroup); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + if (fooMessage_ == null) { FooMessage = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(FooMessage); @@ -16298,29 +21506,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestOneofBackwardsCompatible message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class FooGroup : pb::IMessage { + public sealed partial class FooGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestOneofBackwardsCompatible.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup() { OnConstruction(); } @@ -16328,6 +21546,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup(FooGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -16336,6 +21555,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup Clone() { return new FooGroup(this); } @@ -16346,6 +21566,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -16355,11 +21576,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -16370,6 +21593,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string B { get { return b_ ?? BDefaultValue; } set { @@ -16378,21 +21602,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "b" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasB { get { return b_ != null; } } /// Clears the value of the "b" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearB() { b_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -16406,6 +21634,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -16417,12 +21646,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(40); output.WriteInt32(A); @@ -16434,9 +21668,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(40); + output.WriteInt32(A); + } + if (HasB) { + output.WriteRawTag(50); + output.WriteString(B); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -16452,6 +21706,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooGroup other) { if (other == null) { return; @@ -16466,7 +21721,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -16485,7 +21744,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 36: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 40: { + A = input.ReadInt32(); + break; + } + case 50: { + B = input.ReadString(); + break; + } + } + } } + #endif } @@ -16494,24 +21779,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestOneof2 : pb::IMessage { + public sealed partial class TestOneof2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof2()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[45]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof2() { OnConstruction(); } @@ -16519,6 +21812,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof2(TestOneof2 other) : this() { _hasBits0 = other._hasBits0; bazInt_ = other.bazInt_; @@ -16578,6 +21872,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof2 Clone() { return new TestOneof2(this); } @@ -16585,6 +21880,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_int" field. public const int FooIntFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { get { return HasFooInt ? (int) foo_ : 0; } set { @@ -16594,11 +21890,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooInt { get { return fooCase_ == FooOneofCase.FooInt; } } /// Clears the value of the oneof if it's currently set to "foo_int" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooInt() { if (HasFooInt) { ClearFoo(); @@ -16608,6 +21906,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_string" field. public const int FooStringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { get { return HasFooString ? (string) foo_ : ""; } set { @@ -16617,11 +21916,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooString { get { return fooCase_ == FooOneofCase.FooString; } } /// Clears the value of the oneof if it's currently set to "foo_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooString() { if (HasFooString) { ClearFoo(); @@ -16631,6 +21932,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_cord" field. public const int FooCordFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooCord { get { return HasFooCord ? (string) foo_ : ""; } set { @@ -16640,11 +21942,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooCord { get { return fooCase_ == FooOneofCase.FooCord; } } /// Clears the value of the oneof if it's currently set to "foo_cord" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooCord() { if (HasFooCord) { ClearFoo(); @@ -16654,6 +21958,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_string_piece" field. public const int FooStringPieceFieldNumber = 4; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooStringPiece { get { return HasFooStringPiece ? (string) foo_ : ""; } set { @@ -16663,11 +21968,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooStringPiece { get { return fooCase_ == FooOneofCase.FooStringPiece; } } /// Clears the value of the oneof if it's currently set to "foo_string_piece" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooStringPiece() { if (HasFooStringPiece) { ClearFoo(); @@ -16677,6 +21984,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_bytes" field. public const int FooBytesFieldNumber = 5; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString FooBytes { get { return HasFooBytes ? (pb::ByteString) foo_ : pb::ByteString.Empty; } set { @@ -16686,11 +21994,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooBytes { get { return fooCase_ == FooOneofCase.FooBytes; } } /// Clears the value of the oneof if it's currently set to "foo_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooBytes() { if (HasFooBytes) { ClearFoo(); @@ -16700,6 +22010,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_enum" field. public const int FooEnumFieldNumber = 6; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum FooEnum { get { return HasFooEnum ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum) foo_ : global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum.Foo; } set { @@ -16709,11 +22020,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooEnum { get { return fooCase_ == FooOneofCase.FooEnum; } } /// Clears the value of the oneof if it's currently set to "foo_enum" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooEnum() { if (HasFooEnum) { ClearFoo(); @@ -16723,29 +22036,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_message" field. public const int FooMessageFieldNumber = 7; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage FooMessage { - get { return HasFooMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage) foo_ : null; } + get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage) foo_ : null; } set { foo_ = value; fooCase_ = value == null ? FooOneofCase.None : FooOneofCase.FooMessage; } } - /// Gets whether the "foo_message" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasFooMessage { - get { return fooCase_ == FooOneofCase.FooMessage; } - } - /// Clears the value of the oneof if it's currently set to "foo_message" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearFooMessage() { - if (HasFooMessage) { - ClearFoo(); - } - } /// Field number for the "foogroup" field. public const int FooGroupFieldNumber = 8; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup FooGroup { get { return HasFooGroup ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup) foo_ : null; } set { @@ -16755,11 +22058,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foogroup" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooGroup { get { return fooCase_ == FooOneofCase.FooGroup; } } /// Clears the value of the oneof if it's currently set to "foogroup" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooGroup() { if (HasFooGroup) { ClearFoo(); @@ -16769,29 +22074,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_lazy_message" field. public const int FooLazyMessageFieldNumber = 11; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage FooLazyMessage { - get { return HasFooLazyMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage) foo_ : null; } + get { return fooCase_ == FooOneofCase.FooLazyMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage) foo_ : null; } set { foo_ = value; fooCase_ = value == null ? FooOneofCase.None : FooOneofCase.FooLazyMessage; } } - /// Gets whether the "foo_lazy_message" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasFooLazyMessage { - get { return fooCase_ == FooOneofCase.FooLazyMessage; } - } - /// Clears the value of the oneof if it's currently set to "foo_lazy_message" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearFooLazyMessage() { - if (HasFooLazyMessage) { - ClearFoo(); - } - } /// Field number for the "bar_int" field. public const int BarIntFieldNumber = 12; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int BarInt { get { return HasBarInt ? (int) bar_ : 5; } set { @@ -16801,11 +22096,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarInt { get { return barCase_ == BarOneofCase.BarInt; } } /// Clears the value of the oneof if it's currently set to "bar_int" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarInt() { if (HasBarInt) { ClearBar(); @@ -16815,6 +22112,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_string" field. public const int BarStringFieldNumber = 13; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string BarString { get { return HasBarString ? (string) bar_ : global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("U1RSSU5H"), 0, 6); } set { @@ -16824,11 +22122,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarString { get { return barCase_ == BarOneofCase.BarString; } } /// Clears the value of the oneof if it's currently set to "bar_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarString() { if (HasBarString) { ClearBar(); @@ -16838,6 +22138,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_cord" field. public const int BarCordFieldNumber = 14; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string BarCord { get { return HasBarCord ? (string) bar_ : global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("Q09SRA=="), 0, 4); } set { @@ -16847,11 +22148,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_cord" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarCord { get { return barCase_ == BarOneofCase.BarCord; } } /// Clears the value of the oneof if it's currently set to "bar_cord" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarCord() { if (HasBarCord) { ClearBar(); @@ -16861,6 +22164,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_string_piece" field. public const int BarStringPieceFieldNumber = 15; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string BarStringPiece { get { return HasBarStringPiece ? (string) bar_ : global::System.Text.Encoding.UTF8.GetString(global::System.Convert.FromBase64String("U1BJRUNF"), 0, 6); } set { @@ -16870,11 +22174,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_string_piece" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarStringPiece { get { return barCase_ == BarOneofCase.BarStringPiece; } } /// Clears the value of the oneof if it's currently set to "bar_string_piece" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarStringPiece() { if (HasBarStringPiece) { ClearBar(); @@ -16884,6 +22190,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_bytes" field. public const int BarBytesFieldNumber = 16; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString BarBytes { get { return HasBarBytes ? (pb::ByteString) bar_ : pb::ByteString.FromBase64("QllURVM="); } set { @@ -16893,11 +22200,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarBytes { get { return barCase_ == BarOneofCase.BarBytes; } } /// Clears the value of the oneof if it's currently set to "bar_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarBytes() { if (HasBarBytes) { ClearBar(); @@ -16907,6 +22216,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "bar_enum" field. public const int BarEnumFieldNumber = 17; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum BarEnum { get { return HasBarEnum ? (global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum) bar_ : global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedEnum.Bar; } set { @@ -16916,11 +22226,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "bar_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBarEnum { get { return barCase_ == BarOneofCase.BarEnum; } } /// Clears the value of the oneof if it's currently set to "bar_enum" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBarEnum() { if (HasBarEnum) { ClearBar(); @@ -16933,22 +22245,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int bazInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int BazInt { - get { if ((_hasBits0 & 16) != 0) { return bazInt_; } else { return BazIntDefaultValue; } } + get { if ((_hasBits0 & 1) != 0) { return bazInt_; } else { return BazIntDefaultValue; } } set { - _hasBits0 |= 16; + _hasBits0 |= 1; bazInt_ = value; } } /// Gets whether the "baz_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBazInt { - get { return (_hasBits0 & 16) != 0; } + get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "baz_int" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBazInt() { - _hasBits0 &= ~16; + _hasBits0 &= ~1; } /// Field number for the "baz_string" field. @@ -16957,6 +22272,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string bazString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string BazString { get { return bazString_ ?? BazStringDefaultValue; } set { @@ -16965,11 +22281,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "baz_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBazString { get { return bazString_ != null; } } /// Clears the value of the "baz_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBazString() { bazString_ = null; } @@ -16990,11 +22308,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private FooOneofCase fooCase_ = FooOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOneofCase FooCase { get { return fooCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { fooCase_ = FooOneofCase.None; foo_ = null; @@ -17013,22 +22333,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private BarOneofCase barCase_ = BarOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarOneofCase BarCase { get { return barCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBar() { barCase_ = BarOneofCase.None; bar_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestOneof2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestOneof2 other) { if (ReferenceEquals(other, null)) { return false; @@ -17059,6 +22383,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFooInt) hash ^= FooInt.GetHashCode(); @@ -17067,9 +22392,9 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasFooStringPiece) hash ^= FooStringPiece.GetHashCode(); if (HasFooBytes) hash ^= FooBytes.GetHashCode(); if (HasFooEnum) hash ^= FooEnum.GetHashCode(); - if (HasFooMessage) hash ^= FooMessage.GetHashCode(); + if (fooCase_ == FooOneofCase.FooMessage) hash ^= FooMessage.GetHashCode(); if (HasFooGroup) hash ^= FooGroup.GetHashCode(); - if (HasFooLazyMessage) hash ^= FooLazyMessage.GetHashCode(); + if (fooCase_ == FooOneofCase.FooLazyMessage) hash ^= FooLazyMessage.GetHashCode(); if (HasBarInt) hash ^= BarInt.GetHashCode(); if (HasBarString) hash ^= BarString.GetHashCode(); if (HasBarCord) hash ^= BarCord.GetHashCode(); @@ -17081,18 +22406,102 @@ namespace Google.Protobuf.TestProtos.Proto2 { hash ^= (int) fooCase_; hash ^= (int) barCase_; if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasFooInt) { + output.WriteRawTag(8); + output.WriteInt32(FooInt); + } + if (HasFooString) { + output.WriteRawTag(18); + output.WriteString(FooString); + } + if (HasFooCord) { + output.WriteRawTag(26); + output.WriteString(FooCord); + } + if (HasFooStringPiece) { + output.WriteRawTag(34); + output.WriteString(FooStringPiece); + } + if (HasFooBytes) { + output.WriteRawTag(42); + output.WriteBytes(FooBytes); + } + if (HasFooEnum) { + output.WriteRawTag(48); + output.WriteEnum((int) FooEnum); + } + if (fooCase_ == FooOneofCase.FooMessage) { + output.WriteRawTag(58); + output.WriteMessage(FooMessage); + } + if (HasFooGroup) { + output.WriteRawTag(67); + output.WriteGroup(FooGroup); + output.WriteRawTag(68); + } + if (fooCase_ == FooOneofCase.FooLazyMessage) { + output.WriteRawTag(90); + output.WriteMessage(FooLazyMessage); + } + if (HasBarInt) { + output.WriteRawTag(96); + output.WriteInt32(BarInt); + } + if (HasBarString) { + output.WriteRawTag(106); + output.WriteString(BarString); + } + if (HasBarCord) { + output.WriteRawTag(114); + output.WriteString(BarCord); + } + if (HasBarStringPiece) { + output.WriteRawTag(122); + output.WriteString(BarStringPiece); + } + if (HasBarBytes) { + output.WriteRawTag(130, 1); + output.WriteBytes(BarBytes); + } + if (HasBarEnum) { + output.WriteRawTag(136, 1); + output.WriteEnum((int) BarEnum); + } + if (HasBazInt) { + output.WriteRawTag(144, 1); + output.WriteInt32(BazInt); + } + if (HasBazString) { + output.WriteRawTag(154, 1); + output.WriteString(BazString); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasFooInt) { output.WriteRawTag(8); output.WriteInt32(FooInt); @@ -17117,7 +22526,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(48); output.WriteEnum((int) FooEnum); } - if (HasFooMessage) { + if (fooCase_ == FooOneofCase.FooMessage) { output.WriteRawTag(58); output.WriteMessage(FooMessage); } @@ -17126,7 +22535,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteGroup(FooGroup); output.WriteRawTag(68); } - if (HasFooLazyMessage) { + if (fooCase_ == FooOneofCase.FooLazyMessage) { output.WriteRawTag(90); output.WriteMessage(FooLazyMessage); } @@ -17163,11 +22572,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteString(BazString); } if (_unknownFields != null) { - _unknownFields.WriteTo(output); + _unknownFields.WriteTo(ref output); } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFooInt) { @@ -17188,13 +22599,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasFooEnum) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) FooEnum); } - if (HasFooMessage) { + if (fooCase_ == FooOneofCase.FooMessage) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(FooMessage); } if (HasFooGroup) { size += 2 + pb::CodedOutputStream.ComputeGroupSize(FooGroup); } - if (HasFooLazyMessage) { + if (fooCase_ == FooOneofCase.FooLazyMessage) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(FooLazyMessage); } if (HasBarInt) { @@ -17228,6 +22639,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestOneof2 other) { if (other == null) { return; @@ -17302,7 +22714,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -17336,7 +22752,107 @@ namespace Google.Protobuf.TestProtos.Proto2 { } case 58: { global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage(); - if (HasFooMessage) { + if (fooCase_ == FooOneofCase.FooMessage) { + subBuilder.MergeFrom(FooMessage); + } + input.ReadMessage(subBuilder); + FooMessage = subBuilder; + break; + } + case 67: { + global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.FooGroup(); + if (HasFooGroup) { + subBuilder.MergeFrom(FooGroup); + } + input.ReadGroup(subBuilder); + FooGroup = subBuilder; + break; + } + case 90: { + global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage(); + if (fooCase_ == FooOneofCase.FooLazyMessage) { + subBuilder.MergeFrom(FooLazyMessage); + } + input.ReadMessage(subBuilder); + FooLazyMessage = subBuilder; + break; + } + case 96: { + BarInt = input.ReadInt32(); + break; + } + case 106: { + BarString = input.ReadString(); + break; + } + case 114: { + BarCord = input.ReadString(); + break; + } + case 122: { + BarStringPiece = input.ReadString(); + break; + } + case 130: { + BarBytes = input.ReadBytes(); + break; + } + case 136: { + bar_ = input.ReadEnum(); + barCase_ = BarOneofCase.BarEnum; + break; + } + case 144: { + BazInt = input.ReadInt32(); + break; + } + case 154: { + BazString = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + FooCord = input.ReadString(); + break; + } + case 34: { + FooStringPiece = input.ReadString(); + break; + } + case 42: { + FooBytes = input.ReadBytes(); + break; + } + case 48: { + foo_ = input.ReadEnum(); + fooCase_ = FooOneofCase.FooEnum; + break; + } + case 58: { + global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage(); + if (fooCase_ == FooOneofCase.FooMessage) { subBuilder.MergeFrom(FooMessage); } input.ReadMessage(subBuilder); @@ -17354,7 +22870,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } case 90: { global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Types.NestedMessage(); - if (HasFooLazyMessage) { + if (fooCase_ == FooOneofCase.FooLazyMessage) { subBuilder.MergeFrom(FooLazyMessage); } input.ReadMessage(subBuilder); @@ -17397,10 +22913,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestOneof2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("FOO")] Foo = 1, @@ -17408,24 +22926,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { [pbr::OriginalName("BAZ")] Baz = 3, } - public sealed partial class FooGroup : pb::IMessage { + public sealed partial class FooGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup() { OnConstruction(); } @@ -17433,6 +22959,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup(FooGroup other) : this() { _hasBits0 = other._hasBits0; a_ = other.a_; @@ -17441,6 +22968,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooGroup Clone() { return new FooGroup(this); } @@ -17451,6 +22979,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } } set { @@ -17460,11 +22989,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { _hasBits0 &= ~1; } @@ -17475,6 +23006,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string b_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string B { get { return b_ ?? BDefaultValue; } set { @@ -17483,21 +23015,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "b" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasB { get { return b_ != null; } } /// Clears the value of the "b" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearB() { b_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -17511,6 +23047,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -17522,12 +23059,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(72); output.WriteInt32(A); @@ -17539,9 +23081,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(72); + output.WriteInt32(A); + } + if (HasB) { + output.WriteRawTag(82); + output.WriteString(B); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -17557,6 +23119,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooGroup other) { if (other == null) { return; @@ -17571,7 +23134,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -17590,28 +23157,62 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 68: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 72: { + A = input.ReadInt32(); + break; + } + case 82: { + B = input.ReadString(); + break; + } + } + } } + #endif } - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestOneof2.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -17619,6 +23220,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; quxInt_ = other.quxInt_; @@ -17627,6 +23229,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -17637,6 +23240,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private long quxInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long QuxInt { get { if ((_hasBits0 & 1) != 0) { return quxInt_; } else { return QuxIntDefaultValue; } } set { @@ -17646,11 +23250,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "qux_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasQuxInt { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "qux_int" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearQuxInt() { _hasBits0 &= ~1; } @@ -17661,16 +23267,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(16); private readonly pbc::RepeatedField corgeInt_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField CorgeInt { get { return corgeInt_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -17684,6 +23293,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasQuxInt) hash ^= QuxInt.GetHashCode(); @@ -17695,12 +23305,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasQuxInt) { output.WriteRawTag(8); output.WriteInt64(QuxInt); @@ -17709,9 +23324,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasQuxInt) { + output.WriteRawTag(8); + output.WriteInt64(QuxInt); + } + corgeInt_.WriteTo(ref output, _repeated_corgeInt_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasQuxInt) { @@ -17725,6 +23357,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -17737,7 +23370,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -17755,7 +23392,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + QuxInt = input.ReadInt64(); + break; + } + case 18: + case 16: { + corgeInt_.AddEntriesFrom(ref input, _repeated_corgeInt_codec); + break; + } + } + } } + #endif } @@ -17764,24 +23426,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestRequiredOneof : pb::IMessage { + public sealed partial class TestRequiredOneof : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredOneof()); private pb::UnknownFieldSet _unknownFields; - private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[46]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredOneof() { OnConstruction(); } @@ -17789,8 +23458,8 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredOneof(TestRequiredOneof other) : this() { - _hasBits0 = other._hasBits0; switch (other.FooCase) { case FooOneofCase.FooInt: FooInt = other.FooInt; @@ -17807,6 +23476,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredOneof Clone() { return new TestRequiredOneof(this); } @@ -17814,6 +23484,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_int" field. public const int FooIntFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { get { return HasFooInt ? (int) foo_ : 0; } set { @@ -17823,11 +23494,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_int" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooInt { get { return fooCase_ == FooOneofCase.FooInt; } } /// Clears the value of the oneof if it's currently set to "foo_int" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooInt() { if (HasFooInt) { ClearFoo(); @@ -17837,6 +23510,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_string" field. public const int FooStringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { get { return HasFooString ? (string) foo_ : ""; } set { @@ -17846,11 +23520,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "foo_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFooString { get { return fooCase_ == FooOneofCase.FooString; } } /// Clears the value of the oneof if it's currently set to "foo_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFooString() { if (HasFooString) { ClearFoo(); @@ -17860,25 +23536,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "foo_message" field. public const int FooMessageFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage FooMessage { - get { return HasFooMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage) foo_ : null; } + get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage) foo_ : null; } set { foo_ = value; fooCase_ = value == null ? FooOneofCase.None : FooOneofCase.FooMessage; } } - /// Gets whether the "foo_message" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasFooMessage { - get { return fooCase_ == FooOneofCase.FooMessage; } - } - /// Clears the value of the oneof if it's currently set to "foo_message" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearFooMessage() { - if (HasFooMessage) { - ClearFoo(); - } - } private object foo_; /// Enum of possible cases for the "foo" oneof. @@ -17890,22 +23555,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private FooOneofCase fooCase_ = FooOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOneofCase FooCase { get { return fooCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { fooCase_ = FooOneofCase.None; foo_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequiredOneof); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequiredOneof other) { if (ReferenceEquals(other, null)) { return false; @@ -17921,11 +23590,12 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFooInt) hash ^= FooInt.GetHashCode(); if (HasFooString) hash ^= FooString.GetHashCode(); - if (HasFooMessage) hash ^= FooMessage.GetHashCode(); + if (fooCase_ == FooOneofCase.FooMessage) hash ^= FooMessage.GetHashCode(); hash ^= (int) fooCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -17934,12 +23604,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasFooInt) { output.WriteRawTag(8); output.WriteInt32(FooInt); @@ -17948,16 +23623,40 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(18); output.WriteString(FooString); } - if (HasFooMessage) { + if (fooCase_ == FooOneofCase.FooMessage) { output.WriteRawTag(26); output.WriteMessage(FooMessage); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFooInt) { + output.WriteRawTag(8); + output.WriteInt32(FooInt); + } + if (HasFooString) { + output.WriteRawTag(18); + output.WriteString(FooString); + } + if (fooCase_ == FooOneofCase.FooMessage) { + output.WriteRawTag(26); + output.WriteMessage(FooMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFooInt) { @@ -17966,7 +23665,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasFooString) { size += 1 + pb::CodedOutputStream.ComputeStringSize(FooString); } - if (HasFooMessage) { + if (fooCase_ == FooOneofCase.FooMessage) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(FooMessage); } if (_unknownFields != null) { @@ -17976,6 +23675,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequiredOneof other) { if (other == null) { return; @@ -17999,7 +23699,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -18016,7 +23720,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { } case 26: { global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage(); - if (HasFooMessage) { + if (fooCase_ == FooOneofCase.FooMessage) { + subBuilder.MergeFrom(FooMessage); + } + input.ReadMessage(subBuilder); + FooMessage = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Types.NestedMessage(); + if (fooCase_ == FooOneofCase.FooMessage) { subBuilder.MergeFrom(FooMessage); } input.ReadMessage(subBuilder); @@ -18026,29 +23762,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif #region Nested types /// Container for nested types declared in the TestRequiredOneof message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestRequiredOneof.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -18056,6 +23802,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; requiredDouble_ = other.requiredDouble_; @@ -18063,6 +23810,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -18073,6 +23821,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private double requiredDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double RequiredDouble { get { if ((_hasBits0 & 1) != 0) { return requiredDouble_; } else { return RequiredDoubleDefaultValue; } } set { @@ -18082,21 +23831,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "required_double" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasRequiredDouble { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "required_double" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearRequiredDouble() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -18109,6 +23862,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasRequiredDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(RequiredDouble); @@ -18119,12 +23873,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasRequiredDouble) { output.WriteRawTag(9); output.WriteDouble(RequiredDouble); @@ -18132,9 +23891,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRequiredDouble) { + output.WriteRawTag(9); + output.WriteDouble(RequiredDouble); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasRequiredDouble) { @@ -18147,6 +23922,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -18154,16 +23930,39 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasRequiredDouble) { RequiredDouble = other.RequiredDouble; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + RequiredDouble = input.ReadDouble(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 9: { RequiredDouble = input.ReadDouble(); @@ -18172,6 +23971,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -18180,23 +23980,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestRequiredMap : pb::IMessage { + public sealed partial class TestRequiredMap : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredMap()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[47]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMap() { OnConstruction(); } @@ -18204,12 +24012,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMap(TestRequiredMap other) : this() { foo_ = other.foo_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRequiredMap Clone() { return new TestRequiredMap(this); } @@ -18220,16 +24030,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.TestRequiredMap.Types.NestedMessage.Parser), 10); private readonly pbc::MapField foo_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Foo { get { return foo_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRequiredMap); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRequiredMap other) { if (ReferenceEquals(other, null)) { return false; @@ -18242,6 +24055,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= Foo.GetHashCode(); @@ -18252,19 +24066,37 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else foo_.WriteTo(output, _map_foo_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + foo_.WriteTo(ref output, _map_foo_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += foo_.CalculateSize(_map_foo_codec); @@ -18275,6 +24107,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRequiredMap other) { if (other == null) { return; @@ -18284,7 +24117,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -18297,30 +24134,59 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + foo_.AddEntriesFrom(ref input, _map_foo_codec); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the TestRequiredMap message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestRequiredMap.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -18328,6 +24194,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { _hasBits0 = other._hasBits0; requiredInt32_ = other.requiredInt32_; @@ -18335,6 +24202,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -18345,6 +24213,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int requiredInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int RequiredInt32 { get { if ((_hasBits0 & 1) != 0) { return requiredInt32_; } else { return RequiredInt32DefaultValue; } } set { @@ -18354,21 +24223,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "required_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasRequiredInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "required_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearRequiredInt32() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -18381,6 +24254,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasRequiredInt32) hash ^= RequiredInt32.GetHashCode(); @@ -18391,12 +24265,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasRequiredInt32) { output.WriteRawTag(8); output.WriteInt32(RequiredInt32); @@ -18404,9 +24283,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasRequiredInt32) { + output.WriteRawTag(8); + output.WriteInt32(RequiredInt32); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasRequiredInt32) { @@ -18419,6 +24314,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -18430,7 +24326,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -18443,7 +24343,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + RequiredInt32 = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -18452,23 +24372,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestPackedTypes : pb::IMessage { + public sealed partial class TestPackedTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestPackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[48]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes() { OnConstruction(); } @@ -18476,6 +24404,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes(TestPackedTypes other) : this() { packedInt32_ = other.packedInt32_.Clone(); packedInt64_ = other.packedInt64_.Clone(); @@ -18495,6 +24424,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes Clone() { return new TestPackedTypes(this); } @@ -18505,6 +24435,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(722); private readonly pbc::RepeatedField packedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -18515,6 +24446,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt64(730); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -18525,6 +24457,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt32(738); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -18535,6 +24468,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt64(746); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -18545,6 +24479,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt32(754); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -18555,6 +24490,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt64(762); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -18565,6 +24501,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed32(770); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -18575,6 +24512,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed64(778); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -18585,6 +24523,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed32(786); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -18595,6 +24534,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed64(794); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -18605,6 +24545,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFloat(802); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -18615,6 +24556,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForDouble(810); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -18625,6 +24567,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBool(818); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedBool { get { return packedBool_; } } @@ -18635,16 +24578,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) x); private readonly pbc::RepeatedField packedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedEnum { get { return packedEnum_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestPackedTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestPackedTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -18670,6 +24616,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= packedInt32_.GetHashCode(); @@ -18693,12 +24640,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else packedInt32_.WriteTo(output, _repeated_packedInt32_codec); packedInt64_.WriteTo(output, _repeated_packedInt64_codec); packedUint32_.WriteTo(output, _repeated_packedUint32_codec); @@ -18716,9 +24668,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + packedInt32_.WriteTo(ref output, _repeated_packedInt32_codec); + packedInt64_.WriteTo(ref output, _repeated_packedInt64_codec); + packedUint32_.WriteTo(ref output, _repeated_packedUint32_codec); + packedUint64_.WriteTo(ref output, _repeated_packedUint64_codec); + packedSint32_.WriteTo(ref output, _repeated_packedSint32_codec); + packedSint64_.WriteTo(ref output, _repeated_packedSint64_codec); + packedFixed32_.WriteTo(ref output, _repeated_packedFixed32_codec); + packedFixed64_.WriteTo(ref output, _repeated_packedFixed64_codec); + packedSfixed32_.WriteTo(ref output, _repeated_packedSfixed32_codec); + packedSfixed64_.WriteTo(ref output, _repeated_packedSfixed64_codec); + packedFloat_.WriteTo(ref output, _repeated_packedFloat_codec); + packedDouble_.WriteTo(ref output, _repeated_packedDouble_codec); + packedBool_.WriteTo(ref output, _repeated_packedBool_codec); + packedEnum_.WriteTo(ref output, _repeated_packedEnum_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += packedInt32_.CalculateSize(_repeated_packedInt32_codec); @@ -18742,6 +24720,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestPackedTypes other) { if (other == null) { return; @@ -18764,7 +24743,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -18843,7 +24826,93 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 722: + case 720: { + packedInt32_.AddEntriesFrom(ref input, _repeated_packedInt32_codec); + break; + } + case 730: + case 728: { + packedInt64_.AddEntriesFrom(ref input, _repeated_packedInt64_codec); + break; + } + case 738: + case 736: { + packedUint32_.AddEntriesFrom(ref input, _repeated_packedUint32_codec); + break; + } + case 746: + case 744: { + packedUint64_.AddEntriesFrom(ref input, _repeated_packedUint64_codec); + break; + } + case 754: + case 752: { + packedSint32_.AddEntriesFrom(ref input, _repeated_packedSint32_codec); + break; + } + case 762: + case 760: { + packedSint64_.AddEntriesFrom(ref input, _repeated_packedSint64_codec); + break; + } + case 770: + case 773: { + packedFixed32_.AddEntriesFrom(ref input, _repeated_packedFixed32_codec); + break; + } + case 778: + case 777: { + packedFixed64_.AddEntriesFrom(ref input, _repeated_packedFixed64_codec); + break; + } + case 786: + case 789: { + packedSfixed32_.AddEntriesFrom(ref input, _repeated_packedSfixed32_codec); + break; + } + case 794: + case 793: { + packedSfixed64_.AddEntriesFrom(ref input, _repeated_packedSfixed64_codec); + break; + } + case 802: + case 805: { + packedFloat_.AddEntriesFrom(ref input, _repeated_packedFloat_codec); + break; + } + case 810: + case 809: { + packedDouble_.AddEntriesFrom(ref input, _repeated_packedDouble_codec); + break; + } + case 818: + case 816: { + packedBool_.AddEntriesFrom(ref input, _repeated_packedBool_codec); + break; + } + case 826: + case 824: { + packedEnum_.AddEntriesFrom(ref input, _repeated_packedEnum_codec); + break; + } + } + } } + #endif } @@ -18851,23 +24920,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// A message with the same fields as TestPackedTypes, but without packing. Used /// to test packed <-> unpacked wire compatibility. /// - public sealed partial class TestUnpackedTypes : pb::IMessage { + public sealed partial class TestUnpackedTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[49]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes() { OnConstruction(); } @@ -18875,6 +24952,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes(TestUnpackedTypes other) : this() { unpackedInt32_ = other.unpackedInt32_.Clone(); unpackedInt64_ = other.unpackedInt64_.Clone(); @@ -18894,6 +24972,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes Clone() { return new TestUnpackedTypes(this); } @@ -18904,6 +24983,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(720); private readonly pbc::RepeatedField unpackedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -18914,6 +24994,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt64(728); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -18924,6 +25005,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt32(736); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -18934,6 +25016,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt64(744); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -18944,6 +25027,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt32(752); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -18954,6 +25038,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt64(760); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -18964,6 +25049,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed32(773); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -18974,6 +25060,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFixed64(777); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -18984,6 +25071,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed32(789); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -18994,6 +25082,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSFixed64(793); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -19004,6 +25093,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForFloat(805); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -19014,6 +25104,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForDouble(809); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -19024,6 +25115,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForBool(816); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } @@ -19034,16 +25126,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) x); private readonly pbc::RepeatedField unpackedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedEnum { get { return unpackedEnum_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestUnpackedTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestUnpackedTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -19069,6 +25164,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= unpackedInt32_.GetHashCode(); @@ -19092,12 +25188,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else unpackedInt32_.WriteTo(output, _repeated_unpackedInt32_codec); unpackedInt64_.WriteTo(output, _repeated_unpackedInt64_codec); unpackedUint32_.WriteTo(output, _repeated_unpackedUint32_codec); @@ -19115,9 +25216,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + unpackedInt32_.WriteTo(ref output, _repeated_unpackedInt32_codec); + unpackedInt64_.WriteTo(ref output, _repeated_unpackedInt64_codec); + unpackedUint32_.WriteTo(ref output, _repeated_unpackedUint32_codec); + unpackedUint64_.WriteTo(ref output, _repeated_unpackedUint64_codec); + unpackedSint32_.WriteTo(ref output, _repeated_unpackedSint32_codec); + unpackedSint64_.WriteTo(ref output, _repeated_unpackedSint64_codec); + unpackedFixed32_.WriteTo(ref output, _repeated_unpackedFixed32_codec); + unpackedFixed64_.WriteTo(ref output, _repeated_unpackedFixed64_codec); + unpackedSfixed32_.WriteTo(ref output, _repeated_unpackedSfixed32_codec); + unpackedSfixed64_.WriteTo(ref output, _repeated_unpackedSfixed64_codec); + unpackedFloat_.WriteTo(ref output, _repeated_unpackedFloat_codec); + unpackedDouble_.WriteTo(ref output, _repeated_unpackedDouble_codec); + unpackedBool_.WriteTo(ref output, _repeated_unpackedBool_codec); + unpackedEnum_.WriteTo(ref output, _repeated_unpackedEnum_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += unpackedInt32_.CalculateSize(_repeated_unpackedInt32_codec); @@ -19141,6 +25268,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestUnpackedTypes other) { if (other == null) { return; @@ -19163,7 +25291,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -19242,29 +25374,123 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 722: + case 720: { + unpackedInt32_.AddEntriesFrom(ref input, _repeated_unpackedInt32_codec); + break; + } + case 730: + case 728: { + unpackedInt64_.AddEntriesFrom(ref input, _repeated_unpackedInt64_codec); + break; + } + case 738: + case 736: { + unpackedUint32_.AddEntriesFrom(ref input, _repeated_unpackedUint32_codec); + break; + } + case 746: + case 744: { + unpackedUint64_.AddEntriesFrom(ref input, _repeated_unpackedUint64_codec); + break; + } + case 754: + case 752: { + unpackedSint32_.AddEntriesFrom(ref input, _repeated_unpackedSint32_codec); + break; + } + case 762: + case 760: { + unpackedSint64_.AddEntriesFrom(ref input, _repeated_unpackedSint64_codec); + break; + } + case 770: + case 773: { + unpackedFixed32_.AddEntriesFrom(ref input, _repeated_unpackedFixed32_codec); + break; + } + case 778: + case 777: { + unpackedFixed64_.AddEntriesFrom(ref input, _repeated_unpackedFixed64_codec); + break; + } + case 786: + case 789: { + unpackedSfixed32_.AddEntriesFrom(ref input, _repeated_unpackedSfixed32_codec); + break; + } + case 794: + case 793: { + unpackedSfixed64_.AddEntriesFrom(ref input, _repeated_unpackedSfixed64_codec); + break; + } + case 802: + case 805: { + unpackedFloat_.AddEntriesFrom(ref input, _repeated_unpackedFloat_codec); + break; + } + case 810: + case 809: { + unpackedDouble_.AddEntriesFrom(ref input, _repeated_unpackedDouble_codec); + break; + } + case 818: + case 816: { + unpackedBool_.AddEntriesFrom(ref input, _repeated_unpackedBool_codec); + break; + } + case 826: + case 824: { + unpackedEnum_.AddEntriesFrom(ref input, _repeated_unpackedEnum_codec); + break; + } + } + } } + #endif } - public sealed partial class TestPackedExtensions : pb::IExtendableMessage { + public sealed partial class TestPackedExtensions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestPackedExtensions()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[50]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedExtensions() { OnConstruction(); } @@ -19272,22 +25498,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedExtensions(TestPackedExtensions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedExtensions Clone() { return new TestPackedExtensions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestPackedExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestPackedExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -19302,6 +25532,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -19314,21 +25545,41 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_extensions != null) { _extensions.WriteTo(output); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -19341,6 +25592,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestPackedExtensions other) { if (other == null) { return; @@ -19350,7 +25602,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -19361,7 +25617,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -19387,25 +25661,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestUnpackedExtensions : pb::IExtendableMessage { + public sealed partial class TestUnpackedExtensions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedExtensions()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[51]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedExtensions() { OnConstruction(); } @@ -19413,22 +25695,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedExtensions(TestUnpackedExtensions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _extensions = pb::ExtensionSet.Clone(other._extensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedExtensions Clone() { return new TestUnpackedExtensions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestUnpackedExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestUnpackedExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -19443,6 +25729,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_extensions != null) { @@ -19455,21 +25742,41 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_extensions != null) { _extensions.WriteTo(output); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_extensions != null) { @@ -19482,6 +25789,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestUnpackedExtensions other) { if (other == null) { return; @@ -19491,7 +25799,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -19502,7 +25814,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -19533,24 +25863,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// a set of extensions to TestAllExtensions dynamically, based on the fields /// of this message type. /// - public sealed partial class TestDynamicExtensions : pb::IMessage { + public sealed partial class TestDynamicExtensions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDynamicExtensions()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[52]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDynamicExtensions() { OnConstruction(); } @@ -19558,19 +25896,21 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDynamicExtensions(TestDynamicExtensions other) : this() { _hasBits0 = other._hasBits0; scalarExtension_ = other.scalarExtension_; enumExtension_ = other.enumExtension_; dynamicEnumExtension_ = other.dynamicEnumExtension_; - messageExtension_ = other.HasMessageExtension ? other.messageExtension_.Clone() : null; - dynamicMessageExtension_ = other.HasDynamicMessageExtension ? other.dynamicMessageExtension_.Clone() : null; + messageExtension_ = other.messageExtension_ != null ? other.messageExtension_.Clone() : null; + dynamicMessageExtension_ = other.dynamicMessageExtension_ != null ? other.dynamicMessageExtension_.Clone() : null; repeatedExtension_ = other.repeatedExtension_.Clone(); packedExtension_ = other.packedExtension_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDynamicExtensions Clone() { return new TestDynamicExtensions(this); } @@ -19581,6 +25921,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private uint scalarExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint ScalarExtension { get { if ((_hasBits0 & 1) != 0) { return scalarExtension_; } else { return ScalarExtensionDefaultValue; } } set { @@ -19590,11 +25931,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "scalar_extension" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasScalarExtension { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "scalar_extension" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearScalarExtension() { _hasBits0 &= ~1; } @@ -19605,6 +25948,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum enumExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum EnumExtension { get { if ((_hasBits0 & 2) != 0) { return enumExtension_; } else { return EnumExtensionDefaultValue; } } set { @@ -19614,11 +25958,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "enum_extension" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEnumExtension { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "enum_extension" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEnumExtension() { _hasBits0 &= ~2; } @@ -19629,6 +25975,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicEnumType dynamicEnumExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicEnumType DynamicEnumExtension { get { if ((_hasBits0 & 4) != 0) { return dynamicEnumExtension_; } else { return DynamicEnumExtensionDefaultValue; } } set { @@ -19638,11 +25985,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dynamic_enum_extension" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDynamicEnumExtension { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "dynamic_enum_extension" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDynamicEnumExtension() { _hasBits0 &= ~4; } @@ -19651,43 +26000,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int MessageExtensionFieldNumber = 2003; private global::Google.Protobuf.TestProtos.Proto2.ForeignMessage messageExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignMessage MessageExtension { get { return messageExtension_; } set { messageExtension_ = value; } } - /// Gets whether the message_extension field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasMessageExtension { - get { return messageExtension_ != null; } - } - /// Clears the value of the message_extension field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMessageExtension() { - messageExtension_ = null; - } /// Field number for the "dynamic_message_extension" field. public const int DynamicMessageExtensionFieldNumber = 2004; private global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicMessageType dynamicMessageExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicMessageType DynamicMessageExtension { get { return dynamicMessageExtension_; } set { dynamicMessageExtension_ = value; } } - /// Gets whether the dynamic_message_extension field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasDynamicMessageExtension { - get { return dynamicMessageExtension_ != null; } - } - /// Clears the value of the dynamic_message_extension field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearDynamicMessageExtension() { - dynamicMessageExtension_ = null; - } /// Field number for the "repeated_extension" field. public const int RepeatedExtensionFieldNumber = 2005; @@ -19695,6 +26026,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForString(16042); private readonly pbc::RepeatedField repeatedExtension_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedExtension { get { return repeatedExtension_; } } @@ -19705,16 +26037,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForSInt32(16050); private readonly pbc::RepeatedField packedExtension_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedExtension { get { return packedExtension_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDynamicExtensions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDynamicExtensions other) { if (ReferenceEquals(other, null)) { return false; @@ -19733,28 +26068,66 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasScalarExtension) hash ^= ScalarExtension.GetHashCode(); if (HasEnumExtension) hash ^= EnumExtension.GetHashCode(); if (HasDynamicEnumExtension) hash ^= DynamicEnumExtension.GetHashCode(); - if (HasMessageExtension) hash ^= MessageExtension.GetHashCode(); - if (HasDynamicMessageExtension) hash ^= DynamicMessageExtension.GetHashCode(); + if (messageExtension_ != null) hash ^= MessageExtension.GetHashCode(); + if (dynamicMessageExtension_ != null) hash ^= DynamicMessageExtension.GetHashCode(); hash ^= repeatedExtension_.GetHashCode(); hash ^= packedExtension_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasScalarExtension) { + output.WriteRawTag(133, 125); + output.WriteFixed32(ScalarExtension); + } + if (HasEnumExtension) { + output.WriteRawTag(136, 125); + output.WriteEnum((int) EnumExtension); + } + if (HasDynamicEnumExtension) { + output.WriteRawTag(144, 125); + output.WriteEnum((int) DynamicEnumExtension); + } + if (messageExtension_ != null) { + output.WriteRawTag(154, 125); + output.WriteMessage(MessageExtension); + } + if (dynamicMessageExtension_ != null) { + output.WriteRawTag(162, 125); + output.WriteMessage(DynamicMessageExtension); + } + repeatedExtension_.WriteTo(output, _repeated_repeatedExtension_codec); + packedExtension_.WriteTo(output, _repeated_packedExtension_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasScalarExtension) { output.WriteRawTag(133, 125); output.WriteFixed32(ScalarExtension); @@ -19767,22 +26140,24 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(144, 125); output.WriteEnum((int) DynamicEnumExtension); } - if (HasMessageExtension) { + if (messageExtension_ != null) { output.WriteRawTag(154, 125); output.WriteMessage(MessageExtension); } - if (HasDynamicMessageExtension) { + if (dynamicMessageExtension_ != null) { output.WriteRawTag(162, 125); output.WriteMessage(DynamicMessageExtension); } - repeatedExtension_.WriteTo(output, _repeated_repeatedExtension_codec); - packedExtension_.WriteTo(output, _repeated_packedExtension_codec); + repeatedExtension_.WriteTo(ref output, _repeated_repeatedExtension_codec); + packedExtension_.WriteTo(ref output, _repeated_packedExtension_codec); if (_unknownFields != null) { - _unknownFields.WriteTo(output); + _unknownFields.WriteTo(ref output); } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasScalarExtension) { @@ -19794,10 +26169,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasDynamicEnumExtension) { size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) DynamicEnumExtension); } - if (HasMessageExtension) { + if (messageExtension_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(MessageExtension); } - if (HasDynamicMessageExtension) { + if (dynamicMessageExtension_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(DynamicMessageExtension); } size += repeatedExtension_.CalculateSize(_repeated_repeatedExtension_codec); @@ -19809,6 +26184,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDynamicExtensions other) { if (other == null) { return; @@ -19822,14 +26198,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasDynamicEnumExtension) { DynamicEnumExtension = other.DynamicEnumExtension; } - if (other.HasMessageExtension) { - if (!HasMessageExtension) { + if (other.messageExtension_ != null) { + if (messageExtension_ == null) { MessageExtension = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); } MessageExtension.MergeFrom(other.MessageExtension); } - if (other.HasDynamicMessageExtension) { - if (!HasDynamicMessageExtension) { + if (other.dynamicMessageExtension_ != null) { + if (dynamicMessageExtension_ == null) { DynamicMessageExtension = new global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicMessageType(); } DynamicMessageExtension.MergeFrom(other.DynamicMessageExtension); @@ -19840,7 +26216,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -19860,14 +26240,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } case 16026: { - if (!HasMessageExtension) { + if (messageExtension_ == null) { MessageExtension = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); } input.ReadMessage(MessageExtension); break; } case 16034: { - if (!HasDynamicMessageExtension) { + if (dynamicMessageExtension_ == null) { DynamicMessageExtension = new global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicMessageType(); } input.ReadMessage(DynamicMessageExtension); @@ -19884,11 +26264,63 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 16005: { + ScalarExtension = input.ReadFixed32(); + break; + } + case 16008: { + EnumExtension = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 16016: { + DynamicEnumExtension = (global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicEnumType) input.ReadEnum(); + break; + } + case 16026: { + if (messageExtension_ == null) { + MessageExtension = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); + } + input.ReadMessage(MessageExtension); + break; + } + case 16034: { + if (dynamicMessageExtension_ == null) { + DynamicMessageExtension = new global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Types.DynamicMessageType(); + } + input.ReadMessage(DynamicMessageExtension); + break; + } + case 16042: { + repeatedExtension_.AddEntriesFrom(ref input, _repeated_repeatedExtension_codec); + break; + } + case 16050: + case 16048: { + packedExtension_.AddEntriesFrom(ref input, _repeated_packedExtension_codec); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the TestDynamicExtensions message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum DynamicEnumType { [pbr::OriginalName("DYNAMIC_FOO")] DynamicFoo = 2200, @@ -19896,24 +26328,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { [pbr::OriginalName("DYNAMIC_BAZ")] DynamicBaz = 2202, } - public sealed partial class DynamicMessageType : pb::IMessage { + public sealed partial class DynamicMessageType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DynamicMessageType()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestDynamicExtensions.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DynamicMessageType() { OnConstruction(); } @@ -19921,6 +26361,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DynamicMessageType(DynamicMessageType other) : this() { _hasBits0 = other._hasBits0; dynamicField_ = other.dynamicField_; @@ -19928,6 +26369,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DynamicMessageType Clone() { return new DynamicMessageType(this); } @@ -19938,6 +26380,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int dynamicField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DynamicField { get { if ((_hasBits0 & 1) != 0) { return dynamicField_; } else { return DynamicFieldDefaultValue; } } set { @@ -19947,21 +26390,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "dynamic_field" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDynamicField { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "dynamic_field" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDynamicField() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DynamicMessageType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DynamicMessageType other) { if (ReferenceEquals(other, null)) { return false; @@ -19974,6 +26421,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasDynamicField) hash ^= DynamicField.GetHashCode(); @@ -19984,12 +26432,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasDynamicField) { output.WriteRawTag(160, 131, 1); output.WriteInt32(DynamicField); @@ -19997,9 +26450,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDynamicField) { + output.WriteRawTag(160, 131, 1); + output.WriteInt32(DynamicField); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasDynamicField) { @@ -20012,6 +26481,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DynamicMessageType other) { if (other == null) { return; @@ -20023,7 +26493,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -20036,7 +26510,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 16800: { + DynamicField = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -20045,23 +26539,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage { + public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRepeatedScalarDifferentTagSizes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[53]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes() { OnConstruction(); } @@ -20069,6 +26571,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes(TestRepeatedScalarDifferentTagSizes other) : this() { repeatedFixed32_ = other.repeatedFixed32_.Clone(); repeatedInt32_ = other.repeatedInt32_.Clone(); @@ -20080,6 +26583,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes Clone() { return new TestRepeatedScalarDifferentTagSizes(this); } @@ -20095,6 +26599,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// in TestAllTypes didn't trigger the check. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -20108,6 +26613,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Check for a varint type, just for good measure. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -20121,6 +26627,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// These have two-byte tags. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -20131,6 +26638,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt64(16376); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -20144,6 +26652,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Three byte tags. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -20154,16 +26663,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForUInt64(2097144); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRepeatedScalarDifferentTagSizes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRepeatedScalarDifferentTagSizes other) { if (ReferenceEquals(other, null)) { return false; @@ -20181,6 +26693,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= repeatedFixed32_.GetHashCode(); @@ -20196,12 +26709,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else repeatedFixed32_.WriteTo(output, _repeated_repeatedFixed32_codec); repeatedInt32_.WriteTo(output, _repeated_repeatedInt32_codec); repeatedFixed64_.WriteTo(output, _repeated_repeatedFixed64_codec); @@ -20211,9 +26729,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + repeatedFixed32_.WriteTo(ref output, _repeated_repeatedFixed32_codec); + repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); + repeatedFixed64_.WriteTo(ref output, _repeated_repeatedFixed64_codec); + repeatedInt64_.WriteTo(ref output, _repeated_repeatedInt64_codec); + repeatedFloat_.WriteTo(ref output, _repeated_repeatedFloat_codec); + repeatedUint64_.WriteTo(ref output, _repeated_repeatedUint64_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += repeatedFixed32_.CalculateSize(_repeated_repeatedFixed32_codec); @@ -20229,6 +26765,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRepeatedScalarDifferentTagSizes other) { if (other == null) { return; @@ -20243,7 +26780,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -20282,7 +26823,53 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 98: + case 101: { + repeatedFixed32_.AddEntriesFrom(ref input, _repeated_repeatedFixed32_codec); + break; + } + case 106: + case 104: { + repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec); + break; + } + case 16370: + case 16369: { + repeatedFixed64_.AddEntriesFrom(ref input, _repeated_repeatedFixed64_codec); + break; + } + case 16378: + case 16376: { + repeatedInt64_.AddEntriesFrom(ref input, _repeated_repeatedInt64_codec); + break; + } + case 2097138: + case 2097141: { + repeatedFloat_.AddEntriesFrom(ref input, _repeated_repeatedFloat_codec); + break; + } + case 2097146: + case 2097144: { + repeatedUint64_.AddEntriesFrom(ref input, _repeated_repeatedUint64_codec); + break; + } + } + } } + #endif } @@ -20290,25 +26877,33 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Test that if an optional or required message/group field appears multiple /// times in the input, they need to be merged. /// - public sealed partial class TestParsingMerge : pb::IExtendableMessage { + public sealed partial class TestParsingMerge : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestParsingMerge()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[54]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestParsingMerge() { OnConstruction(); } @@ -20316,9 +26911,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestParsingMerge(TestParsingMerge other) : this() { - requiredAllTypes_ = other.HasRequiredAllTypes ? other.requiredAllTypes_.Clone() : null; - optionalAllTypes_ = other.HasOptionalAllTypes ? other.optionalAllTypes_.Clone() : null; + requiredAllTypes_ = other.requiredAllTypes_ != null ? other.requiredAllTypes_.Clone() : null; + optionalAllTypes_ = other.optionalAllTypes_ != null ? other.optionalAllTypes_.Clone() : null; repeatedAllTypes_ = other.repeatedAllTypes_.Clone(); optionalGroup_ = other.HasOptionalGroup ? other.optionalGroup_.Clone() : null; repeatedGroup_ = other.repeatedGroup_.Clone(); @@ -20327,6 +26923,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestParsingMerge Clone() { return new TestParsingMerge(this); } @@ -20335,43 +26932,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int RequiredAllTypesFieldNumber = 1; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes requiredAllTypes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes RequiredAllTypes { get { return requiredAllTypes_; } set { requiredAllTypes_ = value; } } - /// Gets whether the required_all_types field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasRequiredAllTypes { - get { return requiredAllTypes_ != null; } - } - /// Clears the value of the required_all_types field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearRequiredAllTypes() { - requiredAllTypes_ = null; - } /// Field number for the "optional_all_types" field. public const int OptionalAllTypesFieldNumber = 2; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes optionalAllTypes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes OptionalAllTypes { get { return optionalAllTypes_; } set { optionalAllTypes_ = value; } } - /// Gets whether the optional_all_types field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalAllTypes { - get { return optionalAllTypes_ != null; } - } - /// Clears the value of the optional_all_types field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalAllTypes() { - optionalAllTypes_ = null; - } /// Field number for the "repeated_all_types" field. public const int RepeatedAllTypesFieldNumber = 3; @@ -20379,6 +26958,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField repeatedAllTypes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedAllTypes { get { return repeatedAllTypes_; } } @@ -20387,6 +26967,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalGroupFieldNumber = 10; private global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -20395,11 +26976,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -20410,16 +26993,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForGroup(163, 164, global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedGroup.Parser); private readonly pbc::RepeatedField repeatedGroup_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedGroup { get { return repeatedGroup_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestParsingMerge); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestParsingMerge other) { if (ReferenceEquals(other, null)) { return false; @@ -20439,10 +27025,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasRequiredAllTypes) hash ^= RequiredAllTypes.GetHashCode(); - if (HasOptionalAllTypes) hash ^= OptionalAllTypes.GetHashCode(); + if (requiredAllTypes_ != null) hash ^= RequiredAllTypes.GetHashCode(); + if (optionalAllTypes_ != null) hash ^= OptionalAllTypes.GetHashCode(); hash ^= repeatedAllTypes_.GetHashCode(); if (HasOptionalGroup) hash ^= OptionalGroup.GetHashCode(); hash ^= repeatedGroup_.GetHashCode(); @@ -20456,17 +27043,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasRequiredAllTypes) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (requiredAllTypes_ != null) { output.WriteRawTag(10); output.WriteMessage(RequiredAllTypes); } - if (HasOptionalAllTypes) { + if (optionalAllTypes_ != null) { output.WriteRawTag(18); output.WriteMessage(OptionalAllTypes); } @@ -20483,15 +27075,45 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (requiredAllTypes_ != null) { + output.WriteRawTag(10); + output.WriteMessage(RequiredAllTypes); + } + if (optionalAllTypes_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OptionalAllTypes); + } + repeatedAllTypes_.WriteTo(ref output, _repeated_repeatedAllTypes_codec); + if (HasOptionalGroup) { + output.WriteRawTag(83); + output.WriteGroup(OptionalGroup); + output.WriteRawTag(84); + } + repeatedGroup_.WriteTo(ref output, _repeated_repeatedGroup_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasRequiredAllTypes) { + if (requiredAllTypes_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(RequiredAllTypes); } - if (HasOptionalAllTypes) { + if (optionalAllTypes_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(OptionalAllTypes); } size += repeatedAllTypes_.CalculateSize(_repeated_repeatedAllTypes_codec); @@ -20509,18 +27131,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestParsingMerge other) { if (other == null) { return; } - if (other.HasRequiredAllTypes) { - if (!HasRequiredAllTypes) { + if (other.requiredAllTypes_ != null) { + if (requiredAllTypes_ == null) { RequiredAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } RequiredAllTypes.MergeFrom(other.RequiredAllTypes); } - if (other.HasOptionalAllTypes) { - if (!HasOptionalAllTypes) { + if (other.optionalAllTypes_ != null) { + if (optionalAllTypes_ == null) { OptionalAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } OptionalAllTypes.MergeFrom(other.OptionalAllTypes); @@ -20538,7 +27161,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -20548,14 +27175,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { } break; case 10: { - if (!HasRequiredAllTypes) { + if (requiredAllTypes_ == null) { RequiredAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(RequiredAllTypes); break; } case 18: { - if (!HasOptionalAllTypes) { + if (optionalAllTypes_ == null) { OptionalAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(OptionalAllTypes); @@ -20578,7 +27205,54 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 10: { + if (requiredAllTypes_ == null) { + RequiredAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(RequiredAllTypes); + break; + } + case 18: { + if (optionalAllTypes_ == null) { + OptionalAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(OptionalAllTypes); + break; + } + case 26: { + repeatedAllTypes_.AddEntriesFrom(ref input, _repeated_repeatedAllTypes_codec); + break; + } + case 83: { + if (!HasOptionalGroup) { + OptionalGroup = new global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 163: { + repeatedGroup_.AddEntriesFrom(ref input, _repeated_repeatedGroup_codec); + break; + } + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -20605,6 +27279,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestParsingMerge message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// RepeatedFieldsGenerator defines matching field types as TestParsingMerge, @@ -20613,23 +27288,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Repeated fields in RepeatedFieldsGenerator are expected to be merged into /// the corresponding required/optional fields in TestParsingMerge. /// - public sealed partial class RepeatedFieldsGenerator : pb::IMessage { + public sealed partial class RepeatedFieldsGenerator : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedFieldsGenerator()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedFieldsGenerator() { OnConstruction(); } @@ -20637,6 +27320,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedFieldsGenerator(RepeatedFieldsGenerator other) : this() { field1_ = other.field1_.Clone(); field2_ = other.field2_.Clone(); @@ -20649,6 +27333,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedFieldsGenerator Clone() { return new RepeatedFieldsGenerator(this); } @@ -20659,6 +27344,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField field1_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Field1 { get { return field1_; } } @@ -20669,6 +27355,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField field2_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Field2 { get { return field2_; } } @@ -20679,6 +27366,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField field3_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Field3 { get { return field3_; } } @@ -20689,6 +27377,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForGroup(83, 84, global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedFieldsGenerator.Types.Group1.Parser); private readonly pbc::RepeatedField group1_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Group1 { get { return group1_; } } @@ -20699,6 +27388,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForGroup(163, 164, global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedFieldsGenerator.Types.Group2.Parser); private readonly pbc::RepeatedField group2_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Group2 { get { return group2_; } } @@ -20709,6 +27399,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(8002, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField ext1_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Ext1 { get { return ext1_; } } @@ -20719,16 +27410,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForMessage(8010, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser); private readonly pbc::RepeatedField ext2_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Ext2 { get { return ext2_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedFieldsGenerator); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedFieldsGenerator other) { if (ReferenceEquals(other, null)) { return false; @@ -20747,6 +27441,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= field1_.GetHashCode(); @@ -20763,12 +27458,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else field1_.WriteTo(output, _repeated_field1_codec); field2_.WriteTo(output, _repeated_field2_codec); field3_.WriteTo(output, _repeated_field3_codec); @@ -20779,9 +27479,28 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + field1_.WriteTo(ref output, _repeated_field1_codec); + field2_.WriteTo(ref output, _repeated_field2_codec); + field3_.WriteTo(ref output, _repeated_field3_codec); + group1_.WriteTo(ref output, _repeated_group1_codec); + group2_.WriteTo(ref output, _repeated_group2_codec); + ext1_.WriteTo(ref output, _repeated_ext1_codec); + ext2_.WriteTo(ref output, _repeated_ext2_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += field1_.CalculateSize(_repeated_field1_codec); @@ -20798,6 +27517,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedFieldsGenerator other) { if (other == null) { return; @@ -20813,7 +27533,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -20850,29 +27574,82 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + field1_.AddEntriesFrom(ref input, _repeated_field1_codec); + break; + } + case 18: { + field2_.AddEntriesFrom(ref input, _repeated_field2_codec); + break; + } + case 26: { + field3_.AddEntriesFrom(ref input, _repeated_field3_codec); + break; + } + case 83: { + group1_.AddEntriesFrom(ref input, _repeated_group1_codec); + break; + } + case 163: { + group2_.AddEntriesFrom(ref input, _repeated_group2_codec); + break; + } + case 8002: { + ext1_.AddEntriesFrom(ref input, _repeated_ext1_codec); + break; + } + case 8010: { + ext2_.AddEntriesFrom(ref input, _repeated_ext2_codec); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the RepeatedFieldsGenerator message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class Group1 : pb::IMessage { + public sealed partial class Group1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Group1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedFieldsGenerator.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group1() { OnConstruction(); } @@ -20880,12 +27657,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group1(Group1 other) : this() { - field1_ = other.HasField1 ? other.field1_.Clone() : null; + field1_ = other.field1_ != null ? other.field1_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group1 Clone() { return new Group1(this); } @@ -20894,29 +27673,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int Field1FieldNumber = 11; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes field1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes Field1 { get { return field1_; } set { field1_ = value; } } - /// Gets whether the field1 field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasField1 { - get { return field1_ != null; } - } - /// Clears the value of the field1 field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearField1() { - field1_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Group1); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Group1 other) { if (ReferenceEquals(other, null)) { return false; @@ -20929,9 +27701,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasField1) hash ^= Field1.GetHashCode(); + if (field1_ != null) hash ^= Field1.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -20939,25 +27712,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasField1) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (field1_ != null) { output.WriteRawTag(90); output.WriteMessage(Field1); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (field1_ != null) { + output.WriteRawTag(90); + output.WriteMessage(Field1); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasField1) { + if (field1_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Field1); } if (_unknownFields != null) { @@ -20967,12 +27761,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Group1 other) { if (other == null) { return; } - if (other.HasField1) { - if (!HasField1) { + if (other.field1_ != null) { + if (field1_ == null) { Field1 = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } Field1.MergeFrom(other.Field1); @@ -20981,7 +27776,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -20991,7 +27790,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 90: { - if (!HasField1) { + if (field1_ == null) { Field1 = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(Field1); @@ -20999,27 +27798,60 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 84: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 90: { + if (field1_ == null) { + Field1 = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(Field1); + break; + } + } + } + } + #endif + } - public sealed partial class Group2 : pb::IMessage { + public sealed partial class Group2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Group2()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Types.RepeatedFieldsGenerator.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group2() { OnConstruction(); } @@ -21027,12 +27859,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group2(Group2 other) : this() { - field1_ = other.HasField1 ? other.field1_.Clone() : null; + field1_ = other.field1_ != null ? other.field1_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Group2 Clone() { return new Group2(this); } @@ -21041,29 +27875,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int Field1FieldNumber = 21; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes field1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes Field1 { get { return field1_; } set { field1_ = value; } } - /// Gets whether the field1 field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasField1 { - get { return field1_ != null; } - } - /// Clears the value of the field1 field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearField1() { - field1_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Group2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Group2 other) { if (ReferenceEquals(other, null)) { return false; @@ -21076,9 +27903,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasField1) hash ^= Field1.GetHashCode(); + if (field1_ != null) hash ^= Field1.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -21086,25 +27914,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - if (HasField1) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (field1_ != null) { + output.WriteRawTag(170, 1); + output.WriteMessage(Field1); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (field1_ != null) { output.WriteRawTag(170, 1); output.WriteMessage(Field1); } if (_unknownFields != null) { - _unknownFields.WriteTo(output); + _unknownFields.WriteTo(ref output); } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasField1) { + if (field1_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(Field1); } if (_unknownFields != null) { @@ -21114,12 +27963,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Group2 other) { if (other == null) { return; } - if (other.HasField1) { - if (!HasField1) { + if (other.field1_ != null) { + if (field1_ == null) { Field1 = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } Field1.MergeFrom(other.Field1); @@ -21128,7 +27978,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -21138,7 +27992,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 170: { - if (!HasField1) { + if (field1_ == null) { + Field1 = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(Field1); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 164: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 170: { + if (field1_ == null) { Field1 = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(Field1); @@ -21147,6 +28025,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -21155,23 +28034,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class OptionalGroup : pb::IMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -21179,12 +28066,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { - optionalGroupAllTypes_ = other.HasOptionalGroupAllTypes ? other.optionalGroupAllTypes_.Clone() : null; + optionalGroupAllTypes_ = other.optionalGroupAllTypes_ != null ? other.optionalGroupAllTypes_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -21193,29 +28082,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalGroupAllTypesFieldNumber = 11; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes optionalGroupAllTypes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes OptionalGroupAllTypes { get { return optionalGroupAllTypes_; } set { optionalGroupAllTypes_ = value; } } - /// Gets whether the optional_group_all_types field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalGroupAllTypes { - get { return optionalGroupAllTypes_ != null; } - } - /// Clears the value of the optional_group_all_types field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalGroupAllTypes() { - optionalGroupAllTypes_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -21228,9 +28110,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasOptionalGroupAllTypes) hash ^= OptionalGroupAllTypes.GetHashCode(); + if (optionalGroupAllTypes_ != null) hash ^= OptionalGroupAllTypes.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -21238,25 +28121,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasOptionalGroupAllTypes) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (optionalGroupAllTypes_ != null) { output.WriteRawTag(90); output.WriteMessage(OptionalGroupAllTypes); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (optionalGroupAllTypes_ != null) { + output.WriteRawTag(90); + output.WriteMessage(OptionalGroupAllTypes); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasOptionalGroupAllTypes) { + if (optionalGroupAllTypes_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(OptionalGroupAllTypes); } if (_unknownFields != null) { @@ -21266,12 +28170,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; } - if (other.HasOptionalGroupAllTypes) { - if (!HasOptionalGroupAllTypes) { + if (other.optionalGroupAllTypes_ != null) { + if (optionalGroupAllTypes_ == null) { OptionalGroupAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } OptionalGroupAllTypes.MergeFrom(other.OptionalGroupAllTypes); @@ -21280,7 +28185,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -21290,7 +28199,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 90: { - if (!HasOptionalGroupAllTypes) { + if (optionalGroupAllTypes_ == null) { OptionalGroupAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(OptionalGroupAllTypes); @@ -21298,27 +28207,60 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 84: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 90: { + if (optionalGroupAllTypes_ == null) { + OptionalGroupAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(OptionalGroupAllTypes); + break; + } + } + } + } + #endif + } - public sealed partial class RepeatedGroup : pb::IMessage { + public sealed partial class RepeatedGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedGroup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestParsingMerge.Descriptor.NestedTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup() { OnConstruction(); } @@ -21326,12 +28268,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup(RepeatedGroup other) : this() { - repeatedGroupAllTypes_ = other.HasRepeatedGroupAllTypes ? other.repeatedGroupAllTypes_.Clone() : null; + repeatedGroupAllTypes_ = other.repeatedGroupAllTypes_ != null ? other.repeatedGroupAllTypes_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedGroup Clone() { return new RepeatedGroup(this); } @@ -21340,29 +28284,22 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int RepeatedGroupAllTypesFieldNumber = 21; private global::Google.Protobuf.TestProtos.Proto2.TestAllTypes repeatedGroupAllTypes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes RepeatedGroupAllTypes { get { return repeatedGroupAllTypes_; } set { repeatedGroupAllTypes_ = value; } } - /// Gets whether the repeated_group_all_types field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasRepeatedGroupAllTypes { - get { return repeatedGroupAllTypes_ != null; } - } - /// Clears the value of the repeated_group_all_types field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearRepeatedGroupAllTypes() { - repeatedGroupAllTypes_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -21375,9 +28312,10 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; - if (HasRepeatedGroupAllTypes) hash ^= RepeatedGroupAllTypes.GetHashCode(); + if (repeatedGroupAllTypes_ != null) hash ^= RepeatedGroupAllTypes.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -21385,25 +28323,46 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { - if (HasRepeatedGroupAllTypes) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (repeatedGroupAllTypes_ != null) { output.WriteRawTag(170, 1); output.WriteMessage(RepeatedGroupAllTypes); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (repeatedGroupAllTypes_ != null) { + output.WriteRawTag(170, 1); + output.WriteMessage(RepeatedGroupAllTypes); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; - if (HasRepeatedGroupAllTypes) { + if (repeatedGroupAllTypes_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(RepeatedGroupAllTypes); } if (_unknownFields != null) { @@ -21413,12 +28372,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedGroup other) { if (other == null) { return; } - if (other.HasRepeatedGroupAllTypes) { - if (!HasRepeatedGroupAllTypes) { + if (other.repeatedGroupAllTypes_ != null) { + if (repeatedGroupAllTypes_ == null) { RepeatedGroupAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } RepeatedGroupAllTypes.MergeFrom(other.RepeatedGroupAllTypes); @@ -21427,7 +28387,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -21437,7 +28401,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 170: { - if (!HasRepeatedGroupAllTypes) { + if (repeatedGroupAllTypes_ == null) { + RepeatedGroupAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + } + input.ReadMessage(RepeatedGroupAllTypes); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 164: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 170: { + if (repeatedGroupAllTypes_ == null) { RepeatedGroupAllTypes = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); } input.ReadMessage(RepeatedGroupAllTypes); @@ -21446,6 +28434,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } @@ -21455,6 +28444,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Extensions /// Container for extensions for other messages declared in the TestParsingMerge message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension OptionalExt = new pb::Extension(1000, pb::FieldCodec.ForMessage(8002, global::Google.Protobuf.TestProtos.Proto2.TestAllTypes.Parser)); @@ -21465,23 +28455,31 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestCommentInjectionMessage : pb::IMessage { + public sealed partial class TestCommentInjectionMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCommentInjectionMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[55]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage() { OnConstruction(); } @@ -21489,12 +28487,14 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage(TestCommentInjectionMessage other) : this() { a_ = other.a_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage Clone() { return new TestCommentInjectionMessage(this); } @@ -21508,6 +28508,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// */ <- This should not close the generated doc comment /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string A { get { return a_ ?? ADefaultValue; } set { @@ -21516,21 +28517,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasA { get { return a_ != null; } } /// Clears the value of the "a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearA() { a_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestCommentInjectionMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestCommentInjectionMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -21543,6 +28548,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasA) hash ^= A.GetHashCode(); @@ -21553,12 +28559,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasA) { output.WriteRawTag(10); output.WriteString(A); @@ -21566,9 +28577,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasA) { + output.WriteRawTag(10); + output.WriteString(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasA) { @@ -21581,6 +28608,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestCommentInjectionMessage other) { if (other == null) { return; @@ -21592,7 +28620,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -21605,30 +28637,58 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + A = input.ReadString(); + break; + } + } + } } + #endif } /// /// Test that RPC services work. /// - public sealed partial class FooRequest : pb::IMessage { + public sealed partial class FooRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[56]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest() { OnConstruction(); } @@ -21636,21 +28696,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest(FooRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest Clone() { return new FooRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -21662,6 +28726,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -21671,18 +28736,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -21692,6 +28774,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooRequest other) { if (other == null) { return; @@ -21700,7 +28783,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -21709,27 +28796,51 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class FooResponse : pb::IMessage { + public sealed partial class FooResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[57]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse() { OnConstruction(); } @@ -21737,21 +28848,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse(FooResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse Clone() { return new FooResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -21763,6 +28878,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -21772,18 +28888,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -21793,6 +28926,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooResponse other) { if (other == null) { return; @@ -21801,7 +28935,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -21810,27 +28948,51 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class FooClientMessage : pb::IMessage { + public sealed partial class FooClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[58]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage() { OnConstruction(); } @@ -21838,21 +29000,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage(FooClientMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage Clone() { return new FooClientMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooClientMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooClientMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -21864,6 +29030,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -21873,18 +29040,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -21894,6 +29078,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooClientMessage other) { if (other == null) { return; @@ -21902,7 +29087,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -21911,27 +29100,51 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class FooServerMessage : pb::IMessage { + public sealed partial class FooServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[59]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage() { OnConstruction(); } @@ -21939,21 +29152,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage(FooServerMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage Clone() { return new FooServerMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooServerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooServerMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -21965,6 +29182,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -21974,18 +29192,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -21995,6 +29230,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooServerMessage other) { if (other == null) { return; @@ -22003,7 +29239,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -22012,27 +29252,51 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class BarRequest : pb::IMessage { + public sealed partial class BarRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[60]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest() { OnConstruction(); } @@ -22040,21 +29304,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest(BarRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest Clone() { return new BarRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BarRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BarRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -22066,6 +29334,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -22075,18 +29344,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -22096,6 +29382,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BarRequest other) { if (other == null) { return; @@ -22104,7 +29391,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -22113,27 +29404,51 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class BarResponse : pb::IMessage { + public sealed partial class BarResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[61]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse() { OnConstruction(); } @@ -22141,21 +29456,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse(BarResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse Clone() { return new BarResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BarResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BarResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -22167,6 +29486,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -22176,18 +29496,35 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -22197,6 +29534,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BarResponse other) { if (other == null) { return; @@ -22205,7 +29543,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -22214,28 +29556,52 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class TestJsonName : pb::IMessage { + public sealed partial class TestJsonName : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonName()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[62]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName() { OnConstruction(); } @@ -22243,6 +29609,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName(TestJsonName other) : this() { _hasBits0 = other._hasBits0; fieldName1_ = other.fieldName1_; @@ -22255,6 +29622,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName Clone() { return new TestJsonName(this); } @@ -22265,6 +29633,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fieldName1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName1 { get { if ((_hasBits0 & 1) != 0) { return fieldName1_; } else { return FieldName1DefaultValue; } } set { @@ -22274,11 +29643,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field_name1" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName1 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "field_name1" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName1() { _hasBits0 &= ~1; } @@ -22289,6 +29660,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fieldName2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName2 { get { if ((_hasBits0 & 2) != 0) { return fieldName2_; } else { return FieldName2DefaultValue; } } set { @@ -22298,11 +29670,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "fieldName2" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName2 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "fieldName2" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName2() { _hasBits0 &= ~2; } @@ -22313,6 +29687,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fieldName3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName3 { get { if ((_hasBits0 & 4) != 0) { return fieldName3_; } else { return FieldName3DefaultValue; } } set { @@ -22322,11 +29697,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "FieldName3" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName3 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "FieldName3" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName3() { _hasBits0 &= ~4; } @@ -22337,6 +29714,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int FieldName4_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName4 { get { if ((_hasBits0 & 8) != 0) { return FieldName4_; } else { return FieldName4DefaultValue; } } set { @@ -22346,11 +29724,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "_field_name4" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName4 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "_field_name4" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName4() { _hasBits0 &= ~8; } @@ -22361,6 +29741,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fIELDNAME5_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FIELDNAME5 { get { if ((_hasBits0 & 16) != 0) { return fIELDNAME5_; } else { return FIELDNAME5DefaultValue; } } set { @@ -22370,11 +29751,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "FIELD_NAME5" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFIELDNAME5 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "FIELD_NAME5" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFIELDNAME5() { _hasBits0 &= ~16; } @@ -22385,6 +29768,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fieldName6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FieldName6 { get { if ((_hasBits0 & 32) != 0) { return fieldName6_; } else { return FieldName6DefaultValue; } } set { @@ -22394,21 +29778,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field_name6" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFieldName6 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "field_name6" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFieldName6() { _hasBits0 &= ~32; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestJsonName); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestJsonName other) { if (ReferenceEquals(other, null)) { return false; @@ -22426,6 +29814,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasFieldName1) hash ^= FieldName1.GetHashCode(); @@ -22441,12 +29830,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasFieldName1) { output.WriteRawTag(8); output.WriteInt32(FieldName1); @@ -22474,9 +29868,45 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasFieldName1) { + output.WriteRawTag(8); + output.WriteInt32(FieldName1); + } + if (HasFieldName2) { + output.WriteRawTag(16); + output.WriteInt32(FieldName2); + } + if (HasFieldName3) { + output.WriteRawTag(24); + output.WriteInt32(FieldName3); + } + if (HasFieldName4) { + output.WriteRawTag(32); + output.WriteInt32(FieldName4); + } + if (HasFIELDNAME5) { + output.WriteRawTag(40); + output.WriteInt32(FIELDNAME5); + } + if (HasFieldName6) { + output.WriteRawTag(48); + output.WriteInt32(FieldName6); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasFieldName1) { @@ -22504,6 +29934,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestJsonName other) { if (other == null) { return; @@ -22526,16 +29957,59 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasFieldName6) { FieldName6 = other.FieldName6; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FieldName1 = input.ReadInt32(); + break; + } + case 16: { + FieldName2 = input.ReadInt32(); + break; + } + case 24: { + FieldName3 = input.ReadInt32(); + break; + } + case 32: { + FieldName4 = input.ReadInt32(); + break; + } + case 40: { + FIELDNAME5 = input.ReadInt32(); + break; + } + case 48: { + FieldName6 = input.ReadInt32(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { FieldName1 = input.ReadInt32(); @@ -22564,29 +30038,38 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif } - public sealed partial class TestHugeFieldNumbers : pb::IExtendableMessage { + public sealed partial class TestHugeFieldNumbers : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestHugeFieldNumbers()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[63]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestHugeFieldNumbers() { OnConstruction(); } @@ -22594,6 +30077,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestHugeFieldNumbers(TestHugeFieldNumbers other) : this() { _hasBits0 = other._hasBits0; optionalInt32_ = other.optionalInt32_; @@ -22603,7 +30087,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { optionalEnum_ = other.optionalEnum_; optionalString_ = other.optionalString_; optionalBytes_ = other.optionalBytes_; - optionalMessage_ = other.HasOptionalMessage ? other.optionalMessage_.Clone() : null; + optionalMessage_ = other.optionalMessage_ != null ? other.optionalMessage_.Clone() : null; optionalGroup_ = other.HasOptionalGroup ? other.optionalGroup_.Clone() : null; stringStringMap_ = other.stringStringMap_.Clone(); switch (other.OneofFieldCase) { @@ -22626,6 +30110,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestHugeFieldNumbers Clone() { return new TestHugeFieldNumbers(this); } @@ -22636,6 +30121,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int optionalInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } } set { @@ -22645,11 +30131,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_int32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalInt32 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optional_int32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalInt32() { _hasBits0 &= ~1; } @@ -22660,6 +30148,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int fixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Fixed32 { get { if ((_hasBits0 & 2) != 0) { return fixed32_; } else { return Fixed32DefaultValue; } } set { @@ -22669,11 +30158,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "fixed_32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasFixed32 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "fixed_32" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFixed32() { _hasBits0 &= ~2; } @@ -22684,6 +30175,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(4294960016); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -22694,6 +30186,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = pb::FieldCodec.ForInt32(4294960026); private readonly pbc::RepeatedField packedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -22704,6 +30197,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private global::Google.Protobuf.TestProtos.Proto2.ForeignEnum optionalEnum_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignEnum OptionalEnum { get { if ((_hasBits0 & 4) != 0) { return optionalEnum_; } else { return OptionalEnumDefaultValue; } } set { @@ -22713,11 +30207,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_enum" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalEnum { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "optional_enum" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalEnum() { _hasBits0 &= ~4; } @@ -22728,6 +30224,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private string optionalString_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OptionalString { get { return optionalString_ ?? OptionalStringDefaultValue; } set { @@ -22736,11 +30233,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalString { get { return optionalString_ != null; } } /// Clears the value of the "optional_string" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalString() { optionalString_ = null; } @@ -22751,6 +30250,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private pb::ByteString optionalBytes_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OptionalBytes { get { return optionalBytes_ ?? OptionalBytesDefaultValue; } set { @@ -22759,11 +30259,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "optional_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalBytes { get { return optionalBytes_ != null; } } /// Clears the value of the "optional_bytes" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalBytes() { optionalBytes_ = null; } @@ -22772,27 +30274,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { public const int OptionalMessageFieldNumber = 536870007; private global::Google.Protobuf.TestProtos.Proto2.ForeignMessage optionalMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.ForeignMessage OptionalMessage { get { return optionalMessage_; } set { optionalMessage_ = value; } } - /// Gets whether the optional_message field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptionalMessage { - get { return optionalMessage_ != null; } - } - /// Clears the value of the optional_message field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptionalMessage() { - optionalMessage_ = null; - } /// Field number for the "optionalgroup" field. public const int OptionalGroupFieldNumber = 536870008; private global::Google.Protobuf.TestProtos.Proto2.TestHugeFieldNumbers.Types.OptionalGroup optionalGroup_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestHugeFieldNumbers.Types.OptionalGroup OptionalGroup { get { return optionalGroup_; } set { @@ -22801,11 +30295,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the optionalgroup field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptionalGroup { get { return optionalGroup_ != null; } } /// Clears the value of the optionalgroup field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptionalGroup() { optionalGroup_ = null; } @@ -22816,6 +30312,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { = new pbc::MapField.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 4294960082); private readonly pbc::MapField stringStringMap_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField StringStringMap { get { return stringStringMap_; } } @@ -22823,6 +30320,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 536870011; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { get { return HasOneofUint32 ? (uint) oneofField_ : 0; } set { @@ -22832,11 +30330,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_uint32" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32; } } /// Clears the value of the oneof if it's currently set to "oneof_uint32" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofUint32() { if (HasOneofUint32) { ClearOneofField(); @@ -22846,29 +30346,19 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_test_all_types" field. public const int OneofTestAllTypesFieldNumber = 536870012; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.Proto2.TestAllTypes OneofTestAllTypes { - get { return HasOneofTestAllTypes ? (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes) oneofField_ : null; } + get { return oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes ? (global::Google.Protobuf.TestProtos.Proto2.TestAllTypes) oneofField_ : null; } set { oneofField_ = value; oneofFieldCase_ = value == null ? OneofFieldOneofCase.None : OneofFieldOneofCase.OneofTestAllTypes; } } - /// Gets whether the "oneof_test_all_types" field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOneofTestAllTypes { - get { return oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes; } - } - /// Clears the value of the oneof if it's currently set to "oneof_test_all_types" - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOneofTestAllTypes() { - if (HasOneofTestAllTypes) { - ClearOneofField(); - } - } /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 536870013; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { get { return HasOneofString ? (string) oneofField_ : ""; } set { @@ -22878,11 +30368,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_string" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString; } } /// Clears the value of the oneof if it's currently set to "oneof_string" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofString() { if (HasOneofString) { ClearOneofField(); @@ -22892,6 +30384,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 536870014; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { get { return HasOneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -22901,11 +30394,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "oneof_bytes" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes; } } /// Clears the value of the oneof if it's currently set to "oneof_bytes" [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofBytes() { if (HasOneofBytes) { ClearOneofField(); @@ -22923,22 +30418,26 @@ namespace Google.Protobuf.TestProtos.Proto2 { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestHugeFieldNumbers); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestHugeFieldNumbers other) { if (ReferenceEquals(other, null)) { return false; @@ -22968,6 +30467,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); @@ -22977,11 +30477,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasOptionalEnum) hash ^= OptionalEnum.GetHashCode(); if (HasOptionalString) hash ^= OptionalString.GetHashCode(); if (HasOptionalBytes) hash ^= OptionalBytes.GetHashCode(); - if (HasOptionalMessage) hash ^= OptionalMessage.GetHashCode(); + if (optionalMessage_ != null) hash ^= OptionalMessage.GetHashCode(); if (HasOptionalGroup) hash ^= OptionalGroup.GetHashCode(); hash ^= StringStringMap.GetHashCode(); if (HasOneofUint32) hash ^= OneofUint32.GetHashCode(); - if (HasOneofTestAllTypes) hash ^= OneofTestAllTypes.GetHashCode(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes) hash ^= OneofTestAllTypes.GetHashCode(); if (HasOneofString) hash ^= OneofString.GetHashCode(); if (HasOneofBytes) hash ^= OneofBytes.GetHashCode(); hash ^= (int) oneofFieldCase_; @@ -22995,12 +30495,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasOptionalInt32) { output.WriteRawTag(128, 199, 255, 255, 15); output.WriteInt32(OptionalInt32); @@ -23023,7 +30528,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(178, 199, 255, 255, 15); output.WriteBytes(OptionalBytes); } - if (HasOptionalMessage) { + if (optionalMessage_ != null) { output.WriteRawTag(186, 199, 255, 255, 15); output.WriteMessage(OptionalMessage); } @@ -23037,7 +30542,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { output.WriteRawTag(216, 199, 255, 255, 15); output.WriteUInt32(OneofUint32); } - if (HasOneofTestAllTypes) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes) { output.WriteRawTag(226, 199, 255, 255, 15); output.WriteMessage(OneofTestAllTypes); } @@ -23055,9 +30560,72 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOptionalInt32) { + output.WriteRawTag(128, 199, 255, 255, 15); + output.WriteInt32(OptionalInt32); + } + if (HasFixed32) { + output.WriteRawTag(136, 199, 255, 255, 15); + output.WriteInt32(Fixed32); + } + repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); + packedInt32_.WriteTo(ref output, _repeated_packedInt32_codec); + if (HasOptionalEnum) { + output.WriteRawTag(160, 199, 255, 255, 15); + output.WriteEnum((int) OptionalEnum); + } + if (HasOptionalString) { + output.WriteRawTag(170, 199, 255, 255, 15); + output.WriteString(OptionalString); + } + if (HasOptionalBytes) { + output.WriteRawTag(178, 199, 255, 255, 15); + output.WriteBytes(OptionalBytes); + } + if (optionalMessage_ != null) { + output.WriteRawTag(186, 199, 255, 255, 15); + output.WriteMessage(OptionalMessage); + } + if (HasOptionalGroup) { + output.WriteRawTag(195, 199, 255, 255, 15); + output.WriteGroup(OptionalGroup); + output.WriteRawTag(196, 199, 255, 255, 15); + } + stringStringMap_.WriteTo(ref output, _map_stringStringMap_codec); + if (HasOneofUint32) { + output.WriteRawTag(216, 199, 255, 255, 15); + output.WriteUInt32(OneofUint32); + } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes) { + output.WriteRawTag(226, 199, 255, 255, 15); + output.WriteMessage(OneofTestAllTypes); + } + if (HasOneofString) { + output.WriteRawTag(234, 199, 255, 255, 15); + output.WriteString(OneofString); + } + if (HasOneofBytes) { + output.WriteRawTag(242, 199, 255, 255, 15); + output.WriteBytes(OneofBytes); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasOptionalInt32) { @@ -23077,7 +30645,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasOptionalBytes) { size += 5 + pb::CodedOutputStream.ComputeBytesSize(OptionalBytes); } - if (HasOptionalMessage) { + if (optionalMessage_ != null) { size += 5 + pb::CodedOutputStream.ComputeMessageSize(OptionalMessage); } if (HasOptionalGroup) { @@ -23087,7 +30655,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (HasOneofUint32) { size += 5 + pb::CodedOutputStream.ComputeUInt32Size(OneofUint32); } - if (HasOneofTestAllTypes) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes) { size += 5 + pb::CodedOutputStream.ComputeMessageSize(OneofTestAllTypes); } if (HasOneofString) { @@ -23106,6 +30674,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestHugeFieldNumbers other) { if (other == null) { return; @@ -23127,8 +30696,8 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (other.HasOptionalBytes) { OptionalBytes = other.OptionalBytes; } - if (other.HasOptionalMessage) { - if (!HasOptionalMessage) { + if (other.optionalMessage_ != null) { + if (optionalMessage_ == null) { OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); } OptionalMessage.MergeFrom(other.OptionalMessage); @@ -23163,7 +30732,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -23203,7 +30776,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { break; } case 4294960058: { - if (!HasOptionalMessage) { + if (optionalMessage_ == null) { OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); } input.ReadMessage(OptionalMessage); @@ -23226,7 +30799,93 @@ namespace Google.Protobuf.TestProtos.Proto2 { } case 4294960098: { global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); - if (HasOneofTestAllTypes) { + if (oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes) { + subBuilder.MergeFrom(OneofTestAllTypes); + } + input.ReadMessage(subBuilder); + OneofTestAllTypes = subBuilder; + break; + } + case 4294960106: { + OneofString = input.ReadString(); + break; + } + case 4294960114: { + OneofBytes = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 4294960000: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 4294960008: { + Fixed32 = input.ReadInt32(); + break; + } + case 4294960018: + case 4294960016: { + repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec); + break; + } + case 4294960026: + case 4294960024: { + packedInt32_.AddEntriesFrom(ref input, _repeated_packedInt32_codec); + break; + } + case 4294960032: { + OptionalEnum = (global::Google.Protobuf.TestProtos.Proto2.ForeignEnum) input.ReadEnum(); + break; + } + case 4294960042: { + OptionalString = input.ReadString(); + break; + } + case 4294960050: { + OptionalBytes = input.ReadBytes(); + break; + } + case 4294960058: { + if (optionalMessage_ == null) { + OptionalMessage = new global::Google.Protobuf.TestProtos.Proto2.ForeignMessage(); + } + input.ReadMessage(OptionalMessage); + break; + } + case 4294960067: { + if (!HasOptionalGroup) { + OptionalGroup = new global::Google.Protobuf.TestProtos.Proto2.TestHugeFieldNumbers.Types.OptionalGroup(); + } + input.ReadGroup(OptionalGroup); + break; + } + case 4294960082: { + stringStringMap_.AddEntriesFrom(ref input, _map_stringStringMap_codec); + break; + } + case 4294960088: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 4294960098: { + global::Google.Protobuf.TestProtos.Proto2.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.Proto2.TestAllTypes(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofTestAllTypes) { subBuilder.MergeFrom(OneofTestAllTypes); } input.ReadMessage(subBuilder); @@ -23244,6 +30903,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -23270,25 +30930,34 @@ namespace Google.Protobuf.TestProtos.Proto2 { #region Nested types /// Container for nested types declared in the TestHugeFieldNumbers message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class OptionalGroup : pb::IMessage { + public sealed partial class OptionalGroup : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.TestHugeFieldNumbers.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup() { OnConstruction(); } @@ -23296,6 +30965,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup(OptionalGroup other) : this() { _hasBits0 = other._hasBits0; groupA_ = other.groupA_; @@ -23303,6 +30973,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OptionalGroup Clone() { return new OptionalGroup(this); } @@ -23313,6 +30984,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int groupA_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int GroupA { get { if ((_hasBits0 & 1) != 0) { return groupA_; } else { return GroupADefaultValue; } } set { @@ -23322,21 +30994,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "group_a" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasGroupA { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "group_a" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearGroupA() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OptionalGroup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OptionalGroup other) { if (ReferenceEquals(other, null)) { return false; @@ -23349,6 +31025,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasGroupA) hash ^= GroupA.GetHashCode(); @@ -23359,12 +31036,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasGroupA) { output.WriteRawTag(200, 199, 255, 255, 15); output.WriteInt32(GroupA); @@ -23372,9 +31054,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasGroupA) { + output.WriteRawTag(200, 199, 255, 255, 15); + output.WriteInt32(GroupA); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasGroupA) { @@ -23387,6 +31085,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OptionalGroup other) { if (other == null) { return; @@ -23398,7 +31097,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -23413,7 +31116,29 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + case 4294960068: + return; + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 4294960072: { + GroupA = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -23422,26 +31147,34 @@ namespace Google.Protobuf.TestProtos.Proto2 { } - public sealed partial class TestExtensionInsideTable : pb::IExtendableMessage { + public sealed partial class TestExtensionInsideTable : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestExtensionInsideTable()); private pb::UnknownFieldSet _unknownFields; private pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestReflection.Descriptor.MessageTypes[64]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionInsideTable() { OnConstruction(); } @@ -23449,6 +31182,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionInsideTable(TestExtensionInsideTable other) : this() { _hasBits0 = other._hasBits0; field1_ = other.field1_; @@ -23465,6 +31199,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestExtensionInsideTable Clone() { return new TestExtensionInsideTable(this); } @@ -23475,6 +31210,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field1_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field1 { get { if ((_hasBits0 & 1) != 0) { return field1_; } else { return Field1DefaultValue; } } set { @@ -23484,11 +31220,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field1" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField1 { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "field1" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField1() { _hasBits0 &= ~1; } @@ -23499,6 +31237,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field2 { get { if ((_hasBits0 & 2) != 0) { return field2_; } else { return Field2DefaultValue; } } set { @@ -23508,11 +31247,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field2" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField2 { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "field2" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField2() { _hasBits0 &= ~2; } @@ -23523,6 +31264,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field3 { get { if ((_hasBits0 & 4) != 0) { return field3_; } else { return Field3DefaultValue; } } set { @@ -23532,11 +31274,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field3" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField3 { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "field3" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField3() { _hasBits0 &= ~4; } @@ -23547,6 +31291,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field4_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field4 { get { if ((_hasBits0 & 8) != 0) { return field4_; } else { return Field4DefaultValue; } } set { @@ -23556,11 +31301,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field4" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField4 { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "field4" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField4() { _hasBits0 &= ~8; } @@ -23571,6 +31318,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field6_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field6 { get { if ((_hasBits0 & 16) != 0) { return field6_; } else { return Field6DefaultValue; } } set { @@ -23580,11 +31328,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field6" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField6 { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "field6" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField6() { _hasBits0 &= ~16; } @@ -23595,6 +31345,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field7_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field7 { get { if ((_hasBits0 & 32) != 0) { return field7_; } else { return Field7DefaultValue; } } set { @@ -23604,11 +31355,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field7" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField7 { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "field7" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField7() { _hasBits0 &= ~32; } @@ -23619,6 +31372,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field8_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field8 { get { if ((_hasBits0 & 64) != 0) { return field8_; } else { return Field8DefaultValue; } } set { @@ -23628,11 +31382,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field8" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField8 { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "field8" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField8() { _hasBits0 &= ~64; } @@ -23643,6 +31399,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field9_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field9 { get { if ((_hasBits0 & 128) != 0) { return field9_; } else { return Field9DefaultValue; } } set { @@ -23652,11 +31409,13 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field9" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField9 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "field9" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField9() { _hasBits0 &= ~128; } @@ -23667,6 +31426,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int field10_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Field10 { get { if ((_hasBits0 & 256) != 0) { return field10_; } else { return Field10DefaultValue; } } set { @@ -23676,21 +31436,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "field10" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasField10 { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "field10" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearField10() { _hasBits0 &= ~256; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestExtensionInsideTable); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestExtensionInsideTable other) { if (ReferenceEquals(other, null)) { return false; @@ -23714,6 +31478,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasField1) hash ^= Field1.GetHashCode(); @@ -23735,12 +31500,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasField1) { output.WriteRawTag(8); output.WriteInt32(Field1); @@ -23783,9 +31553,60 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasField1) { + output.WriteRawTag(8); + output.WriteInt32(Field1); + } + if (HasField2) { + output.WriteRawTag(16); + output.WriteInt32(Field2); + } + if (HasField3) { + output.WriteRawTag(24); + output.WriteInt32(Field3); + } + if (HasField4) { + output.WriteRawTag(32); + output.WriteInt32(Field4); + } + if (HasField6) { + output.WriteRawTag(48); + output.WriteInt32(Field6); + } + if (HasField7) { + output.WriteRawTag(56); + output.WriteInt32(Field7); + } + if (HasField8) { + output.WriteRawTag(64); + output.WriteInt32(Field8); + } + if (HasField9) { + output.WriteRawTag(72); + output.WriteInt32(Field9); + } + if (HasField10) { + output.WriteRawTag(80); + output.WriteInt32(Field10); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasField1) { @@ -23825,6 +31646,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestExtensionInsideTable other) { if (other == null) { return; @@ -23861,7 +31683,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -23908,7 +31734,61 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + Field1 = input.ReadInt32(); + break; + } + case 16: { + Field2 = input.ReadInt32(); + break; + } + case 24: { + Field3 = input.ReadInt32(); + break; + } + case 32: { + Field4 = input.ReadInt32(); + break; + } + case 48: { + Field6 = input.ReadInt32(); + break; + } + case 56: { + Field7 = input.ReadInt32(); + break; + } + case 64: { + Field8 = input.ReadInt32(); + break; + } + case 72: { + Field9 = input.ReadInt32(); + break; + } + case 80: { + Field10 = input.ReadInt32(); + break; + } + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs index cb5edf7547..305dfe188e 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs @@ -257,23 +257,31 @@ namespace UnitTest.Issues.TestProtos { /// A test message with custom options at all possible locations (and also some /// regular options, to make sure they interact nicely). /// - public sealed partial class TestMessageWithCustomOptions : pb::IMessage { + public sealed partial class TestMessageWithCustomOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMessageWithCustomOptions()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageWithCustomOptions() { OnConstruction(); } @@ -281,6 +289,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageWithCustomOptions(TestMessageWithCustomOptions other) : this() { field1_ = other.field1_; switch (other.AnOneofCase) { @@ -293,6 +302,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMessageWithCustomOptions Clone() { return new TestMessageWithCustomOptions(this); } @@ -301,6 +311,7 @@ namespace UnitTest.Issues.TestProtos { public const int Field1FieldNumber = 1; private string field1_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Field1 { get { return field1_; } set { @@ -311,6 +322,7 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "oneof_field" field. public const int OneofFieldFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OneofField { get { return anOneofCase_ == AnOneofOneofCase.OneofField ? (int) anOneof_ : 0; } set { @@ -327,22 +339,26 @@ namespace UnitTest.Issues.TestProtos { } private AnOneofOneofCase anOneofCase_ = AnOneofOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AnOneofOneofCase AnOneofCase { get { return anOneofCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearAnOneof() { anOneofCase_ = AnOneofOneofCase.None; anOneof_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMessageWithCustomOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMessageWithCustomOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -357,6 +373,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Field1.Length != 0) hash ^= Field1.GetHashCode(); @@ -369,12 +386,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Field1.Length != 0) { output.WriteRawTag(10); output.WriteString(Field1); @@ -386,9 +408,29 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Field1.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Field1); + } + if (anOneofCase_ == AnOneofOneofCase.OneofField) { + output.WriteRawTag(16); + output.WriteInt32(OneofField); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Field1.Length != 0) { @@ -404,6 +446,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMessageWithCustomOptions other) { if (other == null) { return; @@ -421,7 +464,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -438,11 +485,36 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Field1 = input.ReadString(); + break; + } + case 16: { + OneofField = input.ReadInt32(); + break; + } + } + } + } + #endif + #region Nested types /// Container for nested types declared in the TestMessageWithCustomOptions message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum AnEnum { [pbr::OriginalName("ANENUM_UNSPECIFIED")] Unspecified = 0, @@ -459,23 +531,31 @@ namespace UnitTest.Issues.TestProtos { /// A test RPC service with custom options at all possible locations (and also /// some regular options, to make sure they interact nicely). /// - public sealed partial class CustomOptionFooRequest : pb::IMessage { + public sealed partial class CustomOptionFooRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooRequest() { OnConstruction(); } @@ -483,21 +563,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooRequest(CustomOptionFooRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooRequest Clone() { return new CustomOptionFooRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionFooRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionFooRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -509,6 +593,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -518,18 +603,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -539,6 +641,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionFooRequest other) { if (other == null) { return; @@ -547,7 +650,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -556,27 +663,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class CustomOptionFooResponse : pb::IMessage { + public sealed partial class CustomOptionFooResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooResponse() { OnConstruction(); } @@ -584,21 +715,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooResponse(CustomOptionFooResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooResponse Clone() { return new CustomOptionFooResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionFooResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionFooResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -610,6 +745,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -619,18 +755,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -640,6 +793,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionFooResponse other) { if (other == null) { return; @@ -648,7 +802,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -657,27 +815,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + } - public sealed partial class CustomOptionFooClientMessage : pb::IMessage { + public sealed partial class CustomOptionFooClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooClientMessage() { OnConstruction(); } @@ -685,21 +867,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooClientMessage(CustomOptionFooClientMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooClientMessage Clone() { return new CustomOptionFooClientMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionFooClientMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionFooClientMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -711,6 +897,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -720,18 +907,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -741,6 +945,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionFooClientMessage other) { if (other == null) { return; @@ -749,7 +954,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -758,27 +967,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class CustomOptionFooServerMessage : pb::IMessage { + public sealed partial class CustomOptionFooServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionFooServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooServerMessage() { OnConstruction(); } @@ -786,21 +1019,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooServerMessage(CustomOptionFooServerMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionFooServerMessage Clone() { return new CustomOptionFooServerMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionFooServerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionFooServerMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -812,6 +1049,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -821,18 +1059,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -842,6 +1097,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionFooServerMessage other) { if (other == null) { return; @@ -850,7 +1106,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -859,27 +1119,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class DummyMessageContainingEnum : pb::IMessage { + public sealed partial class DummyMessageContainingEnum : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DummyMessageContainingEnum()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageContainingEnum() { OnConstruction(); } @@ -887,21 +1171,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageContainingEnum(DummyMessageContainingEnum other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageContainingEnum Clone() { return new DummyMessageContainingEnum(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DummyMessageContainingEnum); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DummyMessageContainingEnum other) { if (ReferenceEquals(other, null)) { return false; @@ -913,6 +1201,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -922,18 +1211,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -943,6 +1249,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DummyMessageContainingEnum other) { if (other == null) { return; @@ -951,7 +1258,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -960,11 +1271,28 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif #region Nested types /// Container for nested types declared in the DummyMessageContainingEnum message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum TestEnumType { [pbr::OriginalName("TEST_OPTION_ENUM_UNSPECIFIED")] TestOptionEnumUnspecified = 0, @@ -977,23 +1305,31 @@ namespace UnitTest.Issues.TestProtos { } - public sealed partial class DummyMessageInvalidAsOptionType : pb::IMessage { + public sealed partial class DummyMessageInvalidAsOptionType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DummyMessageInvalidAsOptionType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageInvalidAsOptionType() { OnConstruction(); } @@ -1001,21 +1337,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageInvalidAsOptionType(DummyMessageInvalidAsOptionType other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DummyMessageInvalidAsOptionType Clone() { return new DummyMessageInvalidAsOptionType(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DummyMessageInvalidAsOptionType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DummyMessageInvalidAsOptionType other) { if (ReferenceEquals(other, null)) { return false; @@ -1027,6 +1367,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1036,18 +1377,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1057,6 +1415,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DummyMessageInvalidAsOptionType other) { if (other == null) { return; @@ -1065,7 +1424,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1074,27 +1437,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class CustomOptionMinIntegerValues : pb::IMessage { + public sealed partial class CustomOptionMinIntegerValues : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionMinIntegerValues()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMinIntegerValues() { OnConstruction(); } @@ -1102,21 +1489,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMinIntegerValues(CustomOptionMinIntegerValues other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMinIntegerValues Clone() { return new CustomOptionMinIntegerValues(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionMinIntegerValues); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionMinIntegerValues other) { if (ReferenceEquals(other, null)) { return false; @@ -1128,6 +1519,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1137,18 +1529,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1158,6 +1567,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionMinIntegerValues other) { if (other == null) { return; @@ -1166,7 +1576,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1175,27 +1589,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + } - public sealed partial class CustomOptionMaxIntegerValues : pb::IMessage { + public sealed partial class CustomOptionMaxIntegerValues : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionMaxIntegerValues()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMaxIntegerValues() { OnConstruction(); } @@ -1203,21 +1641,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMaxIntegerValues(CustomOptionMaxIntegerValues other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionMaxIntegerValues Clone() { return new CustomOptionMaxIntegerValues(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionMaxIntegerValues); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionMaxIntegerValues other) { if (ReferenceEquals(other, null)) { return false; @@ -1229,6 +1671,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1238,18 +1681,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1259,6 +1719,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionMaxIntegerValues other) { if (other == null) { return; @@ -1267,7 +1728,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1276,27 +1741,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + } - public sealed partial class CustomOptionOtherValues : pb::IMessage { + public sealed partial class CustomOptionOtherValues : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomOptionOtherValues()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionOtherValues() { OnConstruction(); } @@ -1304,21 +1793,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionOtherValues(CustomOptionOtherValues other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CustomOptionOtherValues Clone() { return new CustomOptionOtherValues(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CustomOptionOtherValues); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CustomOptionOtherValues other) { if (ReferenceEquals(other, null)) { return false; @@ -1330,6 +1823,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1339,18 +1833,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1360,6 +1871,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CustomOptionOtherValues other) { if (other == null) { return; @@ -1368,7 +1880,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1377,27 +1893,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + } - public sealed partial class SettingRealsFromPositiveInts : pb::IMessage { + public sealed partial class SettingRealsFromPositiveInts : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SettingRealsFromPositiveInts()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromPositiveInts() { OnConstruction(); } @@ -1405,21 +1945,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromPositiveInts(SettingRealsFromPositiveInts other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromPositiveInts Clone() { return new SettingRealsFromPositiveInts(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SettingRealsFromPositiveInts); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SettingRealsFromPositiveInts other) { if (ReferenceEquals(other, null)) { return false; @@ -1431,6 +1975,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1440,18 +1985,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1461,6 +2023,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SettingRealsFromPositiveInts other) { if (other == null) { return; @@ -1469,7 +2032,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1478,27 +2045,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class SettingRealsFromNegativeInts : pb::IMessage { + public sealed partial class SettingRealsFromNegativeInts : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SettingRealsFromNegativeInts()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromNegativeInts() { OnConstruction(); } @@ -1506,21 +2097,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromNegativeInts(SettingRealsFromNegativeInts other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SettingRealsFromNegativeInts Clone() { return new SettingRealsFromNegativeInts(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SettingRealsFromNegativeInts); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SettingRealsFromNegativeInts other) { if (ReferenceEquals(other, null)) { return false; @@ -1532,6 +2127,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1541,18 +2137,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1562,6 +2175,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SettingRealsFromNegativeInts other) { if (other == null) { return; @@ -1570,7 +2184,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1579,27 +2197,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class ComplexOptionType1 : pb::IMessage { + public sealed partial class ComplexOptionType1 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType1()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType1() { OnConstruction(); } @@ -1607,6 +2249,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType1(ComplexOptionType1 other) : this() { foo_ = other.foo_; foo2_ = other.foo2_; @@ -1616,6 +2259,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType1 Clone() { return new ComplexOptionType1(this); } @@ -1624,6 +2268,7 @@ namespace UnitTest.Issues.TestProtos { public const int FooFieldNumber = 1; private int foo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Foo { get { return foo_; } set { @@ -1635,6 +2280,7 @@ namespace UnitTest.Issues.TestProtos { public const int Foo2FieldNumber = 2; private int foo2_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Foo2 { get { return foo2_; } set { @@ -1646,6 +2292,7 @@ namespace UnitTest.Issues.TestProtos { public const int Foo3FieldNumber = 3; private int foo3_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Foo3 { get { return foo3_; } set { @@ -1659,16 +2306,19 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForInt32(34); private readonly pbc::RepeatedField foo4_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Foo4 { get { return foo4_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ComplexOptionType1); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ComplexOptionType1 other) { if (ReferenceEquals(other, null)) { return false; @@ -1684,6 +2334,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Foo != 0) hash ^= Foo.GetHashCode(); @@ -1697,12 +2348,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Foo != 0) { output.WriteRawTag(8); output.WriteInt32(Foo); @@ -1719,9 +2375,34 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Foo != 0) { + output.WriteRawTag(8); + output.WriteInt32(Foo); + } + if (Foo2 != 0) { + output.WriteRawTag(16); + output.WriteInt32(Foo2); + } + if (Foo3 != 0) { + output.WriteRawTag(24); + output.WriteInt32(Foo3); + } + foo4_.WriteTo(ref output, _repeated_foo4_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Foo != 0) { @@ -1741,6 +2422,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ComplexOptionType1 other) { if (other == null) { return; @@ -1759,7 +2441,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1785,27 +2471,68 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Foo = input.ReadInt32(); + break; + } + case 16: { + Foo2 = input.ReadInt32(); + break; + } + case 24: { + Foo3 = input.ReadInt32(); + break; + } + case 34: + case 32: { + foo4_.AddEntriesFrom(ref input, _repeated_foo4_codec); + break; + } + } + } + } + #endif + } - public sealed partial class ComplexOptionType2 : pb::IMessage { + public sealed partial class ComplexOptionType2 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType2()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType2() { OnConstruction(); } @@ -1813,6 +2540,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType2(ComplexOptionType2 other) : this() { bar_ = other.bar_ != null ? other.bar_.Clone() : null; baz_ = other.baz_; @@ -1822,6 +2550,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType2 Clone() { return new ComplexOptionType2(this); } @@ -1830,6 +2559,7 @@ namespace UnitTest.Issues.TestProtos { public const int BarFieldNumber = 1; private global::UnitTest.Issues.TestProtos.ComplexOptionType1 bar_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.ComplexOptionType1 Bar { get { return bar_; } set { @@ -1841,6 +2571,7 @@ namespace UnitTest.Issues.TestProtos { public const int BazFieldNumber = 2; private int baz_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Baz { get { return baz_; } set { @@ -1852,6 +2583,7 @@ namespace UnitTest.Issues.TestProtos { public const int FredFieldNumber = 3; private global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4 fred_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4 Fred { get { return fred_; } set { @@ -1865,16 +2597,19 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.Parser); private readonly pbc::RepeatedField barney_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Barney { get { return barney_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ComplexOptionType2); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ComplexOptionType2 other) { if (ReferenceEquals(other, null)) { return false; @@ -1890,6 +2625,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (bar_ != null) hash ^= Bar.GetHashCode(); @@ -1903,12 +2639,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (bar_ != null) { output.WriteRawTag(10); output.WriteMessage(Bar); @@ -1925,9 +2666,34 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (bar_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Bar); + } + if (Baz != 0) { + output.WriteRawTag(16); + output.WriteInt32(Baz); + } + if (fred_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Fred); + } + barney_.WriteTo(ref output, _repeated_barney_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (bar_ != null) { @@ -1947,6 +2713,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ComplexOptionType2 other) { if (other == null) { return; @@ -1971,7 +2738,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2002,29 +2773,76 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (bar_ == null) { + Bar = new global::UnitTest.Issues.TestProtos.ComplexOptionType1(); + } + input.ReadMessage(Bar); + break; + } + case 16: { + Baz = input.ReadInt32(); + break; + } + case 26: { + if (fred_ == null) { + Fred = new global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4(); + } + input.ReadMessage(Fred); + break; + } + case 34: { + barney_.AddEntriesFrom(ref input, _repeated_barney_codec); + break; + } + } + } + } + #endif + #region Nested types /// Container for nested types declared in the ComplexOptionType2 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class ComplexOptionType4 : pb::IMessage { + public sealed partial class ComplexOptionType4 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType4()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.ComplexOptionType2.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType4() { OnConstruction(); } @@ -2032,12 +2850,14 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType4(ComplexOptionType4 other) : this() { waldo_ = other.waldo_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType4 Clone() { return new ComplexOptionType4(this); } @@ -2046,6 +2866,7 @@ namespace UnitTest.Issues.TestProtos { public const int WaldoFieldNumber = 1; private int waldo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Waldo { get { return waldo_; } set { @@ -2054,11 +2875,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ComplexOptionType4); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ComplexOptionType4 other) { if (ReferenceEquals(other, null)) { return false; @@ -2071,6 +2894,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Waldo != 0) hash ^= Waldo.GetHashCode(); @@ -2081,12 +2905,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Waldo != 0) { output.WriteRawTag(8); output.WriteInt32(Waldo); @@ -2094,9 +2923,25 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Waldo != 0) { + output.WriteRawTag(8); + output.WriteInt32(Waldo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Waldo != 0) { @@ -2109,6 +2954,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ComplexOptionType4 other) { if (other == null) { return; @@ -2120,7 +2966,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2133,11 +2983,32 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Waldo = input.ReadInt32(); + break; + } + } + } } + #endif #region Extensions /// Container for extensions for other messages declared in the ComplexOptionType4 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Extensions { public static readonly pb::Extension ComplexOpt4 = new pb::Extension(7633546, pb::FieldCodec.ForMessage(61068370, global::UnitTest.Issues.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.Parser)); @@ -2151,23 +3022,31 @@ namespace UnitTest.Issues.TestProtos { } - public sealed partial class ComplexOptionType3 : pb::IMessage { + public sealed partial class ComplexOptionType3 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexOptionType3()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType3() { OnConstruction(); } @@ -2175,12 +3054,14 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType3(ComplexOptionType3 other) : this() { qux_ = other.qux_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ComplexOptionType3 Clone() { return new ComplexOptionType3(this); } @@ -2189,6 +3070,7 @@ namespace UnitTest.Issues.TestProtos { public const int QuxFieldNumber = 1; private int qux_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Qux { get { return qux_; } set { @@ -2197,11 +3079,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ComplexOptionType3); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ComplexOptionType3 other) { if (ReferenceEquals(other, null)) { return false; @@ -2214,6 +3098,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Qux != 0) hash ^= Qux.GetHashCode(); @@ -2224,12 +3109,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Qux != 0) { output.WriteRawTag(8); output.WriteInt32(Qux); @@ -2237,9 +3127,25 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Qux != 0) { + output.WriteRawTag(8); + output.WriteInt32(Qux); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Qux != 0) { @@ -2252,6 +3158,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ComplexOptionType3 other) { if (other == null) { return; @@ -2263,7 +3170,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2276,30 +3187,58 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Qux = input.ReadInt32(); + break; + } + } + } } + #endif } /// /// Note that we try various different ways of naming the same extension. /// - public sealed partial class VariousComplexOptions : pb::IMessage { + public sealed partial class VariousComplexOptions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VariousComplexOptions()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public VariousComplexOptions() { OnConstruction(); } @@ -2307,21 +3246,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public VariousComplexOptions(VariousComplexOptions other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public VariousComplexOptions Clone() { return new VariousComplexOptions(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as VariousComplexOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(VariousComplexOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -2333,6 +3276,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -2342,18 +3286,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -2363,6 +3324,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(VariousComplexOptions other) { if (other == null) { return; @@ -2371,7 +3333,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2380,30 +3346,54 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + } /// /// A helper type used to test aggregate option parsing /// - public sealed partial class Aggregate : pb::IMessage { + public sealed partial class Aggregate : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Aggregate()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Aggregate() { OnConstruction(); } @@ -2411,6 +3401,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Aggregate(Aggregate other) : this() { i_ = other.i_; s_ = other.s_; @@ -2419,6 +3410,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Aggregate Clone() { return new Aggregate(this); } @@ -2427,6 +3419,7 @@ namespace UnitTest.Issues.TestProtos { public const int IFieldNumber = 1; private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { return i_; } set { @@ -2438,6 +3431,7 @@ namespace UnitTest.Issues.TestProtos { public const int SFieldNumber = 2; private string s_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string S { get { return s_; } set { @@ -2452,6 +3446,7 @@ namespace UnitTest.Issues.TestProtos { /// A nested object /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.Aggregate Sub { get { return sub_; } set { @@ -2460,11 +3455,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Aggregate); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Aggregate other) { if (ReferenceEquals(other, null)) { return false; @@ -2479,6 +3476,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (I != 0) hash ^= I.GetHashCode(); @@ -2491,12 +3489,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (I != 0) { output.WriteRawTag(8); output.WriteInt32(I); @@ -2512,9 +3515,33 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (I != 0) { + output.WriteRawTag(8); + output.WriteInt32(I); + } + if (S.Length != 0) { + output.WriteRawTag(18); + output.WriteString(S); + } + if (sub_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Sub); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (I != 0) { @@ -2533,6 +3560,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Aggregate other) { if (other == null) { return; @@ -2553,7 +3581,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2577,27 +3609,66 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + I = input.ReadInt32(); + break; + } + case 18: { + S = input.ReadString(); + break; + } + case 26: { + if (sub_ == null) { + Sub = new global::UnitTest.Issues.TestProtos.Aggregate(); + } + input.ReadMessage(Sub); + break; + } + } + } } + #endif } - public sealed partial class AggregateMessage : pb::IMessage { + public sealed partial class AggregateMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AggregateMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[17]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AggregateMessage() { OnConstruction(); } @@ -2605,12 +3676,14 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AggregateMessage(AggregateMessage other) : this() { fieldname_ = other.fieldname_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AggregateMessage Clone() { return new AggregateMessage(this); } @@ -2619,6 +3692,7 @@ namespace UnitTest.Issues.TestProtos { public const int FieldnameFieldNumber = 1; private int fieldname_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Fieldname { get { return fieldname_; } set { @@ -2627,11 +3701,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as AggregateMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(AggregateMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -2644,6 +3720,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Fieldname != 0) hash ^= Fieldname.GetHashCode(); @@ -2654,12 +3731,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Fieldname != 0) { output.WriteRawTag(8); output.WriteInt32(Fieldname); @@ -2667,9 +3749,25 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Fieldname != 0) { + output.WriteRawTag(8); + output.WriteInt32(Fieldname); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Fieldname != 0) { @@ -2682,6 +3780,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(AggregateMessage other) { if (other == null) { return; @@ -2693,7 +3792,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2706,30 +3809,58 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Fieldname = input.ReadInt32(); + break; + } + } + } } + #endif } /// /// Test custom options for nested type. /// - public sealed partial class NestedOptionType : pb::IMessage { + public sealed partial class NestedOptionType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedOptionType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestCustomOptionsProto3Reflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOptionType() { OnConstruction(); } @@ -2737,21 +3868,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOptionType(NestedOptionType other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOptionType Clone() { return new NestedOptionType(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedOptionType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedOptionType other) { if (ReferenceEquals(other, null)) { return false; @@ -2763,6 +3898,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -2772,18 +3908,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -2793,6 +3946,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedOptionType other) { if (other == null) { return; @@ -2801,7 +3955,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2810,34 +3968,59 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif #region Nested types /// Container for nested types declared in the NestedOptionType message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, [pbr::OriginalName("NESTED_ENUM_VALUE")] Value = 1, } - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.NestedOptionType.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -2845,12 +4028,14 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { nestedField_ = other.nestedField_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -2859,6 +4044,7 @@ namespace UnitTest.Issues.TestProtos { public const int NestedFieldFieldNumber = 1; private int nestedField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int NestedField { get { return nestedField_; } set { @@ -2867,11 +4053,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -2884,6 +4072,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (NestedField != 0) hash ^= NestedField.GetHashCode(); @@ -2894,12 +4083,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (NestedField != 0) { output.WriteRawTag(8); output.WriteInt32(NestedField); @@ -2907,9 +4101,25 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (NestedField != 0) { + output.WriteRawTag(8); + output.WriteInt32(NestedField); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (NestedField != 0) { @@ -2922,6 +4132,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -2933,7 +4144,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2946,7 +4161,27 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NestedField = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs index d5f8589315..4f40564ebd 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs @@ -59,24 +59,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { #endregion #region Messages - public sealed partial class ImportMessage : pb::IMessage { + public sealed partial class ImportMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImportMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestImportReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage() { OnConstruction(); } @@ -84,6 +92,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage(ImportMessage other) : this() { _hasBits0 = other._hasBits0; d_ = other.d_; @@ -91,6 +100,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage Clone() { return new ImportMessage(this); } @@ -101,6 +111,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int d_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int D { get { if ((_hasBits0 & 1) != 0) { return d_; } else { return DDefaultValue; } } set { @@ -110,21 +121,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "d" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasD { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "d" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearD() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ImportMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ImportMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -137,6 +152,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasD) hash ^= D.GetHashCode(); @@ -147,12 +163,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasD) { output.WriteRawTag(8); output.WriteInt32(D); @@ -160,9 +181,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasD) { + output.WriteRawTag(8); + output.WriteInt32(D); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasD) { @@ -175,6 +212,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ImportMessage other) { if (other == null) { return; @@ -186,7 +224,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -199,7 +241,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + D = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs index 19a1a34634..a3ce7a2259 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs @@ -50,23 +50,31 @@ namespace Google.Protobuf.TestProtos { #endregion #region Messages - public sealed partial class ImportMessage : pb::IMessage { + public sealed partial class ImportMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImportMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestImportProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage() { OnConstruction(); } @@ -74,12 +82,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage(ImportMessage other) : this() { d_ = other.d_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ImportMessage Clone() { return new ImportMessage(this); } @@ -88,6 +98,7 @@ namespace Google.Protobuf.TestProtos { public const int DFieldNumber = 1; private int d_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int D { get { return d_; } set { @@ -96,11 +107,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ImportMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ImportMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -113,6 +126,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (D != 0) hash ^= D.GetHashCode(); @@ -123,12 +137,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (D != 0) { output.WriteRawTag(8); output.WriteInt32(D); @@ -136,9 +155,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (D != 0) { + output.WriteRawTag(8); + output.WriteInt32(D); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (D != 0) { @@ -151,6 +186,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ImportMessage other) { if (other == null) { return; @@ -162,7 +198,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -175,7 +215,27 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + D = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs index 77f2121760..b1e0f30adb 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs @@ -37,24 +37,32 @@ namespace Google.Protobuf.TestProtos.Proto2 { } #region Messages - public sealed partial class PublicImportMessage : pb::IMessage { + public sealed partial class PublicImportMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PublicImportMessage()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.Proto2.UnittestImportPublicReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage() { OnConstruction(); } @@ -62,6 +70,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage(PublicImportMessage other) : this() { _hasBits0 = other._hasBits0; e_ = other.e_; @@ -69,6 +78,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage Clone() { return new PublicImportMessage(this); } @@ -79,6 +89,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { private int e_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int E { get { if ((_hasBits0 & 1) != 0) { return e_; } else { return EDefaultValue; } } set { @@ -88,21 +99,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { } /// Gets whether the "e" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasE { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "e" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearE() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as PublicImportMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(PublicImportMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -115,6 +130,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasE) hash ^= E.GetHashCode(); @@ -125,12 +141,17 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasE) { output.WriteRawTag(8); output.WriteInt32(E); @@ -138,9 +159,25 @@ namespace Google.Protobuf.TestProtos.Proto2 { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasE) { + output.WriteRawTag(8); + output.WriteInt32(E); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasE) { @@ -153,6 +190,7 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(PublicImportMessage other) { if (other == null) { return; @@ -164,7 +202,11 @@ namespace Google.Protobuf.TestProtos.Proto2 { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -177,7 +219,27 @@ namespace Google.Protobuf.TestProtos.Proto2 { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + E = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs index a455655469..dde8b9bda1 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs @@ -38,23 +38,31 @@ namespace Google.Protobuf.TestProtos { } #region Messages - public sealed partial class PublicImportMessage : pb::IMessage { + public sealed partial class PublicImportMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PublicImportMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage() { OnConstruction(); } @@ -62,12 +70,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage(PublicImportMessage other) : this() { e_ = other.e_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public PublicImportMessage Clone() { return new PublicImportMessage(this); } @@ -76,6 +86,7 @@ namespace Google.Protobuf.TestProtos { public const int EFieldNumber = 1; private int e_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int E { get { return e_; } set { @@ -84,11 +95,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as PublicImportMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(PublicImportMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -101,6 +114,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (E != 0) hash ^= E.GetHashCode(); @@ -111,12 +125,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (E != 0) { output.WriteRawTag(8); output.WriteInt32(E); @@ -124,9 +143,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (E != 0) { + output.WriteRawTag(8); + output.WriteInt32(E); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (E != 0) { @@ -139,6 +174,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(PublicImportMessage other) { if (other == null) { return; @@ -150,7 +186,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -163,7 +203,27 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + E = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs index 6b816f739b..1ac4a67299 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs @@ -37,23 +37,31 @@ namespace UnitTest.Issues.TestProtos { } #region Messages - public sealed partial class Foo : pb::IMessage { + public sealed partial class Foo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Foo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssue6936BReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo() { OnConstruction(); } @@ -61,21 +69,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo(Foo other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Foo Clone() { return new Foo(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Foo); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Foo other) { if (ReferenceEquals(other, null)) { return false; @@ -87,6 +99,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -96,18 +109,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -117,6 +147,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Foo other) { if (other == null) { return; @@ -125,7 +156,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -134,7 +169,23 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs index a8a73f6cb6..d7789b87ac 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs @@ -39,23 +39,31 @@ namespace UnitTest.Issues.TestProtos { } #region Messages - public sealed partial class Bar : pb::IMessage { + public sealed partial class Bar : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Bar()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssue6936CReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar() { OnConstruction(); } @@ -63,12 +71,14 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar(Bar other) : this() { foo_ = other.foo_ != null ? other.foo_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Bar Clone() { return new Bar(this); } @@ -77,6 +87,7 @@ namespace UnitTest.Issues.TestProtos { public const int FooFieldNumber = 1; private global::UnitTest.Issues.TestProtos.Foo foo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.Foo Foo { get { return foo_; } set { @@ -85,11 +96,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Bar); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Bar other) { if (ReferenceEquals(other, null)) { return false; @@ -102,6 +115,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (foo_ != null) hash ^= Foo.GetHashCode(); @@ -112,12 +126,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (foo_ != null) { output.WriteRawTag(10); output.WriteMessage(Foo); @@ -125,9 +144,25 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (foo_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Foo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (foo_ != null) { @@ -140,6 +175,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Bar other) { if (other == null) { return; @@ -154,7 +190,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -170,7 +210,30 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (foo_ == null) { + Foo = new global::UnitTest.Issues.TestProtos.Foo(); + } + input.ReadMessage(Foo); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs index f3f40c6a70..ec4c07b112 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs @@ -24,36 +24,43 @@ namespace UnitTest.Issues.TestProtos { static UnittestIssuesReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyInCghJ", - "c3N1ZTMwNxobCgpOZXN0ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdh", - "dGl2ZUVudW1NZXNzYWdlEiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNz", - "dWVzLk5lZ2F0aXZlRW51bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9p", - "c3N1ZXMuTmVnYXRpdmVFbnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygO", - "Mh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVj", - "YXRlZENoaWxkIrkCChdEZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5Qcmlt", - "aXRpdmVWYWx1ZRgBIAEoBUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVC", - "AhgBEjoKDE1lc3NhZ2VWYWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E", - "ZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVu", - "aXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1", - "ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAES", - "NgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0", - "ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNl", - "cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa", - "EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT", - "CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv", - "MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p", - "bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y", - "IksKDFRlc3RKc29uTmFtZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9u", - "GAIgASgJUgRkZXNjEhIKBGd1aWQYAyABKAlSBGV4aWQifwoMT25lb2ZNZXJn", - "aW5nEg4KBHRleHQYASABKAlIABI2CgZuZXN0ZWQYAiABKAsyJC51bml0dGVz", - "dF9pc3N1ZXMuT25lb2ZNZXJnaW5nLk5lc3RlZEgAGh4KBk5lc3RlZBIJCgF4", - "GAEgASgFEgkKAXkYAiABKAVCBwoFdmFsdWUqVQoMTmVnYXRpdmVFbnVtEhYK", - "Ek5FR0FUSVZFX0VOVU1fWkVSTxAAEhYKCUZpdmVCZWxvdxD7//////////8B", - "EhUKCE1pbnVzT25lEP///////////wEqLgoORGVwcmVjYXRlZEVudW0SEwoP", - "REVQUkVDQVRFRF9aRVJPEAASBwoDb25lEAFCHaoCGlVuaXRUZXN0Lklzc3Vl", - "cy5UZXN0UHJvdG9zYgZwcm90bzM=")); + "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcxocZ29v", + "Z2xlL3Byb3RvYnVmL3N0cnVjdC5wcm90byInCghJc3N1ZTMwNxobCgpOZXN0", + "ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdhdGl2ZUVudW1NZXNzYWdl", + "EiwKBXZhbHVlGAEgASgOMh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51", + "bRIxCgZ2YWx1ZXMYAiADKA4yHS51bml0dGVzdF9pc3N1ZXMuTmVnYXRpdmVF", + "bnVtQgIQABI4Cg1wYWNrZWRfdmFsdWVzGAMgAygOMh0udW5pdHRlc3RfaXNz", + "dWVzLk5lZ2F0aXZlRW51bUICEAEiEQoPRGVwcmVjYXRlZENoaWxkIrkCChdE", + "ZXByZWNhdGVkRmllbGRzTWVzc2FnZRIaCg5QcmltaXRpdmVWYWx1ZRgBIAEo", + "BUICGAESGgoOUHJpbWl0aXZlQXJyYXkYAiADKAVCAhgBEjoKDE1lc3NhZ2VW", + "YWx1ZRgDIAEoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRC", + "AhgBEjoKDE1lc3NhZ2VBcnJheRgEIAMoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5E", + "ZXByZWNhdGVkQ2hpbGRCAhgBEjYKCUVudW1WYWx1ZRgFIAEoDjIfLnVuaXR0", + "ZXN0X2lzc3Vlcy5EZXByZWNhdGVkRW51bUICGAESNgoJRW51bUFycmF5GAYg", + "AygOMh8udW5pdHRlc3RfaXNzdWVzLkRlcHJlY2F0ZWRFbnVtQgIYASIZCglJ", + "dGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNlcnZlZE5hbWVzEg0KBXR5", + "cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUaEAoOU29tZU5lc3RlZFR5", + "cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxITCgtwbGFpbl9pbnQzMhgE", + "IAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghvMV9pbnQzMhgFIAEoBUgA", + "EhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9pbnQzMhgGIAEoBUgBEhMK", + "CW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8yIksKDFRlc3RKc29uTmFt", + "ZRIMCgRuYW1lGAEgASgJEhkKC2Rlc2NyaXB0aW9uGAIgASgJUgRkZXNjEhIK", + "BGd1aWQYAyABKAlSBGV4aWQifwoMT25lb2ZNZXJnaW5nEg4KBHRleHQYASAB", + "KAlIABI2CgZuZXN0ZWQYAiABKAsyJC51bml0dGVzdF9pc3N1ZXMuT25lb2ZN", + "ZXJnaW5nLk5lc3RlZEgAGh4KBk5lc3RlZBIJCgF4GAEgASgFEgkKAXkYAiAB", + "KAVCBwoFdmFsdWUiawoWTnVsbFZhbHVlT3V0c2lkZVN0cnVjdBIWCgxzdHJp", + "bmdfdmFsdWUYASABKAlIABIwCgpudWxsX3ZhbHVlGAIgASgOMhouZ29vZ2xl", + "LnByb3RvYnVmLk51bGxWYWx1ZUgAQgcKBXZhbHVlIkUKE051bGxWYWx1ZU5v", + "dEluT25lb2YSLgoKbnVsbF92YWx1ZRgCIAEoDjIaLmdvb2dsZS5wcm90b2J1", + "Zi5OdWxsVmFsdWUiYAoXTWl4ZWRSZWd1bGFyQW5kT3B0aW9uYWwSFQoNcmVn", + "dWxhcl9maWVsZBgBIAEoCRIbCg5vcHRpb25hbF9maWVsZBgCIAEoCUgAiAEB", + "QhEKD19vcHRpb25hbF9maWVsZCpVCgxOZWdhdGl2ZUVudW0SFgoSTkVHQVRJ", + "VkVfRU5VTV9aRVJPEAASFgoJRml2ZUJlbG93EPv//////////wESFQoITWlu", + "dXNPbmUQ////////////ASouCg5EZXByZWNhdGVkRW51bRITCg9ERVBSRUNB", + "VEVEX1pFUk8QABIHCgNvbmUQAUIdqgIaVW5pdFRlc3QuSXNzdWVzLlRlc3RQ", + "cm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307), global::UnitTest.Issues.TestProtos.Issue307.Parser, null, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Parser, null, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice.Parser, null, null, null, null, null)})}), new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), global::UnitTest.Issues.TestProtos.NegativeEnumMessage.Parser, new[]{ "Value", "Values", "PackedValues" }, null, null, null, null), @@ -63,7 +70,10 @@ namespace UnitTest.Issues.TestProtos { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames), global::UnitTest.Issues.TestProtos.ReservedNames.Parser, new[]{ "Types_", "Descriptor_" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType), global::UnitTest.Issues.TestProtos.ReservedNames.Types.SomeNestedType.Parser, null, null, null, null, null)}), new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering), global::UnitTest.Issues.TestProtos.TestJsonFieldOrdering.Parser, new[]{ "PlainInt32", "O1String", "O1Int32", "PlainString", "O2Int32", "O2String" }, new[]{ "O1", "O2" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.TestJsonName), global::UnitTest.Issues.TestProtos.TestJsonName.Parser, new[]{ "Name", "Description", "Guid" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofMerging), global::UnitTest.Issues.TestProtos.OneofMerging.Parser, new[]{ "Text", "Nested" }, new[]{ "Value" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested), global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested.Parser, new[]{ "X", "Y" }, null, null, null, null)}) + new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofMerging), global::UnitTest.Issues.TestProtos.OneofMerging.Parser, new[]{ "Text", "Nested" }, new[]{ "Value" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested), global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested.Parser, new[]{ "X", "Y" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NullValueOutsideStruct), global::UnitTest.Issues.TestProtos.NullValueOutsideStruct.Parser, new[]{ "StringValue", "NullValue" }, new[]{ "Value" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.NullValueNotInOneof), global::UnitTest.Issues.TestProtos.NullValueNotInOneof.Parser, new[]{ "NullValue" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.MixedRegularAndOptional), global::UnitTest.Issues.TestProtos.MixedRegularAndOptional.Parser, new[]{ "RegularField", "OptionalField" }, new[]{ "OptionalField" }, null, null, null) })); } #endregion @@ -88,23 +98,31 @@ namespace UnitTest.Issues.TestProtos { /// Issue 307: when generating doubly-nested types, any references /// should be of the form A.Types.B.Types.C. /// - public sealed partial class Issue307 : pb::IMessage { + public sealed partial class Issue307 : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Issue307()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Issue307() { OnConstruction(); } @@ -112,21 +130,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Issue307(Issue307 other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Issue307 Clone() { return new Issue307(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Issue307); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Issue307 other) { if (ReferenceEquals(other, null)) { return false; @@ -138,6 +160,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -147,18 +170,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -168,6 +208,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Issue307 other) { if (other == null) { return; @@ -176,7 +217,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -185,29 +230,54 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif #region Nested types /// Container for nested types declared in the Issue307 message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class NestedOnce : pb::IMessage { + public sealed partial class NestedOnce : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedOnce()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOnce() { OnConstruction(); } @@ -215,21 +285,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOnce(NestedOnce other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedOnce Clone() { return new NestedOnce(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedOnce); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedOnce other) { if (ReferenceEquals(other, null)) { return false; @@ -241,6 +315,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -250,18 +325,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -271,6 +363,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedOnce other) { if (other == null) { return; @@ -279,7 +372,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -288,29 +385,54 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif #region Nested types /// Container for nested types declared in the NestedOnce message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class NestedTwice : pb::IMessage { + public sealed partial class NestedTwice : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTwice()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTwice() { OnConstruction(); } @@ -318,21 +440,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTwice(NestedTwice other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTwice Clone() { return new NestedTwice(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedTwice); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedTwice other) { if (ReferenceEquals(other, null)) { return false; @@ -344,6 +470,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -353,18 +480,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -374,6 +518,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedTwice other) { if (other == null) { return; @@ -382,7 +527,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -391,7 +540,23 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } @@ -405,23 +570,31 @@ namespace UnitTest.Issues.TestProtos { } - public sealed partial class NegativeEnumMessage : pb::IMessage { + public sealed partial class NegativeEnumMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NegativeEnumMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NegativeEnumMessage() { OnConstruction(); } @@ -429,6 +602,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NegativeEnumMessage(NegativeEnumMessage other) : this() { value_ = other.value_; values_ = other.values_.Clone(); @@ -437,6 +611,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NegativeEnumMessage Clone() { return new NegativeEnumMessage(this); } @@ -445,6 +620,7 @@ namespace UnitTest.Issues.TestProtos { public const int ValueFieldNumber = 1; private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.Zero; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.NegativeEnum Value { get { return value_; } set { @@ -458,6 +634,7 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); private readonly pbc::RepeatedField values_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Values { get { return values_; } } @@ -468,16 +645,19 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); private readonly pbc::RepeatedField packedValues_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedValues { get { return packedValues_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NegativeEnumMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NegativeEnumMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -492,6 +672,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) hash ^= Value.GetHashCode(); @@ -504,12 +685,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) { output.WriteRawTag(8); output.WriteEnum((int) Value); @@ -519,9 +705,27 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) { + output.WriteRawTag(8); + output.WriteEnum((int) Value); + } + values_.WriteTo(ref output, _repeated_values_codec); + packedValues_.WriteTo(ref output, _repeated_packedValues_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.Zero) { @@ -536,6 +740,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NegativeEnumMessage other) { if (other == null) { return; @@ -549,7 +754,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -572,27 +781,65 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Value = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum(); + break; + } + case 18: + case 16: { + values_.AddEntriesFrom(ref input, _repeated_values_codec); + break; + } + case 26: + case 24: { + packedValues_.AddEntriesFrom(ref input, _repeated_packedValues_codec); + break; + } + } + } } + #endif } - public sealed partial class DeprecatedChild : pb::IMessage { + public sealed partial class DeprecatedChild : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeprecatedChild()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedChild() { OnConstruction(); } @@ -600,21 +847,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedChild(DeprecatedChild other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedChild Clone() { return new DeprecatedChild(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DeprecatedChild); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DeprecatedChild other) { if (ReferenceEquals(other, null)) { return false; @@ -626,6 +877,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -635,18 +887,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -656,6 +925,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DeprecatedChild other) { if (other == null) { return; @@ -664,7 +934,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -673,27 +947,51 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class DeprecatedFieldsMessage : pb::IMessage { + public sealed partial class DeprecatedFieldsMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeprecatedFieldsMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedFieldsMessage() { OnConstruction(); } @@ -701,6 +999,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() { primitiveValue_ = other.primitiveValue_; primitiveArray_ = other.primitiveArray_.Clone(); @@ -712,6 +1011,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DeprecatedFieldsMessage Clone() { return new DeprecatedFieldsMessage(this); } @@ -721,6 +1021,7 @@ namespace UnitTest.Issues.TestProtos { private int primitiveValue_; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int PrimitiveValue { get { return primitiveValue_; } set { @@ -735,6 +1036,7 @@ namespace UnitTest.Issues.TestProtos { private readonly pbc::RepeatedField primitiveArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PrimitiveArray { get { return primitiveArray_; } } @@ -744,6 +1046,7 @@ namespace UnitTest.Issues.TestProtos { private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue { get { return messageValue_; } set { @@ -758,6 +1061,7 @@ namespace UnitTest.Issues.TestProtos { private readonly pbc::RepeatedField messageArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField MessageArray { get { return messageArray_; } } @@ -767,6 +1071,7 @@ namespace UnitTest.Issues.TestProtos { private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { get { return enumValue_; } set { @@ -781,16 +1086,19 @@ namespace UnitTest.Issues.TestProtos { private readonly pbc::RepeatedField enumArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField EnumArray { get { return enumArray_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DeprecatedFieldsMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DeprecatedFieldsMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -808,6 +1116,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode(); @@ -823,12 +1132,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (PrimitiveValue != 0) { output.WriteRawTag(8); output.WriteInt32(PrimitiveValue); @@ -847,9 +1161,36 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (PrimitiveValue != 0) { + output.WriteRawTag(8); + output.WriteInt32(PrimitiveValue); + } + primitiveArray_.WriteTo(ref output, _repeated_primitiveArray_codec); + if (messageValue_ != null) { + output.WriteRawTag(26); + output.WriteMessage(MessageValue); + } + messageArray_.WriteTo(ref output, _repeated_messageArray_codec); + if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DeprecatedZero) { + output.WriteRawTag(40); + output.WriteEnum((int) EnumValue); + } + enumArray_.WriteTo(ref output, _repeated_enumArray_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (PrimitiveValue != 0) { @@ -871,6 +1212,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DeprecatedFieldsMessage other) { if (other == null) { return; @@ -894,7 +1236,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -932,30 +1278,83 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + PrimitiveValue = input.ReadInt32(); + break; + } + case 18: + case 16: { + primitiveArray_.AddEntriesFrom(ref input, _repeated_primitiveArray_codec); + break; + } + case 26: { + if (messageValue_ == null) { + MessageValue = new global::UnitTest.Issues.TestProtos.DeprecatedChild(); + } + input.ReadMessage(MessageValue); + break; + } + case 34: { + messageArray_.AddEntriesFrom(ref input, _repeated_messageArray_codec); + break; + } + case 40: { + EnumValue = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum(); + break; + } + case 50: + case 48: { + enumArray_.AddEntriesFrom(ref input, _repeated_enumArray_codec); + break; + } + } + } } + #endif } /// /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45 /// - public sealed partial class ItemField : pb::IMessage { + public sealed partial class ItemField : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ItemField()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ItemField() { OnConstruction(); } @@ -963,12 +1362,14 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ItemField(ItemField other) : this() { item_ = other.item_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ItemField Clone() { return new ItemField(this); } @@ -977,6 +1378,7 @@ namespace UnitTest.Issues.TestProtos { public const int ItemFieldNumber = 1; private int item_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Item { get { return item_; } set { @@ -985,11 +1387,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ItemField); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ItemField other) { if (ReferenceEquals(other, null)) { return false; @@ -1002,6 +1406,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Item != 0) hash ^= Item.GetHashCode(); @@ -1012,12 +1417,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Item != 0) { output.WriteRawTag(8); output.WriteInt32(Item); @@ -1025,9 +1435,25 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Item != 0) { + output.WriteRawTag(8); + output.WriteInt32(Item); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Item != 0) { @@ -1040,6 +1466,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ItemField other) { if (other == null) { return; @@ -1051,7 +1478,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1064,27 +1495,55 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Item = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class ReservedNames : pb::IMessage { + public sealed partial class ReservedNames : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReservedNames()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ReservedNames() { OnConstruction(); } @@ -1092,6 +1551,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ReservedNames(ReservedNames other) : this() { types_ = other.types_; descriptor_ = other.descriptor_; @@ -1099,6 +1559,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ReservedNames Clone() { return new ReservedNames(this); } @@ -1107,6 +1568,7 @@ namespace UnitTest.Issues.TestProtos { public const int Types_FieldNumber = 1; private int types_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Types_ { get { return types_; } set { @@ -1118,6 +1580,7 @@ namespace UnitTest.Issues.TestProtos { public const int Descriptor_FieldNumber = 2; private int descriptor_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Descriptor_ { get { return descriptor_; } set { @@ -1126,11 +1589,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ReservedNames); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ReservedNames other) { if (ReferenceEquals(other, null)) { return false; @@ -1144,6 +1609,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Types_ != 0) hash ^= Types_.GetHashCode(); @@ -1155,12 +1621,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Types_ != 0) { output.WriteRawTag(8); output.WriteInt32(Types_); @@ -1172,9 +1643,29 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Types_ != 0) { + output.WriteRawTag(8); + output.WriteInt32(Types_); + } + if (Descriptor_ != 0) { + output.WriteRawTag(16); + output.WriteInt32(Descriptor_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Types_ != 0) { @@ -1190,6 +1681,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ReservedNames other) { if (other == null) { return; @@ -1204,7 +1696,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1221,32 +1717,65 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Types_ = input.ReadInt32(); + break; + } + case 16: { + Descriptor_ = input.ReadInt32(); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the ReservedNames message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Force a nested type called Types /// - public sealed partial class SomeNestedType : pb::IMessage { + public sealed partial class SomeNestedType : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SomeNestedType()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.ReservedNames.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SomeNestedType() { OnConstruction(); } @@ -1254,21 +1783,25 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SomeNestedType(SomeNestedType other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SomeNestedType Clone() { return new SomeNestedType(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SomeNestedType); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SomeNestedType other) { if (ReferenceEquals(other, null)) { return false; @@ -1280,6 +1813,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -1289,18 +1823,35 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -1310,6 +1861,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SomeNestedType other) { if (other == null) { return; @@ -1318,7 +1870,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1327,7 +1883,23 @@ namespace UnitTest.Issues.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } @@ -1348,23 +1920,31 @@ namespace UnitTest.Issues.TestProtos { /// Alternatively, consider just adding this to /// unittest_proto3.proto if multiple platforms want it. /// - public sealed partial class TestJsonFieldOrdering : pb::IMessage { + public sealed partial class TestJsonFieldOrdering : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonFieldOrdering()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonFieldOrdering() { OnConstruction(); } @@ -1372,6 +1952,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonFieldOrdering(TestJsonFieldOrdering other) : this() { plainInt32_ = other.plainInt32_; plainString_ = other.plainString_; @@ -1397,6 +1978,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonFieldOrdering Clone() { return new TestJsonFieldOrdering(this); } @@ -1405,6 +1987,7 @@ namespace UnitTest.Issues.TestProtos { public const int PlainInt32FieldNumber = 4; private int plainInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int PlainInt32 { get { return plainInt32_; } set { @@ -1415,6 +1998,7 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "o1_string" field. public const int O1StringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string O1String { get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; } set { @@ -1426,6 +2010,7 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "o1_int32" field. public const int O1Int32FieldNumber = 5; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int O1Int32 { get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; } set { @@ -1438,6 +2023,7 @@ namespace UnitTest.Issues.TestProtos { public const int PlainStringFieldNumber = 1; private string plainString_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string PlainString { get { return plainString_; } set { @@ -1448,6 +2034,7 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "o2_int32" field. public const int O2Int32FieldNumber = 6; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int O2Int32 { get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; } set { @@ -1459,6 +2046,7 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "o2_string" field. public const int O2StringFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string O2String { get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; } set { @@ -1476,11 +2064,13 @@ namespace UnitTest.Issues.TestProtos { } private O1OneofCase o1Case_ = O1OneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public O1OneofCase O1Case { get { return o1Case_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearO1() { o1Case_ = O1OneofCase.None; o1_ = null; @@ -1495,22 +2085,26 @@ namespace UnitTest.Issues.TestProtos { } private O2OneofCase o2Case_ = O2OneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public O2OneofCase O2Case { get { return o2Case_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearO2() { o2Case_ = O2OneofCase.None; o2_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestJsonFieldOrdering); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestJsonFieldOrdering other) { if (ReferenceEquals(other, null)) { return false; @@ -1530,6 +2124,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (PlainInt32 != 0) hash ^= PlainInt32.GetHashCode(); @@ -1547,12 +2142,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (PlainString.Length != 0) { output.WriteRawTag(10); output.WriteString(PlainString); @@ -1580,9 +2180,45 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (PlainString.Length != 0) { + output.WriteRawTag(10); + output.WriteString(PlainString); + } + if (o1Case_ == O1OneofCase.O1String) { + output.WriteRawTag(18); + output.WriteString(O1String); + } + if (o2Case_ == O2OneofCase.O2String) { + output.WriteRawTag(26); + output.WriteString(O2String); + } + if (PlainInt32 != 0) { + output.WriteRawTag(32); + output.WriteInt32(PlainInt32); + } + if (o1Case_ == O1OneofCase.O1Int32) { + output.WriteRawTag(40); + output.WriteInt32(O1Int32); + } + if (o2Case_ == O2OneofCase.O2Int32) { + output.WriteRawTag(48); + output.WriteInt32(O2Int32); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (PlainInt32 != 0) { @@ -1610,6 +2246,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestJsonFieldOrdering other) { if (other == null) { return; @@ -1642,7 +2279,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1675,27 +2316,75 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif } - } - - public sealed partial class TestJsonName : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonName()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[7]; } - } - + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + PlainString = input.ReadString(); + break; + } + case 18: { + O1String = input.ReadString(); + break; + } + case 26: { + O2String = input.ReadString(); + break; + } + case 32: { + PlainInt32 = input.ReadInt32(); + break; + } + case 40: { + O1Int32 = input.ReadInt32(); + break; + } + case 48: { + O2Int32 = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class TestJsonName : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonName()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName() { OnConstruction(); } @@ -1703,6 +2392,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName(TestJsonName other) : this() { name_ = other.name_; description_ = other.description_; @@ -1711,6 +2401,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestJsonName Clone() { return new TestJsonName(this); } @@ -1722,6 +2413,7 @@ namespace UnitTest.Issues.TestProtos { /// Message for testing the effects for of the json_name option /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -1733,6 +2425,7 @@ namespace UnitTest.Issues.TestProtos { public const int DescriptionFieldNumber = 2; private string description_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Description { get { return description_; } set { @@ -1744,6 +2437,7 @@ namespace UnitTest.Issues.TestProtos { public const int GuidFieldNumber = 3; private string guid_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Guid { get { return guid_; } set { @@ -1752,11 +2446,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestJsonName); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestJsonName other) { if (ReferenceEquals(other, null)) { return false; @@ -1771,6 +2467,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -1783,12 +2480,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); @@ -1804,9 +2506,33 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Description.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Description); + } + if (Guid.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Guid); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -1825,6 +2551,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestJsonName other) { if (other == null) { return; @@ -1842,7 +2569,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1863,7 +2594,35 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Description = input.ReadString(); + break; + } + case 26: { + Guid = input.ReadString(); + break; + } + } + } } + #endif } @@ -1872,23 +2631,31 @@ namespace UnitTest.Issues.TestProtos { /// oneof case, which is itself a message type, the submessages should /// be merged. /// - public sealed partial class OneofMerging : pb::IMessage { + public sealed partial class OneofMerging : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofMerging()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofMerging() { OnConstruction(); } @@ -1896,6 +2663,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofMerging(OneofMerging other) : this() { switch (other.ValueCase) { case ValueOneofCase.Text: @@ -1910,6 +2678,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofMerging Clone() { return new OneofMerging(this); } @@ -1917,6 +2686,7 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "text" field. public const int TextFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Text { get { return valueCase_ == ValueOneofCase.Text ? (string) value_ : ""; } set { @@ -1928,6 +2698,7 @@ namespace UnitTest.Issues.TestProtos { /// Field number for the "nested" field. public const int NestedFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested Nested { get { return valueCase_ == ValueOneofCase.Nested ? (global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested) value_ : null; } set { @@ -1945,22 +2716,26 @@ namespace UnitTest.Issues.TestProtos { } private ValueOneofCase valueCase_ = ValueOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueOneofCase ValueCase { get { return valueCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearValue() { valueCase_ = ValueOneofCase.None; value_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneofMerging); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneofMerging other) { if (ReferenceEquals(other, null)) { return false; @@ -1975,6 +2750,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (valueCase_ == ValueOneofCase.Text) hash ^= Text.GetHashCode(); @@ -1987,12 +2763,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (valueCase_ == ValueOneofCase.Text) { output.WriteRawTag(10); output.WriteString(Text); @@ -2004,9 +2785,29 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (valueCase_ == ValueOneofCase.Text) { + output.WriteRawTag(10); + output.WriteString(Text); + } + if (valueCase_ == ValueOneofCase.Nested) { + output.WriteRawTag(18); + output.WriteMessage(Nested); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (valueCase_ == ValueOneofCase.Text) { @@ -2022,6 +2823,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneofMerging other) { if (other == null) { return; @@ -2042,7 +2844,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2064,29 +2870,67 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Text = input.ReadString(); + break; + } + case 18: { + global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested subBuilder = new global::UnitTest.Issues.TestProtos.OneofMerging.Types.Nested(); + if (valueCase_ == ValueOneofCase.Nested) { + subBuilder.MergeFrom(Nested); + } + input.ReadMessage(subBuilder); + Nested = subBuilder; + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the OneofMerging message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class Nested : pb::IMessage { + public sealed partial class Nested : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Nested()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.OneofMerging.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Nested() { OnConstruction(); } @@ -2094,6 +2938,7 @@ namespace UnitTest.Issues.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Nested(Nested other) : this() { x_ = other.x_; y_ = other.y_; @@ -2101,6 +2946,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Nested Clone() { return new Nested(this); } @@ -2109,6 +2955,7 @@ namespace UnitTest.Issues.TestProtos { public const int XFieldNumber = 1; private int x_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int X { get { return x_; } set { @@ -2120,6 +2967,7 @@ namespace UnitTest.Issues.TestProtos { public const int YFieldNumber = 2; private int y_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Y { get { return y_; } set { @@ -2128,11 +2976,13 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Nested); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Nested other) { if (ReferenceEquals(other, null)) { return false; @@ -2146,6 +2996,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (X != 0) hash ^= X.GetHashCode(); @@ -2157,12 +3008,17 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (X != 0) { output.WriteRawTag(8); output.WriteInt32(X); @@ -2174,9 +3030,29 @@ namespace UnitTest.Issues.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (X != 0) { + output.WriteRawTag(8); + output.WriteInt32(X); + } + if (Y != 0) { + output.WriteRawTag(16); + output.WriteInt32(Y); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (X != 0) { @@ -2192,6 +3068,7 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Nested other) { if (other == null) { return; @@ -2206,7 +3083,11 @@ namespace UnitTest.Issues.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2223,7 +3104,31 @@ namespace UnitTest.Issues.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + X = input.ReadInt32(); + break; + } + case 16: { + Y = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -2232,6 +3137,694 @@ namespace UnitTest.Issues.TestProtos { } + public sealed partial class NullValueOutsideStruct : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NullValueOutsideStruct()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NullValueOutsideStruct() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NullValueOutsideStruct(NullValueOutsideStruct other) : this() { + switch (other.ValueCase) { + case ValueOneofCase.StringValue: + StringValue = other.StringValue; + break; + case ValueOneofCase.NullValue: + NullValue = other.NullValue; + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NullValueOutsideStruct Clone() { + return new NullValueOutsideStruct(this); + } + + /// Field number for the "string_value" field. + public const int StringValueFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string StringValue { + get { return valueCase_ == ValueOneofCase.StringValue ? (string) value_ : ""; } + set { + value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + valueCase_ = ValueOneofCase.StringValue; + } + } + + /// Field number for the "null_value" field. + public const int NullValueFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { + get { return valueCase_ == ValueOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) value_ : global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; } + set { + value_ = value; + valueCase_ = ValueOneofCase.NullValue; + } + } + + private object value_; + /// Enum of possible cases for the "value" oneof. + public enum ValueOneofCase { + None = 0, + StringValue = 1, + NullValue = 2, + } + private ValueOneofCase valueCase_ = ValueOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ValueOneofCase ValueCase { + get { return valueCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearValue() { + valueCase_ = ValueOneofCase.None; + value_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NullValueOutsideStruct); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NullValueOutsideStruct other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StringValue != other.StringValue) return false; + if (NullValue != other.NullValue) return false; + if (ValueCase != other.ValueCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (valueCase_ == ValueOneofCase.StringValue) hash ^= StringValue.GetHashCode(); + if (valueCase_ == ValueOneofCase.NullValue) hash ^= NullValue.GetHashCode(); + hash ^= (int) valueCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (valueCase_ == ValueOneofCase.StringValue) { + output.WriteRawTag(10); + output.WriteString(StringValue); + } + if (valueCase_ == ValueOneofCase.NullValue) { + output.WriteRawTag(16); + output.WriteEnum((int) NullValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (valueCase_ == ValueOneofCase.StringValue) { + output.WriteRawTag(10); + output.WriteString(StringValue); + } + if (valueCase_ == ValueOneofCase.NullValue) { + output.WriteRawTag(16); + output.WriteEnum((int) NullValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (valueCase_ == ValueOneofCase.StringValue) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(StringValue); + } + if (valueCase_ == ValueOneofCase.NullValue) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) NullValue); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NullValueOutsideStruct other) { + if (other == null) { + return; + } + switch (other.ValueCase) { + case ValueOneofCase.StringValue: + StringValue = other.StringValue; + break; + case ValueOneofCase.NullValue: + NullValue = other.NullValue; + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + StringValue = input.ReadString(); + break; + } + case 16: { + value_ = input.ReadEnum(); + valueCase_ = ValueOneofCase.NullValue; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + StringValue = input.ReadString(); + break; + } + case 16: { + value_ = input.ReadEnum(); + valueCase_ = ValueOneofCase.NullValue; + break; + } + } + } + } + #endif + + } + + public sealed partial class NullValueNotInOneof : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NullValueNotInOneof()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NullValueNotInOneof() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NullValueNotInOneof(NullValueNotInOneof other) : this() { + nullValue_ = other.nullValue_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NullValueNotInOneof Clone() { + return new NullValueNotInOneof(this); + } + + /// Field number for the "null_value" field. + public const int NullValueFieldNumber = 2; + private global::Google.Protobuf.WellKnownTypes.NullValue nullValue_ = global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { + get { return nullValue_; } + set { + nullValue_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NullValueNotInOneof); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NullValueNotInOneof other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NullValue != other.NullValue) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) hash ^= NullValue.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { + output.WriteRawTag(16); + output.WriteEnum((int) NullValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { + output.WriteRawTag(16); + output.WriteEnum((int) NullValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) NullValue); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NullValueNotInOneof other) { + if (other == null) { + return; + } + if (other.NullValue != global::Google.Protobuf.WellKnownTypes.NullValue.NullValue) { + NullValue = other.NullValue; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 16: { + NullValue = (global::Google.Protobuf.WellKnownTypes.NullValue) input.ReadEnum(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 16: { + NullValue = (global::Google.Protobuf.WellKnownTypes.NullValue) input.ReadEnum(); + break; + } + } + } + } + #endif + + } + + public sealed partial class MixedRegularAndOptional : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MixedRegularAndOptional()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::UnitTest.Issues.TestProtos.UnittestIssuesReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixedRegularAndOptional() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixedRegularAndOptional(MixedRegularAndOptional other) : this() { + regularField_ = other.regularField_; + optionalField_ = other.optionalField_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public MixedRegularAndOptional Clone() { + return new MixedRegularAndOptional(this); + } + + /// Field number for the "regular_field" field. + public const int RegularFieldFieldNumber = 1; + private string regularField_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string RegularField { + get { return regularField_; } + set { + regularField_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "optional_field" field. + public const int OptionalFieldFieldNumber = 2; + private string optionalField_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string OptionalField { + get { return optionalField_ ?? ""; } + set { + optionalField_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "optional_field" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalField { + get { return optionalField_ != null; } + } + /// Clears the value of the "optional_field" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalField() { + optionalField_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as MixedRegularAndOptional); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(MixedRegularAndOptional other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RegularField != other.RegularField) return false; + if (OptionalField != other.OptionalField) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (RegularField.Length != 0) hash ^= RegularField.GetHashCode(); + if (HasOptionalField) hash ^= OptionalField.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (RegularField.Length != 0) { + output.WriteRawTag(10); + output.WriteString(RegularField); + } + if (HasOptionalField) { + output.WriteRawTag(18); + output.WriteString(OptionalField); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (RegularField.Length != 0) { + output.WriteRawTag(10); + output.WriteString(RegularField); + } + if (HasOptionalField) { + output.WriteRawTag(18); + output.WriteString(OptionalField); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (RegularField.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(RegularField); + } + if (HasOptionalField) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OptionalField); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(MixedRegularAndOptional other) { + if (other == null) { + return; + } + if (other.RegularField.Length != 0) { + RegularField = other.RegularField; + } + if (other.HasOptionalField) { + OptionalField = other.OptionalField; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + RegularField = input.ReadString(); + break; + } + case 18: { + OptionalField = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + RegularField = input.ReadString(); + break; + } + case 18: { + OptionalField = input.ReadString(); + break; + } + } + } + } + #endif + + } + #endregion } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs index 3f01e38bb9..1af0d9e3f6 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs @@ -254,23 +254,31 @@ namespace Google.Protobuf.TestProtos { /// This proto includes every type of field in both singular and repeated /// forms. /// - public sealed partial class TestAllTypes : pb::IMessage { + public sealed partial class TestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes() { OnConstruction(); } @@ -278,6 +286,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes(TestAllTypes other) : this() { singleInt32_ = other.singleInt32_; singleInt64_ = other.singleInt64_; @@ -342,6 +351,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestAllTypes Clone() { return new TestAllTypes(this); } @@ -353,6 +363,7 @@ namespace Google.Protobuf.TestProtos { /// Singular /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int SingleInt32 { get { return singleInt32_; } set { @@ -364,6 +375,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleInt64FieldNumber = 2; private long singleInt64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SingleInt64 { get { return singleInt64_; } set { @@ -375,6 +387,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleUint32FieldNumber = 3; private uint singleUint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint SingleUint32 { get { return singleUint32_; } set { @@ -386,6 +399,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleUint64FieldNumber = 4; private ulong singleUint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong SingleUint64 { get { return singleUint64_; } set { @@ -397,6 +411,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleSint32FieldNumber = 5; private int singleSint32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int SingleSint32 { get { return singleSint32_; } set { @@ -408,6 +423,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleSint64FieldNumber = 6; private long singleSint64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SingleSint64 { get { return singleSint64_; } set { @@ -419,6 +435,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleFixed32FieldNumber = 7; private uint singleFixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint SingleFixed32 { get { return singleFixed32_; } set { @@ -430,6 +447,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleFixed64FieldNumber = 8; private ulong singleFixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong SingleFixed64 { get { return singleFixed64_; } set { @@ -441,6 +459,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleSfixed32FieldNumber = 9; private int singleSfixed32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int SingleSfixed32 { get { return singleSfixed32_; } set { @@ -452,6 +471,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleSfixed64FieldNumber = 10; private long singleSfixed64_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SingleSfixed64 { get { return singleSfixed64_; } set { @@ -463,6 +483,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleFloatFieldNumber = 11; private float singleFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float SingleFloat { get { return singleFloat_; } set { @@ -474,6 +495,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleDoubleFieldNumber = 12; private double singleDouble_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double SingleDouble { get { return singleDouble_; } set { @@ -485,6 +507,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleBoolFieldNumber = 13; private bool singleBool_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool SingleBool { get { return singleBool_; } set { @@ -496,6 +519,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleStringFieldNumber = 14; private string singleString_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string SingleString { get { return singleString_; } set { @@ -507,6 +531,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleBytesFieldNumber = 15; private pb::ByteString singleBytes_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString SingleBytes { get { return singleBytes_; } set { @@ -518,6 +543,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedMessageFieldNumber = 18; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage singleNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage SingleNestedMessage { get { return singleNestedMessage_; } set { @@ -529,6 +555,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleForeignMessageFieldNumber = 19; private global::Google.Protobuf.TestProtos.ForeignMessage singleForeignMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ForeignMessage SingleForeignMessage { get { return singleForeignMessage_; } set { @@ -540,6 +567,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleImportMessageFieldNumber = 20; private global::Google.Protobuf.TestProtos.ImportMessage singleImportMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ImportMessage SingleImportMessage { get { return singleImportMessage_; } set { @@ -551,6 +579,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedEnumFieldNumber = 21; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum singleNestedEnum_ = global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum.Unspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum SingleNestedEnum { get { return singleNestedEnum_; } set { @@ -562,6 +591,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleForeignEnumFieldNumber = 22; private global::Google.Protobuf.TestProtos.ForeignEnum singleForeignEnum_ = global::Google.Protobuf.TestProtos.ForeignEnum.ForeignUnspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ForeignEnum SingleForeignEnum { get { return singleForeignEnum_; } set { @@ -573,6 +603,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleImportEnumFieldNumber = 23; private global::Google.Protobuf.TestProtos.ImportEnum singleImportEnum_ = global::Google.Protobuf.TestProtos.ImportEnum.Unspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ImportEnum SingleImportEnum { get { return singleImportEnum_; } set { @@ -587,6 +618,7 @@ namespace Google.Protobuf.TestProtos { /// Defined in unittest_import_public.proto /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.PublicImportMessage SinglePublicImportMessage { get { return singlePublicImportMessage_; } set { @@ -603,6 +635,7 @@ namespace Google.Protobuf.TestProtos { /// Repeated /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -613,6 +646,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt64(258); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -623,6 +657,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt32(266); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -633,6 +668,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt64(274); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -643,6 +679,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt32(282); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -653,6 +690,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt64(290); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -663,6 +701,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed32(298); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -673,6 +712,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed64(306); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -683,6 +723,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed32(314); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -693,6 +734,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed64(322); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -703,6 +745,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFloat(330); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -713,6 +756,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForDouble(338); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -723,6 +767,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForBool(346); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -733,6 +778,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -743,6 +789,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -753,6 +800,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(386, global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -763,6 +811,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(394, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -773,6 +822,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(402, global::Google.Protobuf.TestProtos.ImportMessage.Parser); private readonly pbc::RepeatedField repeatedImportMessage_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedImportMessage { get { return repeatedImportMessage_; } } @@ -783,6 +833,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) x); private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -793,6 +844,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } @@ -803,6 +855,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(426, x => (int) x, x => (global::Google.Protobuf.TestProtos.ImportEnum) x); private readonly pbc::RepeatedField repeatedImportEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedImportEnum { get { return repeatedImportEnum_; } } @@ -816,6 +869,7 @@ namespace Google.Protobuf.TestProtos { /// Defined in unittest_import_public.proto /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedPublicImportMessage { get { return repeatedPublicImportMessage_; } } @@ -823,6 +877,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint OneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } set { @@ -834,6 +889,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage) oneofField_ : null; } set { @@ -845,6 +901,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } set { @@ -856,6 +913,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString OneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -875,22 +933,26 @@ namespace Google.Protobuf.TestProtos { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -951,6 +1013,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (SingleInt32 != 0) hash ^= SingleInt32.GetHashCode(); @@ -1009,12 +1072,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (SingleInt32 != 0) { output.WriteRawTag(8); output.WriteInt32(SingleInt32); @@ -1144,9 +1212,147 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SingleInt32 != 0) { + output.WriteRawTag(8); + output.WriteInt32(SingleInt32); + } + if (SingleInt64 != 0L) { + output.WriteRawTag(16); + output.WriteInt64(SingleInt64); + } + if (SingleUint32 != 0) { + output.WriteRawTag(24); + output.WriteUInt32(SingleUint32); + } + if (SingleUint64 != 0UL) { + output.WriteRawTag(32); + output.WriteUInt64(SingleUint64); + } + if (SingleSint32 != 0) { + output.WriteRawTag(40); + output.WriteSInt32(SingleSint32); + } + if (SingleSint64 != 0L) { + output.WriteRawTag(48); + output.WriteSInt64(SingleSint64); + } + if (SingleFixed32 != 0) { + output.WriteRawTag(61); + output.WriteFixed32(SingleFixed32); + } + if (SingleFixed64 != 0UL) { + output.WriteRawTag(65); + output.WriteFixed64(SingleFixed64); + } + if (SingleSfixed32 != 0) { + output.WriteRawTag(77); + output.WriteSFixed32(SingleSfixed32); + } + if (SingleSfixed64 != 0L) { + output.WriteRawTag(81); + output.WriteSFixed64(SingleSfixed64); + } + if (SingleFloat != 0F) { + output.WriteRawTag(93); + output.WriteFloat(SingleFloat); + } + if (SingleDouble != 0D) { + output.WriteRawTag(97); + output.WriteDouble(SingleDouble); + } + if (SingleBool != false) { + output.WriteRawTag(104); + output.WriteBool(SingleBool); + } + if (SingleString.Length != 0) { + output.WriteRawTag(114); + output.WriteString(SingleString); + } + if (SingleBytes.Length != 0) { + output.WriteRawTag(122); + output.WriteBytes(SingleBytes); + } + if (singleNestedMessage_ != null) { + output.WriteRawTag(146, 1); + output.WriteMessage(SingleNestedMessage); + } + if (singleForeignMessage_ != null) { + output.WriteRawTag(154, 1); + output.WriteMessage(SingleForeignMessage); + } + if (singleImportMessage_ != null) { + output.WriteRawTag(162, 1); + output.WriteMessage(SingleImportMessage); + } + if (SingleNestedEnum != global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum.Unspecified) { + output.WriteRawTag(168, 1); + output.WriteEnum((int) SingleNestedEnum); + } + if (SingleForeignEnum != global::Google.Protobuf.TestProtos.ForeignEnum.ForeignUnspecified) { + output.WriteRawTag(176, 1); + output.WriteEnum((int) SingleForeignEnum); + } + if (SingleImportEnum != global::Google.Protobuf.TestProtos.ImportEnum.Unspecified) { + output.WriteRawTag(184, 1); + output.WriteEnum((int) SingleImportEnum); + } + if (singlePublicImportMessage_ != null) { + output.WriteRawTag(210, 1); + output.WriteMessage(SinglePublicImportMessage); + } + repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); + repeatedInt64_.WriteTo(ref output, _repeated_repeatedInt64_codec); + repeatedUint32_.WriteTo(ref output, _repeated_repeatedUint32_codec); + repeatedUint64_.WriteTo(ref output, _repeated_repeatedUint64_codec); + repeatedSint32_.WriteTo(ref output, _repeated_repeatedSint32_codec); + repeatedSint64_.WriteTo(ref output, _repeated_repeatedSint64_codec); + repeatedFixed32_.WriteTo(ref output, _repeated_repeatedFixed32_codec); + repeatedFixed64_.WriteTo(ref output, _repeated_repeatedFixed64_codec); + repeatedSfixed32_.WriteTo(ref output, _repeated_repeatedSfixed32_codec); + repeatedSfixed64_.WriteTo(ref output, _repeated_repeatedSfixed64_codec); + repeatedFloat_.WriteTo(ref output, _repeated_repeatedFloat_codec); + repeatedDouble_.WriteTo(ref output, _repeated_repeatedDouble_codec); + repeatedBool_.WriteTo(ref output, _repeated_repeatedBool_codec); + repeatedString_.WriteTo(ref output, _repeated_repeatedString_codec); + repeatedBytes_.WriteTo(ref output, _repeated_repeatedBytes_codec); + repeatedNestedMessage_.WriteTo(ref output, _repeated_repeatedNestedMessage_codec); + repeatedForeignMessage_.WriteTo(ref output, _repeated_repeatedForeignMessage_codec); + repeatedImportMessage_.WriteTo(ref output, _repeated_repeatedImportMessage_codec); + repeatedNestedEnum_.WriteTo(ref output, _repeated_repeatedNestedEnum_codec); + repeatedForeignEnum_.WriteTo(ref output, _repeated_repeatedForeignEnum_codec); + repeatedImportEnum_.WriteTo(ref output, _repeated_repeatedImportEnum_codec); + repeatedPublicImportMessage_.WriteTo(ref output, _repeated_repeatedPublicImportMessage_codec); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { + output.WriteRawTag(248, 6); + output.WriteUInt32(OneofUint32); + } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + output.WriteRawTag(130, 7); + output.WriteMessage(OneofNestedMessage); + } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofString) { + output.WriteRawTag(138, 7); + output.WriteString(OneofString); + } + if (oneofFieldCase_ == OneofFieldOneofCase.OneofBytes) { + output.WriteRawTag(146, 7); + output.WriteBytes(OneofBytes); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (SingleInt32 != 0) { @@ -1256,6 +1462,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestAllTypes other) { if (other == null) { return; @@ -1382,7 +1589,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1616,11 +1827,253 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + SingleInt32 = input.ReadInt32(); + break; + } + case 16: { + SingleInt64 = input.ReadInt64(); + break; + } + case 24: { + SingleUint32 = input.ReadUInt32(); + break; + } + case 32: { + SingleUint64 = input.ReadUInt64(); + break; + } + case 40: { + SingleSint32 = input.ReadSInt32(); + break; + } + case 48: { + SingleSint64 = input.ReadSInt64(); + break; + } + case 61: { + SingleFixed32 = input.ReadFixed32(); + break; + } + case 65: { + SingleFixed64 = input.ReadFixed64(); + break; + } + case 77: { + SingleSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + SingleSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + SingleFloat = input.ReadFloat(); + break; + } + case 97: { + SingleDouble = input.ReadDouble(); + break; + } + case 104: { + SingleBool = input.ReadBool(); + break; + } + case 114: { + SingleString = input.ReadString(); + break; + } + case 122: { + SingleBytes = input.ReadBytes(); + break; + } + case 146: { + if (singleNestedMessage_ == null) { + SingleNestedMessage = new global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(SingleNestedMessage); + break; + } + case 154: { + if (singleForeignMessage_ == null) { + SingleForeignMessage = new global::Google.Protobuf.TestProtos.ForeignMessage(); + } + input.ReadMessage(SingleForeignMessage); + break; + } + case 162: { + if (singleImportMessage_ == null) { + SingleImportMessage = new global::Google.Protobuf.TestProtos.ImportMessage(); + } + input.ReadMessage(SingleImportMessage); + break; + } + case 168: { + SingleNestedEnum = (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + SingleForeignEnum = (global::Google.Protobuf.TestProtos.ForeignEnum) input.ReadEnum(); + break; + } + case 184: { + SingleImportEnum = (global::Google.Protobuf.TestProtos.ImportEnum) input.ReadEnum(); + break; + } + case 210: { + if (singlePublicImportMessage_ == null) { + SinglePublicImportMessage = new global::Google.Protobuf.TestProtos.PublicImportMessage(); + } + input.ReadMessage(SinglePublicImportMessage); + break; + } + case 250: + case 248: { + repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec); + break; + } + case 258: + case 256: { + repeatedInt64_.AddEntriesFrom(ref input, _repeated_repeatedInt64_codec); + break; + } + case 266: + case 264: { + repeatedUint32_.AddEntriesFrom(ref input, _repeated_repeatedUint32_codec); + break; + } + case 274: + case 272: { + repeatedUint64_.AddEntriesFrom(ref input, _repeated_repeatedUint64_codec); + break; + } + case 282: + case 280: { + repeatedSint32_.AddEntriesFrom(ref input, _repeated_repeatedSint32_codec); + break; + } + case 290: + case 288: { + repeatedSint64_.AddEntriesFrom(ref input, _repeated_repeatedSint64_codec); + break; + } + case 298: + case 301: { + repeatedFixed32_.AddEntriesFrom(ref input, _repeated_repeatedFixed32_codec); + break; + } + case 306: + case 305: { + repeatedFixed64_.AddEntriesFrom(ref input, _repeated_repeatedFixed64_codec); + break; + } + case 314: + case 317: { + repeatedSfixed32_.AddEntriesFrom(ref input, _repeated_repeatedSfixed32_codec); + break; + } + case 322: + case 321: { + repeatedSfixed64_.AddEntriesFrom(ref input, _repeated_repeatedSfixed64_codec); + break; + } + case 330: + case 333: { + repeatedFloat_.AddEntriesFrom(ref input, _repeated_repeatedFloat_codec); + break; + } + case 338: + case 337: { + repeatedDouble_.AddEntriesFrom(ref input, _repeated_repeatedDouble_codec); + break; + } + case 346: + case 344: { + repeatedBool_.AddEntriesFrom(ref input, _repeated_repeatedBool_codec); + break; + } + case 354: { + repeatedString_.AddEntriesFrom(ref input, _repeated_repeatedString_codec); + break; + } + case 362: { + repeatedBytes_.AddEntriesFrom(ref input, _repeated_repeatedBytes_codec); + break; + } + case 386: { + repeatedNestedMessage_.AddEntriesFrom(ref input, _repeated_repeatedNestedMessage_codec); + break; + } + case 394: { + repeatedForeignMessage_.AddEntriesFrom(ref input, _repeated_repeatedForeignMessage_codec); + break; + } + case 402: { + repeatedImportMessage_.AddEntriesFrom(ref input, _repeated_repeatedImportMessage_codec); + break; + } + case 410: + case 408: { + repeatedNestedEnum_.AddEntriesFrom(ref input, _repeated_repeatedNestedEnum_codec); + break; + } + case 418: + case 416: { + repeatedForeignEnum_.AddEntriesFrom(ref input, _repeated_repeatedForeignEnum_codec); + break; + } + case 426: + case 424: { + repeatedImportEnum_.AddEntriesFrom(ref input, _repeated_repeatedImportEnum_codec); + break; + } + case 434: { + repeatedPublicImportMessage_.AddEntriesFrom(ref input, _repeated_repeatedPublicImportMessage_codec); + break; + } + case 888: { + OneofUint32 = input.ReadUInt32(); + break; + } + case 898: { + global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage(); + if (oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage) { + subBuilder.MergeFrom(OneofNestedMessage); + } + input.ReadMessage(subBuilder); + OneofNestedMessage = subBuilder; + break; + } + case 906: { + OneofString = input.ReadString(); + break; + } + case 914: { + OneofBytes = input.ReadBytes(); + break; + } + } + } + } + #endif + #region Nested types /// Container for nested types declared in the TestAllTypes message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum NestedEnum { [pbr::OriginalName("NESTED_ENUM_UNSPECIFIED")] Unspecified = 0, @@ -1633,23 +2086,31 @@ namespace Google.Protobuf.TestProtos { [pbr::OriginalName("NEG")] Neg = -1, } - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.TestAllTypes.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -1657,12 +2118,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { bb_ = other.bb_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -1676,6 +2139,7 @@ namespace Google.Protobuf.TestProtos { /// This file needs to compile in proto1 to test backwards-compatibility. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { return bb_; } set { @@ -1684,11 +2148,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -1701,6 +2167,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Bb != 0) hash ^= Bb.GetHashCode(); @@ -1711,12 +2178,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Bb != 0) { output.WriteRawTag(8); output.WriteInt32(Bb); @@ -1724,9 +2196,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Bb != 0) { + output.WriteRawTag(8); + output.WriteInt32(Bb); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Bb != 0) { @@ -1739,6 +2227,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -1750,7 +2239,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1763,8 +2256,28 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + } + } + } + #endif + } } @@ -1775,23 +2288,31 @@ namespace Google.Protobuf.TestProtos { /// /// This proto includes a recursively nested message. /// - public sealed partial class NestedTestAllTypes : pb::IMessage { + public sealed partial class NestedTestAllTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTestAllTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes() { OnConstruction(); } @@ -1799,6 +2320,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes(NestedTestAllTypes other) : this() { child_ = other.child_ != null ? other.child_.Clone() : null; payload_ = other.payload_ != null ? other.payload_.Clone() : null; @@ -1807,6 +2329,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedTestAllTypes Clone() { return new NestedTestAllTypes(this); } @@ -1815,6 +2338,7 @@ namespace Google.Protobuf.TestProtos { public const int ChildFieldNumber = 1; private global::Google.Protobuf.TestProtos.NestedTestAllTypes child_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.NestedTestAllTypes Child { get { return child_; } set { @@ -1826,6 +2350,7 @@ namespace Google.Protobuf.TestProtos { public const int PayloadFieldNumber = 2; private global::Google.Protobuf.TestProtos.TestAllTypes payload_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes Payload { get { return payload_; } set { @@ -1839,16 +2364,19 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.NestedTestAllTypes.Parser); private readonly pbc::RepeatedField repeatedChild_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedChild { get { return repeatedChild_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedTestAllTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedTestAllTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -1863,6 +2391,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (child_ != null) hash ^= Child.GetHashCode(); @@ -1875,12 +2404,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (child_ != null) { output.WriteRawTag(10); output.WriteMessage(Child); @@ -1893,9 +2427,30 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (child_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Child); + } + if (payload_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Payload); + } + repeatedChild_.WriteTo(ref output, _repeated_repeatedChild_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (child_ != null) { @@ -1912,6 +2467,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedTestAllTypes other) { if (other == null) { return; @@ -1933,7 +2489,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1960,27 +2520,69 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (child_ == null) { + Child = new global::Google.Protobuf.TestProtos.NestedTestAllTypes(); + } + input.ReadMessage(Child); + break; + } + case 18: { + if (payload_ == null) { + Payload = new global::Google.Protobuf.TestProtos.TestAllTypes(); + } + input.ReadMessage(Payload); + break; + } + case 26: { + repeatedChild_.AddEntriesFrom(ref input, _repeated_repeatedChild_codec); + break; + } + } + } } + #endif } - public sealed partial class TestDeprecatedFields : pb::IMessage { + public sealed partial class TestDeprecatedFields : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedFields()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields() { OnConstruction(); } @@ -1988,12 +2590,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields(TestDeprecatedFields other) : this() { deprecatedInt32_ = other.deprecatedInt32_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestDeprecatedFields Clone() { return new TestDeprecatedFields(this); } @@ -2003,6 +2607,7 @@ namespace Google.Protobuf.TestProtos { private int deprecatedInt32_; [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DeprecatedInt32 { get { return deprecatedInt32_; } set { @@ -2011,11 +2616,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestDeprecatedFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestDeprecatedFields other) { if (ReferenceEquals(other, null)) { return false; @@ -2028,6 +2635,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (DeprecatedInt32 != 0) hash ^= DeprecatedInt32.GetHashCode(); @@ -2038,12 +2646,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (DeprecatedInt32 != 0) { output.WriteRawTag(8); output.WriteInt32(DeprecatedInt32); @@ -2051,9 +2664,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (DeprecatedInt32 != 0) { + output.WriteRawTag(8); + output.WriteInt32(DeprecatedInt32); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (DeprecatedInt32 != 0) { @@ -2066,6 +2695,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestDeprecatedFields other) { if (other == null) { return; @@ -2077,7 +2707,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2090,7 +2724,27 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + DeprecatedInt32 = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -2098,23 +2752,31 @@ namespace Google.Protobuf.TestProtos { /// Define these after TestAllTypes to make sure the compiler can handle /// that. /// - public sealed partial class ForeignMessage : pb::IMessage { + public sealed partial class ForeignMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage() { OnConstruction(); } @@ -2122,12 +2784,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage(ForeignMessage other) : this() { c_ = other.c_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ForeignMessage Clone() { return new ForeignMessage(this); } @@ -2136,6 +2800,7 @@ namespace Google.Protobuf.TestProtos { public const int CFieldNumber = 1; private int c_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int C { get { return c_; } set { @@ -2144,11 +2809,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ForeignMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ForeignMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -2161,6 +2828,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (C != 0) hash ^= C.GetHashCode(); @@ -2171,12 +2839,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (C != 0) { output.WriteRawTag(8); output.WriteInt32(C); @@ -2184,9 +2857,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (C != 0) { + output.WriteRawTag(8); + output.WriteInt32(C); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (C != 0) { @@ -2199,6 +2888,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ForeignMessage other) { if (other == null) { return; @@ -2210,12 +2900,35 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + C = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { C = input.ReadInt32(); @@ -2224,26 +2937,35 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class TestReservedFields : pb::IMessage { + public sealed partial class TestReservedFields : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReservedFields()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields() { OnConstruction(); } @@ -2251,21 +2973,25 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields(TestReservedFields other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReservedFields Clone() { return new TestReservedFields(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestReservedFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestReservedFields other) { if (ReferenceEquals(other, null)) { return false; @@ -2277,6 +3003,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -2286,18 +3013,35 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -2307,6 +3051,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestReservedFields other) { if (other == null) { return; @@ -2315,7 +3060,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2324,30 +3073,54 @@ namespace Google.Protobuf.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } /// /// Test that we can use NestedMessage from outside TestAllTypes. /// - public sealed partial class TestForeignNested : pb::IMessage { + public sealed partial class TestForeignNested : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestForeignNested()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested() { OnConstruction(); } @@ -2355,12 +3128,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested(TestForeignNested other) : this() { foreignNested_ = other.foreignNested_ != null ? other.foreignNested_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestForeignNested Clone() { return new TestForeignNested(this); } @@ -2369,6 +3144,7 @@ namespace Google.Protobuf.TestProtos { public const int ForeignNestedFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { get { return foreignNested_; } set { @@ -2377,11 +3153,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestForeignNested); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestForeignNested other) { if (ReferenceEquals(other, null)) { return false; @@ -2394,6 +3172,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (foreignNested_ != null) hash ^= ForeignNested.GetHashCode(); @@ -2404,12 +3183,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (foreignNested_ != null) { output.WriteRawTag(10); output.WriteMessage(ForeignNested); @@ -2417,9 +3201,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (foreignNested_ != null) { + output.WriteRawTag(10); + output.WriteMessage(ForeignNested); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (foreignNested_ != null) { @@ -2432,6 +3232,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestForeignNested other) { if (other == null) { return; @@ -2446,7 +3247,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2462,30 +3267,61 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (foreignNested_ == null) { + ForeignNested = new global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage(); + } + input.ReadMessage(ForeignNested); + break; + } + } + } } + #endif } /// /// Test that really large tag numbers don't break anything. /// - public sealed partial class TestReallyLargeTagNumber : pb::IMessage { + public sealed partial class TestReallyLargeTagNumber : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReallyLargeTagNumber()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber() { OnConstruction(); } @@ -2493,6 +3329,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber(TestReallyLargeTagNumber other) : this() { a_ = other.a_; bb_ = other.bb_; @@ -2500,6 +3337,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestReallyLargeTagNumber Clone() { return new TestReallyLargeTagNumber(this); } @@ -2512,6 +3350,7 @@ namespace Google.Protobuf.TestProtos { /// three bits to communicate wire type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int A { get { return a_; } set { @@ -2523,6 +3362,7 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 268435455; private int bb_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { return bb_; } set { @@ -2531,11 +3371,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestReallyLargeTagNumber); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestReallyLargeTagNumber other) { if (ReferenceEquals(other, null)) { return false; @@ -2549,6 +3391,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (A != 0) hash ^= A.GetHashCode(); @@ -2560,12 +3403,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (A != 0) { output.WriteRawTag(8); output.WriteInt32(A); @@ -2577,9 +3425,29 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (A != 0) { + output.WriteRawTag(8); + output.WriteInt32(A); + } + if (Bb != 0) { + output.WriteRawTag(248, 255, 255, 255, 7); + output.WriteInt32(Bb); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (A != 0) { @@ -2595,6 +3463,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestReallyLargeTagNumber other) { if (other == null) { return; @@ -2609,7 +3478,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2626,27 +3499,59 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + A = input.ReadInt32(); + break; + } + case 2147483640: { + Bb = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class TestRecursiveMessage : pb::IMessage { + public sealed partial class TestRecursiveMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRecursiveMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage() { OnConstruction(); } @@ -2654,6 +3559,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage(TestRecursiveMessage other) : this() { a_ = other.a_ != null ? other.a_.Clone() : null; i_ = other.i_; @@ -2661,6 +3567,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRecursiveMessage Clone() { return new TestRecursiveMessage(this); } @@ -2669,6 +3576,7 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestRecursiveMessage a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestRecursiveMessage A { get { return a_; } set { @@ -2680,6 +3588,7 @@ namespace Google.Protobuf.TestProtos { public const int IFieldNumber = 2; private int i_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int I { get { return i_; } set { @@ -2688,11 +3597,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRecursiveMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRecursiveMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -2706,6 +3617,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (a_ != null) hash ^= A.GetHashCode(); @@ -2717,12 +3629,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (a_ != null) { output.WriteRawTag(10); output.WriteMessage(A); @@ -2734,9 +3651,29 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (a_ != null) { + output.WriteRawTag(10); + output.WriteMessage(A); + } + if (I != 0) { + output.WriteRawTag(16); + output.WriteInt32(I); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (a_ != null) { @@ -2752,6 +3689,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRecursiveMessage other) { if (other == null) { return; @@ -2769,7 +3707,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2789,30 +3731,65 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (a_ == null) { + A = new global::Google.Protobuf.TestProtos.TestRecursiveMessage(); + } + input.ReadMessage(A); + break; + } + case 16: { + I = input.ReadInt32(); + break; + } + } + } } + #endif } /// /// Test that mutual recursion works. /// - public sealed partial class TestMutualRecursionA : pb::IMessage { + public sealed partial class TestMutualRecursionA : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionA()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA() { OnConstruction(); } @@ -2820,12 +3797,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA(TestMutualRecursionA other) : this() { bb_ = other.bb_ != null ? other.bb_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionA Clone() { return new TestMutualRecursionA(this); } @@ -2834,6 +3813,7 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionB bb_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestMutualRecursionB Bb { get { return bb_; } set { @@ -2842,11 +3822,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMutualRecursionA); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMutualRecursionA other) { if (ReferenceEquals(other, null)) { return false; @@ -2859,6 +3841,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (bb_ != null) hash ^= Bb.GetHashCode(); @@ -2869,12 +3852,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (bb_ != null) { output.WriteRawTag(10); output.WriteMessage(Bb); @@ -2882,9 +3870,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (bb_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Bb); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (bb_ != null) { @@ -2897,6 +3901,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMutualRecursionA other) { if (other == null) { return; @@ -2911,7 +3916,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2927,27 +3936,58 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (bb_ == null) { + Bb = new global::Google.Protobuf.TestProtos.TestMutualRecursionB(); + } + input.ReadMessage(Bb); + break; + } + } + } } + #endif } - public sealed partial class TestMutualRecursionB : pb::IMessage { + public sealed partial class TestMutualRecursionB : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionB()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB() { OnConstruction(); } @@ -2955,6 +3995,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB(TestMutualRecursionB other) : this() { a_ = other.a_ != null ? other.a_.Clone() : null; optionalInt32_ = other.optionalInt32_; @@ -2962,6 +4003,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestMutualRecursionB Clone() { return new TestMutualRecursionB(this); } @@ -2970,6 +4012,7 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionA a_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestMutualRecursionA A { get { return a_; } set { @@ -2981,6 +4024,7 @@ namespace Google.Protobuf.TestProtos { public const int OptionalInt32FieldNumber = 2; private int optionalInt32_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OptionalInt32 { get { return optionalInt32_; } set { @@ -2989,11 +4033,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestMutualRecursionB); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestMutualRecursionB other) { if (ReferenceEquals(other, null)) { return false; @@ -3007,6 +4053,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (a_ != null) hash ^= A.GetHashCode(); @@ -3018,12 +4065,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (a_ != null) { output.WriteRawTag(10); output.WriteMessage(A); @@ -3035,9 +4087,29 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (a_ != null) { + output.WriteRawTag(10); + output.WriteMessage(A); + } + if (OptionalInt32 != 0) { + output.WriteRawTag(16); + output.WriteInt32(OptionalInt32); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (a_ != null) { @@ -3053,6 +4125,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestMutualRecursionB other) { if (other == null) { return; @@ -3070,7 +4143,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3090,27 +4167,62 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (a_ == null) { + A = new global::Google.Protobuf.TestProtos.TestMutualRecursionA(); + } + input.ReadMessage(A); + break; + } + case 16: { + OptionalInt32 = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class TestEnumAllowAlias : pb::IMessage { + public sealed partial class TestEnumAllowAlias : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEnumAllowAlias()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEnumAllowAlias() { OnConstruction(); } @@ -3118,12 +4230,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEnumAllowAlias(TestEnumAllowAlias other) : this() { value_ = other.value_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEnumAllowAlias Clone() { return new TestEnumAllowAlias(this); } @@ -3132,6 +4246,7 @@ namespace Google.Protobuf.TestProtos { public const int ValueFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestEnumWithDupValue value_ = global::Google.Protobuf.TestProtos.TestEnumWithDupValue.Unspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestEnumWithDupValue Value { get { return value_; } set { @@ -3140,11 +4255,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEnumAllowAlias); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEnumAllowAlias other) { if (ReferenceEquals(other, null)) { return false; @@ -3157,6 +4274,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Value != global::Google.Protobuf.TestProtos.TestEnumWithDupValue.Unspecified) hash ^= Value.GetHashCode(); @@ -3167,12 +4285,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Value != global::Google.Protobuf.TestProtos.TestEnumWithDupValue.Unspecified) { output.WriteRawTag(8); output.WriteEnum((int) Value); @@ -3180,9 +4303,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Value != global::Google.Protobuf.TestProtos.TestEnumWithDupValue.Unspecified) { + output.WriteRawTag(8); + output.WriteEnum((int) Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Value != global::Google.Protobuf.TestProtos.TestEnumWithDupValue.Unspecified) { @@ -3195,6 +4334,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEnumAllowAlias other) { if (other == null) { return; @@ -3206,7 +4346,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3219,7 +4363,27 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Value = (global::Google.Protobuf.TestProtos.TestEnumWithDupValue) input.ReadEnum(); + break; + } + } + } } + #endif } @@ -3227,23 +4391,31 @@ namespace Google.Protobuf.TestProtos { /// Test message with CamelCase field names. This violates Protocol Buffer /// standard style. /// - public sealed partial class TestCamelCaseFieldNames : pb::IMessage { + public sealed partial class TestCamelCaseFieldNames : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCamelCaseFieldNames()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames() { OnConstruction(); } @@ -3251,6 +4423,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames(TestCamelCaseFieldNames other) : this() { primitiveField_ = other.primitiveField_; stringField_ = other.stringField_; @@ -3264,6 +4437,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCamelCaseFieldNames Clone() { return new TestCamelCaseFieldNames(this); } @@ -3272,6 +4446,7 @@ namespace Google.Protobuf.TestProtos { public const int PrimitiveFieldFieldNumber = 1; private int primitiveField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int PrimitiveField { get { return primitiveField_; } set { @@ -3283,6 +4458,7 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 2; private string stringField_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField { get { return stringField_; } set { @@ -3294,6 +4470,7 @@ namespace Google.Protobuf.TestProtos { public const int EnumFieldFieldNumber = 3; private global::Google.Protobuf.TestProtos.ForeignEnum enumField_ = global::Google.Protobuf.TestProtos.ForeignEnum.ForeignUnspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ForeignEnum EnumField { get { return enumField_; } set { @@ -3305,6 +4482,7 @@ namespace Google.Protobuf.TestProtos { public const int MessageFieldFieldNumber = 4; private global::Google.Protobuf.TestProtos.ForeignMessage messageField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.ForeignMessage MessageField { get { return messageField_; } set { @@ -3318,6 +4496,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt32(58); private readonly pbc::RepeatedField repeatedPrimitiveField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedPrimitiveField { get { return repeatedPrimitiveField_; } } @@ -3328,6 +4507,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForString(66); private readonly pbc::RepeatedField repeatedStringField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedStringField { get { return repeatedStringField_; } } @@ -3338,6 +4518,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(74, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField repeatedEnumField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedEnumField { get { return repeatedEnumField_; } } @@ -3348,16 +4529,19 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(82, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedMessageField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedMessageField { get { return repeatedMessageField_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestCamelCaseFieldNames); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestCamelCaseFieldNames other) { if (ReferenceEquals(other, null)) { return false; @@ -3377,6 +4561,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (PrimitiveField != 0) hash ^= PrimitiveField.GetHashCode(); @@ -3394,12 +4579,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (PrimitiveField != 0) { output.WriteRawTag(8); output.WriteInt32(PrimitiveField); @@ -3423,9 +4613,41 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (PrimitiveField != 0) { + output.WriteRawTag(8); + output.WriteInt32(PrimitiveField); + } + if (StringField.Length != 0) { + output.WriteRawTag(18); + output.WriteString(StringField); + } + if (EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.ForeignUnspecified) { + output.WriteRawTag(24); + output.WriteEnum((int) EnumField); + } + if (messageField_ != null) { + output.WriteRawTag(34); + output.WriteMessage(MessageField); + } + repeatedPrimitiveField_.WriteTo(ref output, _repeated_repeatedPrimitiveField_codec); + repeatedStringField_.WriteTo(ref output, _repeated_repeatedStringField_codec); + repeatedEnumField_.WriteTo(ref output, _repeated_repeatedEnumField_codec); + repeatedMessageField_.WriteTo(ref output, _repeated_repeatedMessageField_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (PrimitiveField != 0) { @@ -3451,6 +4673,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestCamelCaseFieldNames other) { if (other == null) { return; @@ -3478,7 +4701,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3519,12 +4746,65 @@ namespace Google.Protobuf.TestProtos { break; } case 82: { - repeatedMessageField_.AddEntriesFrom(input, _repeated_repeatedMessageField_codec); + repeatedMessageField_.AddEntriesFrom(input, _repeated_repeatedMessageField_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + PrimitiveField = input.ReadInt32(); + break; + } + case 18: { + StringField = input.ReadString(); + break; + } + case 24: { + EnumField = (global::Google.Protobuf.TestProtos.ForeignEnum) input.ReadEnum(); + break; + } + case 34: { + if (messageField_ == null) { + MessageField = new global::Google.Protobuf.TestProtos.ForeignMessage(); + } + input.ReadMessage(MessageField); + break; + } + case 58: + case 56: { + repeatedPrimitiveField_.AddEntriesFrom(ref input, _repeated_repeatedPrimitiveField_codec); + break; + } + case 66: { + repeatedStringField_.AddEntriesFrom(ref input, _repeated_repeatedStringField_codec); + break; + } + case 74: + case 72: { + repeatedEnumField_.AddEntriesFrom(ref input, _repeated_repeatedEnumField_codec); + break; + } + case 82: { + repeatedMessageField_.AddEntriesFrom(ref input, _repeated_repeatedMessageField_codec); break; } } } } + #endif } @@ -3532,23 +4812,31 @@ namespace Google.Protobuf.TestProtos { /// We list fields out of order, to ensure that we're using field number and not /// field index to determine serialization order. /// - public sealed partial class TestFieldOrderings : pb::IMessage { + public sealed partial class TestFieldOrderings : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestFieldOrderings()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings() { OnConstruction(); } @@ -3556,6 +4844,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings(TestFieldOrderings other) : this() { myString_ = other.myString_; myInt_ = other.myInt_; @@ -3565,6 +4854,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestFieldOrderings Clone() { return new TestFieldOrderings(this); } @@ -3573,6 +4863,7 @@ namespace Google.Protobuf.TestProtos { public const int MyStringFieldNumber = 11; private string myString_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string MyString { get { return myString_; } set { @@ -3584,6 +4875,7 @@ namespace Google.Protobuf.TestProtos { public const int MyIntFieldNumber = 1; private long myInt_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long MyInt { get { return myInt_; } set { @@ -3595,6 +4887,7 @@ namespace Google.Protobuf.TestProtos { public const int MyFloatFieldNumber = 101; private float myFloat_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float MyFloat { get { return myFloat_; } set { @@ -3606,6 +4899,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedMessageFieldNumber = 200; private global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage singleNestedMessage_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage SingleNestedMessage { get { return singleNestedMessage_; } set { @@ -3614,11 +4908,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestFieldOrderings); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestFieldOrderings other) { if (ReferenceEquals(other, null)) { return false; @@ -3634,6 +4930,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (MyString.Length != 0) hash ^= MyString.GetHashCode(); @@ -3647,12 +4944,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (MyInt != 0L) { output.WriteRawTag(8); output.WriteInt64(MyInt); @@ -3672,9 +4974,37 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (MyInt != 0L) { + output.WriteRawTag(8); + output.WriteInt64(MyInt); + } + if (MyString.Length != 0) { + output.WriteRawTag(90); + output.WriteString(MyString); + } + if (MyFloat != 0F) { + output.WriteRawTag(173, 6); + output.WriteFloat(MyFloat); + } + if (singleNestedMessage_ != null) { + output.WriteRawTag(194, 12); + output.WriteMessage(SingleNestedMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (MyString.Length != 0) { @@ -3696,6 +5026,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestFieldOrderings other) { if (other == null) { return; @@ -3719,7 +5050,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3747,29 +5082,73 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + MyInt = input.ReadInt64(); + break; + } + case 90: { + MyString = input.ReadString(); + break; + } + case 813: { + MyFloat = input.ReadFloat(); + break; + } + case 1602: { + if (singleNestedMessage_ == null) { + SingleNestedMessage = new global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage(); + } + input.ReadMessage(SingleNestedMessage); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the TestFieldOrderings message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class NestedMessage : pb::IMessage { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.TestFieldOrderings.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage() { OnConstruction(); } @@ -3777,6 +5156,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage(NestedMessage other) : this() { oo_ = other.oo_; bb_ = other.bb_; @@ -3784,6 +5164,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedMessage Clone() { return new NestedMessage(this); } @@ -3792,6 +5173,7 @@ namespace Google.Protobuf.TestProtos { public const int OoFieldNumber = 2; private long oo_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Oo { get { return oo_; } set { @@ -3808,6 +5190,7 @@ namespace Google.Protobuf.TestProtos { /// This file needs to compile in proto1 to test backwards-compatibility. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Bb { get { return bb_; } set { @@ -3816,11 +5199,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -3834,6 +5219,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Oo != 0L) hash ^= Oo.GetHashCode(); @@ -3845,12 +5231,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Bb != 0) { output.WriteRawTag(8); output.WriteInt32(Bb); @@ -3862,9 +5253,29 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Bb != 0) { + output.WriteRawTag(8); + output.WriteInt32(Bb); + } + if (Oo != 0L) { + output.WriteRawTag(16); + output.WriteInt64(Oo); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Oo != 0L) { @@ -3880,6 +5291,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedMessage other) { if (other == null) { return; @@ -3894,7 +5306,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3911,8 +5327,32 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + case 16: { + Oo = input.ReadInt64(); + break; + } + } + } + } + #endif + } } @@ -3920,23 +5360,31 @@ namespace Google.Protobuf.TestProtos { } - public sealed partial class SparseEnumMessage : pb::IMessage { + public sealed partial class SparseEnumMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseEnumMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage() { OnConstruction(); } @@ -3944,12 +5392,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage(SparseEnumMessage other) : this() { sparseEnum_ = other.sparseEnum_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseEnumMessage Clone() { return new SparseEnumMessage(this); } @@ -3958,6 +5408,7 @@ namespace Google.Protobuf.TestProtos { public const int SparseEnumFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestSparseEnum sparseEnum_ = global::Google.Protobuf.TestProtos.TestSparseEnum.Unspecified; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestSparseEnum SparseEnum { get { return sparseEnum_; } set { @@ -3966,11 +5417,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SparseEnumMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SparseEnumMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -3983,6 +5436,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.Unspecified) hash ^= SparseEnum.GetHashCode(); @@ -3993,12 +5447,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.Unspecified) { output.WriteRawTag(8); output.WriteEnum((int) SparseEnum); @@ -4006,9 +5465,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.Unspecified) { + output.WriteRawTag(8); + output.WriteEnum((int) SparseEnum); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (SparseEnum != global::Google.Protobuf.TestProtos.TestSparseEnum.Unspecified) { @@ -4021,6 +5496,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SparseEnumMessage other) { if (other == null) { return; @@ -4032,7 +5508,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4045,30 +5525,58 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + SparseEnum = (global::Google.Protobuf.TestProtos.TestSparseEnum) input.ReadEnum(); + break; + } + } + } } + #endif } /// /// Test String and Bytes: string is for valid UTF-8 strings /// - public sealed partial class OneString : pb::IMessage { + public sealed partial class OneString : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString() { OnConstruction(); } @@ -4076,12 +5584,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString(OneString other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneString Clone() { return new OneString(this); } @@ -4090,6 +5600,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private string data_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Data { get { return data_; } set { @@ -4098,11 +5609,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneString); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneString other) { if (ReferenceEquals(other, null)) { return false; @@ -4115,6 +5628,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data.Length != 0) hash ^= Data.GetHashCode(); @@ -4125,12 +5639,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Data.Length != 0) { output.WriteRawTag(10); output.WriteString(Data); @@ -4138,9 +5657,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Data.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data.Length != 0) { @@ -4153,6 +5688,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneString other) { if (other == null) { return; @@ -4164,7 +5700,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4177,27 +5717,55 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Data = input.ReadString(); + break; + } + } + } } + #endif } - public sealed partial class MoreString : pb::IMessage { + public sealed partial class MoreString : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreString()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString() { OnConstruction(); } @@ -4205,12 +5773,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString(MoreString other) : this() { data_ = other.data_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreString Clone() { return new MoreString(this); } @@ -4221,16 +5791,19 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField data_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Data { get { return data_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MoreString); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MoreString other) { if (ReferenceEquals(other, null)) { return false; @@ -4243,6 +5816,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= data_.GetHashCode(); @@ -4253,19 +5827,37 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else data_.WriteTo(output, _repeated_data_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + data_.WriteTo(ref output, _repeated_data_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += data_.CalculateSize(_repeated_data_codec); @@ -4276,6 +5868,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MoreString other) { if (other == null) { return; @@ -4285,7 +5878,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4298,27 +5895,55 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + data_.AddEntriesFrom(ref input, _repeated_data_codec); + break; + } + } + } } + #endif } - public sealed partial class OneBytes : pb::IMessage { + public sealed partial class OneBytes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes() { OnConstruction(); } @@ -4326,12 +5951,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes(OneBytes other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneBytes Clone() { return new OneBytes(this); } @@ -4340,6 +5967,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString Data { get { return data_; } set { @@ -4348,11 +5976,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneBytes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneBytes other) { if (ReferenceEquals(other, null)) { return false; @@ -4365,6 +5995,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data.Length != 0) hash ^= Data.GetHashCode(); @@ -4375,12 +6006,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Data.Length != 0) { output.WriteRawTag(10); output.WriteBytes(Data); @@ -4388,9 +6024,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Data.Length != 0) { + output.WriteRawTag(10); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data.Length != 0) { @@ -4403,6 +6055,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneBytes other) { if (other == null) { return; @@ -4414,7 +6067,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4427,27 +6084,55 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } } + #endif } - public sealed partial class MoreBytes : pb::IMessage { + public sealed partial class MoreBytes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreBytes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[17]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes() { OnConstruction(); } @@ -4455,12 +6140,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes(MoreBytes other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MoreBytes Clone() { return new MoreBytes(this); } @@ -4469,6 +6156,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString Data { get { return data_; } set { @@ -4477,11 +6165,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MoreBytes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MoreBytes other) { if (ReferenceEquals(other, null)) { return false; @@ -4494,6 +6184,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data.Length != 0) hash ^= Data.GetHashCode(); @@ -4504,12 +6195,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Data.Length != 0) { output.WriteRawTag(10); output.WriteBytes(Data); @@ -4517,9 +6213,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Data.Length != 0) { + output.WriteRawTag(10); + output.WriteBytes(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data.Length != 0) { @@ -4532,6 +6244,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MoreBytes other) { if (other == null) { return; @@ -4543,7 +6256,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4556,30 +6273,58 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Data = input.ReadBytes(); + break; + } + } + } } + #endif } /// /// Test int32, uint32, int64, uint64, and bool are all compatible /// - public sealed partial class Int32Message : pb::IMessage { + public sealed partial class Int32Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int32Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message() { OnConstruction(); } @@ -4587,12 +6332,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message(Int32Message other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int32Message Clone() { return new Int32Message(this); } @@ -4601,6 +6348,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private int data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Data { get { return data_; } set { @@ -4609,11 +6357,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Int32Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Int32Message other) { if (ReferenceEquals(other, null)) { return false; @@ -4626,6 +6376,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != 0) hash ^= Data.GetHashCode(); @@ -4636,12 +6387,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Data != 0) { output.WriteRawTag(8); output.WriteInt32(Data); @@ -4649,9 +6405,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Data != 0) { + output.WriteRawTag(8); + output.WriteInt32(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != 0) { @@ -4664,6 +6436,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Int32Message other) { if (other == null) { return; @@ -4675,7 +6448,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4688,27 +6465,55 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Data = input.ReadInt32(); + break; + } + } + } } + #endif } - public sealed partial class Uint32Message : pb::IMessage { + public sealed partial class Uint32Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint32Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[19]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message() { OnConstruction(); } @@ -4716,12 +6521,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message(Uint32Message other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint32Message Clone() { return new Uint32Message(this); } @@ -4730,6 +6537,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private uint data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint Data { get { return data_; } set { @@ -4738,11 +6546,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Uint32Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Uint32Message other) { if (ReferenceEquals(other, null)) { return false; @@ -4755,6 +6565,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != 0) hash ^= Data.GetHashCode(); @@ -4765,12 +6576,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Data != 0) { output.WriteRawTag(8); output.WriteUInt32(Data); @@ -4778,9 +6594,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Data != 0) { + output.WriteRawTag(8); + output.WriteUInt32(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != 0) { @@ -4793,6 +6625,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Uint32Message other) { if (other == null) { return; @@ -4804,7 +6637,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -4817,27 +6654,55 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Data = input.ReadUInt32(); + break; + } + } + } + } + #endif + } - public sealed partial class Int64Message : pb::IMessage { + public sealed partial class Int64Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int64Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[20]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message() { OnConstruction(); } @@ -4845,12 +6710,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message(Int64Message other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Int64Message Clone() { return new Int64Message(this); } @@ -4859,6 +6726,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private long data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Data { get { return data_; } set { @@ -4867,11 +6735,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Int64Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Int64Message other) { if (ReferenceEquals(other, null)) { return false; @@ -4884,6 +6754,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != 0L) hash ^= Data.GetHashCode(); @@ -4894,12 +6765,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Data != 0L) { output.WriteRawTag(8); output.WriteInt64(Data); @@ -4907,9 +6783,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Data != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != 0L) { @@ -4922,6 +6814,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Int64Message other) { if (other == null) { return; @@ -4929,16 +6822,39 @@ namespace Google.Protobuf.TestProtos { if (other.Data != 0L) { Data = other.Data; } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Data = input.ReadInt64(); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { Data = input.ReadInt64(); @@ -4947,26 +6863,35 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } - public sealed partial class Uint64Message : pb::IMessage { + public sealed partial class Uint64Message : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint64Message()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[21]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message() { OnConstruction(); } @@ -4974,12 +6899,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message(Uint64Message other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Uint64Message Clone() { return new Uint64Message(this); } @@ -4988,6 +6915,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private ulong data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong Data { get { return data_; } set { @@ -4996,11 +6924,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Uint64Message); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Uint64Message other) { if (ReferenceEquals(other, null)) { return false; @@ -5013,6 +6943,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != 0UL) hash ^= Data.GetHashCode(); @@ -5023,12 +6954,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Data != 0UL) { output.WriteRawTag(8); output.WriteUInt64(Data); @@ -5036,9 +6972,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Data != 0UL) { + output.WriteRawTag(8); + output.WriteUInt64(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != 0UL) { @@ -5051,6 +7003,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Uint64Message other) { if (other == null) { return; @@ -5062,7 +7015,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5075,27 +7032,55 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Data = input.ReadUInt64(); + break; + } + } + } } + #endif } - public sealed partial class BoolMessage : pb::IMessage { + public sealed partial class BoolMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[22]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage() { OnConstruction(); } @@ -5103,12 +7088,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage(BoolMessage other) : this() { data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BoolMessage Clone() { return new BoolMessage(this); } @@ -5117,6 +7104,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private bool data_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Data { get { return data_; } set { @@ -5125,11 +7113,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BoolMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BoolMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -5142,6 +7132,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Data != false) hash ^= Data.GetHashCode(); @@ -5152,12 +7143,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Data != false) { output.WriteRawTag(8); output.WriteBool(Data); @@ -5165,9 +7161,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Data != false) { + output.WriteRawTag(8); + output.WriteBool(Data); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Data != false) { @@ -5180,6 +7192,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BoolMessage other) { if (other == null) { return; @@ -5191,7 +7204,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5204,30 +7221,58 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Data = input.ReadBool(); + break; + } + } + } } + #endif } /// /// Test oneofs. /// - public sealed partial class TestOneof : pb::IMessage { + public sealed partial class TestOneof : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[23]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof() { OnConstruction(); } @@ -5235,6 +7280,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof(TestOneof other) : this() { switch (other.FooCase) { case FooOneofCase.FooInt: @@ -5252,6 +7298,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestOneof Clone() { return new TestOneof(this); } @@ -5259,6 +7306,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "foo_int" field. public const int FooIntFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int FooInt { get { return fooCase_ == FooOneofCase.FooInt ? (int) foo_ : 0; } set { @@ -5270,6 +7318,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "foo_string" field. public const int FooStringFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FooString { get { return fooCase_ == FooOneofCase.FooString ? (string) foo_ : ""; } set { @@ -5281,6 +7330,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "foo_message" field. public const int FooMessageFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.TestProtos.TestAllTypes FooMessage { get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes) foo_ : null; } set { @@ -5299,22 +7349,26 @@ namespace Google.Protobuf.TestProtos { } private FooOneofCase fooCase_ = FooOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooOneofCase FooCase { get { return fooCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearFoo() { fooCase_ = FooOneofCase.None; foo_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestOneof); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestOneof other) { if (ReferenceEquals(other, null)) { return false; @@ -5330,6 +7384,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (fooCase_ == FooOneofCase.FooInt) hash ^= FooInt.GetHashCode(); @@ -5343,12 +7398,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (fooCase_ == FooOneofCase.FooInt) { output.WriteRawTag(8); output.WriteInt32(FooInt); @@ -5364,9 +7424,33 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (fooCase_ == FooOneofCase.FooInt) { + output.WriteRawTag(8); + output.WriteInt32(FooInt); + } + if (fooCase_ == FooOneofCase.FooString) { + output.WriteRawTag(18); + output.WriteString(FooString); + } + if (fooCase_ == FooOneofCase.FooMessage) { + output.WriteRawTag(26); + output.WriteMessage(FooMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (fooCase_ == FooOneofCase.FooInt) { @@ -5385,6 +7469,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestOneof other) { if (other == null) { return; @@ -5408,7 +7493,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5434,27 +7523,68 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FooInt = input.ReadInt32(); + break; + } + case 18: { + FooString = input.ReadString(); + break; + } + case 26: { + global::Google.Protobuf.TestProtos.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.TestAllTypes(); + if (fooCase_ == FooOneofCase.FooMessage) { + subBuilder.MergeFrom(FooMessage); + } + input.ReadMessage(subBuilder); + FooMessage = subBuilder; + break; + } + } + } } + #endif } - public sealed partial class TestPackedTypes : pb::IMessage { + public sealed partial class TestPackedTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestPackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[24]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes() { OnConstruction(); } @@ -5462,6 +7592,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes(TestPackedTypes other) : this() { packedInt32_ = other.packedInt32_.Clone(); packedInt64_ = other.packedInt64_.Clone(); @@ -5481,6 +7612,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestPackedTypes Clone() { return new TestPackedTypes(this); } @@ -5491,6 +7623,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt32(722); private readonly pbc::RepeatedField packedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -5501,6 +7634,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt64(730); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -5511,6 +7645,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt32(738); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -5521,6 +7656,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt64(746); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -5531,6 +7667,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt32(754); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -5541,6 +7678,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt64(762); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -5551,6 +7689,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed32(770); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -5561,6 +7700,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed64(778); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -5571,6 +7711,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed32(786); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -5581,6 +7722,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed64(794); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -5591,6 +7733,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFloat(802); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -5601,6 +7744,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForDouble(810); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -5611,6 +7755,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForBool(818); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedBool { get { return packedBool_; } } @@ -5621,16 +7766,19 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField packedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PackedEnum { get { return packedEnum_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestPackedTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestPackedTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -5656,6 +7804,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= packedInt32_.GetHashCode(); @@ -5679,12 +7828,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else packedInt32_.WriteTo(output, _repeated_packedInt32_codec); packedInt64_.WriteTo(output, _repeated_packedInt64_codec); packedUint32_.WriteTo(output, _repeated_packedUint32_codec); @@ -5702,9 +7856,35 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + packedInt32_.WriteTo(ref output, _repeated_packedInt32_codec); + packedInt64_.WriteTo(ref output, _repeated_packedInt64_codec); + packedUint32_.WriteTo(ref output, _repeated_packedUint32_codec); + packedUint64_.WriteTo(ref output, _repeated_packedUint64_codec); + packedSint32_.WriteTo(ref output, _repeated_packedSint32_codec); + packedSint64_.WriteTo(ref output, _repeated_packedSint64_codec); + packedFixed32_.WriteTo(ref output, _repeated_packedFixed32_codec); + packedFixed64_.WriteTo(ref output, _repeated_packedFixed64_codec); + packedSfixed32_.WriteTo(ref output, _repeated_packedSfixed32_codec); + packedSfixed64_.WriteTo(ref output, _repeated_packedSfixed64_codec); + packedFloat_.WriteTo(ref output, _repeated_packedFloat_codec); + packedDouble_.WriteTo(ref output, _repeated_packedDouble_codec); + packedBool_.WriteTo(ref output, _repeated_packedBool_codec); + packedEnum_.WriteTo(ref output, _repeated_packedEnum_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += packedInt32_.CalculateSize(_repeated_packedInt32_codec); @@ -5728,6 +7908,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestPackedTypes other) { if (other == null) { return; @@ -5750,7 +7931,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5829,7 +8014,93 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 722: + case 720: { + packedInt32_.AddEntriesFrom(ref input, _repeated_packedInt32_codec); + break; + } + case 730: + case 728: { + packedInt64_.AddEntriesFrom(ref input, _repeated_packedInt64_codec); + break; + } + case 738: + case 736: { + packedUint32_.AddEntriesFrom(ref input, _repeated_packedUint32_codec); + break; + } + case 746: + case 744: { + packedUint64_.AddEntriesFrom(ref input, _repeated_packedUint64_codec); + break; + } + case 754: + case 752: { + packedSint32_.AddEntriesFrom(ref input, _repeated_packedSint32_codec); + break; + } + case 762: + case 760: { + packedSint64_.AddEntriesFrom(ref input, _repeated_packedSint64_codec); + break; + } + case 770: + case 773: { + packedFixed32_.AddEntriesFrom(ref input, _repeated_packedFixed32_codec); + break; + } + case 778: + case 777: { + packedFixed64_.AddEntriesFrom(ref input, _repeated_packedFixed64_codec); + break; + } + case 786: + case 789: { + packedSfixed32_.AddEntriesFrom(ref input, _repeated_packedSfixed32_codec); + break; + } + case 794: + case 793: { + packedSfixed64_.AddEntriesFrom(ref input, _repeated_packedSfixed64_codec); + break; + } + case 802: + case 805: { + packedFloat_.AddEntriesFrom(ref input, _repeated_packedFloat_codec); + break; + } + case 810: + case 809: { + packedDouble_.AddEntriesFrom(ref input, _repeated_packedDouble_codec); + break; + } + case 818: + case 816: { + packedBool_.AddEntriesFrom(ref input, _repeated_packedBool_codec); + break; + } + case 826: + case 824: { + packedEnum_.AddEntriesFrom(ref input, _repeated_packedEnum_codec); + break; + } + } + } } + #endif } @@ -5837,23 +8108,31 @@ namespace Google.Protobuf.TestProtos { /// A message with the same fields as TestPackedTypes, but without packing. Used /// to test packed <-> unpacked wire compatibility. /// - public sealed partial class TestUnpackedTypes : pb::IMessage { + public sealed partial class TestUnpackedTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[25]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes() { OnConstruction(); } @@ -5861,6 +8140,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes(TestUnpackedTypes other) : this() { unpackedInt32_ = other.unpackedInt32_.Clone(); unpackedInt64_ = other.unpackedInt64_.Clone(); @@ -5880,6 +8160,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestUnpackedTypes Clone() { return new TestUnpackedTypes(this); } @@ -5890,6 +8171,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt32(720); private readonly pbc::RepeatedField unpackedInt32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -5900,6 +8182,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt64(728); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -5910,6 +8193,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt32(736); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -5920,6 +8204,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt64(744); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -5930,6 +8215,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt32(752); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -5940,6 +8226,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSInt64(760); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -5950,6 +8237,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed32(773); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -5960,6 +8248,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFixed64(777); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -5970,6 +8259,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed32(789); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -5980,6 +8270,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForSFixed64(793); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -5990,6 +8281,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForFloat(805); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -6000,6 +8292,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForDouble(809); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -6010,6 +8303,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForBool(816); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } @@ -6020,16 +8314,19 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField unpackedEnum_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UnpackedEnum { get { return unpackedEnum_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestUnpackedTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestUnpackedTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -6055,6 +8352,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= unpackedInt32_.GetHashCode(); @@ -6078,12 +8376,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else unpackedInt32_.WriteTo(output, _repeated_unpackedInt32_codec); unpackedInt64_.WriteTo(output, _repeated_unpackedInt64_codec); unpackedUint32_.WriteTo(output, _repeated_unpackedUint32_codec); @@ -6101,9 +8404,35 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + unpackedInt32_.WriteTo(ref output, _repeated_unpackedInt32_codec); + unpackedInt64_.WriteTo(ref output, _repeated_unpackedInt64_codec); + unpackedUint32_.WriteTo(ref output, _repeated_unpackedUint32_codec); + unpackedUint64_.WriteTo(ref output, _repeated_unpackedUint64_codec); + unpackedSint32_.WriteTo(ref output, _repeated_unpackedSint32_codec); + unpackedSint64_.WriteTo(ref output, _repeated_unpackedSint64_codec); + unpackedFixed32_.WriteTo(ref output, _repeated_unpackedFixed32_codec); + unpackedFixed64_.WriteTo(ref output, _repeated_unpackedFixed64_codec); + unpackedSfixed32_.WriteTo(ref output, _repeated_unpackedSfixed32_codec); + unpackedSfixed64_.WriteTo(ref output, _repeated_unpackedSfixed64_codec); + unpackedFloat_.WriteTo(ref output, _repeated_unpackedFloat_codec); + unpackedDouble_.WriteTo(ref output, _repeated_unpackedDouble_codec); + unpackedBool_.WriteTo(ref output, _repeated_unpackedBool_codec); + unpackedEnum_.WriteTo(ref output, _repeated_unpackedEnum_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += unpackedInt32_.CalculateSize(_repeated_unpackedInt32_codec); @@ -6127,128 +8456,227 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestUnpackedTypes other) { if (other == null) { return; } - unpackedInt32_.Add(other.unpackedInt32_); - unpackedInt64_.Add(other.unpackedInt64_); - unpackedUint32_.Add(other.unpackedUint32_); - unpackedUint64_.Add(other.unpackedUint64_); - unpackedSint32_.Add(other.unpackedSint32_); - unpackedSint64_.Add(other.unpackedSint64_); - unpackedFixed32_.Add(other.unpackedFixed32_); - unpackedFixed64_.Add(other.unpackedFixed64_); - unpackedSfixed32_.Add(other.unpackedSfixed32_); - unpackedSfixed64_.Add(other.unpackedSfixed64_); - unpackedFloat_.Add(other.unpackedFloat_); - unpackedDouble_.Add(other.unpackedDouble_); - unpackedBool_.Add(other.unpackedBool_); - unpackedEnum_.Add(other.unpackedEnum_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + unpackedInt32_.Add(other.unpackedInt32_); + unpackedInt64_.Add(other.unpackedInt64_); + unpackedUint32_.Add(other.unpackedUint32_); + unpackedUint64_.Add(other.unpackedUint64_); + unpackedSint32_.Add(other.unpackedSint32_); + unpackedSint64_.Add(other.unpackedSint64_); + unpackedFixed32_.Add(other.unpackedFixed32_); + unpackedFixed64_.Add(other.unpackedFixed64_); + unpackedSfixed32_.Add(other.unpackedSfixed32_); + unpackedSfixed64_.Add(other.unpackedSfixed64_); + unpackedFloat_.Add(other.unpackedFloat_); + unpackedDouble_.Add(other.unpackedDouble_); + unpackedBool_.Add(other.unpackedBool_); + unpackedEnum_.Add(other.unpackedEnum_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 722: + case 720: { + unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec); + break; + } + case 730: + case 728: { + unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec); + break; + } + case 738: + case 736: { + unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec); + break; + } + case 746: + case 744: { + unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec); + break; + } + case 754: + case 752: { + unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec); + break; + } + case 762: + case 760: { + unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec); + break; + } + case 770: + case 773: { + unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec); + break; + } + case 778: + case 777: { + unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + break; + } + case 786: + case 789: { + unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + break; + } + case 794: + case 793: { + unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + break; + } + case 802: + case 805: { + unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + break; + } + case 810: + case 809: { + unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + break; + } + case 818: + case 816: { + unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + break; + } + case 826: + case 824: { + unpackedEnum_.AddEntriesFrom(input, _repeated_unpackedEnum_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 722: case 720: { - unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec); + unpackedInt32_.AddEntriesFrom(ref input, _repeated_unpackedInt32_codec); break; } case 730: case 728: { - unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec); + unpackedInt64_.AddEntriesFrom(ref input, _repeated_unpackedInt64_codec); break; } case 738: case 736: { - unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec); + unpackedUint32_.AddEntriesFrom(ref input, _repeated_unpackedUint32_codec); break; } case 746: case 744: { - unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec); + unpackedUint64_.AddEntriesFrom(ref input, _repeated_unpackedUint64_codec); break; } case 754: case 752: { - unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec); + unpackedSint32_.AddEntriesFrom(ref input, _repeated_unpackedSint32_codec); break; } case 762: case 760: { - unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec); + unpackedSint64_.AddEntriesFrom(ref input, _repeated_unpackedSint64_codec); break; } case 770: case 773: { - unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec); + unpackedFixed32_.AddEntriesFrom(ref input, _repeated_unpackedFixed32_codec); break; } case 778: case 777: { - unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec); + unpackedFixed64_.AddEntriesFrom(ref input, _repeated_unpackedFixed64_codec); break; } case 786: case 789: { - unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec); + unpackedSfixed32_.AddEntriesFrom(ref input, _repeated_unpackedSfixed32_codec); break; } case 794: case 793: { - unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec); + unpackedSfixed64_.AddEntriesFrom(ref input, _repeated_unpackedSfixed64_codec); break; } case 802: case 805: { - unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec); + unpackedFloat_.AddEntriesFrom(ref input, _repeated_unpackedFloat_codec); break; } case 810: case 809: { - unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec); + unpackedDouble_.AddEntriesFrom(ref input, _repeated_unpackedDouble_codec); break; } case 818: case 816: { - unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec); + unpackedBool_.AddEntriesFrom(ref input, _repeated_unpackedBool_codec); break; } case 826: case 824: { - unpackedEnum_.AddEntriesFrom(input, _repeated_unpackedEnum_codec); + unpackedEnum_.AddEntriesFrom(ref input, _repeated_unpackedEnum_codec); break; } } } } + #endif } - public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage { + public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRepeatedScalarDifferentTagSizes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[26]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes() { OnConstruction(); } @@ -6256,6 +8684,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes(TestRepeatedScalarDifferentTagSizes other) : this() { repeatedFixed32_ = other.repeatedFixed32_.Clone(); repeatedInt32_ = other.repeatedInt32_.Clone(); @@ -6267,6 +8696,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestRepeatedScalarDifferentTagSizes Clone() { return new TestRepeatedScalarDifferentTagSizes(this); } @@ -6282,6 +8712,7 @@ namespace Google.Protobuf.TestProtos { /// in TestAllTypes didn't trigger the check. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -6295,6 +8726,7 @@ namespace Google.Protobuf.TestProtos { /// Check for a varint type, just for good measure. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -6308,6 +8740,7 @@ namespace Google.Protobuf.TestProtos { /// These have two-byte tags. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -6318,6 +8751,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForInt64(16378); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -6331,6 +8765,7 @@ namespace Google.Protobuf.TestProtos { /// Three byte tags. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -6341,16 +8776,19 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForUInt64(2097146); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestRepeatedScalarDifferentTagSizes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestRepeatedScalarDifferentTagSizes other) { if (ReferenceEquals(other, null)) { return false; @@ -6368,6 +8806,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= repeatedFixed32_.GetHashCode(); @@ -6383,12 +8822,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else repeatedFixed32_.WriteTo(output, _repeated_repeatedFixed32_codec); repeatedInt32_.WriteTo(output, _repeated_repeatedInt32_codec); repeatedFixed64_.WriteTo(output, _repeated_repeatedFixed64_codec); @@ -6398,9 +8842,27 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + repeatedFixed32_.WriteTo(ref output, _repeated_repeatedFixed32_codec); + repeatedInt32_.WriteTo(ref output, _repeated_repeatedInt32_codec); + repeatedFixed64_.WriteTo(ref output, _repeated_repeatedFixed64_codec); + repeatedInt64_.WriteTo(ref output, _repeated_repeatedInt64_codec); + repeatedFloat_.WriteTo(ref output, _repeated_repeatedFloat_codec); + repeatedUint64_.WriteTo(ref output, _repeated_repeatedUint64_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += repeatedFixed32_.CalculateSize(_repeated_repeatedFixed32_codec); @@ -6416,6 +8878,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestRepeatedScalarDifferentTagSizes other) { if (other == null) { return; @@ -6430,7 +8893,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6469,27 +8936,81 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 98: + case 101: { + repeatedFixed32_.AddEntriesFrom(ref input, _repeated_repeatedFixed32_codec); + break; + } + case 106: + case 104: { + repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec); + break; + } + case 16370: + case 16369: { + repeatedFixed64_.AddEntriesFrom(ref input, _repeated_repeatedFixed64_codec); + break; + } + case 16378: + case 16376: { + repeatedInt64_.AddEntriesFrom(ref input, _repeated_repeatedInt64_codec); + break; + } + case 2097138: + case 2097141: { + repeatedFloat_.AddEntriesFrom(ref input, _repeated_repeatedFloat_codec); + break; + } + case 2097146: + case 2097144: { + repeatedUint64_.AddEntriesFrom(ref input, _repeated_repeatedUint64_codec); + break; + } + } + } } + #endif } - public sealed partial class TestCommentInjectionMessage : pb::IMessage { + public sealed partial class TestCommentInjectionMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCommentInjectionMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[27]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage() { OnConstruction(); } @@ -6497,12 +9018,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage(TestCommentInjectionMessage other) : this() { a_ = other.a_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestCommentInjectionMessage Clone() { return new TestCommentInjectionMessage(this); } @@ -6514,6 +9037,7 @@ namespace Google.Protobuf.TestProtos { /// */ <- This should not close the generated doc comment /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string A { get { return a_; } set { @@ -6522,11 +9046,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestCommentInjectionMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestCommentInjectionMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -6539,6 +9065,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (A.Length != 0) hash ^= A.GetHashCode(); @@ -6549,12 +9076,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (A.Length != 0) { output.WriteRawTag(10); output.WriteString(A); @@ -6562,9 +9094,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (A.Length != 0) { + output.WriteRawTag(10); + output.WriteString(A); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (A.Length != 0) { @@ -6577,6 +9125,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestCommentInjectionMessage other) { if (other == null) { return; @@ -6588,7 +9137,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6601,30 +9154,58 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + A = input.ReadString(); + break; + } + } + } } + #endif } /// /// Test that RPC services work. /// - public sealed partial class FooRequest : pb::IMessage { + public sealed partial class FooRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[28]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest() { OnConstruction(); } @@ -6632,21 +9213,25 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest(FooRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooRequest Clone() { return new FooRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -6658,6 +9243,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -6667,18 +9253,35 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -6688,6 +9291,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooRequest other) { if (other == null) { return; @@ -6696,7 +9300,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6705,27 +9313,51 @@ namespace Google.Protobuf.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class FooResponse : pb::IMessage { + public sealed partial class FooResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[29]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse() { OnConstruction(); } @@ -6733,21 +9365,25 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse(FooResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooResponse Clone() { return new FooResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -6759,6 +9395,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -6768,18 +9405,35 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -6789,6 +9443,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooResponse other) { if (other == null) { return; @@ -6797,7 +9452,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6806,27 +9465,51 @@ namespace Google.Protobuf.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class FooClientMessage : pb::IMessage { + public sealed partial class FooClientMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooClientMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[30]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage() { OnConstruction(); } @@ -6834,21 +9517,25 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage(FooClientMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooClientMessage Clone() { return new FooClientMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooClientMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooClientMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -6860,6 +9547,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -6869,18 +9557,35 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -6890,6 +9595,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooClientMessage other) { if (other == null) { return; @@ -6898,7 +9604,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6907,27 +9617,51 @@ namespace Google.Protobuf.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class FooServerMessage : pb::IMessage { + public sealed partial class FooServerMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooServerMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[31]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage() { OnConstruction(); } @@ -6935,21 +9669,25 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage(FooServerMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FooServerMessage Clone() { return new FooServerMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FooServerMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FooServerMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -6961,6 +9699,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -6970,18 +9709,35 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -6991,6 +9747,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FooServerMessage other) { if (other == null) { return; @@ -6999,7 +9756,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7008,27 +9769,51 @@ namespace Google.Protobuf.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class BarRequest : pb::IMessage { + public sealed partial class BarRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarRequest()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[32]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest() { OnConstruction(); } @@ -7036,21 +9821,25 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest(BarRequest other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarRequest Clone() { return new BarRequest(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BarRequest); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BarRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -7062,6 +9851,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -7071,18 +9861,35 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -7092,6 +9899,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BarRequest other) { if (other == null) { return; @@ -7100,7 +9908,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7109,27 +9921,51 @@ namespace Google.Protobuf.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class BarResponse : pb::IMessage { + public sealed partial class BarResponse : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarResponse()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[33]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse() { OnConstruction(); } @@ -7137,21 +9973,25 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse(BarResponse other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BarResponse Clone() { return new BarResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BarResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BarResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -7163,6 +10003,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -7172,18 +10013,35 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -7193,6 +10051,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BarResponse other) { if (other == null) { return; @@ -7201,7 +10060,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7210,27 +10073,51 @@ namespace Google.Protobuf.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } - public sealed partial class TestEmptyMessage : pb::IMessage { + public sealed partial class TestEmptyMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[34]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage() { OnConstruction(); } @@ -7238,21 +10125,25 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage(TestEmptyMessage other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestEmptyMessage Clone() { return new TestEmptyMessage(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestEmptyMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestEmptyMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -7264,6 +10155,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -7273,18 +10165,35 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -7294,6 +10203,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestEmptyMessage other) { if (other == null) { return; @@ -7302,7 +10212,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7311,30 +10225,54 @@ namespace Google.Protobuf.TestProtos { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } /// /// This is a leading comment /// - public sealed partial class CommentMessage : pb::IMessage { + public sealed partial class CommentMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CommentMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3Reflection.Descriptor.MessageTypes[35]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CommentMessage() { OnConstruction(); } @@ -7342,12 +10280,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CommentMessage(CommentMessage other) : this() { text_ = other.text_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public CommentMessage Clone() { return new CommentMessage(this); } @@ -7359,6 +10299,7 @@ namespace Google.Protobuf.TestProtos { /// Leading field comment /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Text { get { return text_; } set { @@ -7367,11 +10308,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as CommentMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(CommentMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -7384,6 +10327,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Text.Length != 0) hash ^= Text.GetHashCode(); @@ -7394,12 +10338,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Text.Length != 0) { output.WriteRawTag(10); output.WriteString(Text); @@ -7407,9 +10356,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Text.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Text); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Text.Length != 0) { @@ -7422,6 +10387,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(CommentMessage other) { if (other == null) { return; @@ -7433,7 +10399,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7446,11 +10416,32 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Text = input.ReadString(); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the CommentMessage message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Leading nested enum comment @@ -7465,23 +10456,31 @@ namespace Google.Protobuf.TestProtos { /// /// Leading nested message comment /// - public sealed partial class NestedCommentMessage : pb::IMessage { + public sealed partial class NestedCommentMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedCommentMessage()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.CommentMessage.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedCommentMessage() { OnConstruction(); } @@ -7489,12 +10488,14 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedCommentMessage(NestedCommentMessage other) : this() { nestedText_ = other.nestedText_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NestedCommentMessage Clone() { return new NestedCommentMessage(this); } @@ -7506,6 +10507,7 @@ namespace Google.Protobuf.TestProtos { /// Leading nested message field comment /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string NestedText { get { return nestedText_; } set { @@ -7514,11 +10516,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NestedCommentMessage); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NestedCommentMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -7531,6 +10535,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (NestedText.Length != 0) hash ^= NestedText.GetHashCode(); @@ -7541,12 +10546,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (NestedText.Length != 0) { output.WriteRawTag(10); output.WriteString(NestedText); @@ -7554,9 +10564,25 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (NestedText.Length != 0) { + output.WriteRawTag(10); + output.WriteString(NestedText); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (NestedText.Length != 0) { @@ -7569,6 +10595,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NestedCommentMessage other) { if (other == null) { return; @@ -7580,7 +10607,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7593,7 +10624,27 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + NestedText = input.ReadString(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs new file mode 100644 index 0000000000..a41b890fc6 --- /dev/null +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs @@ -0,0 +1,2092 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/unittest_proto3_optional.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace ProtobufUnittest { + + /// Holder for reflection information generated from google/protobuf/unittest_proto3_optional.proto + public static partial class UnittestProto3OptionalReflection { + + #region Descriptor + /// File descriptor for google/protobuf/unittest_proto3_optional.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static UnittestProto3OptionalReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci5nb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcHJvdG8zX29wdGlvbmFsLnBy", + "b3RvEhFwcm90b2J1Zl91bml0dGVzdBogZ29vZ2xlL3Byb3RvYnVmL2Rlc2Ny", + "aXB0b3IucHJvdG8isQoKElRlc3RQcm90bzNPcHRpb25hbBIbCg5vcHRpb25h", + "bF9pbnQzMhgBIAEoBUgAiAEBEhsKDm9wdGlvbmFsX2ludDY0GAIgASgDSAGI", + "AQESHAoPb3B0aW9uYWxfdWludDMyGAMgASgNSAKIAQESHAoPb3B0aW9uYWxf", + "dWludDY0GAQgASgESAOIAQESHAoPb3B0aW9uYWxfc2ludDMyGAUgASgRSASI", + "AQESHAoPb3B0aW9uYWxfc2ludDY0GAYgASgSSAWIAQESHQoQb3B0aW9uYWxf", + "Zml4ZWQzMhgHIAEoB0gGiAEBEh0KEG9wdGlvbmFsX2ZpeGVkNjQYCCABKAZI", + "B4gBARIeChFvcHRpb25hbF9zZml4ZWQzMhgJIAEoD0gIiAEBEh4KEW9wdGlv", + "bmFsX3NmaXhlZDY0GAogASgQSAmIAQESGwoOb3B0aW9uYWxfZmxvYXQYCyAB", + "KAJICogBARIcCg9vcHRpb25hbF9kb3VibGUYDCABKAFIC4gBARIaCg1vcHRp", + "b25hbF9ib29sGA0gASgISAyIAQESHAoPb3B0aW9uYWxfc3RyaW5nGA4gASgJ", + "SA2IAQESGwoOb3B0aW9uYWxfYnl0ZXMYDyABKAxIDogBARIeCg1vcHRpb25h", + "bF9jb3JkGBAgASgJQgIIAUgPiAEBElkKF29wdGlvbmFsX25lc3RlZF9tZXNz", + "YWdlGBIgASgLMjMucHJvdG9idWZfdW5pdHRlc3QuVGVzdFByb3RvM09wdGlv", + "bmFsLk5lc3RlZE1lc3NhZ2VIEIgBARJZChNsYXp5X25lc3RlZF9tZXNzYWdl", + "GBMgASgLMjMucHJvdG9idWZfdW5pdHRlc3QuVGVzdFByb3RvM09wdGlvbmFs", + "Lk5lc3RlZE1lc3NhZ2VCAigBSBGIAQESUwoUb3B0aW9uYWxfbmVzdGVkX2Vu", + "dW0YFSABKA4yMC5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJvdG8zT3B0aW9u", + "YWwuTmVzdGVkRW51bUgSiAEBEhYKDnNpbmd1bGFyX2ludDMyGBYgASgFEhYK", + "DnNpbmd1bGFyX2ludDY0GBcgASgDGicKDU5lc3RlZE1lc3NhZ2USDwoCYmIY", + "ASABKAVIAIgBAUIFCgNfYmIiSgoKTmVzdGVkRW51bRIPCgtVTlNQRUNJRklF", + "RBAAEgcKA0ZPTxABEgcKA0JBUhACEgcKA0JBWhADEhAKA05FRxD/////////", + "//8BQhEKD19vcHRpb25hbF9pbnQzMkIRCg9fb3B0aW9uYWxfaW50NjRCEgoQ", + "X29wdGlvbmFsX3VpbnQzMkISChBfb3B0aW9uYWxfdWludDY0QhIKEF9vcHRp", + "b25hbF9zaW50MzJCEgoQX29wdGlvbmFsX3NpbnQ2NEITChFfb3B0aW9uYWxf", + "Zml4ZWQzMkITChFfb3B0aW9uYWxfZml4ZWQ2NEIUChJfb3B0aW9uYWxfc2Zp", + "eGVkMzJCFAoSX29wdGlvbmFsX3NmaXhlZDY0QhEKD19vcHRpb25hbF9mbG9h", + "dEISChBfb3B0aW9uYWxfZG91YmxlQhAKDl9vcHRpb25hbF9ib29sQhIKEF9v", + "cHRpb25hbF9zdHJpbmdCEQoPX29wdGlvbmFsX2J5dGVzQhAKDl9vcHRpb25h", + "bF9jb3JkQhoKGF9vcHRpb25hbF9uZXN0ZWRfbWVzc2FnZUIWChRfbGF6eV9u", + "ZXN0ZWRfbWVzc2FnZUIXChVfb3B0aW9uYWxfbmVzdGVkX2VudW0iiQIKGVRl", + "c3RQcm90bzNPcHRpb25hbE1lc3NhZ2USUgoObmVzdGVkX21lc3NhZ2UYASAB", + "KAsyOi5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJvdG8zT3B0aW9uYWxNZXNz", + "YWdlLk5lc3RlZE1lc3NhZ2USYAoXb3B0aW9uYWxfbmVzdGVkX21lc3NhZ2UY", + "AiABKAsyOi5wcm90b2J1Zl91bml0dGVzdC5UZXN0UHJvdG8zT3B0aW9uYWxN", + "ZXNzYWdlLk5lc3RlZE1lc3NhZ2VIAIgBARoaCg1OZXN0ZWRNZXNzYWdlEgkK", + "AXMYASABKAlCGgoYX29wdGlvbmFsX25lc3RlZF9tZXNzYWdlIqkBChhQcm90", + "bzNPcHRpb25hbEV4dGVuc2lvbnMyPAoPZXh0X25vX29wdGlvbmFsEh8uZ29v", + "Z2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGIjN2akBIAEoBTJBChFleHRf", + "d2l0aF9vcHRpb25hbBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9u", + "cxiJzdmpASABKAWIAQE6DMDozM0KCMjozM0KEEIlCiFjb20uZ29vZ2xlLnBy", + "b3RvYnVmLnRlc3RpbmcucHJvdG9QAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3Optional), global::ProtobufUnittest.TestProto3Optional.Parser, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalCord", "OptionalNestedMessage", "LazyNestedMessage", "OptionalNestedEnum", "SingularInt32", "SingularInt64" }, new[]{ "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalCord", "OptionalNestedMessage", "LazyNestedMessage", "OptionalNestedEnum" }, new[]{ typeof(global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage), global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage.Parser, new[]{ "Bb" }, new[]{ "Bb" }, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3OptionalMessage), global::ProtobufUnittest.TestProto3OptionalMessage.Parser, new[]{ "NestedMessage", "OptionalNestedMessage" }, new[]{ "OptionalNestedMessage" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage), global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage.Parser, new[]{ "S" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufUnittest.Proto3OptionalExtensions), global::ProtobufUnittest.Proto3OptionalExtensions.Parser, null, null, null, new pb::Extension[] { global::ProtobufUnittest.Proto3OptionalExtensions.Extensions.ExtNoOptional, global::ProtobufUnittest.Proto3OptionalExtensions.Extensions.ExtWithOptional }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TestProto3Optional : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestProto3Optional()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TestProto3Optional() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TestProto3Optional(TestProto3Optional other) : this() { + _hasBits0 = other._hasBits0; + optionalInt32_ = other.optionalInt32_; + optionalInt64_ = other.optionalInt64_; + optionalUint32_ = other.optionalUint32_; + optionalUint64_ = other.optionalUint64_; + optionalSint32_ = other.optionalSint32_; + optionalSint64_ = other.optionalSint64_; + optionalFixed32_ = other.optionalFixed32_; + optionalFixed64_ = other.optionalFixed64_; + optionalSfixed32_ = other.optionalSfixed32_; + optionalSfixed64_ = other.optionalSfixed64_; + optionalFloat_ = other.optionalFloat_; + optionalDouble_ = other.optionalDouble_; + optionalBool_ = other.optionalBool_; + optionalString_ = other.optionalString_; + optionalBytes_ = other.optionalBytes_; + optionalCord_ = other.optionalCord_; + optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; + lazyNestedMessage_ = other.lazyNestedMessage_ != null ? other.lazyNestedMessage_.Clone() : null; + optionalNestedEnum_ = other.optionalNestedEnum_; + singularInt32_ = other.singularInt32_; + singularInt64_ = other.singularInt64_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TestProto3Optional Clone() { + return new TestProto3Optional(this); + } + + /// Field number for the "optional_int32" field. + public const int OptionalInt32FieldNumber = 1; + private int optionalInt32_; + /// + /// Singular + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OptionalInt32 { + get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return 0; } } + set { + _hasBits0 |= 1; + optionalInt32_ = value; + } + } + /// Gets whether the "optional_int32" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalInt32 { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "optional_int32" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalInt32() { + _hasBits0 &= ~1; + } + + /// Field number for the "optional_int64" field. + public const int OptionalInt64FieldNumber = 2; + private long optionalInt64_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long OptionalInt64 { + get { if ((_hasBits0 & 2) != 0) { return optionalInt64_; } else { return 0L; } } + set { + _hasBits0 |= 2; + optionalInt64_ = value; + } + } + /// Gets whether the "optional_int64" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalInt64 { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "optional_int64" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalInt64() { + _hasBits0 &= ~2; + } + + /// Field number for the "optional_uint32" field. + public const int OptionalUint32FieldNumber = 3; + private uint optionalUint32_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint OptionalUint32 { + get { if ((_hasBits0 & 4) != 0) { return optionalUint32_; } else { return 0; } } + set { + _hasBits0 |= 4; + optionalUint32_ = value; + } + } + /// Gets whether the "optional_uint32" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalUint32 { + get { return (_hasBits0 & 4) != 0; } + } + /// Clears the value of the "optional_uint32" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalUint32() { + _hasBits0 &= ~4; + } + + /// Field number for the "optional_uint64" field. + public const int OptionalUint64FieldNumber = 4; + private ulong optionalUint64_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ulong OptionalUint64 { + get { if ((_hasBits0 & 8) != 0) { return optionalUint64_; } else { return 0UL; } } + set { + _hasBits0 |= 8; + optionalUint64_ = value; + } + } + /// Gets whether the "optional_uint64" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalUint64 { + get { return (_hasBits0 & 8) != 0; } + } + /// Clears the value of the "optional_uint64" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalUint64() { + _hasBits0 &= ~8; + } + + /// Field number for the "optional_sint32" field. + public const int OptionalSint32FieldNumber = 5; + private int optionalSint32_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OptionalSint32 { + get { if ((_hasBits0 & 16) != 0) { return optionalSint32_; } else { return 0; } } + set { + _hasBits0 |= 16; + optionalSint32_ = value; + } + } + /// Gets whether the "optional_sint32" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalSint32 { + get { return (_hasBits0 & 16) != 0; } + } + /// Clears the value of the "optional_sint32" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalSint32() { + _hasBits0 &= ~16; + } + + /// Field number for the "optional_sint64" field. + public const int OptionalSint64FieldNumber = 6; + private long optionalSint64_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long OptionalSint64 { + get { if ((_hasBits0 & 32) != 0) { return optionalSint64_; } else { return 0L; } } + set { + _hasBits0 |= 32; + optionalSint64_ = value; + } + } + /// Gets whether the "optional_sint64" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalSint64 { + get { return (_hasBits0 & 32) != 0; } + } + /// Clears the value of the "optional_sint64" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalSint64() { + _hasBits0 &= ~32; + } + + /// Field number for the "optional_fixed32" field. + public const int OptionalFixed32FieldNumber = 7; + private uint optionalFixed32_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint OptionalFixed32 { + get { if ((_hasBits0 & 64) != 0) { return optionalFixed32_; } else { return 0; } } + set { + _hasBits0 |= 64; + optionalFixed32_ = value; + } + } + /// Gets whether the "optional_fixed32" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalFixed32 { + get { return (_hasBits0 & 64) != 0; } + } + /// Clears the value of the "optional_fixed32" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalFixed32() { + _hasBits0 &= ~64; + } + + /// Field number for the "optional_fixed64" field. + public const int OptionalFixed64FieldNumber = 8; + private ulong optionalFixed64_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ulong OptionalFixed64 { + get { if ((_hasBits0 & 128) != 0) { return optionalFixed64_; } else { return 0UL; } } + set { + _hasBits0 |= 128; + optionalFixed64_ = value; + } + } + /// Gets whether the "optional_fixed64" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalFixed64 { + get { return (_hasBits0 & 128) != 0; } + } + /// Clears the value of the "optional_fixed64" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalFixed64() { + _hasBits0 &= ~128; + } + + /// Field number for the "optional_sfixed32" field. + public const int OptionalSfixed32FieldNumber = 9; + private int optionalSfixed32_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int OptionalSfixed32 { + get { if ((_hasBits0 & 256) != 0) { return optionalSfixed32_; } else { return 0; } } + set { + _hasBits0 |= 256; + optionalSfixed32_ = value; + } + } + /// Gets whether the "optional_sfixed32" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalSfixed32 { + get { return (_hasBits0 & 256) != 0; } + } + /// Clears the value of the "optional_sfixed32" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalSfixed32() { + _hasBits0 &= ~256; + } + + /// Field number for the "optional_sfixed64" field. + public const int OptionalSfixed64FieldNumber = 10; + private long optionalSfixed64_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long OptionalSfixed64 { + get { if ((_hasBits0 & 512) != 0) { return optionalSfixed64_; } else { return 0L; } } + set { + _hasBits0 |= 512; + optionalSfixed64_ = value; + } + } + /// Gets whether the "optional_sfixed64" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalSfixed64 { + get { return (_hasBits0 & 512) != 0; } + } + /// Clears the value of the "optional_sfixed64" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalSfixed64() { + _hasBits0 &= ~512; + } + + /// Field number for the "optional_float" field. + public const int OptionalFloatFieldNumber = 11; + private float optionalFloat_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float OptionalFloat { + get { if ((_hasBits0 & 1024) != 0) { return optionalFloat_; } else { return 0F; } } + set { + _hasBits0 |= 1024; + optionalFloat_ = value; + } + } + /// Gets whether the "optional_float" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalFloat { + get { return (_hasBits0 & 1024) != 0; } + } + /// Clears the value of the "optional_float" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalFloat() { + _hasBits0 &= ~1024; + } + + /// Field number for the "optional_double" field. + public const int OptionalDoubleFieldNumber = 12; + private double optionalDouble_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public double OptionalDouble { + get { if ((_hasBits0 & 2048) != 0) { return optionalDouble_; } else { return 0D; } } + set { + _hasBits0 |= 2048; + optionalDouble_ = value; + } + } + /// Gets whether the "optional_double" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalDouble { + get { return (_hasBits0 & 2048) != 0; } + } + /// Clears the value of the "optional_double" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalDouble() { + _hasBits0 &= ~2048; + } + + /// Field number for the "optional_bool" field. + public const int OptionalBoolFieldNumber = 13; + private bool optionalBool_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool OptionalBool { + get { if ((_hasBits0 & 4096) != 0) { return optionalBool_; } else { return false; } } + set { + _hasBits0 |= 4096; + optionalBool_ = value; + } + } + /// Gets whether the "optional_bool" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalBool { + get { return (_hasBits0 & 4096) != 0; } + } + /// Clears the value of the "optional_bool" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalBool() { + _hasBits0 &= ~4096; + } + + /// Field number for the "optional_string" field. + public const int OptionalStringFieldNumber = 14; + private string optionalString_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string OptionalString { + get { return optionalString_ ?? ""; } + set { + optionalString_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "optional_string" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalString { + get { return optionalString_ != null; } + } + /// Clears the value of the "optional_string" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalString() { + optionalString_ = null; + } + + /// Field number for the "optional_bytes" field. + public const int OptionalBytesFieldNumber = 15; + private pb::ByteString optionalBytes_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString OptionalBytes { + get { return optionalBytes_ ?? pb::ByteString.Empty; } + set { + optionalBytes_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "optional_bytes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalBytes { + get { return optionalBytes_ != null; } + } + /// Clears the value of the "optional_bytes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalBytes() { + optionalBytes_ = null; + } + + /// Field number for the "optional_cord" field. + public const int OptionalCordFieldNumber = 16; + private string optionalCord_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string OptionalCord { + get { return optionalCord_ ?? ""; } + set { + optionalCord_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "optional_cord" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalCord { + get { return optionalCord_ != null; } + } + /// Clears the value of the "optional_cord" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalCord() { + optionalCord_ = null; + } + + /// Field number for the "optional_nested_message" field. + public const int OptionalNestedMessageFieldNumber = 18; + private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage optionalNestedMessage_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage OptionalNestedMessage { + get { return optionalNestedMessage_; } + set { + optionalNestedMessage_ = value; + } + } + + /// Field number for the "lazy_nested_message" field. + public const int LazyNestedMessageFieldNumber = 19; + private global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage lazyNestedMessage_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage LazyNestedMessage { + get { return lazyNestedMessage_; } + set { + lazyNestedMessage_ = value; + } + } + + /// Field number for the "optional_nested_enum" field. + public const int OptionalNestedEnumFieldNumber = 21; + private global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum optionalNestedEnum_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum OptionalNestedEnum { + get { if ((_hasBits0 & 8192) != 0) { return optionalNestedEnum_; } else { return global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum.Unspecified; } } + set { + _hasBits0 |= 8192; + optionalNestedEnum_ = value; + } + } + /// Gets whether the "optional_nested_enum" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasOptionalNestedEnum { + get { return (_hasBits0 & 8192) != 0; } + } + /// Clears the value of the "optional_nested_enum" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearOptionalNestedEnum() { + _hasBits0 &= ~8192; + } + + /// Field number for the "singular_int32" field. + public const int SingularInt32FieldNumber = 22; + private int singularInt32_; + /// + /// Add some non-optional fields to verify we can mix them. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int SingularInt32 { + get { return singularInt32_; } + set { + singularInt32_ = value; + } + } + + /// Field number for the "singular_int64" field. + public const int SingularInt64FieldNumber = 23; + private long singularInt64_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long SingularInt64 { + get { return singularInt64_; } + set { + singularInt64_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TestProto3Optional); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TestProto3Optional other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OptionalInt32 != other.OptionalInt32) return false; + if (OptionalInt64 != other.OptionalInt64) return false; + if (OptionalUint32 != other.OptionalUint32) return false; + if (OptionalUint64 != other.OptionalUint64) return false; + if (OptionalSint32 != other.OptionalSint32) return false; + if (OptionalSint64 != other.OptionalSint64) return false; + if (OptionalFixed32 != other.OptionalFixed32) return false; + if (OptionalFixed64 != other.OptionalFixed64) return false; + if (OptionalSfixed32 != other.OptionalSfixed32) return false; + if (OptionalSfixed64 != other.OptionalSfixed64) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OptionalFloat, other.OptionalFloat)) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(OptionalDouble, other.OptionalDouble)) return false; + if (OptionalBool != other.OptionalBool) return false; + if (OptionalString != other.OptionalString) return false; + if (OptionalBytes != other.OptionalBytes) return false; + if (OptionalCord != other.OptionalCord) return false; + if (!object.Equals(OptionalNestedMessage, other.OptionalNestedMessage)) return false; + if (!object.Equals(LazyNestedMessage, other.LazyNestedMessage)) return false; + if (OptionalNestedEnum != other.OptionalNestedEnum) return false; + if (SingularInt32 != other.SingularInt32) return false; + if (SingularInt64 != other.SingularInt64) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode(); + if (HasOptionalInt64) hash ^= OptionalInt64.GetHashCode(); + if (HasOptionalUint32) hash ^= OptionalUint32.GetHashCode(); + if (HasOptionalUint64) hash ^= OptionalUint64.GetHashCode(); + if (HasOptionalSint32) hash ^= OptionalSint32.GetHashCode(); + if (HasOptionalSint64) hash ^= OptionalSint64.GetHashCode(); + if (HasOptionalFixed32) hash ^= OptionalFixed32.GetHashCode(); + if (HasOptionalFixed64) hash ^= OptionalFixed64.GetHashCode(); + if (HasOptionalSfixed32) hash ^= OptionalSfixed32.GetHashCode(); + if (HasOptionalSfixed64) hash ^= OptionalSfixed64.GetHashCode(); + if (HasOptionalFloat) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OptionalFloat); + if (HasOptionalDouble) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OptionalDouble); + if (HasOptionalBool) hash ^= OptionalBool.GetHashCode(); + if (HasOptionalString) hash ^= OptionalString.GetHashCode(); + if (HasOptionalBytes) hash ^= OptionalBytes.GetHashCode(); + if (HasOptionalCord) hash ^= OptionalCord.GetHashCode(); + if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode(); + if (lazyNestedMessage_ != null) hash ^= LazyNestedMessage.GetHashCode(); + if (HasOptionalNestedEnum) hash ^= OptionalNestedEnum.GetHashCode(); + if (SingularInt32 != 0) hash ^= SingularInt32.GetHashCode(); + if (SingularInt64 != 0L) hash ^= SingularInt64.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasOptionalInt32) { + output.WriteRawTag(8); + output.WriteInt32(OptionalInt32); + } + if (HasOptionalInt64) { + output.WriteRawTag(16); + output.WriteInt64(OptionalInt64); + } + if (HasOptionalUint32) { + output.WriteRawTag(24); + output.WriteUInt32(OptionalUint32); + } + if (HasOptionalUint64) { + output.WriteRawTag(32); + output.WriteUInt64(OptionalUint64); + } + if (HasOptionalSint32) { + output.WriteRawTag(40); + output.WriteSInt32(OptionalSint32); + } + if (HasOptionalSint64) { + output.WriteRawTag(48); + output.WriteSInt64(OptionalSint64); + } + if (HasOptionalFixed32) { + output.WriteRawTag(61); + output.WriteFixed32(OptionalFixed32); + } + if (HasOptionalFixed64) { + output.WriteRawTag(65); + output.WriteFixed64(OptionalFixed64); + } + if (HasOptionalSfixed32) { + output.WriteRawTag(77); + output.WriteSFixed32(OptionalSfixed32); + } + if (HasOptionalSfixed64) { + output.WriteRawTag(81); + output.WriteSFixed64(OptionalSfixed64); + } + if (HasOptionalFloat) { + output.WriteRawTag(93); + output.WriteFloat(OptionalFloat); + } + if (HasOptionalDouble) { + output.WriteRawTag(97); + output.WriteDouble(OptionalDouble); + } + if (HasOptionalBool) { + output.WriteRawTag(104); + output.WriteBool(OptionalBool); + } + if (HasOptionalString) { + output.WriteRawTag(114); + output.WriteString(OptionalString); + } + if (HasOptionalBytes) { + output.WriteRawTag(122); + output.WriteBytes(OptionalBytes); + } + if (HasOptionalCord) { + output.WriteRawTag(130, 1); + output.WriteString(OptionalCord); + } + if (optionalNestedMessage_ != null) { + output.WriteRawTag(146, 1); + output.WriteMessage(OptionalNestedMessage); + } + if (lazyNestedMessage_ != null) { + output.WriteRawTag(154, 1); + output.WriteMessage(LazyNestedMessage); + } + if (HasOptionalNestedEnum) { + output.WriteRawTag(168, 1); + output.WriteEnum((int) OptionalNestedEnum); + } + if (SingularInt32 != 0) { + output.WriteRawTag(176, 1); + output.WriteInt32(SingularInt32); + } + if (SingularInt64 != 0L) { + output.WriteRawTag(184, 1); + output.WriteInt64(SingularInt64); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasOptionalInt32) { + output.WriteRawTag(8); + output.WriteInt32(OptionalInt32); + } + if (HasOptionalInt64) { + output.WriteRawTag(16); + output.WriteInt64(OptionalInt64); + } + if (HasOptionalUint32) { + output.WriteRawTag(24); + output.WriteUInt32(OptionalUint32); + } + if (HasOptionalUint64) { + output.WriteRawTag(32); + output.WriteUInt64(OptionalUint64); + } + if (HasOptionalSint32) { + output.WriteRawTag(40); + output.WriteSInt32(OptionalSint32); + } + if (HasOptionalSint64) { + output.WriteRawTag(48); + output.WriteSInt64(OptionalSint64); + } + if (HasOptionalFixed32) { + output.WriteRawTag(61); + output.WriteFixed32(OptionalFixed32); + } + if (HasOptionalFixed64) { + output.WriteRawTag(65); + output.WriteFixed64(OptionalFixed64); + } + if (HasOptionalSfixed32) { + output.WriteRawTag(77); + output.WriteSFixed32(OptionalSfixed32); + } + if (HasOptionalSfixed64) { + output.WriteRawTag(81); + output.WriteSFixed64(OptionalSfixed64); + } + if (HasOptionalFloat) { + output.WriteRawTag(93); + output.WriteFloat(OptionalFloat); + } + if (HasOptionalDouble) { + output.WriteRawTag(97); + output.WriteDouble(OptionalDouble); + } + if (HasOptionalBool) { + output.WriteRawTag(104); + output.WriteBool(OptionalBool); + } + if (HasOptionalString) { + output.WriteRawTag(114); + output.WriteString(OptionalString); + } + if (HasOptionalBytes) { + output.WriteRawTag(122); + output.WriteBytes(OptionalBytes); + } + if (HasOptionalCord) { + output.WriteRawTag(130, 1); + output.WriteString(OptionalCord); + } + if (optionalNestedMessage_ != null) { + output.WriteRawTag(146, 1); + output.WriteMessage(OptionalNestedMessage); + } + if (lazyNestedMessage_ != null) { + output.WriteRawTag(154, 1); + output.WriteMessage(LazyNestedMessage); + } + if (HasOptionalNestedEnum) { + output.WriteRawTag(168, 1); + output.WriteEnum((int) OptionalNestedEnum); + } + if (SingularInt32 != 0) { + output.WriteRawTag(176, 1); + output.WriteInt32(SingularInt32); + } + if (SingularInt64 != 0L) { + output.WriteRawTag(184, 1); + output.WriteInt64(SingularInt64); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasOptionalInt32) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32); + } + if (HasOptionalInt64) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OptionalInt64); + } + if (HasOptionalUint32) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(OptionalUint32); + } + if (HasOptionalUint64) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(OptionalUint64); + } + if (HasOptionalSint32) { + size += 1 + pb::CodedOutputStream.ComputeSInt32Size(OptionalSint32); + } + if (HasOptionalSint64) { + size += 1 + pb::CodedOutputStream.ComputeSInt64Size(OptionalSint64); + } + if (HasOptionalFixed32) { + size += 1 + 4; + } + if (HasOptionalFixed64) { + size += 1 + 8; + } + if (HasOptionalSfixed32) { + size += 1 + 4; + } + if (HasOptionalSfixed64) { + size += 1 + 8; + } + if (HasOptionalFloat) { + size += 1 + 4; + } + if (HasOptionalDouble) { + size += 1 + 8; + } + if (HasOptionalBool) { + size += 1 + 1; + } + if (HasOptionalString) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OptionalString); + } + if (HasOptionalBytes) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(OptionalBytes); + } + if (HasOptionalCord) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalCord); + } + if (optionalNestedMessage_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); + } + if (lazyNestedMessage_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(LazyNestedMessage); + } + if (HasOptionalNestedEnum) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) OptionalNestedEnum); + } + if (SingularInt32 != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(SingularInt32); + } + if (SingularInt64 != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(SingularInt64); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TestProto3Optional other) { + if (other == null) { + return; + } + if (other.HasOptionalInt32) { + OptionalInt32 = other.OptionalInt32; + } + if (other.HasOptionalInt64) { + OptionalInt64 = other.OptionalInt64; + } + if (other.HasOptionalUint32) { + OptionalUint32 = other.OptionalUint32; + } + if (other.HasOptionalUint64) { + OptionalUint64 = other.OptionalUint64; + } + if (other.HasOptionalSint32) { + OptionalSint32 = other.OptionalSint32; + } + if (other.HasOptionalSint64) { + OptionalSint64 = other.OptionalSint64; + } + if (other.HasOptionalFixed32) { + OptionalFixed32 = other.OptionalFixed32; + } + if (other.HasOptionalFixed64) { + OptionalFixed64 = other.OptionalFixed64; + } + if (other.HasOptionalSfixed32) { + OptionalSfixed32 = other.OptionalSfixed32; + } + if (other.HasOptionalSfixed64) { + OptionalSfixed64 = other.OptionalSfixed64; + } + if (other.HasOptionalFloat) { + OptionalFloat = other.OptionalFloat; + } + if (other.HasOptionalDouble) { + OptionalDouble = other.OptionalDouble; + } + if (other.HasOptionalBool) { + OptionalBool = other.OptionalBool; + } + if (other.HasOptionalString) { + OptionalString = other.OptionalString; + } + if (other.HasOptionalBytes) { + OptionalBytes = other.OptionalBytes; + } + if (other.HasOptionalCord) { + OptionalCord = other.OptionalCord; + } + if (other.optionalNestedMessage_ != null) { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); + } + OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); + } + if (other.lazyNestedMessage_ != null) { + if (lazyNestedMessage_ == null) { + LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); + } + LazyNestedMessage.MergeFrom(other.LazyNestedMessage); + } + if (other.HasOptionalNestedEnum) { + OptionalNestedEnum = other.OptionalNestedEnum; + } + if (other.SingularInt32 != 0) { + SingularInt32 = other.SingularInt32; + } + if (other.SingularInt64 != 0L) { + SingularInt64 = other.SingularInt64; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 16: { + OptionalInt64 = input.ReadInt64(); + break; + } + case 24: { + OptionalUint32 = input.ReadUInt32(); + break; + } + case 32: { + OptionalUint64 = input.ReadUInt64(); + break; + } + case 40: { + OptionalSint32 = input.ReadSInt32(); + break; + } + case 48: { + OptionalSint64 = input.ReadSInt64(); + break; + } + case 61: { + OptionalFixed32 = input.ReadFixed32(); + break; + } + case 65: { + OptionalFixed64 = input.ReadFixed64(); + break; + } + case 77: { + OptionalSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + OptionalSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + OptionalFloat = input.ReadFloat(); + break; + } + case 97: { + OptionalDouble = input.ReadDouble(); + break; + } + case 104: { + OptionalBool = input.ReadBool(); + break; + } + case 114: { + OptionalString = input.ReadString(); + break; + } + case 122: { + OptionalBytes = input.ReadBytes(); + break; + } + case 130: { + OptionalCord = input.ReadString(); + break; + } + case 146: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + case 154: { + if (lazyNestedMessage_ == null) { + LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); + } + input.ReadMessage(LazyNestedMessage); + break; + } + case 168: { + OptionalNestedEnum = (global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + SingularInt32 = input.ReadInt32(); + break; + } + case 184: { + SingularInt64 = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + OptionalInt32 = input.ReadInt32(); + break; + } + case 16: { + OptionalInt64 = input.ReadInt64(); + break; + } + case 24: { + OptionalUint32 = input.ReadUInt32(); + break; + } + case 32: { + OptionalUint64 = input.ReadUInt64(); + break; + } + case 40: { + OptionalSint32 = input.ReadSInt32(); + break; + } + case 48: { + OptionalSint64 = input.ReadSInt64(); + break; + } + case 61: { + OptionalFixed32 = input.ReadFixed32(); + break; + } + case 65: { + OptionalFixed64 = input.ReadFixed64(); + break; + } + case 77: { + OptionalSfixed32 = input.ReadSFixed32(); + break; + } + case 81: { + OptionalSfixed64 = input.ReadSFixed64(); + break; + } + case 93: { + OptionalFloat = input.ReadFloat(); + break; + } + case 97: { + OptionalDouble = input.ReadDouble(); + break; + } + case 104: { + OptionalBool = input.ReadBool(); + break; + } + case 114: { + OptionalString = input.ReadString(); + break; + } + case 122: { + OptionalBytes = input.ReadBytes(); + break; + } + case 130: { + OptionalCord = input.ReadString(); + break; + } + case 146: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + case 154: { + if (lazyNestedMessage_ == null) { + LazyNestedMessage = new global::ProtobufUnittest.TestProto3Optional.Types.NestedMessage(); + } + input.ReadMessage(LazyNestedMessage); + break; + } + case 168: { + OptionalNestedEnum = (global::ProtobufUnittest.TestProto3Optional.Types.NestedEnum) input.ReadEnum(); + break; + } + case 176: { + SingularInt32 = input.ReadInt32(); + break; + } + case 184: { + SingularInt64 = input.ReadInt64(); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TestProto3Optional message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public enum NestedEnum { + [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0, + [pbr::OriginalName("FOO")] Foo = 1, + [pbr::OriginalName("BAR")] Bar = 2, + [pbr::OriginalName("BAZ")] Baz = 3, + /// + /// Intentionally negative. + /// + [pbr::OriginalName("NEG")] Neg = -1, + } + + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ProtobufUnittest.TestProto3Optional.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NestedMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NestedMessage(NestedMessage other) : this() { + _hasBits0 = other._hasBits0; + bb_ = other.bb_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NestedMessage Clone() { + return new NestedMessage(this); + } + + /// Field number for the "bb" field. + public const int BbFieldNumber = 1; + private int bb_; + /// + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Bb { + get { if ((_hasBits0 & 1) != 0) { return bb_; } else { return 0; } } + set { + _hasBits0 |= 1; + bb_ = value; + } + } + /// Gets whether the "bb" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasBb { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "bb" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearBb() { + _hasBits0 &= ~1; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NestedMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NestedMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Bb != other.Bb) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasBb) hash ^= Bb.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasBb) { + output.WriteRawTag(8); + output.WriteInt32(Bb); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasBb) { + output.WriteRawTag(8); + output.WriteInt32(Bb); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasBb) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Bb); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NestedMessage other) { + if (other == null) { + return; + } + if (other.HasBb) { + Bb = other.Bb; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Bb = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + public sealed partial class TestProto3OptionalMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestProto3OptionalMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TestProto3OptionalMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TestProto3OptionalMessage(TestProto3OptionalMessage other) : this() { + nestedMessage_ = other.nestedMessage_ != null ? other.nestedMessage_.Clone() : null; + optionalNestedMessage_ = other.optionalNestedMessage_ != null ? other.optionalNestedMessage_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public TestProto3OptionalMessage Clone() { + return new TestProto3OptionalMessage(this); + } + + /// Field number for the "nested_message" field. + public const int NestedMessageFieldNumber = 1; + private global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage nestedMessage_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage NestedMessage { + get { return nestedMessage_; } + set { + nestedMessage_ = value; + } + } + + /// Field number for the "optional_nested_message" field. + public const int OptionalNestedMessageFieldNumber = 2; + private global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage optionalNestedMessage_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage OptionalNestedMessage { + get { return optionalNestedMessage_; } + set { + optionalNestedMessage_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as TestProto3OptionalMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(TestProto3OptionalMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(NestedMessage, other.NestedMessage)) return false; + if (!object.Equals(OptionalNestedMessage, other.OptionalNestedMessage)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (nestedMessage_ != null) hash ^= NestedMessage.GetHashCode(); + if (optionalNestedMessage_ != null) hash ^= OptionalNestedMessage.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (nestedMessage_ != null) { + output.WriteRawTag(10); + output.WriteMessage(NestedMessage); + } + if (optionalNestedMessage_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OptionalNestedMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (nestedMessage_ != null) { + output.WriteRawTag(10); + output.WriteMessage(NestedMessage); + } + if (optionalNestedMessage_ != null) { + output.WriteRawTag(18); + output.WriteMessage(OptionalNestedMessage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (nestedMessage_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(NestedMessage); + } + if (optionalNestedMessage_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OptionalNestedMessage); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(TestProto3OptionalMessage other) { + if (other == null) { + return; + } + if (other.nestedMessage_ != null) { + if (nestedMessage_ == null) { + NestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); + } + NestedMessage.MergeFrom(other.NestedMessage); + } + if (other.optionalNestedMessage_ != null) { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); + } + OptionalNestedMessage.MergeFrom(other.OptionalNestedMessage); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (nestedMessage_ == null) { + NestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); + } + input.ReadMessage(NestedMessage); + break; + } + case 18: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (nestedMessage_ == null) { + NestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); + } + input.ReadMessage(NestedMessage); + break; + } + case 18: { + if (optionalNestedMessage_ == null) { + OptionalNestedMessage = new global::ProtobufUnittest.TestProto3OptionalMessage.Types.NestedMessage(); + } + input.ReadMessage(OptionalNestedMessage); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the TestProto3OptionalMessage message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + public sealed partial class NestedMessage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ProtobufUnittest.TestProto3OptionalMessage.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NestedMessage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NestedMessage(NestedMessage other) : this() { + s_ = other.s_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NestedMessage Clone() { + return new NestedMessage(this); + } + + /// Field number for the "s" field. + public const int SFieldNumber = 1; + private string s_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string S { + get { return s_; } + set { + s_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NestedMessage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NestedMessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (S != other.S) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (S.Length != 0) hash ^= S.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (S.Length != 0) { + output.WriteRawTag(10); + output.WriteString(S); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (S.Length != 0) { + output.WriteRawTag(10); + output.WriteString(S); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (S.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(S); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NestedMessage other) { + if (other == null) { + return; + } + if (other.S.Length != 0) { + S = other.S; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + S = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + S = input.ReadString(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + public sealed partial class Proto3OptionalExtensions : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Proto3OptionalExtensions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ProtobufUnittest.UnittestProto3OptionalReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Proto3OptionalExtensions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Proto3OptionalExtensions(Proto3OptionalExtensions other) : this() { + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Proto3OptionalExtensions Clone() { + return new Proto3OptionalExtensions(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Proto3OptionalExtensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Proto3OptionalExtensions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Proto3OptionalExtensions other) { + if (other == null) { + return; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } + } + #endif + + #region Extensions + /// Container for extensions for other messages declared in the Proto3OptionalExtensions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Extensions { + public static readonly pb::Extension ExtNoOptional = + new pb::Extension(355886728, pb::FieldCodec.ForInt32(2847093824, 0)); + public static readonly pb::Extension ExtWithOptional = + new pb::Extension(355886729, pb::FieldCodec.ForInt32(2847093832, 0)); + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs new file mode 100644 index 0000000000..7a8f72d4bb --- /dev/null +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs @@ -0,0 +1,379 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: unittest_selfreferential_options.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { + + /// Holder for reflection information generated from unittest_selfreferential_options.proto + public static partial class UnittestSelfreferentialOptionsReflection { + + #region Descriptor + /// File descriptor for unittest_selfreferential_options.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static UnittestSelfreferentialOptionsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiZ1bml0dGVzdF9zZWxmcmVmZXJlbnRpYWxfb3B0aW9ucy5wcm90bxIpcHJv", + "dG9idWZfdW5pdHRlc3Rfc2VsZnJlZmVyZW50aWFsX29wdGlvbnMaIGdvb2ds", + "ZS9wcm90b2J1Zi9kZXNjcmlwdG9yLnByb3RvIkwKCkZvb09wdGlvbnMSHgoH", + "aW50X29wdBgBIAEoBUINyj4KCAHAPgLKPgIIAxITCgNmb28YAiABKAVCBso+", + "AxDSCSoJCOgHEICAgIACOjkKC2Jhcl9vcHRpb25zEh0uZ29vZ2xlLnByb3Rv", + "YnVmLkZpZWxkT3B0aW9ucxjoByABKAVCBMA+0gk6agoLZm9vX29wdGlvbnMS", + "HS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGOkHIAEoCzI1LnByb3Rv", + "YnVmX3VuaXR0ZXN0X3NlbGZyZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlv", + "bnM6SwoLZm9vX2ludF9vcHQSNS5wcm90b2J1Zl91bml0dGVzdF9zZWxmcmVm", + "ZXJlbnRpYWxfb3B0aW9ucy5Gb29PcHRpb25zGOgHIAEoBTqCAQoLZm9vX2Zv", + "b19vcHQSNS5wcm90b2J1Zl91bml0dGVzdF9zZWxmcmVmZXJlbnRpYWxfb3B0", + "aW9ucy5Gb29PcHRpb25zGOkHIAEoCzI1LnByb3RvYnVmX3VuaXR0ZXN0X3Nl", + "bGZyZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlvbnNCNKoCMVVuaXRUZXN0", + "Lklzc3Vlcy5UZXN0UHJvdG9zLlNlbGZyZWZlcmVudGlhbE9wdGlvbnM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pb::Extension[] { UnittestSelfreferentialOptionsExtensions.BarOptions, UnittestSelfreferentialOptionsExtensions.FooOptions, UnittestSelfreferentialOptionsExtensions.FooIntOpt, UnittestSelfreferentialOptionsExtensions.FooFooOpt }, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions), global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Parser, new[]{ "IntOpt", "Foo" }, null, null, null, null) + })); + } + #endregion + + } + /// Holder for extension identifiers generated from the top level of unittest_selfreferential_options.proto + public static partial class UnittestSelfreferentialOptionsExtensions { + /// + /// Custom field option used on the definition of that field option. + /// + public static readonly pb::Extension BarOptions = + new pb::Extension(1000, pb::FieldCodec.ForInt32(8000, 0)); + public static readonly pb::Extension FooOptions = + new pb::Extension(1001, pb::FieldCodec.ForMessage(8010, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Parser)); + public static readonly pb::Extension FooIntOpt = + new pb::Extension(1000, pb::FieldCodec.ForInt32(8000, 0)); + public static readonly pb::Extension FooFooOpt = + new pb::Extension(1001, pb::FieldCodec.ForMessage(8010, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Parser)); + } + + #region Messages + public sealed partial class FooOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooOptions()); + private pb::UnknownFieldSet _unknownFields; + private pb::ExtensionSet _extensions; + private pb::ExtensionSet _Extensions { get { return _extensions; } } + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FooOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FooOptions(FooOptions other) : this() { + _hasBits0 = other._hasBits0; + intOpt_ = other.intOpt_; + foo_ = other.foo_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + _extensions = pb::ExtensionSet.Clone(other._extensions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public FooOptions Clone() { + return new FooOptions(this); + } + + /// Field number for the "int_opt" field. + public const int IntOptFieldNumber = 1; + private readonly static int IntOptDefaultValue = 0; + + private int intOpt_; + /// + /// Custom field option used in definition of the extension message. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int IntOpt { + get { if ((_hasBits0 & 1) != 0) { return intOpt_; } else { return IntOptDefaultValue; } } + set { + _hasBits0 |= 1; + intOpt_ = value; + } + } + /// Gets whether the "int_opt" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIntOpt { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "int_opt" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIntOpt() { + _hasBits0 &= ~1; + } + + /// Field number for the "foo" field. + public const int FooFieldNumber = 2; + private readonly static int FooDefaultValue = 0; + + private int foo_; + /// + /// Custom field option used in definition of the custom option's message. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Foo { + get { if ((_hasBits0 & 2) != 0) { return foo_; } else { return FooDefaultValue; } } + set { + _hasBits0 |= 2; + foo_ = value; + } + } + /// Gets whether the "foo" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasFoo { + get { return (_hasBits0 & 2) != 0; } + } + /// Clears the value of the "foo" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearFoo() { + _hasBits0 &= ~2; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as FooOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(FooOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (IntOpt != other.IntOpt) return false; + if (Foo != other.Foo) return false; + if (!Equals(_extensions, other._extensions)) { + return false; + } + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasIntOpt) hash ^= IntOpt.GetHashCode(); + if (HasFoo) hash ^= Foo.GetHashCode(); + if (_extensions != null) { + hash ^= _extensions.GetHashCode(); + } + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasIntOpt) { + output.WriteRawTag(8); + output.WriteInt32(IntOpt); + } + if (HasFoo) { + output.WriteRawTag(16); + output.WriteInt32(Foo); + } + if (_extensions != null) { + _extensions.WriteTo(output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasIntOpt) { + output.WriteRawTag(8); + output.WriteInt32(IntOpt); + } + if (HasFoo) { + output.WriteRawTag(16); + output.WriteInt32(Foo); + } + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasIntOpt) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntOpt); + } + if (HasFoo) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Foo); + } + if (_extensions != null) { + size += _extensions.CalculateSize(); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(FooOptions other) { + if (other == null) { + return; + } + if (other.HasIntOpt) { + IntOpt = other.IntOpt; + } + if (other.HasFoo) { + Foo = other.Foo; + } + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 8: { + IntOpt = input.ReadInt32(); + break; + } + case 16: { + Foo = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + IntOpt = input.ReadInt32(); + break; + } + case 16: { + Foo = input.ReadInt32(); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); + } + public void SetExtension(pb::Extension extension, TValue value) { + pb::ExtensionSet.Set(ref _extensions, extension, value); + } + public bool HasExtension(pb::Extension extension) { + return pb::ExtensionSet.Has(ref _extensions, extension); + } + public void ClearExtension(pb::Extension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + public void ClearExtension(pb::RepeatedExtension extension) { + pb::ExtensionSet.Clear(ref _extensions, extension); + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs index 90b338436b..58e866e766 100644 --- a/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs +++ b/csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs @@ -179,23 +179,31 @@ namespace Google.Protobuf.TestProtos { /// Each wrapper type is included separately, as languages /// map handle different wrappers in different ways. /// - public sealed partial class TestWellKnownTypes : pb::IMessage { + public sealed partial class TestWellKnownTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypesReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestWellKnownTypes() { OnConstruction(); } @@ -203,6 +211,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestWellKnownTypes(TestWellKnownTypes other) : this() { anyField_ = other.anyField_ != null ? other.anyField_.Clone() : null; apiField_ = other.apiField_ != null ? other.apiField_.Clone() : null; @@ -227,6 +236,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TestWellKnownTypes Clone() { return new TestWellKnownTypes(this); } @@ -235,6 +245,7 @@ namespace Google.Protobuf.TestProtos { public const int AnyFieldFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Any anyField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return anyField_; } set { @@ -246,6 +257,7 @@ namespace Google.Protobuf.TestProtos { public const int ApiFieldFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Api apiField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return apiField_; } set { @@ -257,6 +269,7 @@ namespace Google.Protobuf.TestProtos { public const int DurationFieldFieldNumber = 3; private global::Google.Protobuf.WellKnownTypes.Duration durationField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return durationField_; } set { @@ -268,6 +281,7 @@ namespace Google.Protobuf.TestProtos { public const int EmptyFieldFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.Empty emptyField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return emptyField_; } set { @@ -279,6 +293,7 @@ namespace Google.Protobuf.TestProtos { public const int FieldMaskFieldFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.FieldMask fieldMaskField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return fieldMaskField_; } set { @@ -290,6 +305,7 @@ namespace Google.Protobuf.TestProtos { public const int SourceContextFieldFieldNumber = 6; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContextField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return sourceContextField_; } set { @@ -301,6 +317,7 @@ namespace Google.Protobuf.TestProtos { public const int StructFieldFieldNumber = 7; private global::Google.Protobuf.WellKnownTypes.Struct structField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return structField_; } set { @@ -312,6 +329,7 @@ namespace Google.Protobuf.TestProtos { public const int TimestampFieldFieldNumber = 8; private global::Google.Protobuf.WellKnownTypes.Timestamp timestampField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return timestampField_; } set { @@ -323,6 +341,7 @@ namespace Google.Protobuf.TestProtos { public const int TypeFieldFieldNumber = 9; private global::Google.Protobuf.WellKnownTypes.Type typeField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return typeField_; } set { @@ -335,6 +354,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); private double? doubleField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField { get { return doubleField_; } set { @@ -348,6 +368,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_floatField_codec = pb::FieldCodec.ForStructWrapper(90); private float? floatField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float? FloatField { get { return floatField_; } set { @@ -361,6 +382,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); private long? int64Field_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field { get { return int64Field_; } set { @@ -374,6 +396,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); private ulong? uint64Field_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong? Uint64Field { get { return uint64Field_; } set { @@ -387,6 +410,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); private int? int32Field_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int? Int32Field { get { return int32Field_; } set { @@ -400,6 +424,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); private uint? uint32Field_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint? Uint32Field { get { return uint32Field_; } set { @@ -413,6 +438,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_boolField_codec = pb::FieldCodec.ForStructWrapper(130); private bool? boolField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool? BoolField { get { return boolField_; } set { @@ -426,6 +452,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_stringField_codec = pb::FieldCodec.ForClassWrapper(138); private string stringField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField { get { return stringField_; } set { @@ -439,6 +466,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _single_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); private pb::ByteString bytesField_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString BytesField { get { return bytesField_; } set { @@ -454,6 +482,7 @@ namespace Google.Protobuf.TestProtos { /// Part of struct, but useful to be able to test separately /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Value ValueField { get { return valueField_; } set { @@ -462,11 +491,13 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TestWellKnownTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TestWellKnownTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -497,6 +528,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (anyField_ != null) hash ^= AnyField.GetHashCode(); @@ -525,12 +557,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (anyField_ != null) { output.WriteRawTag(10); output.WriteMessage(AnyField); @@ -601,9 +638,88 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (anyField_ != null) { + output.WriteRawTag(10); + output.WriteMessage(AnyField); + } + if (apiField_ != null) { + output.WriteRawTag(18); + output.WriteMessage(ApiField); + } + if (durationField_ != null) { + output.WriteRawTag(26); + output.WriteMessage(DurationField); + } + if (emptyField_ != null) { + output.WriteRawTag(34); + output.WriteMessage(EmptyField); + } + if (fieldMaskField_ != null) { + output.WriteRawTag(42); + output.WriteMessage(FieldMaskField); + } + if (sourceContextField_ != null) { + output.WriteRawTag(50); + output.WriteMessage(SourceContextField); + } + if (structField_ != null) { + output.WriteRawTag(58); + output.WriteMessage(StructField); + } + if (timestampField_ != null) { + output.WriteRawTag(66); + output.WriteMessage(TimestampField); + } + if (typeField_ != null) { + output.WriteRawTag(74); + output.WriteMessage(TypeField); + } + if (doubleField_ != null) { + _single_doubleField_codec.WriteTagAndValue(ref output, DoubleField); + } + if (floatField_ != null) { + _single_floatField_codec.WriteTagAndValue(ref output, FloatField); + } + if (int64Field_ != null) { + _single_int64Field_codec.WriteTagAndValue(ref output, Int64Field); + } + if (uint64Field_ != null) { + _single_uint64Field_codec.WriteTagAndValue(ref output, Uint64Field); + } + if (int32Field_ != null) { + _single_int32Field_codec.WriteTagAndValue(ref output, Int32Field); + } + if (uint32Field_ != null) { + _single_uint32Field_codec.WriteTagAndValue(ref output, Uint32Field); + } + if (boolField_ != null) { + _single_boolField_codec.WriteTagAndValue(ref output, BoolField); + } + if (stringField_ != null) { + _single_stringField_codec.WriteTagAndValue(ref output, StringField); + } + if (bytesField_ != null) { + _single_bytesField_codec.WriteTagAndValue(ref output, BytesField); + } + if (valueField_ != null) { + output.WriteRawTag(154, 1); + output.WriteMessage(ValueField); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (anyField_ != null) { @@ -670,6 +786,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TestWellKnownTypes other) { if (other == null) { return; @@ -783,7 +900,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -925,30 +1046,187 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (anyField_ == null) { + AnyField = new global::Google.Protobuf.WellKnownTypes.Any(); + } + input.ReadMessage(AnyField); + break; + } + case 18: { + if (apiField_ == null) { + ApiField = new global::Google.Protobuf.WellKnownTypes.Api(); + } + input.ReadMessage(ApiField); + break; + } + case 26: { + if (durationField_ == null) { + DurationField = new global::Google.Protobuf.WellKnownTypes.Duration(); + } + input.ReadMessage(DurationField); + break; + } + case 34: { + if (emptyField_ == null) { + EmptyField = new global::Google.Protobuf.WellKnownTypes.Empty(); + } + input.ReadMessage(EmptyField); + break; + } + case 42: { + if (fieldMaskField_ == null) { + FieldMaskField = new global::Google.Protobuf.WellKnownTypes.FieldMask(); + } + input.ReadMessage(FieldMaskField); + break; + } + case 50: { + if (sourceContextField_ == null) { + SourceContextField = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + } + input.ReadMessage(SourceContextField); + break; + } + case 58: { + if (structField_ == null) { + StructField = new global::Google.Protobuf.WellKnownTypes.Struct(); + } + input.ReadMessage(StructField); + break; + } + case 66: { + if (timestampField_ == null) { + TimestampField = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + } + input.ReadMessage(TimestampField); + break; + } + case 74: { + if (typeField_ == null) { + TypeField = new global::Google.Protobuf.WellKnownTypes.Type(); + } + input.ReadMessage(TypeField); + break; + } + case 82: { + double? value = _single_doubleField_codec.Read(ref input); + if (doubleField_ == null || value != 0D) { + DoubleField = value; + } + break; + } + case 90: { + float? value = _single_floatField_codec.Read(ref input); + if (floatField_ == null || value != 0F) { + FloatField = value; + } + break; + } + case 98: { + long? value = _single_int64Field_codec.Read(ref input); + if (int64Field_ == null || value != 0L) { + Int64Field = value; + } + break; + } + case 106: { + ulong? value = _single_uint64Field_codec.Read(ref input); + if (uint64Field_ == null || value != 0UL) { + Uint64Field = value; + } + break; + } + case 114: { + int? value = _single_int32Field_codec.Read(ref input); + if (int32Field_ == null || value != 0) { + Int32Field = value; + } + break; + } + case 122: { + uint? value = _single_uint32Field_codec.Read(ref input); + if (uint32Field_ == null || value != 0) { + Uint32Field = value; + } + break; + } + case 130: { + bool? value = _single_boolField_codec.Read(ref input); + if (boolField_ == null || value != false) { + BoolField = value; + } + break; + } + case 138: { + string value = _single_stringField_codec.Read(ref input); + if (stringField_ == null || value != "") { + StringField = value; + } + break; + } + case 146: { + pb::ByteString value = _single_bytesField_codec.Read(ref input); + if (bytesField_ == null || value != pb::ByteString.Empty) { + BytesField = value; + } + break; + } + case 154: { + if (valueField_ == null) { + ValueField = new global::Google.Protobuf.WellKnownTypes.Value(); + } + input.ReadMessage(ValueField); + break; + } + } + } + } + #endif + } /// /// A repeated field for each well-known type. /// - public sealed partial class RepeatedWellKnownTypes : pb::IMessage { + public sealed partial class RepeatedWellKnownTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypesReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedWellKnownTypes() { OnConstruction(); } @@ -956,6 +1234,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedWellKnownTypes(RepeatedWellKnownTypes other) : this() { anyField_ = other.anyField_.Clone(); apiField_ = other.apiField_.Clone(); @@ -979,6 +1258,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RepeatedWellKnownTypes Clone() { return new RepeatedWellKnownTypes(this); } @@ -989,6 +1269,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Any.Parser); private readonly pbc::RepeatedField anyField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField AnyField { get { return anyField_; } } @@ -999,6 +1280,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser); private readonly pbc::RepeatedField apiField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ApiField { get { return apiField_; } } @@ -1009,6 +1291,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Duration.Parser); private readonly pbc::RepeatedField durationField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField DurationField { get { return durationField_; } } @@ -1019,6 +1302,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Empty.Parser); private readonly pbc::RepeatedField emptyField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField EmptyField { get { return emptyField_; } } @@ -1029,6 +1313,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser); private readonly pbc::RepeatedField fieldMaskField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField FieldMaskField { get { return fieldMaskField_; } } @@ -1039,6 +1324,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser); private readonly pbc::RepeatedField sourceContextField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField SourceContextField { get { return sourceContextField_; } } @@ -1049,6 +1335,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.WellKnownTypes.Struct.Parser); private readonly pbc::RepeatedField structField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField StructField { get { return structField_; } } @@ -1059,6 +1346,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser); private readonly pbc::RepeatedField timestampField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField TimestampField { get { return timestampField_; } } @@ -1069,6 +1357,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Type.Parser); private readonly pbc::RepeatedField typeField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField TypeField { get { return typeField_; } } @@ -1082,6 +1371,7 @@ namespace Google.Protobuf.TestProtos { /// These don't actually make a lot of sense, but they're not prohibited... /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField DoubleField { get { return doubleField_; } } @@ -1092,6 +1382,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(90); private readonly pbc::RepeatedField floatField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField FloatField { get { return floatField_; } } @@ -1102,6 +1393,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(98); private readonly pbc::RepeatedField int64Field_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Int64Field { get { return int64Field_; } } @@ -1112,6 +1404,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(106); private readonly pbc::RepeatedField uint64Field_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Uint64Field { get { return uint64Field_; } } @@ -1122,6 +1415,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(114); private readonly pbc::RepeatedField int32Field_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Int32Field { get { return int32Field_; } } @@ -1132,6 +1426,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(122); private readonly pbc::RepeatedField uint32Field_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Uint32Field { get { return uint32Field_; } } @@ -1142,6 +1437,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForStructWrapper(130); private readonly pbc::RepeatedField boolField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField BoolField { get { return boolField_; } } @@ -1152,6 +1448,7 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForClassWrapper(138); private readonly pbc::RepeatedField stringField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField StringField { get { return stringField_; } } @@ -1162,16 +1459,19 @@ namespace Google.Protobuf.TestProtos { = pb::FieldCodec.ForClassWrapper(146); private readonly pbc::RepeatedField bytesField_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField BytesField { get { return bytesField_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RepeatedWellKnownTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RepeatedWellKnownTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -1201,6 +1501,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= anyField_.GetHashCode(); @@ -1228,12 +1529,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else anyField_.WriteTo(output, _repeated_anyField_codec); apiField_.WriteTo(output, _repeated_apiField_codec); durationField_.WriteTo(output, _repeated_durationField_codec); @@ -1255,9 +1561,39 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + anyField_.WriteTo(ref output, _repeated_anyField_codec); + apiField_.WriteTo(ref output, _repeated_apiField_codec); + durationField_.WriteTo(ref output, _repeated_durationField_codec); + emptyField_.WriteTo(ref output, _repeated_emptyField_codec); + fieldMaskField_.WriteTo(ref output, _repeated_fieldMaskField_codec); + sourceContextField_.WriteTo(ref output, _repeated_sourceContextField_codec); + structField_.WriteTo(ref output, _repeated_structField_codec); + timestampField_.WriteTo(ref output, _repeated_timestampField_codec); + typeField_.WriteTo(ref output, _repeated_typeField_codec); + doubleField_.WriteTo(ref output, _repeated_doubleField_codec); + floatField_.WriteTo(ref output, _repeated_floatField_codec); + int64Field_.WriteTo(ref output, _repeated_int64Field_codec); + uint64Field_.WriteTo(ref output, _repeated_uint64Field_codec); + int32Field_.WriteTo(ref output, _repeated_int32Field_codec); + uint32Field_.WriteTo(ref output, _repeated_uint32Field_codec); + boolField_.WriteTo(ref output, _repeated_boolField_codec); + stringField_.WriteTo(ref output, _repeated_stringField_codec); + bytesField_.WriteTo(ref output, _repeated_bytesField_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += anyField_.CalculateSize(_repeated_anyField_codec); @@ -1285,6 +1621,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RepeatedWellKnownTypes other) { if (other == null) { return; @@ -1311,7 +1648,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1392,27 +1733,123 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + anyField_.AddEntriesFrom(ref input, _repeated_anyField_codec); + break; + } + case 18: { + apiField_.AddEntriesFrom(ref input, _repeated_apiField_codec); + break; + } + case 26: { + durationField_.AddEntriesFrom(ref input, _repeated_durationField_codec); + break; + } + case 34: { + emptyField_.AddEntriesFrom(ref input, _repeated_emptyField_codec); + break; + } + case 42: { + fieldMaskField_.AddEntriesFrom(ref input, _repeated_fieldMaskField_codec); + break; + } + case 50: { + sourceContextField_.AddEntriesFrom(ref input, _repeated_sourceContextField_codec); + break; + } + case 58: { + structField_.AddEntriesFrom(ref input, _repeated_structField_codec); + break; + } + case 66: { + timestampField_.AddEntriesFrom(ref input, _repeated_timestampField_codec); + break; + } + case 74: { + typeField_.AddEntriesFrom(ref input, _repeated_typeField_codec); + break; + } + case 82: { + doubleField_.AddEntriesFrom(ref input, _repeated_doubleField_codec); + break; + } + case 90: { + floatField_.AddEntriesFrom(ref input, _repeated_floatField_codec); + break; + } + case 98: { + int64Field_.AddEntriesFrom(ref input, _repeated_int64Field_codec); + break; + } + case 106: { + uint64Field_.AddEntriesFrom(ref input, _repeated_uint64Field_codec); + break; + } + case 114: { + int32Field_.AddEntriesFrom(ref input, _repeated_int32Field_codec); + break; + } + case 122: { + uint32Field_.AddEntriesFrom(ref input, _repeated_uint32Field_codec); + break; + } + case 130: { + boolField_.AddEntriesFrom(ref input, _repeated_boolField_codec); + break; + } + case 138: { + stringField_.AddEntriesFrom(ref input, _repeated_stringField_codec); + break; + } + case 146: { + bytesField_.AddEntriesFrom(ref input, _repeated_bytesField_codec); + break; + } + } + } } + #endif } - public sealed partial class OneofWellKnownTypes : pb::IMessage { + public sealed partial class OneofWellKnownTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypesReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofWellKnownTypes() { OnConstruction(); } @@ -1420,6 +1857,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofWellKnownTypes(OneofWellKnownTypes other) : this() { switch (other.OneofFieldCase) { case OneofFieldOneofCase.AnyField: @@ -1482,6 +1920,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofWellKnownTypes Clone() { return new OneofWellKnownTypes(this); } @@ -1489,6 +1928,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "any_field" field. public const int AnyFieldFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return oneofFieldCase_ == OneofFieldOneofCase.AnyField ? (global::Google.Protobuf.WellKnownTypes.Any) oneofField_ : null; } set { @@ -1500,6 +1940,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "api_field" field. public const int ApiFieldFieldNumber = 2; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return oneofFieldCase_ == OneofFieldOneofCase.ApiField ? (global::Google.Protobuf.WellKnownTypes.Api) oneofField_ : null; } set { @@ -1511,6 +1952,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "duration_field" field. public const int DurationFieldFieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return oneofFieldCase_ == OneofFieldOneofCase.DurationField ? (global::Google.Protobuf.WellKnownTypes.Duration) oneofField_ : null; } set { @@ -1522,6 +1964,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "empty_field" field. public const int EmptyFieldFieldNumber = 4; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return oneofFieldCase_ == OneofFieldOneofCase.EmptyField ? (global::Google.Protobuf.WellKnownTypes.Empty) oneofField_ : null; } set { @@ -1533,6 +1976,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "field_mask_field" field. public const int FieldMaskFieldFieldNumber = 5; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField ? (global::Google.Protobuf.WellKnownTypes.FieldMask) oneofField_ : null; } set { @@ -1544,6 +1988,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "source_context_field" field. public const int SourceContextFieldFieldNumber = 6; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return oneofFieldCase_ == OneofFieldOneofCase.SourceContextField ? (global::Google.Protobuf.WellKnownTypes.SourceContext) oneofField_ : null; } set { @@ -1555,6 +2000,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "struct_field" field. public const int StructFieldFieldNumber = 7; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return oneofFieldCase_ == OneofFieldOneofCase.StructField ? (global::Google.Protobuf.WellKnownTypes.Struct) oneofField_ : null; } set { @@ -1566,6 +2012,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "timestamp_field" field. public const int TimestampFieldFieldNumber = 8; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return oneofFieldCase_ == OneofFieldOneofCase.TimestampField ? (global::Google.Protobuf.WellKnownTypes.Timestamp) oneofField_ : null; } set { @@ -1577,6 +2024,7 @@ namespace Google.Protobuf.TestProtos { /// Field number for the "type_field" field. public const int TypeFieldFieldNumber = 9; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return oneofFieldCase_ == OneofFieldOneofCase.TypeField ? (global::Google.Protobuf.WellKnownTypes.Type) oneofField_ : null; } set { @@ -1589,6 +2037,7 @@ namespace Google.Protobuf.TestProtos { public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec _oneof_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double? DoubleField { get { return oneofFieldCase_ == OneofFieldOneofCase.DoubleField ? (double?) oneofField_ : (double?) null; } set { @@ -1601,6 +2050,7 @@ namespace Google.Protobuf.TestProtos { public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec _oneof_floatField_codec = pb::FieldCodec.ForStructWrapper(90); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float? FloatField { get { return oneofFieldCase_ == OneofFieldOneofCase.FloatField ? (float?) oneofField_ : (float?) null; } set { @@ -1613,6 +2063,7 @@ namespace Google.Protobuf.TestProtos { public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec _oneof_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long? Int64Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Int64Field ? (long?) oneofField_ : (long?) null; } set { @@ -1625,6 +2076,7 @@ namespace Google.Protobuf.TestProtos { public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec _oneof_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong? Uint64Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Uint64Field ? (ulong?) oneofField_ : (ulong?) null; } set { @@ -1637,6 +2089,7 @@ namespace Google.Protobuf.TestProtos { public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec _oneof_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int? Int32Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Int32Field ? (int?) oneofField_ : (int?) null; } set { @@ -1649,6 +2102,7 @@ namespace Google.Protobuf.TestProtos { public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec _oneof_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public uint? Uint32Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Uint32Field ? (uint?) oneofField_ : (uint?) null; } set { @@ -1661,6 +2115,7 @@ namespace Google.Protobuf.TestProtos { public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec _oneof_boolField_codec = pb::FieldCodec.ForStructWrapper(130); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool? BoolField { get { return oneofFieldCase_ == OneofFieldOneofCase.BoolField ? (bool?) oneofField_ : (bool?) null; } set { @@ -1673,6 +2128,7 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec _oneof_stringField_codec = pb::FieldCodec.ForClassWrapper(138); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringField { get { return oneofFieldCase_ == OneofFieldOneofCase.StringField ? (string) oneofField_ : (string) null; } set { @@ -1685,6 +2141,7 @@ namespace Google.Protobuf.TestProtos { public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec _oneof_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString BytesField { get { return oneofFieldCase_ == OneofFieldOneofCase.BytesField ? (pb::ByteString) oneofField_ : (pb::ByteString) null; } set { @@ -1718,22 +2175,26 @@ namespace Google.Protobuf.TestProtos { } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofField() { oneofFieldCase_ = OneofFieldOneofCase.None; oneofField_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneofWellKnownTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneofWellKnownTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -1764,6 +2225,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (oneofFieldCase_ == OneofFieldOneofCase.AnyField) hash ^= AnyField.GetHashCode(); @@ -1792,12 +2254,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (oneofFieldCase_ == OneofFieldOneofCase.AnyField) { output.WriteRawTag(10); output.WriteMessage(AnyField); @@ -1864,9 +2331,84 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (oneofFieldCase_ == OneofFieldOneofCase.AnyField) { + output.WriteRawTag(10); + output.WriteMessage(AnyField); + } + if (oneofFieldCase_ == OneofFieldOneofCase.ApiField) { + output.WriteRawTag(18); + output.WriteMessage(ApiField); + } + if (oneofFieldCase_ == OneofFieldOneofCase.DurationField) { + output.WriteRawTag(26); + output.WriteMessage(DurationField); + } + if (oneofFieldCase_ == OneofFieldOneofCase.EmptyField) { + output.WriteRawTag(34); + output.WriteMessage(EmptyField); + } + if (oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField) { + output.WriteRawTag(42); + output.WriteMessage(FieldMaskField); + } + if (oneofFieldCase_ == OneofFieldOneofCase.SourceContextField) { + output.WriteRawTag(50); + output.WriteMessage(SourceContextField); + } + if (oneofFieldCase_ == OneofFieldOneofCase.StructField) { + output.WriteRawTag(58); + output.WriteMessage(StructField); + } + if (oneofFieldCase_ == OneofFieldOneofCase.TimestampField) { + output.WriteRawTag(66); + output.WriteMessage(TimestampField); + } + if (oneofFieldCase_ == OneofFieldOneofCase.TypeField) { + output.WriteRawTag(74); + output.WriteMessage(TypeField); + } + if (oneofFieldCase_ == OneofFieldOneofCase.DoubleField) { + _oneof_doubleField_codec.WriteTagAndValue(ref output, (double?) oneofField_); + } + if (oneofFieldCase_ == OneofFieldOneofCase.FloatField) { + _oneof_floatField_codec.WriteTagAndValue(ref output, (float?) oneofField_); + } + if (oneofFieldCase_ == OneofFieldOneofCase.Int64Field) { + _oneof_int64Field_codec.WriteTagAndValue(ref output, (long?) oneofField_); + } + if (oneofFieldCase_ == OneofFieldOneofCase.Uint64Field) { + _oneof_uint64Field_codec.WriteTagAndValue(ref output, (ulong?) oneofField_); + } + if (oneofFieldCase_ == OneofFieldOneofCase.Int32Field) { + _oneof_int32Field_codec.WriteTagAndValue(ref output, (int?) oneofField_); + } + if (oneofFieldCase_ == OneofFieldOneofCase.Uint32Field) { + _oneof_uint32Field_codec.WriteTagAndValue(ref output, (uint?) oneofField_); + } + if (oneofFieldCase_ == OneofFieldOneofCase.BoolField) { + _oneof_boolField_codec.WriteTagAndValue(ref output, (bool?) oneofField_); + } + if (oneofFieldCase_ == OneofFieldOneofCase.StringField) { + _oneof_stringField_codec.WriteTagAndValue(ref output, (string) oneofField_); + } + if (oneofFieldCase_ == OneofFieldOneofCase.BytesField) { + _oneof_bytesField_codec.WriteTagAndValue(ref output, (pb::ByteString) oneofField_); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (oneofFieldCase_ == OneofFieldOneofCase.AnyField) { @@ -1930,6 +2472,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneofWellKnownTypes other) { if (other == null) { return; @@ -2022,7 +2565,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2148,8 +2695,141 @@ namespace Google.Protobuf.TestProtos { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + global::Google.Protobuf.WellKnownTypes.Any subBuilder = new global::Google.Protobuf.WellKnownTypes.Any(); + if (oneofFieldCase_ == OneofFieldOneofCase.AnyField) { + subBuilder.MergeFrom(AnyField); + } + input.ReadMessage(subBuilder); + AnyField = subBuilder; + break; + } + case 18: { + global::Google.Protobuf.WellKnownTypes.Api subBuilder = new global::Google.Protobuf.WellKnownTypes.Api(); + if (oneofFieldCase_ == OneofFieldOneofCase.ApiField) { + subBuilder.MergeFrom(ApiField); + } + input.ReadMessage(subBuilder); + ApiField = subBuilder; + break; + } + case 26: { + global::Google.Protobuf.WellKnownTypes.Duration subBuilder = new global::Google.Protobuf.WellKnownTypes.Duration(); + if (oneofFieldCase_ == OneofFieldOneofCase.DurationField) { + subBuilder.MergeFrom(DurationField); + } + input.ReadMessage(subBuilder); + DurationField = subBuilder; + break; + } + case 34: { + global::Google.Protobuf.WellKnownTypes.Empty subBuilder = new global::Google.Protobuf.WellKnownTypes.Empty(); + if (oneofFieldCase_ == OneofFieldOneofCase.EmptyField) { + subBuilder.MergeFrom(EmptyField); + } + input.ReadMessage(subBuilder); + EmptyField = subBuilder; + break; + } + case 42: { + global::Google.Protobuf.WellKnownTypes.FieldMask subBuilder = new global::Google.Protobuf.WellKnownTypes.FieldMask(); + if (oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField) { + subBuilder.MergeFrom(FieldMaskField); + } + input.ReadMessage(subBuilder); + FieldMaskField = subBuilder; + break; + } + case 50: { + global::Google.Protobuf.WellKnownTypes.SourceContext subBuilder = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + if (oneofFieldCase_ == OneofFieldOneofCase.SourceContextField) { + subBuilder.MergeFrom(SourceContextField); + } + input.ReadMessage(subBuilder); + SourceContextField = subBuilder; + break; + } + case 58: { + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (oneofFieldCase_ == OneofFieldOneofCase.StructField) { + subBuilder.MergeFrom(StructField); + } + input.ReadMessage(subBuilder); + StructField = subBuilder; + break; + } + case 66: { + global::Google.Protobuf.WellKnownTypes.Timestamp subBuilder = new global::Google.Protobuf.WellKnownTypes.Timestamp(); + if (oneofFieldCase_ == OneofFieldOneofCase.TimestampField) { + subBuilder.MergeFrom(TimestampField); + } + input.ReadMessage(subBuilder); + TimestampField = subBuilder; + break; + } + case 74: { + global::Google.Protobuf.WellKnownTypes.Type subBuilder = new global::Google.Protobuf.WellKnownTypes.Type(); + if (oneofFieldCase_ == OneofFieldOneofCase.TypeField) { + subBuilder.MergeFrom(TypeField); + } + input.ReadMessage(subBuilder); + TypeField = subBuilder; + break; + } + case 82: { + DoubleField = _oneof_doubleField_codec.Read(ref input); + break; + } + case 90: { + FloatField = _oneof_floatField_codec.Read(ref input); + break; + } + case 98: { + Int64Field = _oneof_int64Field_codec.Read(ref input); + break; + } + case 106: { + Uint64Field = _oneof_uint64Field_codec.Read(ref input); + break; + } + case 114: { + Int32Field = _oneof_int32Field_codec.Read(ref input); + break; + } + case 122: { + Uint32Field = _oneof_uint32Field_codec.Read(ref input); + break; + } + case 130: { + BoolField = _oneof_boolField_codec.Read(ref input); + break; + } + case 138: { + StringField = _oneof_stringField_codec.Read(ref input); + break; + } + case 146: { + BytesField = _oneof_bytesField_codec.Read(ref input); + break; + } + } + } + } + #endif + } /// @@ -2157,23 +2837,31 @@ namespace Google.Protobuf.TestProtos { /// need to worry about the value part of the map being the /// well-known types, as messages can't be map keys. /// - public sealed partial class MapWellKnownTypes : pb::IMessage { + public sealed partial class MapWellKnownTypes : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapWellKnownTypes()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypesReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MapWellKnownTypes() { OnConstruction(); } @@ -2181,6 +2869,7 @@ namespace Google.Protobuf.TestProtos { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MapWellKnownTypes(MapWellKnownTypes other) : this() { anyField_ = other.anyField_.Clone(); apiField_ = other.apiField_.Clone(); @@ -2204,6 +2893,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MapWellKnownTypes Clone() { return new MapWellKnownTypes(this); } @@ -2214,6 +2904,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Any.Parser), 10); private readonly pbc::MapField anyField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField AnyField { get { return anyField_; } } @@ -2224,6 +2915,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser), 18); private readonly pbc::MapField apiField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField ApiField { get { return apiField_; } } @@ -2234,6 +2926,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Duration.Parser), 26); private readonly pbc::MapField durationField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField DurationField { get { return durationField_; } } @@ -2244,6 +2937,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Empty.Parser), 34); private readonly pbc::MapField emptyField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField EmptyField { get { return emptyField_; } } @@ -2254,6 +2948,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser), 42); private readonly pbc::MapField fieldMaskField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField FieldMaskField { get { return fieldMaskField_; } } @@ -2264,6 +2959,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser), 50); private readonly pbc::MapField sourceContextField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField SourceContextField { get { return sourceContextField_; } } @@ -2274,6 +2970,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Struct.Parser), 58); private readonly pbc::MapField structField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField StructField { get { return structField_; } } @@ -2284,6 +2981,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser), 66); private readonly pbc::MapField timestampField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField TimestampField { get { return timestampField_; } } @@ -2294,6 +2992,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Type.Parser), 74); private readonly pbc::MapField typeField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField TypeField { get { return typeField_; } } @@ -2304,6 +3003,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 82); private readonly pbc::MapField doubleField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField DoubleField { get { return doubleField_; } } @@ -2314,6 +3014,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 90); private readonly pbc::MapField floatField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField FloatField { get { return floatField_; } } @@ -2324,6 +3025,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 98); private readonly pbc::MapField int64Field_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Int64Field { get { return int64Field_; } } @@ -2334,6 +3036,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 106); private readonly pbc::MapField uint64Field_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Uint64Field { get { return uint64Field_; } } @@ -2344,6 +3047,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 114); private readonly pbc::MapField int32Field_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Int32Field { get { return int32Field_; } } @@ -2354,6 +3058,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 122); private readonly pbc::MapField uint32Field_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Uint32Field { get { return uint32Field_; } } @@ -2364,6 +3069,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForStructWrapper(18), 130); private readonly pbc::MapField boolField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField BoolField { get { return boolField_; } } @@ -2374,6 +3080,7 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForClassWrapper(18), 138); private readonly pbc::MapField stringField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField StringField { get { return stringField_; } } @@ -2384,16 +3091,19 @@ namespace Google.Protobuf.TestProtos { = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForClassWrapper(18), 146); private readonly pbc::MapField bytesField_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField BytesField { get { return bytesField_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MapWellKnownTypes); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MapWellKnownTypes other) { if (ReferenceEquals(other, null)) { return false; @@ -2423,6 +3133,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= AnyField.GetHashCode(); @@ -2450,12 +3161,17 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else anyField_.WriteTo(output, _map_anyField_codec); apiField_.WriteTo(output, _map_apiField_codec); durationField_.WriteTo(output, _map_durationField_codec); @@ -2477,9 +3193,39 @@ namespace Google.Protobuf.TestProtos { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + anyField_.WriteTo(ref output, _map_anyField_codec); + apiField_.WriteTo(ref output, _map_apiField_codec); + durationField_.WriteTo(ref output, _map_durationField_codec); + emptyField_.WriteTo(ref output, _map_emptyField_codec); + fieldMaskField_.WriteTo(ref output, _map_fieldMaskField_codec); + sourceContextField_.WriteTo(ref output, _map_sourceContextField_codec); + structField_.WriteTo(ref output, _map_structField_codec); + timestampField_.WriteTo(ref output, _map_timestampField_codec); + typeField_.WriteTo(ref output, _map_typeField_codec); + doubleField_.WriteTo(ref output, _map_doubleField_codec); + floatField_.WriteTo(ref output, _map_floatField_codec); + int64Field_.WriteTo(ref output, _map_int64Field_codec); + uint64Field_.WriteTo(ref output, _map_uint64Field_codec); + int32Field_.WriteTo(ref output, _map_int32Field_codec); + uint32Field_.WriteTo(ref output, _map_uint32Field_codec); + boolField_.WriteTo(ref output, _map_boolField_codec); + stringField_.WriteTo(ref output, _map_stringField_codec); + bytesField_.WriteTo(ref output, _map_bytesField_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += anyField_.CalculateSize(_map_anyField_codec); @@ -2507,6 +3253,7 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MapWellKnownTypes other) { if (other == null) { return; @@ -2533,7 +3280,11 @@ namespace Google.Protobuf.TestProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2614,7 +3365,95 @@ namespace Google.Protobuf.TestProtos { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + anyField_.AddEntriesFrom(ref input, _map_anyField_codec); + break; + } + case 18: { + apiField_.AddEntriesFrom(ref input, _map_apiField_codec); + break; + } + case 26: { + durationField_.AddEntriesFrom(ref input, _map_durationField_codec); + break; + } + case 34: { + emptyField_.AddEntriesFrom(ref input, _map_emptyField_codec); + break; + } + case 42: { + fieldMaskField_.AddEntriesFrom(ref input, _map_fieldMaskField_codec); + break; + } + case 50: { + sourceContextField_.AddEntriesFrom(ref input, _map_sourceContextField_codec); + break; + } + case 58: { + structField_.AddEntriesFrom(ref input, _map_structField_codec); + break; + } + case 66: { + timestampField_.AddEntriesFrom(ref input, _map_timestampField_codec); + break; + } + case 74: { + typeField_.AddEntriesFrom(ref input, _map_typeField_codec); + break; + } + case 82: { + doubleField_.AddEntriesFrom(ref input, _map_doubleField_codec); + break; + } + case 90: { + floatField_.AddEntriesFrom(ref input, _map_floatField_codec); + break; + } + case 98: { + int64Field_.AddEntriesFrom(ref input, _map_int64Field_codec); + break; + } + case 106: { + uint64Field_.AddEntriesFrom(ref input, _map_uint64Field_codec); + break; + } + case 114: { + int32Field_.AddEntriesFrom(ref input, _map_int32Field_codec); + break; + } + case 122: { + uint32Field_.AddEntriesFrom(ref input, _map_uint32Field_codec); + break; + } + case 130: { + boolField_.AddEntriesFrom(ref input, _map_boolField_codec); + break; + } + case 138: { + stringField_.AddEntriesFrom(ref input, _map_stringField_codec); + break; + } + case 146: { + bytesField_.AddEntriesFrom(ref input, _map_bytesField_codec); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs b/csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs new file mode 100644 index 0000000000..a36a9513c7 --- /dev/null +++ b/csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs @@ -0,0 +1,225 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Buffers; +using System.Diagnostics; + +namespace Google.Protobuf.Buffers +{ + /// + /// Represents a heap-based, array-backed output sink into which data can be written. + /// + /// ArrayBufferWriter is originally from corefx, and has been contributed to Protobuf + /// https://github.com/dotnet/runtime/blob/071da4c41aa808c949a773b92dca6f88de9d11f3/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs + /// + internal sealed class TestArrayBufferWriter : IBufferWriter + { + private T[] _buffer; + private int _index; + + private const int DefaultInitialBufferSize = 256; + + /// + /// Creates an instance of an , in which data can be written to, + /// with the default initial capacity. + /// + public TestArrayBufferWriter() + { + _buffer = new T[0]; + _index = 0; + } + + /// + /// Useful for testing writing to buffer writer with a lot of small segments. + /// If set, it limits the max number of bytes by which the buffer grows by at once. + /// + public int? MaxGrowBy { get; set; } + + /// + /// Creates an instance of an , in which data can be written to, + /// with an initial capacity specified. + /// + /// The minimum capacity with which to initialize the underlying buffer. + /// + /// Thrown when is not positive (i.e. less than or equal to 0). + /// + public TestArrayBufferWriter(int initialCapacity) + { + if (initialCapacity <= 0) + throw new ArgumentException(nameof(initialCapacity)); + + _buffer = new T[initialCapacity]; + _index = 0; + } + + /// + /// Returns the data written to the underlying buffer so far, as a . + /// + public ReadOnlyMemory WrittenMemory => _buffer.AsMemory(0, _index); + + /// + /// Returns the data written to the underlying buffer so far, as a . + /// + public ReadOnlySpan WrittenSpan => _buffer.AsSpan(0, _index); + + /// + /// Returns the amount of data written to the underlying buffer so far. + /// + public int WrittenCount => _index; + + /// + /// Returns the total amount of space within the underlying buffer. + /// + public int Capacity => _buffer.Length; + + /// + /// Returns the amount of space available that can still be written into without forcing the underlying buffer to grow. + /// + public int FreeCapacity => _buffer.Length - _index; + + /// + /// Clears the data written to the underlying buffer. + /// + /// + /// You must clear the before trying to re-use it. + /// + public void Clear() + { + Debug.Assert(_buffer.Length >= _index); + _buffer.AsSpan(0, _index).Clear(); + _index = 0; + } + + /// + /// Notifies that amount of data was written to the output / + /// + /// + /// Thrown when is negative. + /// + /// + /// Thrown when attempting to advance past the end of the underlying buffer. + /// + /// + /// You must request a new buffer after calling Advance to continue writing more data and cannot write to a previously acquired buffer. + /// + public void Advance(int count) + { + if (count < 0) + throw new ArgumentException(nameof(count)); + + if (_index > _buffer.Length - count) + throw new InvalidOperationException("Advanced past capacity."); + + _index += count; + } + + /// + /// Returns a to write to that is at least the requested length (specified by ). + /// If no is provided (or it's equal to 0), some non-empty buffer is returned. + /// + /// + /// Thrown when is negative. + /// + /// + /// This will never return an empty . + /// + /// + /// There is no guarantee that successive calls will return the same buffer or the same-sized buffer. + /// + /// + /// You must request a new buffer after calling Advance to continue writing more data and cannot write to a previously acquired buffer. + /// + public Memory GetMemory(int sizeHint = 0) + { + CheckAndResizeBuffer(sizeHint); + Debug.Assert(_buffer.Length > _index); + return _buffer.AsMemory(_index); + } + + /// + /// Returns a to write to that is at least the requested length (specified by ). + /// If no is provided (or it's equal to 0), some non-empty buffer is returned. + /// + /// + /// Thrown when is negative. + /// + /// + /// This will never return an empty . + /// + /// + /// There is no guarantee that successive calls will return the same buffer or the same-sized buffer. + /// + /// + /// You must request a new buffer after calling Advance to continue writing more data and cannot write to a previously acquired buffer. + /// + public Span GetSpan(int sizeHint = 0) + { + CheckAndResizeBuffer(sizeHint); + Debug.Assert(_buffer.Length > _index); + return _buffer.AsSpan(_index); + } + + private void CheckAndResizeBuffer(int sizeHint) + { + if (sizeHint < 0) + throw new ArgumentException(nameof(sizeHint)); + + if (sizeHint == 0) + { + sizeHint = 1; + } + + if (sizeHint > FreeCapacity) + { + int growBy = Math.Max(sizeHint, _buffer.Length); + + if (_buffer.Length == 0) + { + growBy = Math.Max(growBy, DefaultInitialBufferSize); + } + + // enable tests that write to small buffer segments + if (MaxGrowBy.HasValue && growBy > MaxGrowBy.Value) + { + growBy = MaxGrowBy.Value; + } + + int newSize = checked(_buffer.Length + growBy); + + Array.Resize(ref _buffer, newSize); + } + + Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint); + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs index 84e6341e95..04d68b5bdc 100644 --- a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs +++ b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs @@ -34,6 +34,13 @@ using System; using System.Text; using NUnit.Framework; using System.IO; +using System.Collections.Generic; +using System.Collections; +using System.Linq; +using System.Buffers; +using System.Runtime.InteropServices; +using System.Threading; +using System.Runtime.CompilerServices; #if !NET35 using System.Threading.Tasks; #endif @@ -54,6 +61,7 @@ namespace Google.Protobuf EqualityTester.AssertInequality(b1, b3); EqualityTester.AssertInequality(b1, b4); EqualityTester.AssertInequality(b1, null); + EqualityTester.AssertEquality(ByteString.Empty, ByteString.Empty); #pragma warning disable 1718 // Deliberately calling ==(b1, b1) and !=(b1, b1) Assert.IsTrue(b1 == b1); Assert.IsTrue(b1 == b2); @@ -63,6 +71,7 @@ namespace Google.Protobuf Assert.IsTrue((ByteString) null == null); Assert.IsFalse(b1 != b1); Assert.IsFalse(b1 != b2); + Assert.IsTrue(ByteString.Empty == ByteString.Empty); #pragma warning disable 1718 Assert.IsTrue(b1 != b3); Assert.IsTrue(b1 != b4); @@ -110,6 +119,18 @@ namespace Google.Protobuf Assert.AreEqual(10, bs[0]); } + [Test] + public void CopyFromReadOnlySpanCopiesContents() + { + byte[] data = new byte[1]; + data[0] = 10; + ReadOnlySpan byteSpan = data; + var bs = ByteString.CopyFrom(byteSpan); + Assert.AreEqual(10, bs[0]); + data[0] = 5; + Assert.AreEqual(10, bs[0]); + } + [Test] public void ToByteArrayCopiesContents() { @@ -142,6 +163,100 @@ namespace Google.Protobuf Assert.AreEqual(3, bs[1]); } + [Test] + public void CopyTo() + { + byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; + ByteString bs = ByteString.CopyFrom(data); + + byte[] dest = new byte[data.Length]; + bs.CopyTo(dest, 0); + + CollectionAssert.AreEqual(data, dest); + } + + [Test] + public void GetEnumerator() + { + byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; + ByteString bs = ByteString.CopyFrom(data); + + IEnumerator genericEnumerator = bs.GetEnumerator(); + Assert.IsTrue(genericEnumerator.MoveNext()); + Assert.AreEqual(0, genericEnumerator.Current); + + IEnumerator enumerator = ((IEnumerable)bs).GetEnumerator(); + Assert.IsTrue(enumerator.MoveNext()); + Assert.AreEqual(0, enumerator.Current); + + // Call via LINQ + CollectionAssert.AreEqual(bs.Span.ToArray(), bs.ToArray()); + } + + [Test] + public void UnsafeWrap() + { + byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; + ByteString bs = UnsafeByteOperations.UnsafeWrap(data.AsMemory(2, 3)); + ReadOnlySpan s = bs.Span; + + Assert.AreEqual(3, s.Length); + Assert.AreEqual(2, s[0]); + Assert.AreEqual(3, s[1]); + Assert.AreEqual(4, s[2]); + + // Check that the value is not a copy + data[2] = byte.MaxValue; + Assert.AreEqual(byte.MaxValue, s[0]); + } + + [Test] + public void CreateCodedInput_FromArraySegment() + { + byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; + ByteString bs = UnsafeByteOperations.UnsafeWrap(data.AsMemory(2, 3)); + CodedInputStream codedInputStream = bs.CreateCodedInput(); + + byte[] bytes = codedInputStream.ReadRawBytes(3); + + Assert.AreEqual(3, bytes.Length); + Assert.AreEqual(2, bytes[0]); + Assert.AreEqual(3, bytes[1]); + Assert.AreEqual(4, bytes[2]); + Assert.IsTrue(codedInputStream.IsAtEnd); + } + + [Test] + public void WriteToStream() + { + byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6 }; + ByteString bs = ByteString.CopyFrom(data); + + MemoryStream ms = new MemoryStream(); + bs.WriteTo(ms); + + CollectionAssert.AreEqual(data, ms.ToArray()); + } + + [Test] + public void WriteToStream_Stackalloc() + { + byte[] data = Encoding.UTF8.GetBytes("Hello world"); + Span s = stackalloc byte[data.Length]; + data.CopyTo(s); + + MemoryStream ms = new MemoryStream(); + + using (UnmanagedMemoryManager manager = new UnmanagedMemoryManager(s)) + { + ByteString bs = ByteString.AttachBytes(manager.Memory); + + bs.WriteTo(ms); + } + + CollectionAssert.AreEqual(data, ms.ToArray()); + } + [Test] public void ToStringUtf8() { @@ -156,6 +271,21 @@ namespace Google.Protobuf Assert.AreEqual("\u20ac", bs.ToString(Encoding.Unicode)); } + [Test] + public void ToString_Stackalloc() + { + byte[] data = Encoding.UTF8.GetBytes("Hello world"); + Span s = stackalloc byte[data.Length]; + data.CopyTo(s); + + using (UnmanagedMemoryManager manager = new UnmanagedMemoryManager(s)) + { + ByteString bs = ByteString.AttachBytes(manager.Memory); + + Assert.AreEqual("Hello world", bs.ToString(Encoding.UTF8)); + } + } + [Test] public void FromBase64_WithText() { @@ -172,6 +302,29 @@ namespace Google.Protobuf Assert.AreSame(ByteString.Empty, ByteString.FromBase64("")); } + [Test] + public void ToBase64_Array() + { + ByteString bs = ByteString.CopyFrom(Encoding.UTF8.GetBytes("Hello world")); + + Assert.AreEqual("SGVsbG8gd29ybGQ=", bs.ToBase64()); + } + + [Test] + public void ToBase64_Stackalloc() + { + byte[] data = Encoding.UTF8.GetBytes("Hello world"); + Span s = stackalloc byte[data.Length]; + data.CopyTo(s); + + using (UnmanagedMemoryManager manager = new UnmanagedMemoryManager(s)) + { + ByteString bs = ByteString.AttachBytes(manager.Memory); + + Assert.AreEqual("SGVsbG8gd29ybGQ=", bs.ToBase64()); + } + } + [Test] public void FromStream_Seekable() { @@ -233,5 +386,54 @@ namespace Google.Protobuf ByteString b2 = ByteString.CopyFrom(200, 1, 2, 3, 4); Assert.AreNotEqual(b1.GetHashCode(), b2.GetHashCode()); } + + [Test] + public void GetContentsAsReadOnlySpan() + { + var byteString = ByteString.CopyFrom(1, 2, 3, 4, 5); + var copied = byteString.Span.ToArray(); + CollectionAssert.AreEqual(byteString, copied); + } + + [Test] + public void GetContentsAsReadOnlyMemory() + { + var byteString = ByteString.CopyFrom(1, 2, 3, 4, 5); + var copied = byteString.Memory.ToArray(); + CollectionAssert.AreEqual(byteString, copied); + } + + // Create Memory from non-array source. + // Use by ByteString tests that have optimized path for array backed Memory. + private sealed unsafe class UnmanagedMemoryManager : MemoryManager where T : unmanaged + { + private readonly T* _pointer; + private readonly int _length; + + public UnmanagedMemoryManager(Span span) + { + fixed (T* ptr = &MemoryMarshal.GetReference(span)) + { + _pointer = ptr; + _length = span.Length; + } + } + + public override Span GetSpan() => new Span(_pointer, _length); + + public override MemoryHandle Pin(int elementIndex = 0) + { + if (elementIndex < 0 || elementIndex >= _length) + { + throw new ArgumentOutOfRangeException(nameof(elementIndex)); + } + + return new MemoryHandle(_pointer + elementIndex); + } + + public override void Unpin() { } + + protected override void Dispose(bool disposing) { } + } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs b/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs index 5f360ff46e..5e72525fc9 100644 --- a/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs +++ b/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs @@ -31,6 +31,7 @@ #endregion using System; +using System.Buffers; using System.IO; using Google.Protobuf.TestProtos; using Proto2 = Google.Protobuf.TestProtos.Proto2; @@ -62,11 +63,22 @@ namespace Google.Protobuf { CodedInputStream input = new CodedInputStream(data); Assert.AreEqual((uint) value, input.ReadRawVarint32()); + Assert.IsTrue(input.IsAtEnd); input = new CodedInputStream(data); Assert.AreEqual(value, input.ReadRawVarint64()); Assert.IsTrue(input.IsAtEnd); + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + Assert.AreEqual((uint) value, ctx.ReadUInt32()); + }, true); + + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadUInt64()); + }, true); + // Try different block sizes. for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) { @@ -76,6 +88,16 @@ namespace Google.Protobuf input = new CodedInputStream(new SmallBlockInputStream(data, bufferSize)); Assert.AreEqual(value, input.ReadRawVarint64()); Assert.IsTrue(input.IsAtEnd); + + AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, bufferSize), (ref ParseContext ctx) => + { + Assert.AreEqual((uint) value, ctx.ReadUInt32()); + }, true); + + AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, bufferSize), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadUInt64()); + }, true); } // Try reading directly from a MemoryStream. We want to verify that it @@ -104,11 +126,58 @@ namespace Google.Protobuf exception = Assert.Throws(() => input.ReadRawVarint64()); Assert.AreEqual(expected.Message, exception.Message); + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + try + { + ctx.ReadUInt32(); + Assert.Fail(); + } + catch (InvalidProtocolBufferException ex) + { + Assert.AreEqual(expected.Message, ex.Message); + } + }, false); + + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + try + { + ctx.ReadUInt64(); + Assert.Fail(); + } + catch (InvalidProtocolBufferException ex) + { + Assert.AreEqual(expected.Message, ex.Message); + } + }, false); + // Make sure we get the same error when reading directly from a Stream. exception = Assert.Throws(() => CodedInputStream.ReadRawVarint32(new MemoryStream(data))); Assert.AreEqual(expected.Message, exception.Message); } + private delegate void ParseContextAssertAction(ref ParseContext ctx); + + private static void AssertReadFromParseContext(ReadOnlySequence input, ParseContextAssertAction assertAction, bool assertIsAtEnd) + { + // Check as ReadOnlySequence + ParseContext.Initialize(input, out ParseContext parseCtx); + assertAction(ref parseCtx); + if (assertIsAtEnd) + { + Assert.IsTrue(SegmentedBufferHelper.IsAtEnd(ref parseCtx.buffer, ref parseCtx.state)); + } + + // Check as ReadOnlySpan + ParseContext.Initialize(input.ToArray().AsSpan(), out ParseContext spanParseContext); + assertAction(ref spanParseContext); + if (assertIsAtEnd) + { + Assert.IsTrue(SegmentedBufferHelper.IsAtEnd(ref spanParseContext.buffer, ref spanParseContext.state)); + } + } + [Test] public void ReadVarint() { @@ -157,6 +226,11 @@ namespace Google.Protobuf Assert.AreEqual(value, input.ReadRawLittleEndian32()); Assert.IsTrue(input.IsAtEnd); + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadFixed32()); + }, true); + // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { @@ -164,6 +238,11 @@ namespace Google.Protobuf new SmallBlockInputStream(data, blockSize)); Assert.AreEqual(value, input.ReadRawLittleEndian32()); Assert.IsTrue(input.IsAtEnd); + + AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, blockSize), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadFixed32()); + }, true); } } @@ -177,6 +256,11 @@ namespace Google.Protobuf Assert.AreEqual(value, input.ReadRawLittleEndian64()); Assert.IsTrue(input.IsAtEnd); + AssertReadFromParseContext(new ReadOnlySequence(data), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadFixed64()); + }, true); + // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { @@ -184,6 +268,11 @@ namespace Google.Protobuf new SmallBlockInputStream(data, blockSize)); Assert.AreEqual(value, input.ReadRawLittleEndian64()); Assert.IsTrue(input.IsAtEnd); + + AssertReadFromParseContext(ReadOnlySequenceFactory.CreateWithContent(data, blockSize), (ref ParseContext ctx) => + { + Assert.AreEqual(value, ctx.ReadFixed64()); + }, true); } } @@ -202,29 +291,29 @@ namespace Google.Protobuf [Test] public void DecodeZigZag32() { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(0)); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(1)); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(2)); - Assert.AreEqual(-2, CodedInputStream.DecodeZigZag32(3)); - Assert.AreEqual(0x3FFFFFFF, CodedInputStream.DecodeZigZag32(0x7FFFFFFE)); - Assert.AreEqual(unchecked((int) 0xC0000000), CodedInputStream.DecodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0x7FFFFFFF, CodedInputStream.DecodeZigZag32(0xFFFFFFFE)); - Assert.AreEqual(unchecked((int) 0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF)); + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(0)); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(1)); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(2)); + Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag32(3)); + Assert.AreEqual(0x3FFFFFFF, ParsingPrimitives.DecodeZigZag32(0x7FFFFFFE)); + Assert.AreEqual(unchecked((int) 0xC0000000), ParsingPrimitives.DecodeZigZag32(0x7FFFFFFF)); + Assert.AreEqual(0x7FFFFFFF, ParsingPrimitives.DecodeZigZag32(0xFFFFFFFE)); + Assert.AreEqual(unchecked((int) 0x80000000), ParsingPrimitives.DecodeZigZag32(0xFFFFFFFF)); } [Test] public void DecodeZigZag64() { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(0)); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(1)); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(2)); - Assert.AreEqual(-2, CodedInputStream.DecodeZigZag64(3)); - Assert.AreEqual(0x000000003FFFFFFFL, CodedInputStream.DecodeZigZag64(0x000000007FFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), CodedInputStream.DecodeZigZag64(0x000000007FFFFFFFL)); - Assert.AreEqual(0x000000007FFFFFFFL, CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFFL)); - Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(0)); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(1)); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(2)); + Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag64(3)); + Assert.AreEqual(0x000000003FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFEL)); + Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFFL)); + Assert.AreEqual(0x000000007FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFEL)); + Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFFL)); + Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); + Assert.AreEqual(unchecked((long) 0x8000000000000000L), ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); } [Test] @@ -244,7 +333,44 @@ namespace Google.Protobuf Assert.AreEqual(message, message2); } } - + + [Test] + public void ReadWholeMessage_VaryingBlockSizes_FromSequence() + { + TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); + + byte[] rawBytes = message.ToByteArray(); + Assert.AreEqual(rawBytes.Length, message.CalculateSize()); + TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(rawBytes); + Assert.AreEqual(message, message2); + + // Try different block sizes. + for (int blockSize = 1; blockSize < 256; blockSize *= 2) + { + message2 = TestAllTypes.Parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(rawBytes, blockSize)); + Assert.AreEqual(message, message2); + } + } + + [Test] + public void ReadInt32Wrapper_VariableBlockSizes() + { + byte[] rawBytes = new byte[] { 202, 1, 11, 8, 254, 255, 255, 255, 255, 255, 255, 255, 255, 1 }; + + for (int blockSize = 1; blockSize <= rawBytes.Length; blockSize++) + { + ReadOnlySequence data = ReadOnlySequenceFactory.CreateWithContent(rawBytes, blockSize); + AssertReadFromParseContext(data, (ref ParseContext ctx) => + { + ctx.ReadTag(); + + var value = ParsingPrimitivesWrappers.ReadInt32Wrapper(ref ctx); + + Assert.AreEqual(-2, value); + }, true); + } + } + [Test] public void ReadHugeBlob() { @@ -285,6 +411,70 @@ namespace Google.Protobuf Assert.Throws(() => input.ReadBytes()); } + [Test] + public void ReadBlobGreaterThanCurrentLimit() + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + output.WriteRawVarint32(tag); + output.WriteRawVarint32(4); + output.WriteRawBytes(new byte[4]); // Pad with a few random bytes. + output.Flush(); + ms.Position = 0; + + CodedInputStream input = new CodedInputStream(ms); + Assert.AreEqual(tag, input.ReadTag()); + + // Specify limit smaller than data length + input.PushLimit(3); + Assert.Throws(() => input.ReadBytes()); + + AssertReadFromParseContext(new ReadOnlySequence(ms.ToArray()), (ref ParseContext ctx) => + { + Assert.AreEqual(tag, ctx.ReadTag()); + SegmentedBufferHelper.PushLimit(ref ctx.state, 3); + try + { + ctx.ReadBytes(); + Assert.Fail(); + } + catch (InvalidProtocolBufferException) {} + }, true); + } + + [Test] + public void ReadStringGreaterThanCurrentLimit() + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + output.WriteRawVarint32(tag); + output.WriteRawVarint32(4); + output.WriteRawBytes(new byte[4]); // Pad with a few random bytes. + output.Flush(); + ms.Position = 0; + + CodedInputStream input = new CodedInputStream(ms.ToArray()); + Assert.AreEqual(tag, input.ReadTag()); + + // Specify limit smaller than data length + input.PushLimit(3); + Assert.Throws(() => input.ReadString()); + + AssertReadFromParseContext(new ReadOnlySequence(ms.ToArray()), (ref ParseContext ctx) => + { + Assert.AreEqual(tag, ctx.ReadTag()); + SegmentedBufferHelper.PushLimit(ref ctx.state, 3); + try + { + ctx.ReadString(); + Assert.Fail(); + } + catch (InvalidProtocolBufferException) { } + }, true); + } + // Representations of a tag for field 0 with various wire types [Test] [TestCase(0)] @@ -339,64 +529,64 @@ namespace Google.Protobuf Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(input)); } - private static byte[] MakeMaliciousRecursionUnknownFieldsPayload(int recursionDepth) - { - // generate recursively nested groups that will be parsed as unknown fields - int unknownFieldNumber = 14; // an unused field number - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - for (int i = 0; i < recursionDepth; i++) - { - output.WriteTag(WireFormat.MakeTag(unknownFieldNumber, WireFormat.WireType.StartGroup)); - } - for (int i = 0; i < recursionDepth; i++) - { - output.WriteTag(WireFormat.MakeTag(unknownFieldNumber, WireFormat.WireType.EndGroup)); - } - output.Flush(); - return ms.ToArray(); + private static byte[] MakeMaliciousRecursionUnknownFieldsPayload(int recursionDepth) + { + // generate recursively nested groups that will be parsed as unknown fields + int unknownFieldNumber = 14; // an unused field number + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + for (int i = 0; i < recursionDepth; i++) + { + output.WriteTag(WireFormat.MakeTag(unknownFieldNumber, WireFormat.WireType.StartGroup)); + } + for (int i = 0; i < recursionDepth; i++) + { + output.WriteTag(WireFormat.MakeTag(unknownFieldNumber, WireFormat.WireType.EndGroup)); + } + output.Flush(); + return ms.ToArray(); } [Test] public void MaliciousRecursion_UnknownFields() { - byte[] payloadAtRecursiveLimit = MakeMaliciousRecursionUnknownFieldsPayload(CodedInputStream.DefaultRecursionLimit); - byte[] payloadBeyondRecursiveLimit = MakeMaliciousRecursionUnknownFieldsPayload(CodedInputStream.DefaultRecursionLimit + 1); - - Assert.DoesNotThrow(() => TestRecursiveMessage.Parser.ParseFrom(payloadAtRecursiveLimit)); + byte[] payloadAtRecursiveLimit = MakeMaliciousRecursionUnknownFieldsPayload(CodedInputStream.DefaultRecursionLimit); + byte[] payloadBeyondRecursiveLimit = MakeMaliciousRecursionUnknownFieldsPayload(CodedInputStream.DefaultRecursionLimit + 1); + + Assert.DoesNotThrow(() => TestRecursiveMessage.Parser.ParseFrom(payloadAtRecursiveLimit)); Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(payloadBeyondRecursiveLimit)); } [Test] public void ReadGroup_WrongEndGroupTag() - { - int groupFieldNumber = Proto2.TestAllTypes.OptionalGroupFieldNumber; - - // write Proto2.TestAllTypes with "optional_group" set, but use wrong EndGroup closing tag - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - output.WriteTag(WireFormat.MakeTag(groupFieldNumber, WireFormat.WireType.StartGroup)); - output.WriteGroup(new Proto2.TestAllTypes.Types.OptionalGroup { A = 12345 }); - // end group with different field number - output.WriteTag(WireFormat.MakeTag(groupFieldNumber + 1, WireFormat.WireType.EndGroup)); - output.Flush(); - var payload = ms.ToArray(); - - Assert.Throws(() => Proto2.TestAllTypes.Parser.ParseFrom(payload)); + { + int groupFieldNumber = Proto2.TestAllTypes.OptionalGroupFieldNumber; + + // write Proto2.TestAllTypes with "optional_group" set, but use wrong EndGroup closing tag + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + output.WriteTag(WireFormat.MakeTag(groupFieldNumber, WireFormat.WireType.StartGroup)); + output.WriteGroup(new Proto2.TestAllTypes.Types.OptionalGroup { A = 12345 }); + // end group with different field number + output.WriteTag(WireFormat.MakeTag(groupFieldNumber + 1, WireFormat.WireType.EndGroup)); + output.Flush(); + var payload = ms.ToArray(); + + Assert.Throws(() => Proto2.TestAllTypes.Parser.ParseFrom(payload)); } [Test] public void ReadGroup_UnknownFields_WrongEndGroupTag() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(ms); - output.WriteTag(WireFormat.MakeTag(14, WireFormat.WireType.StartGroup)); - // end group with different field number - output.WriteTag(WireFormat.MakeTag(15, WireFormat.WireType.EndGroup)); - output.Flush(); - var payload = ms.ToArray(); - - Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(payload)); + { + MemoryStream ms = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(ms); + output.WriteTag(WireFormat.MakeTag(14, WireFormat.WireType.StartGroup)); + // end group with different field number + output.WriteTag(WireFormat.MakeTag(15, WireFormat.WireType.EndGroup)); + output.Flush(); + var payload = ms.ToArray(); + + Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(payload)); } [Test] diff --git a/csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs b/csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs index 98cabd55ad..14440098f1 100644 --- a/csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs +++ b/csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs @@ -33,7 +33,9 @@ using System; using System.IO; using Google.Protobuf.TestProtos; +using Google.Protobuf.Buffers; using NUnit.Framework; +using System.Text; namespace Google.Protobuf { @@ -48,22 +50,39 @@ namespace Google.Protobuf // Only do 32-bit write if the value fits in 32 bits. if ((value >> 32) == 0) { + // CodedOutputStream MemoryStream rawOutput = new MemoryStream(); CodedOutputStream output = new CodedOutputStream(rawOutput); output.WriteRawVarint32((uint) value); output.Flush(); Assert.AreEqual(data, rawOutput.ToArray()); + + // IBufferWriter + var bufferWriter = new TestArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteUInt32((uint) value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + // Also try computing size. Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value)); } { + // CodedOutputStream MemoryStream rawOutput = new MemoryStream(); CodedOutputStream output = new CodedOutputStream(rawOutput); output.WriteRawVarint64(value); output.Flush(); Assert.AreEqual(data, rawOutput.ToArray()); + // IBufferWriter + var bufferWriter = new TestArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteUInt64(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + // Also try computing size. Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint64Size(value)); } @@ -80,6 +99,13 @@ namespace Google.Protobuf output.WriteRawVarint32((uint) value); output.Flush(); Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new TestArrayBufferWriter(); + bufferWriter.MaxGrowBy = bufferSize; + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteUInt32((uint) value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); } { @@ -88,7 +114,15 @@ namespace Google.Protobuf output.WriteRawVarint64(value); output.Flush(); Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new TestArrayBufferWriter(); + bufferWriter.MaxGrowBy = bufferSize; + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteUInt64(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); } + } } @@ -133,20 +167,35 @@ namespace Google.Protobuf /// private static void AssertWriteLittleEndian32(byte[] data, uint value) { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput); - output.WriteRawLittleEndian32(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); + { + var rawOutput = new MemoryStream(); + var output = new CodedOutputStream(rawOutput); + output.WriteRawLittleEndian32(value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new TestArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteFixed32(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + } // Try different buffer sizes. for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) { - rawOutput = new MemoryStream(); - output = new CodedOutputStream(rawOutput, bufferSize); + var rawOutput = new MemoryStream(); + var output = new CodedOutputStream(rawOutput, bufferSize); output.WriteRawLittleEndian32(value); output.Flush(); Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new TestArrayBufferWriter(); + bufferWriter.MaxGrowBy = bufferSize; + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteFixed32(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); } } @@ -156,20 +205,35 @@ namespace Google.Protobuf /// private static void AssertWriteLittleEndian64(byte[] data, ulong value) { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = new CodedOutputStream(rawOutput); - output.WriteRawLittleEndian64(value); - output.Flush(); - Assert.AreEqual(data, rawOutput.ToArray()); + { + var rawOutput = new MemoryStream(); + var output = new CodedOutputStream(rawOutput); + output.WriteRawLittleEndian64(value); + output.Flush(); + Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new TestArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteFixed64(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); + } // Try different block sizes. for (int blockSize = 1; blockSize <= 16; blockSize *= 2) { - rawOutput = new MemoryStream(); - output = new CodedOutputStream(rawOutput, blockSize); + var rawOutput = new MemoryStream(); + var output = new CodedOutputStream(rawOutput, blockSize); output.WriteRawLittleEndian64(value); output.Flush(); Assert.AreEqual(data, rawOutput.ToArray()); + + var bufferWriter = new TestArrayBufferWriter(); + bufferWriter.MaxGrowBy = blockSize; + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteFixed64(value); + ctx.Flush(); + Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); } } @@ -205,41 +269,72 @@ namespace Google.Protobuf message.WriteTo(output); output.Flush(); Assert.AreEqual(rawBytes, rawOutput.ToArray()); + + var bufferWriter = new TestArrayBufferWriter(); + bufferWriter.MaxGrowBy = blockSize; + message.WriteTo(bufferWriter); + Assert.AreEqual(rawBytes, bufferWriter.WrittenSpan.ToArray()); } } + + [Test] + public void WriteContext_WritesWithFlushes() + { + TestAllTypes message = SampleMessages.CreateFullTestAllTypes(); + + MemoryStream expectedOutput = new MemoryStream(); + CodedOutputStream output = new CodedOutputStream(expectedOutput); + output.WriteMessage(message); + output.Flush(); + byte[] expectedBytes1 = expectedOutput.ToArray(); + + output.WriteMessage(message); + output.Flush(); + byte[] expectedBytes2 = expectedOutput.ToArray(); + + var bufferWriter = new TestArrayBufferWriter(); + WriteContext.Initialize(bufferWriter, out WriteContext ctx); + ctx.WriteMessage(message); + ctx.Flush(); + Assert.AreEqual(expectedBytes1, bufferWriter.WrittenSpan.ToArray()); + + ctx.WriteMessage(message); + ctx.Flush(); + Assert.AreEqual(expectedBytes2, bufferWriter.WrittenSpan.ToArray()); + } [Test] public void EncodeZigZag32() { - Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag32(0)); - Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag32(-1)); - Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag32(1)); - Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag32(-2)); - Assert.AreEqual(0x7FFFFFFEu, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF)); - Assert.AreEqual(0x7FFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0xC0000000))); - Assert.AreEqual(0xFFFFFFFEu, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0xFFFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0x80000000))); + Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag32(0)); + Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag32(-1)); + Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag32(1)); + Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag32(-2)); + Assert.AreEqual(0x7FFFFFFEu, WritingPrimitives.EncodeZigZag32(0x3FFFFFFF)); + Assert.AreEqual(0x7FFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0xC0000000))); + Assert.AreEqual(0xFFFFFFFEu, WritingPrimitives.EncodeZigZag32(0x7FFFFFFF)); + Assert.AreEqual(0xFFFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0x80000000))); } [Test] public void EncodeZigZag64() { - Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag64(0)); - Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag64(-1)); - Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag64(1)); - Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag64(-2)); + Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag64(0)); + Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag64(-1)); + Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag64(1)); + Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag64(-2)); Assert.AreEqual(0x000000007FFFFFFEuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); Assert.AreEqual(0x000000007FFFFFFFuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); Assert.AreEqual(0x00000000FFFFFFFEuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); Assert.AreEqual(0x00000000FFFFFFFFuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); Assert.AreEqual(0xFFFFFFFFFFFFFFFEL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); Assert.AreEqual(0xFFFFFFFFFFFFFFFFL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); + WritingPrimitives.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); } [Test] @@ -247,26 +342,26 @@ namespace Google.Protobuf { // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) // were chosen semi-randomly via keyboard bashing. - Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(0))); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(1))); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-1))); - Assert.AreEqual(14927, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(14927))); - Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612))); + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(0))); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(1))); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-1))); + Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(14927))); + Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-3612))); } [Test] public void RoundTripZigZag64() { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0))); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(1))); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-1))); - Assert.AreEqual(14927, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(14927))); - Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-3612))); + Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(0))); + Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(1))); + Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-1))); + Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(14927))); + Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-3612))); Assert.AreEqual(856912304801416L, - CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(856912304801416L))); + ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(856912304801416L))); Assert.AreEqual(-75123905439571256L, - CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-75123905439571256L))); + ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-75123905439571256L))); } [Test] @@ -395,7 +490,7 @@ namespace Google.Protobuf Assert.IsTrue(memoryStream.CanWrite); using (var cos = new CodedOutputStream(memoryStream)) { - cos.WriteRawByte(0); + cos.WriteRawBytes(new byte[] {0}); Assert.AreEqual(0, memoryStream.Position); // Not flushed yet } Assert.AreEqual(1, memoryStream.ToArray().Length); // Flushed data from CodedOutputStream to MemoryStream @@ -409,7 +504,7 @@ namespace Google.Protobuf Assert.IsTrue(memoryStream.CanWrite); using (var cos = new CodedOutputStream(memoryStream, true)) { - cos.WriteRawByte(0); + cos.WriteRawBytes(new byte[] {0}); Assert.AreEqual(0, memoryStream.Position); // Not flushed yet } Assert.AreEqual(1, memoryStream.Position); // Flushed data from CodedOutputStream to MemoryStream @@ -422,5 +517,67 @@ namespace Google.Protobuf var stream = new CodedOutputStream(new byte[10]); stream.Dispose(); } + + [Test] + public void WriteString_AsciiSmall_MaxUtf8SizeExceedsBuffer() + { + var buffer = new byte[5]; + var output = new CodedOutputStream(buffer); + output.WriteString("ABC"); + + output.Flush(); + + // Verify written content + var input = new CodedInputStream(buffer); + Assert.AreEqual("ABC", input.ReadString()); + } + + [Test] + public void WriteStringsOfDifferentSizes_Ascii() + { + for (int i = 1; i <= 1024; i++) + { + var buffer = new byte[4096]; + var output = new CodedOutputStream(buffer); + var sb = new StringBuilder(); + for (int j = 0; j < i; j++) + { + sb.Append((j % 10).ToString()); // incrementing numbers, repeating + } + var s = sb.ToString(); + output.WriteString(s); + + output.Flush(); + + // Verify written content + var input = new CodedInputStream(buffer); + Assert.AreEqual(s, input.ReadString()); + } + } + + [Test] + public void WriteStringsOfDifferentSizes_Unicode() + { + for (int i = 1; i <= 1024; i++) + { + var buffer = new byte[4096]; + var output = new CodedOutputStream(buffer); + var sb = new StringBuilder(); + for (int j = 0; j < i; j++) + { + char c = (char)((j % 10) + 10112); + sb.Append(c.ToString()); // incrementing unicode numbers, repeating + } + var s = sb.ToString(); + output.WriteString(s); + + output.Flush(); + + // Verify written content + var input = new CodedInputStream(buffer); + + Assert.AreEqual(s, input.ReadString()); + } + } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs b/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs index f64ebac4ef..d4c63dc688 100644 --- a/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs +++ b/csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs @@ -31,6 +31,7 @@ #endregion using System; +using System.IO; using System.Collections.Generic; using Google.Protobuf.TestProtos; using NUnit.Framework; @@ -583,6 +584,59 @@ namespace Google.Protobuf.Collections Assert.False(map.TryGetValue(SampleNaNs.PayloadFlipped, out ignored)); } + [Test] + public void AddEntriesFrom_CodedInputStream() + { + // map will have string key and string value + var keyTag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + var valueTag = WireFormat.MakeTag(2, WireFormat.WireType.LengthDelimited); + + var memoryStream = new MemoryStream(); + var output = new CodedOutputStream(memoryStream); + output.WriteLength(20); // total of keyTag + key + valueTag + value + output.WriteTag(keyTag); + output.WriteString("the_key"); + output.WriteTag(valueTag); + output.WriteString("the_value"); + output.Flush(); + + var field = new MapField(); + var mapCodec = new MapField.Codec(FieldCodec.ForString(keyTag, ""), FieldCodec.ForString(valueTag, ""), 10); + var input = new CodedInputStream(memoryStream.ToArray()); + + // test the legacy overload of AddEntriesFrom that takes a CodedInputStream + field.AddEntriesFrom(input, mapCodec); + CollectionAssert.AreEquivalent(new[] { "the_key" }, field.Keys); + CollectionAssert.AreEquivalent(new[] { "the_value" }, field.Values); + Assert.IsTrue(input.IsAtEnd); + } + + [Test] + public void AddEntriesFrom_CodedInputStream_MissingKey() + { + // map will have string key and string value + var keyTag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + var valueTag = WireFormat.MakeTag(2, WireFormat.WireType.LengthDelimited); + + var memoryStream = new MemoryStream(); + var output = new CodedOutputStream(memoryStream); + output.WriteLength(11); // total of valueTag + value + output.WriteTag(valueTag); + output.WriteString("the_value"); + output.Flush(); + + Console.WriteLine(BitConverter.ToString(memoryStream.ToArray())); + + var field = new MapField(); + var mapCodec = new MapField.Codec(FieldCodec.ForString(keyTag, ""), FieldCodec.ForString(valueTag, ""), 10); + var input = new CodedInputStream(memoryStream.ToArray()); + + field.AddEntriesFrom(input, mapCodec); + CollectionAssert.AreEquivalent(new[] { "" }, field.Keys); + CollectionAssert.AreEquivalent(new[] { "the_value" }, field.Values); + Assert.IsTrue(input.IsAtEnd); + } + #if !NET35 [Test] public void IDictionaryKeys_Equals_IReadOnlyDictionaryKeys() diff --git a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs index 527c7d404c..61453e5ab2 100644 --- a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs +++ b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs @@ -595,6 +595,95 @@ namespace Google.Protobuf.Collections Assert.AreEqual(((SampleEnum)(-5)), values[5]); } + [Test] + public void TestPackedRepeatedFieldCollectionNonDivisibleLength() + { + uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); + var codec = FieldCodec.ForFixed32(tag); + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(tag); + output.WriteString("A long string"); + output.WriteTag(codec.Tag); + output.WriteRawVarint32((uint)codec.FixedSize - 1); // Length not divisible by FixedSize + output.WriteFixed32(uint.MaxValue); + output.Flush(); + stream.Position = 0; + + var input = new CodedInputStream(stream); + input.ReadTag(); + input.ReadString(); + input.ReadTag(); + var field = new RepeatedField(); + Assert.Throws(() => field.AddEntriesFrom(input, codec)); + + // Collection was not pre-initialized + Assert.AreEqual(0, field.Count); + } + + [Test] + public void TestPackedRepeatedFieldCollectionNotAllocatedWhenLengthExceedsBuffer() + { + uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); + var codec = FieldCodec.ForFixed32(tag); + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(tag); + output.WriteString("A long string"); + output.WriteTag(codec.Tag); + output.WriteRawVarint32((uint)codec.FixedSize); + // Note that there is no content for the packed field. + // The field length exceeds the remaining length of content. + output.Flush(); + stream.Position = 0; + + var input = new CodedInputStream(stream); + input.ReadTag(); + input.ReadString(); + input.ReadTag(); + var field = new RepeatedField(); + Assert.Throws(() => field.AddEntriesFrom(input, codec)); + + // Collection was not pre-initialized + Assert.AreEqual(0, field.Count); + } + + [Test] + public void TestPackedRepeatedFieldCollectionNotAllocatedWhenLengthExceedsRemainingData() + { + uint tag = WireFormat.MakeTag(10, WireFormat.WireType.LengthDelimited); + var codec = FieldCodec.ForFixed32(tag); + var stream = new MemoryStream(); + var output = new CodedOutputStream(stream); + output.WriteTag(tag); + output.WriteString("A long string"); + output.WriteTag(codec.Tag); + output.WriteRawVarint32((uint)codec.FixedSize); + // Note that there is no content for the packed field. + // The field length exceeds the remaining length of the buffer. + output.Flush(); + stream.Position = 0; + + var sequence = ReadOnlySequenceFactory.CreateWithContent(stream.ToArray()); + ParseContext.Initialize(sequence, out ParseContext ctx); + + ctx.ReadTag(); + ctx.ReadString(); + ctx.ReadTag(); + var field = new RepeatedField(); + try + { + field.AddEntriesFrom(ref ctx, codec); + Assert.Fail(); + } + catch (InvalidProtocolBufferException) + { + } + + // Collection was not pre-initialized + Assert.AreEqual(0, field.Count); + } + // Fairly perfunctory tests for the non-generic IList implementation [Test] public void IList_Indexer() diff --git a/csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs b/csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs index 33dc50430d..951e856a59 100644 --- a/csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs +++ b/csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs @@ -1,4 +1,4 @@ -using Google.Protobuf.TestProtos.Proto2; +using Google.Protobuf.TestProtos.Proto2; using NUnit.Framework; using static Google.Protobuf.TestProtos.Proto2.UnittestExtensions; @@ -34,12 +34,16 @@ namespace Google.Protobuf message.SetExtension(OptionalBoolExtension, true); var serialized = message.ToByteArray(); - var other = TestAllExtensions.Parser - .WithExtensionRegistry(new ExtensionRegistry() { OptionalBoolExtension }) - .ParseFrom(serialized); + MessageParsingHelpers.AssertWritingMessage(message); - Assert.AreEqual(message, other); - Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); + MessageParsingHelpers.AssertReadingMessage( + TestAllExtensions.Parser.WithExtensionRegistry(new ExtensionRegistry() { OptionalBoolExtension }), + serialized, + other => + { + Assert.AreEqual(message, other); + Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); + }); } [Test] @@ -59,6 +63,22 @@ namespace Google.Protobuf Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); } + [Test] + public void TryMergeFieldFrom_CodedInputStream() + { + var message = new TestAllExtensions(); + message.SetExtension(OptionalStringExtension, "abcd"); + + var input = new CodedInputStream(message.ToByteArray()); + input.ExtensionRegistry = new ExtensionRegistry() { OptionalStringExtension }; + input.ReadTag(); // TryMergeFieldFrom expects that a tag was just read and will inspect the LastTag value + + ExtensionSet extensionSet = null; + // test the legacy overload of TryMergeFieldFrom that takes a CodedInputStream + Assert.IsTrue(ExtensionSet.TryMergeFieldFrom(ref extensionSet, input)); + Assert.AreEqual("abcd", ExtensionSet.Get(ref extensionSet, OptionalStringExtension)); + } + [Test] public void TestEquals() { @@ -96,7 +116,22 @@ namespace Google.Protobuf var other = message.Clone(); Assert.AreEqual(message, other); - Assert.AreEqual(message.CalculateSize(), message.CalculateSize()); + Assert.AreEqual(message.CalculateSize(), other.CalculateSize()); + } + + [Test] + public void TestDefaultValueRoundTrip() + { + var message = new TestAllExtensions(); + message.SetExtension(OptionalBoolExtension, false); + Assert.IsFalse(message.GetExtension(OptionalBoolExtension)); + Assert.IsTrue(message.HasExtension(OptionalBoolExtension)); + + var bytes = message.ToByteArray(); + var registry = new ExtensionRegistry { OptionalBoolExtension }; + var parsed = TestAllExtensions.Parser.WithExtensionRegistry(registry).ParseFrom(bytes); + Assert.IsFalse(parsed.GetExtension(OptionalBoolExtension)); + Assert.IsTrue(parsed.HasExtension(OptionalBoolExtension)); } } } diff --git a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs index b20ecccde2..7f366926fa 100644 --- a/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs +++ b/csharp/src/Google.Protobuf.Test/FieldCodecTest.cs @@ -124,11 +124,21 @@ namespace Google.Protobuf { var stream = new MemoryStream(); var codedOutput = new CodedOutputStream(stream); - codec.ValueWriter(codedOutput, sampleValue); + WriteContext.Initialize(codedOutput, out WriteContext ctx); + try + { + // only write the value using the codec + codec.ValueWriter(ref ctx, sampleValue); + } + finally + { + ctx.CopyStateTo(codedOutput); + } + codedOutput.Flush(); stream.Position = 0; var codedInput = new CodedInputStream(stream); - Assert.AreEqual(sampleValue, codec.ValueReader(codedInput)); + Assert.AreEqual(sampleValue, codec.Read(codedInput)); Assert.IsTrue(codedInput.IsAtEnd); } @@ -158,7 +168,7 @@ namespace Google.Protobuf { // WriteTagAndValue ignores default values var stream = new MemoryStream(); - CodedOutputStream codedOutput; + CodedOutputStream codedOutput; #if !NET35 codedOutput = new CodedOutputStream(stream); codec.WriteTagAndValue(codedOutput, codec.DefaultValue); @@ -175,13 +185,23 @@ namespace Google.Protobuf if (codec.DefaultValue != null) // This part isn't appropriate for message types. { codedOutput = new CodedOutputStream(stream); - codec.ValueWriter(codedOutput, codec.DefaultValue); + WriteContext.Initialize(codedOutput, out WriteContext ctx); + try + { + // only write the value using the codec + codec.ValueWriter(ref ctx, codec.DefaultValue); + } + finally + { + ctx.CopyStateTo(codedOutput); + } + codedOutput.Flush(); Assert.AreNotEqual(0, stream.Position); Assert.AreEqual(stream.Position, codec.ValueSizeCalculator(codec.DefaultValue)); stream.Position = 0; var codedInput = new CodedInputStream(stream); - Assert.AreEqual(codec.DefaultValue, codec.ValueReader(codedInput)); + Assert.AreEqual(codec.DefaultValue, codec.Read(codedInput)); } } diff --git a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs index 718c3edcb8..1abed60563 100644 --- a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs +++ b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs @@ -269,8 +269,8 @@ namespace Google.Protobuf [Test] public void RequiredFieldsNoThrow() { - Assert.DoesNotThrow(() => TestRequired.Parser.ParseFrom(new byte[0])); - Assert.DoesNotThrow(() => (TestRequired.Parser as MessageParser).ParseFrom(new byte[0])); + Assert.DoesNotThrow(() => MessageParsingHelpers.AssertReadingMessage(TestRequired.Parser, new byte[0], m => { })); + Assert.DoesNotThrow(() => MessageParsingHelpers.AssertReadingMessage(TestRequired.Parser as MessageParser, new byte[0], m => { })); } [Test] @@ -344,9 +344,9 @@ namespace Google.Protobuf } }; - byte[] bytes = message.ToByteArray(); - TestAllTypes parsed = Proto2.TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(Proto2.TestAllTypes.Parser, message); } [Test] @@ -361,9 +361,11 @@ namespace Google.Protobuf new RepeatedGroup_extension { A = 30 } }); - byte[] bytes = message.ToByteArray(); - TestAllExtensions extendable_parsed = TestAllExtensions.Parser.WithExtensionRegistry(new ExtensionRegistry() { UnittestExtensions.OptionalGroupExtension, UnittestExtensions.RepeatedGroupExtension }).ParseFrom(bytes); - Assert.AreEqual(message, extendable_parsed); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip( + TestAllExtensions.Parser.WithExtensionRegistry(new ExtensionRegistry() { UnittestExtensions.OptionalGroupExtension, UnittestExtensions.RepeatedGroupExtension }), + message); } [Test] @@ -372,9 +374,11 @@ namespace Google.Protobuf var message = new TestGroupExtension(); message.SetExtension(TestNestedExtension.Extensions.OptionalGroupExtension, new TestNestedExtension.Types.OptionalGroup_extension { A = 10 }); - byte[] bytes = message.ToByteArray(); - TestGroupExtension extendable_parsed = TestGroupExtension.Parser.WithExtensionRegistry(new ExtensionRegistry() { TestNestedExtension.Extensions.OptionalGroupExtension }).ParseFrom(bytes); - Assert.AreEqual(message, extendable_parsed); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip( + TestGroupExtension.Parser.WithExtensionRegistry(new ExtensionRegistry() { TestNestedExtension.Extensions.OptionalGroupExtension }), + message); } } } diff --git a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs index 103df7dd2f..06af5e9e9a 100644 --- a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs +++ b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs @@ -131,8 +131,10 @@ namespace Google.Protobuf // Without setting any values, there's nothing to write. byte[] bytes = message.ToByteArray(); Assert.AreEqual(0, bytes.Length); - TestAllTypes parsed = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message); } [Test] @@ -164,9 +166,9 @@ namespace Google.Protobuf SingleUint64 = ulong.MaxValue }; - byte[] bytes = message.ToByteArray(); - TestAllTypes parsed = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message); } [Test] @@ -198,9 +200,9 @@ namespace Google.Protobuf RepeatedUint64 = { ulong.MaxValue, uint.MinValue } }; - byte[] bytes = message.ToByteArray(); - TestAllTypes parsed = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message); } // Note that not every map within map_unittest_proto3 is used. They all go through very @@ -230,9 +232,9 @@ namespace Google.Protobuf } }; - byte[] bytes = message.ToByteArray(); - TestMap parsed = TestMap.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestMap.Parser, message); } [Test] @@ -246,9 +248,16 @@ namespace Google.Protobuf byte[] bytes = message.ToByteArray(); Assert.AreEqual(2, bytes.Length); // Tag for field entry (1 byte), length of entry (0; 1 byte) - var parsed = TestMap.Parser.ParseFrom(bytes); - Assert.AreEqual(1, parsed.MapInt32Bytes.Count); - Assert.AreEqual(ByteString.Empty, parsed.MapInt32Bytes[0]); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + bytes, + parsed=> + { + Assert.AreEqual(1, parsed.MapInt32Bytes.Count); + Assert.AreEqual(ByteString.Empty, parsed.MapInt32Bytes[0]); + }); } [Test] @@ -265,8 +274,13 @@ namespace Google.Protobuf output.WriteMessage(nestedMessage); output.Flush(); - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(nestedMessage, parsed.MapInt32ForeignMessage[0]); + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(nestedMessage, parsed.MapInt32ForeignMessage[0]); + }); } [Test] @@ -282,8 +296,13 @@ namespace Google.Protobuf output.WriteInt32(key); output.Flush(); - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(0.0, parsed.MapInt32Double[key]); + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(0.0, parsed.MapInt32Double[key]); + }); } [Test] @@ -299,8 +318,13 @@ namespace Google.Protobuf output.WriteInt32(key); output.Flush(); - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(new ForeignMessage(), parsed.MapInt32ForeignMessage[key]); + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(new ForeignMessage(), parsed.MapInt32ForeignMessage[key]); + }); } [Test] @@ -327,8 +351,13 @@ namespace Google.Protobuf output.WriteInt32(extra); output.Flush(); - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(value, parsed.MapInt32Int32[key]); + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(value, parsed.MapInt32Int32[key]); + }); } [Test] @@ -351,8 +380,13 @@ namespace Google.Protobuf output.WriteInt32(key); output.Flush(); - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(value, parsed.MapInt32Int32[key]); + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(value, parsed.MapInt32Int32[key]); + }); } [Test] @@ -397,13 +431,19 @@ namespace Google.Protobuf output.WriteInt32(value3); output.Flush(); - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - var expected = new TestMap - { - MapInt32Int32 = { { key1, value1 }, { key3, value3 } }, - MapStringString = { { key2, value2 } } - }; - Assert.AreEqual(expected, parsed); + + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + var expected = new TestMap + { + MapInt32Int32 = { { key1, value1 }, { key3, value3 } }, + MapStringString = { { key2, value2 } } + }; + Assert.AreEqual(expected, parsed); + }); } [Test] @@ -433,8 +473,13 @@ namespace Google.Protobuf output.WriteInt32(value2); output.Flush(); - var parsed = TestMap.Parser.ParseFrom(memoryStream.ToArray()); - Assert.AreEqual(value2, parsed.MapInt32Int32[key]); + MessageParsingHelpers.AssertReadingMessage( + TestMap.Parser, + memoryStream.ToArray(), + parsed => + { + Assert.AreEqual(value2, parsed.MapInt32Int32[key]); + }); } [Test] @@ -619,9 +664,12 @@ namespace Google.Protobuf var bytes = message.ToByteArray(); Assert.AreEqual(3, bytes.Length); // 2 bytes for the tag + 1 for the value - no string! - var message2 = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, message2); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message2.OneofFieldCase); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message, parsedMessage => + { + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, parsedMessage.OneofFieldCase); + }); } [Test] @@ -633,9 +681,12 @@ namespace Google.Protobuf var bytes = message.ToByteArray(); Assert.AreEqual(3, bytes.Length); // 2 bytes for the tag + 1 for the value - it's still serialized - var message2 = TestAllTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, message2); - Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, message2.OneofFieldCase); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestAllTypes.Parser, message, parsedMessage => + { + Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.OneofUint32, parsedMessage.OneofFieldCase); + }); } [Test] @@ -651,10 +702,14 @@ namespace Google.Protobuf message.WriteTo(output); output.Flush(); - stream.Position = 0; - var parsed = TestAllTypes.Parser.ParseFrom(stream); - // TODO(jieluo): Add test back when DiscardUnknownFields API is supported. - // Assert.AreEqual(message, parsed); + MessageParsingHelpers.AssertReadingMessage( + TestAllTypes.Parser, + stream.ToArray(), + parsed => + { + // TODO(jieluo): Add test back when DiscardUnknownFields API is supported. + // Assert.AreEqual(message, parsed); + }); } [Test] @@ -663,8 +718,15 @@ namespace Google.Protobuf // Simple way of ensuring we can skip all kinds of fields. var data = SampleMessages.CreateFullTestAllTypes().ToByteArray(); var empty = Empty.Parser.ParseFrom(data); - // TODO(jieluo): Add test back when DiscardUnknownFields API is supported. - // Assert.AreNotEqual(new Empty(), empty); + + MessageParsingHelpers.AssertReadingMessage( + Empty.Parser, + data, + parsed => + { + // TODO(jieluo): Add test back when DiscardUnknownFields API is supported. + // Assert.AreNotEqual(new Empty(), empty); + }); } // This was originally seen as a conformance test failure. @@ -674,7 +736,7 @@ namespace Google.Protobuf // 130, 3 is the message tag // 1 is the data length - but there's no data. var data = new byte[] { 130, 3, 1 }; - Assert.Throws(() => TestAllTypes.Parser.ParseFrom(data)); + MessageParsingHelpers.AssertReadingMessageThrows(TestAllTypes.Parser, data); } /// @@ -695,7 +757,7 @@ namespace Google.Protobuf output.Flush(); stream.Position = 0; - Assert.Throws(() => TestAllTypes.Parser.ParseFrom(stream)); + MessageParsingHelpers.AssertReadingMessageThrows(TestAllTypes.Parser, stream.ToArray()); } [Test] diff --git a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj index 1a7953d6b7..cdfa98e098 100644 --- a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj +++ b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj @@ -1,11 +1,11 @@  - net451;netcoreapp2.1 + net451;netcoreapp2.1;net50 ../../keys/Google.Protobuf.snk true - true False + True diff --git a/csharp/src/Google.Protobuf.Test/IssuesTest.cs b/csharp/src/Google.Protobuf.Test/IssuesTest.cs index 941bce0160..2904c461df 100644 --- a/csharp/src/Google.Protobuf.Test/IssuesTest.cs +++ b/csharp/src/Google.Protobuf.Test/IssuesTest.cs @@ -108,7 +108,7 @@ namespace Google.Protobuf // we still must read the tag correctly, even though the tag is at the very end of our limited input // (which is a corner case and will most likely result in an error when trying to read value of the field - // decribed by this tag, but it would be a logical error not to read the tag that's actually present). + // described by this tag, but it would be a logical error not to read the tag that's actually present). // See https://github.com/protocolbuffers/protobuf/pull/7289 cis.AssertNextTag(WireFormat.MakeTag(11, WireFormat.WireType.Varint)); } diff --git a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs index b07a84161a..1a650933ef 100644 --- a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs @@ -40,6 +40,7 @@ using Google.Protobuf.Reflection; using static Google.Protobuf.JsonParserTest; // For WrapInQuotes using System.IO; using Google.Protobuf.Collections; +using ProtobufUnittest; namespace Google.Protobuf { @@ -153,6 +154,48 @@ namespace Google.Protobuf AssertJson(expectedText, actualText); } + [Test] + public void WithFormatDefaultValues_DoesNotAffectMessageFields() + { + var message = new TestAllTypes(); + var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); + var json = formatter.Format(message); + Assert.IsFalse(json.Contains("\"singleNestedMessage\"")); + Assert.IsFalse(json.Contains("\"singleForeignMessage\"")); + Assert.IsFalse(json.Contains("\"singleImportMessage\"")); + } + + [Test] + public void WithFormatDefaultValues_DoesNotAffectProto3OptionalFields() + { + var message = new TestProto3Optional(); + message.OptionalInt32 = 0; + var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); + var json = formatter.Format(message); + // The non-optional proto3 fields are formatted, as is the optional-but-specified field. + AssertJson("{ 'optionalInt32': 0, 'singularInt32': 0, 'singularInt64': '0' }", json); + } + + [Test] + public void WithFormatDefaultValues_DoesNotAffectProto2Fields() + { + var message = new TestProtos.Proto2.ForeignMessage(); + message.C = 0; + var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); + var json = formatter.Format(message); + // The specified field is formatted, but the non-specified field (d) is not. + AssertJson("{ 'c': 0 }", json); + } + + [Test] + public void WithFormatDefaultValues_DoesNotAffectOneofFields() + { + var message = new TestOneof(); + var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); + var json = formatter.Format(message); + AssertJson("{ }", json); + } + [Test] public void RepeatedField() { @@ -183,6 +226,28 @@ namespace Google.Protobuf JsonFormatter.Default.Format(new TestMap { MapBoolBool = { { false, true }, { true, false } } })); } + [Test] + public void NullValueOutsideStruct() + { + var message = new NullValueOutsideStruct { NullValue = NullValue.NullValue }; + AssertJson("{ 'nullValue': null }", JsonFormatter.Default.Format(message)); + } + + [Test] + public void NullValueNotInOneof() + { + var message = new NullValueNotInOneof(); + AssertJson("{ }", JsonFormatter.Default.Format(message)); + } + + [Test] + public void NullValueNotInOneof_FormatDefaults() + { + var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); + var message = new NullValueNotInOneof(); + AssertJson("{ 'nullValue': null }", formatter.Format(message)); + } + [TestCase(1.0, "1")] [TestCase(double.NaN, "'NaN'")] [TestCase(double.PositiveInfinity, "'Infinity'")] @@ -313,14 +378,16 @@ namespace Google.Protobuf } [Test] - public void WrapperFormatting_IncludeNull() + public void WrapperFormatting_FormatDefaultValuesDoesNotFormatNull() { // The actual JSON here is very large because there are lots of fields. Just test a couple of them. var message = new TestWellKnownTypes { Int32Field = 10 }; var formatter = new JsonFormatter(JsonFormatter.Settings.Default.WithFormatDefaultValues(true)); var actualJson = formatter.Format(message); - Assert.IsTrue(actualJson.Contains("\"int64Field\": null")); - Assert.IsFalse(actualJson.Contains("\"int32Field\": null")); + // This *used* to include "int64Field": null, but that was a bug. + // WithDefaultValues should not affect message fields, including wrapper types. + Assert.IsFalse(actualJson.Contains("\"int64Field\": null")); + Assert.IsTrue(actualJson.Contains("\"int32Field\": 10")); } [Test] @@ -602,6 +669,13 @@ namespace Google.Protobuf AssertWriteValue(value, "[ 1, 2, 3 ]"); } + [Test] + public void Proto2_DefaultValuesWritten() + { + var value = new ProtobufTestMessages.Proto2.TestAllTypesProto2() { FieldName13 = 0 }; + AssertWriteValue(value, "{ 'FieldName13': 0 }"); + } + private static void AssertWriteValue(object value, string expectedJson) { var writer = new StringWriter(); diff --git a/csharp/src/Google.Protobuf.Test/JsonParserTest.cs b/csharp/src/Google.Protobuf.Test/JsonParserTest.cs index a6cf04ab7a..69c9eb6e99 100644 --- a/csharp/src/Google.Protobuf.Test/JsonParserTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonParserTest.cs @@ -34,7 +34,9 @@ using Google.Protobuf.Reflection; using Google.Protobuf.TestProtos; using Google.Protobuf.WellKnownTypes; using NUnit.Framework; +using ProtobufTestMessages.Proto2; using System; +using UnitTest.Issues.TestProtos; namespace Google.Protobuf { @@ -549,9 +551,13 @@ namespace Google.Protobuf } [Test] + // Skip these test cases in .NET 5 because floating point parsing supports bigger values. + // These big values won't throw an error in the test. +#if !NET5_0 [TestCase("1.7977e308")] [TestCase("-1.7977e308")] [TestCase("1e309")] +#endif [TestCase("1,0")] [TestCase("1.0.0")] [TestCase("+1")] @@ -949,6 +955,16 @@ namespace Google.Protobuf Assert.Throws(() => TestAllTypes.Parser.ParseJson(json)); } + [Test] + public void Proto2_DefaultValuesPreserved() + { + string json = "{ \"FieldName13\": 0 }"; + var parsed = TestAllTypesProto2.Parser.ParseJson(json); + Assert.False(parsed.HasFieldName10); + Assert.True(parsed.HasFieldName13); + Assert.AreEqual(0, parsed.FieldName13); + } + [Test] [TestCase("5")] [TestCase("\"text\"")] @@ -963,6 +979,43 @@ namespace Google.Protobuf Assert.AreEqual(expected, actual); } + [Test] + public void NullValueOutsideStruct_NullLiteral() + { + string json = "{ \"nullValue\": null }"; + var message = NullValueOutsideStruct.Parser.ParseJson(json); + Assert.AreEqual(NullValueOutsideStruct.ValueOneofCase.NullValue, message.ValueCase); + } + + [Test] + public void NullValueNotInOneof_NullLiteral() + { + // We'd only normally see this with FormatDefaultValues set to true. + string json = "{ \"nullValue\": null }"; + var message = NullValueNotInOneof.Parser.ParseJson(json); + Assert.AreEqual(NullValue.NullValue, message.NullValue); + } + + // NullValue used to only be converted to the null literal when part of a struct. + // Otherwise, it would end up as a string "NULL_VALUE" (the name of the enum value). + // We still parse that form, for compatibility. + [Test] + public void NullValueOutsideStruct_Compatibility() + { + string json = "{ \"nullValue\": \"NULL_VALUE\" }"; + var message = NullValueOutsideStruct.Parser.ParseJson(json); + Assert.AreEqual(NullValueOutsideStruct.ValueOneofCase.NullValue, message.ValueCase); + } + + [Test] + public void NullValueNotInOneof_Compatibility() + { + // We'd only normally see this with FormatDefaultValues set to true. + string json = "{ \"nullValue\": \"NULL_VALUE\" }"; + var message = NullValueNotInOneof.Parser.ParseJson(json); + Assert.AreEqual(NullValue.NullValue, message.NullValue); + } + /// /// Various tests use strings which have quotes round them for parsing or as the result /// of formatting, but without those quotes being specified in the tests (for the sake of readability). diff --git a/csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs b/csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs index df43effd4f..0cbc0a4ff8 100644 --- a/csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs @@ -199,8 +199,12 @@ namespace Google.Protobuf [TestCase("1e-")] [TestCase("--")] [TestCase("--1")] + // Skip these test cases in .NET 5 because floating point parsing supports bigger values. + // These big values won't throw an error in the test. +#if !NET5_0 [TestCase("-1.7977e308")] [TestCase("1.7977e308")] +#endif public void InvalidNumberValue(string json) { AssertThrowsAfter(json); diff --git a/csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs b/csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs new file mode 100644 index 0000000000..22adcaa95d --- /dev/null +++ b/csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs @@ -0,0 +1,296 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion +using Google.Protobuf; +using Google.Protobuf.Reflection; +using System.Buffers; +using pb = global::Google.Protobuf; +using pbr = global::Google.Protobuf.Reflection; +using NUnit.Framework; +using System.IO; +using System; +using Google.Protobuf.Buffers; + +namespace Google.Protobuf +{ + public class LegacyGeneratedCodeTest + { + [Test] + public void IntermixingOfNewAndLegacyGeneratedCodeWorksWithCodedInputStream() + { + var message = new ParseContextEnabledMessageB + { + A = new LegacyGeneratedCodeMessageA + { + Bb = new ParseContextEnabledMessageB { OptionalInt32 = 12345 } + }, + OptionalInt32 = 6789 + }; + var data = message.ToByteArray(); + + // when parsing started using CodedInputStream and a message with legacy generated code + // is encountered somewhere in the parse tree, we still need to be able to use its + // MergeFrom(CodedInputStream) method to parse correctly. + var codedInput = new CodedInputStream(data); + var parsed = new ParseContextEnabledMessageB(); + codedInput.ReadRawMessage(parsed); + Assert.IsTrue(codedInput.IsAtEnd); + + Assert.AreEqual(12345, parsed.A.Bb.OptionalInt32); + Assert.AreEqual(6789, parsed.OptionalInt32); + } + + [Test] + public void LegacyGeneratedCodeThrowsWithReadOnlySequence() + { + var message = new ParseContextEnabledMessageB + { + A = new LegacyGeneratedCodeMessageA + { + Bb = new ParseContextEnabledMessageB { OptionalInt32 = 12345 } + }, + OptionalInt32 = 6789 + }; + var data = message.ToByteArray(); + + // if parsing started using ReadOnlySequence and we don't have a CodedInputStream + // instance at hand, we cannot fall back to the legacy MergeFrom(CodedInputStream) + // method and parsing will fail. As a consequence, one can only use parsing + // from ReadOnlySequence if all the messages in the parsing tree have their generated + // code up to date. + var exception = Assert.Throws(() => + { + ParseContext.Initialize(new ReadOnlySequence(data), out ParseContext parseCtx); + var parsed = new ParseContextEnabledMessageB(); + ParsingPrimitivesMessages.ReadRawMessage(ref parseCtx, parsed); + }); + Assert.AreEqual($"Message {typeof(LegacyGeneratedCodeMessageA).Name} doesn't provide the generated method that enables ParseContext-based parsing. You might need to regenerate the generated protobuf code.", exception.Message); + } + + [Test] + public void IntermixingOfNewAndLegacyGeneratedCodeWorksWithCodedOutputStream() + { + // when serialization started using CodedOutputStream and a message with legacy generated code + // is encountered somewhere in the parse tree, we still need to be able to use its + // WriteTo(CodedOutputStream) method to serialize correctly. + var ms = new MemoryStream(); + var codedOutput = new CodedOutputStream(ms); + var message = new ParseContextEnabledMessageB + { + A = new LegacyGeneratedCodeMessageA + { + Bb = new ParseContextEnabledMessageB { OptionalInt32 = 12345 } + }, + OptionalInt32 = 6789 + }; + message.WriteTo(codedOutput); + codedOutput.Flush(); + + var codedInput = new CodedInputStream(ms.ToArray()); + var parsed = new ParseContextEnabledMessageB(); + codedInput.ReadRawMessage(parsed); + Assert.IsTrue(codedInput.IsAtEnd); + + Assert.AreEqual(12345, parsed.A.Bb.OptionalInt32); + Assert.AreEqual(6789, parsed.OptionalInt32); + } + + [Test] + public void LegacyGeneratedCodeThrowsWithIBufferWriter() + { + // if serialization started using IBufferWriter and we don't have a CodedOutputStream + // instance at hand, we cannot fall back to the legacy WriteTo(CodedOutputStream) + // method and serializatin will fail. As a consequence, one can only use serialization + // to IBufferWriter if all the messages in the parsing tree have their generated + // code up to date. + var message = new ParseContextEnabledMessageB + { + A = new LegacyGeneratedCodeMessageA + { + Bb = new ParseContextEnabledMessageB { OptionalInt32 = 12345 } + }, + OptionalInt32 = 6789 + }; + var exception = Assert.Throws(() => + { + WriteContext.Initialize(new TestArrayBufferWriter(), out WriteContext writeCtx); + ((IBufferMessage)message).InternalWriteTo(ref writeCtx); + }); + Assert.AreEqual($"Message {typeof(LegacyGeneratedCodeMessageA).Name} doesn't provide the generated method that enables WriteContext-based serialization. You might need to regenerate the generated protobuf code.", exception.Message); + } + + // hand-modified version of a generated message that only provides the legacy + // MergeFrom(CodedInputStream) method and doesn't implement IBufferMessage. + private sealed partial class LegacyGeneratedCodeMessageA : pb::IMessage { + private pb::UnknownFieldSet _unknownFields; + + pbr::MessageDescriptor pb::IMessage.Descriptor => throw new System.NotImplementedException(); + + /// Field number for the "bb" field. + public const int BbFieldNumber = 1; + private ParseContextEnabledMessageB bb_; + public ParseContextEnabledMessageB Bb { + get { return bb_; } + set { + bb_ = value; + } + } + + public void WriteTo(pb::CodedOutputStream output) { + if (bb_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Bb); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + public int CalculateSize() { + int size = 0; + if (bb_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Bb); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (bb_ == null) { + Bb = new ParseContextEnabledMessageB(); + } + input.ReadMessage(Bb); + break; + } + } + } + } + } + + // hand-modified version of a generated message that does provide + // the new InternalMergeFrom(ref ParseContext) method. + private sealed partial class ParseContextEnabledMessageB : pb::IBufferMessage { + private pb::UnknownFieldSet _unknownFields; + + pbr::MessageDescriptor pb::IMessage.Descriptor => throw new System.NotImplementedException(); + + /// Field number for the "a" field. + public const int AFieldNumber = 1; + private LegacyGeneratedCodeMessageA a_; + public LegacyGeneratedCodeMessageA A { + get { return a_; } + set { + a_ = value; + } + } + + /// Field number for the "optional_int32" field. + public const int OptionalInt32FieldNumber = 2; + private int optionalInt32_; + public int OptionalInt32 { + get { return optionalInt32_; } + set { + optionalInt32_ = value; + } + } + + public void WriteTo(pb::CodedOutputStream output) { + output.WriteRawMessage(this); + } + + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) + { + if (a_ != null) + { + output.WriteRawTag(10); + output.WriteMessage(A); + } + if (OptionalInt32 != 0) + { + output.WriteRawTag(16); + output.WriteInt32(OptionalInt32); + } + if (_unknownFields != null) + { + _unknownFields.WriteTo(ref output); + } + } + + public int CalculateSize() { + int size = 0; + if (a_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(A); + } + if (OptionalInt32 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + public void MergeFrom(pb::CodedInputStream input) { + input.ReadRawMessage(this); + } + + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (a_ == null) { + A = new LegacyGeneratedCodeMessageA(); + } + input.ReadMessage(A); + break; + } + case 16: { + OptionalInt32 = input.ReadInt32(); + break; + } + } + } + } + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs b/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs new file mode 100644 index 0000000000..05f1e36f96 --- /dev/null +++ b/csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs @@ -0,0 +1,154 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using NUnit.Framework; +using System; +using System.Buffers; +using Google.Protobuf.Buffers; + +namespace Google.Protobuf +{ + public static class MessageParsingHelpers + { + public static void AssertReadingMessage(MessageParser parser, byte[] bytes, Action assert) where T : IMessage + { + var parsedMsg = parser.ParseFrom(bytes); + assert(parsedMsg); + + // Load content as single segment + parsedMsg = parser.ParseFrom(new ReadOnlySequence(bytes)); + assert(parsedMsg); + + // Load content as multiple segments + parsedMsg = parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(bytes)); + assert(parsedMsg); + + // Load content as ReadOnlySpan + parsedMsg = parser.ParseFrom(new ReadOnlySpan(bytes)); + assert(parsedMsg); + } + + public static void AssertReadingMessage(MessageParser parser, byte[] bytes, Action assert) + { + var parsedMsg = parser.ParseFrom(bytes); + assert(parsedMsg); + + // Load content as single segment + parsedMsg = parser.ParseFrom(new ReadOnlySequence(bytes)); + assert(parsedMsg); + + // Load content as multiple segments + parsedMsg = parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(bytes)); + assert(parsedMsg); + + // Load content as ReadOnlySpan + parsedMsg = parser.ParseFrom(new ReadOnlySpan(bytes)); + assert(parsedMsg); + } + + public static void AssertReadingMessageThrows(MessageParser parser, byte[] bytes) + where TMessage : IMessage + where TException : Exception + { + Assert.Throws(() => parser.ParseFrom(bytes)); + + Assert.Throws(() => parser.ParseFrom(new ReadOnlySequence(bytes))); + + Assert.Throws(() => parser.ParseFrom(new ReadOnlySpan(bytes))); + } + + public static void AssertRoundtrip(MessageParser parser, T message, Action additionalAssert = null) where T : IMessage + { + var bytes = message.ToByteArray(); + + // also serialize using IBufferWriter and check it leads to the same data + var bufferWriter = new TestArrayBufferWriter(); + message.WriteTo(bufferWriter); + Assert.AreEqual(bytes, bufferWriter.WrittenSpan.ToArray(), "Both serialization approaches need to result in the same data."); + + var parsedMsg = parser.ParseFrom(bytes); + Assert.AreEqual(message, parsedMsg); + additionalAssert?.Invoke(parsedMsg); + + // Load content as single segment + parsedMsg = parser.ParseFrom(new ReadOnlySequence(bytes)); + Assert.AreEqual(message, parsedMsg); + additionalAssert?.Invoke(parsedMsg); + + // Load content as multiple segments + parsedMsg = parser.ParseFrom(ReadOnlySequenceFactory.CreateWithContent(bytes)); + Assert.AreEqual(message, parsedMsg); + additionalAssert?.Invoke(parsedMsg); + + // Load content as ReadOnlySpan + parsedMsg = parser.ParseFrom(new ReadOnlySpan(bytes)); + Assert.AreEqual(message, parsedMsg); + additionalAssert?.Invoke(parsedMsg); + } + + public static void AssertWritingMessage(IMessage message) + { + // serialize using CodedOutputStream + var bytes = message.ToByteArray(); + + int messageSize = message.CalculateSize(); + Assert.AreEqual(message.CalculateSize(), bytes.Length); + + // serialize using IBufferWriter and check it leads to the same output + var bufferWriter = new TestArrayBufferWriter(); + message.WriteTo(bufferWriter); + Assert.AreEqual(bytes, bufferWriter.WrittenSpan.ToArray()); + + // serialize into a single span and check it leads to the same output + var singleSpan = new Span(new byte[messageSize]); + message.WriteTo(singleSpan); + Assert.AreEqual(bytes, singleSpan.ToArray()); + + // test for different IBufferWriter.GetSpan() segment sizes + for (int blockSize = 1; blockSize < 256; blockSize *= 2) + { + var segmentedBufferWriter = new TestArrayBufferWriter(); + segmentedBufferWriter.MaxGrowBy = blockSize; + message.WriteTo(segmentedBufferWriter); + Assert.AreEqual(bytes, segmentedBufferWriter.WrittenSpan.ToArray()); + } + + // if the full message is small enough, try serializing directly into stack-allocated buffer + if (bytes.Length <= 256) + { + Span stackAllocBuffer = stackalloc byte[bytes.Length]; + message.WriteTo(stackAllocBuffer); + Assert.AreEqual(bytes, stackAllocBuffer.ToArray()); + } + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs b/csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs new file mode 100644 index 0000000000..46a8c57a78 --- /dev/null +++ b/csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs @@ -0,0 +1,153 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using NUnit.Framework; +using ProtobufUnittest; +using System; +using System.IO; +using UnitTest.Issues.TestProtos; + +namespace Google.Protobuf.Test +{ + class Proto3OptionalTest + { + [Test] + public void OptionalInt32FieldLifecycle() + { + var message = new TestProto3Optional(); + Assert.IsFalse(message.HasOptionalInt32); + Assert.AreEqual(0, message.OptionalInt32); + + message.OptionalInt32 = 5; + Assert.IsTrue(message.HasOptionalInt32); + Assert.AreEqual(5, message.OptionalInt32); + + message.OptionalInt32 = 0; + Assert.IsTrue(message.HasOptionalInt32); + Assert.AreEqual(0, message.OptionalInt32); + + message.ClearOptionalInt32(); + Assert.IsFalse(message.HasOptionalInt32); + Assert.AreEqual(0, message.OptionalInt32); + } + + [Test] + public void OptionalStringFieldLifecycle() + { + var message = new TestProto3Optional(); + Assert.IsFalse(message.HasOptionalString); + Assert.AreEqual("", message.OptionalString); + + message.OptionalString = "x"; + Assert.IsTrue(message.HasOptionalString); + Assert.AreEqual("x", message.OptionalString); + + message.OptionalString = ""; + Assert.IsTrue(message.HasOptionalString); + Assert.AreEqual("", message.OptionalString); + + message.ClearOptionalString(); + Assert.IsFalse(message.HasOptionalString); + Assert.AreEqual("", message.OptionalString); + + Assert.Throws(() => message.OptionalString = null); + } + + [Test] + public void Clone() + { + var original = new TestProto3Optional { OptionalInt64 = 0L }; + + var clone = original.Clone(); + Assert.False(clone.HasOptionalInt32); + Assert.AreEqual(0, clone.OptionalInt32); + Assert.True(clone.HasOptionalInt64); + Assert.AreEqual(0L, clone.OptionalInt64); + } + + [Test] + public void Serialization_NotSet() + { + var stream = new MemoryStream(); + var message = new TestProto3Optional(); + message.WriteTo(stream); + Assert.AreEqual(0, stream.Length); + } + + [Test] + public void Serialization_SetToDefault() + { + var stream = new MemoryStream(); + var message = new TestProto3Optional { OptionalInt32 = 0 }; + message.WriteTo(stream); + Assert.AreEqual(2, stream.Length); // Tag and value + } + + [Test] + public void Serialization_Roundtrip() + { + var original = new TestProto3Optional { OptionalInt64 = 0L, OptionalFixed32 = 5U }; + var stream = new MemoryStream(); + original.WriteTo(stream); + stream.Position = 0; + var deserialized = TestProto3Optional.Parser.ParseFrom(stream); + + Assert.AreEqual(0, deserialized.OptionalInt32); + Assert.IsFalse(deserialized.HasOptionalInt32); + + Assert.AreEqual(0L, deserialized.OptionalInt64); + Assert.IsTrue(deserialized.HasOptionalInt64); + + Assert.AreEqual(5U, deserialized.OptionalFixed32); + Assert.IsTrue(deserialized.HasOptionalFixed32); + } + + [Test] + public void Equality_IgnoresPresence() + { + var message1 = new TestProto3Optional { OptionalInt32 = 0 }; + var message2 = new TestProto3Optional(); + + Assert.IsTrue(message1.Equals(message2)); + message1.ClearOptionalInt32(); + } + + [Test] + public void MixedFields() + { + var descriptor = MixedRegularAndOptional.Descriptor; + Assert.AreEqual(1, descriptor.Oneofs.Count); + Assert.AreEqual(0, descriptor.RealOneofCount); + Assert.True(descriptor.Oneofs[0].IsSynthetic); + } + } +} diff --git a/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs b/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs new file mode 100644 index 0000000000..f0248ac3c3 --- /dev/null +++ b/csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs @@ -0,0 +1,139 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Google.Protobuf +{ + internal static class ReadOnlySequenceFactory + { + /// + /// Create a sequence from the specified data. The data will be divided up into segments in the sequence. + /// + public static ReadOnlySequence CreateWithContent(byte[] data, int segmentSize = 1, bool addEmptySegmentDelimiters = true) + { + var segments = new List(); + + if (addEmptySegmentDelimiters) + { + segments.Add(new byte[0]); + } + + var currentIndex = 0; + while (currentIndex < data.Length) + { + var segment = new List(); + while (segment.Count < segmentSize && currentIndex < data.Length) + { + segment.Add(data[currentIndex++]); + } + segments.Add(segment.ToArray()); + + if (addEmptySegmentDelimiters) + { + segments.Add(new byte[0]); + } + } + + return CreateSegments(segments.ToArray()); + } + + /// + /// Originally from corefx, and has been contributed to Protobuf + /// https://github.com/dotnet/corefx/blob/e99ec129cfd594d53f4390bf97d1d736cff6f860/src/System.Memory/tests/ReadOnlyBuffer/ReadOnlySequenceFactory.byte.cs + /// + private static ReadOnlySequence CreateSegments(params byte[][] inputs) + { + if (inputs == null || inputs.Length == 0) + { + throw new InvalidOperationException(); + } + + int i = 0; + + BufferSegment last = null; + BufferSegment first = null; + + do + { + byte[] s = inputs[i]; + int length = s.Length; + int dataOffset = length; + var chars = new byte[length * 2]; + + for (int j = 0; j < length; j++) + { + chars[dataOffset + j] = s[j]; + } + + // Create a segment that has offset relative to the OwnedMemory and OwnedMemory itself has offset relative to array + var memory = new Memory(chars).Slice(length, length); + + if (first == null) + { + first = new BufferSegment(memory); + last = first; + } + else + { + last = last.Append(memory); + } + i++; + } while (i < inputs.Length); + + return new ReadOnlySequence(first, 0, last, last.Memory.Length); + } + + private class BufferSegment : ReadOnlySequenceSegment + { + public BufferSegment(Memory memory) + { + Memory = memory; + } + + public BufferSegment Append(Memory memory) + { + var segment = new BufferSegment(memory) + { + RunningIndex = RunningIndex + Memory.Length + }; + Next = segment; + return segment; + } + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs b/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs new file mode 100644 index 0000000000..f2d9a2d4e2 --- /dev/null +++ b/csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs @@ -0,0 +1,119 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using NUnit.Framework; +using System.Diagnostics; +using System; +using System.Reflection; +using System.IO; + +namespace Google.Protobuf +{ + public class RefStructCompatibilityTest + { + /// + /// Checks that the generated code can be compiler with an old C# compiler. + /// The reason why this test is needed is that even though dotnet SDK projects allow to set LangVersion, + /// this setting doesn't accurately simulate compilation with an actual old pre-roslyn C# compiler. + /// For instance, the "ref struct" types are only supported by C# 7.2 and higher, but even if + /// LangVersion is set low, the roslyn compiler still understands the concept of ref struct + /// and silently accepts them. Therefore we try to build the generated code with an actual old C# compiler + /// to be able to catch these sort of compatibility problems. + /// + [Test] + public void GeneratedCodeCompilesWithOldCsharpCompiler() + { + if (Environment.OSVersion.Platform != PlatformID.Win32NT) + { + // This tests needs old C# compiler which is only available on Windows. Skipping it on all other platforms. + return; + } + + var currentAssemblyDir = Path.GetDirectoryName(typeof(RefStructCompatibilityTest).GetTypeInfo().Assembly.Location); + var testProtosProjectDir = Path.GetFullPath(Path.Combine(currentAssemblyDir, "..", "..", "..", "..", "Google.Protobuf.Test.TestProtos")); + var testProtosOutputDir = (currentAssemblyDir.Contains("bin/Debug/") || currentAssemblyDir.Contains("bin\\Debug\\")) ? "bin\\Debug\\net45" : "bin\\Release\\net45"; + + // If "ref struct" types are used in the generated code, compilation with an old compiler will fail with the following error: + // "XYZ is obsolete: 'Types with embedded references are not supported in this version of your compiler.'" + // We build the code with GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE to avoid the use of ref struct in the generated code. + var compatibilityFlag = "-define:GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE"; + var sources = "*.cs"; // the generated sources from the TestProtos project + var args = $"-langversion:3 -target:library {compatibilityFlag} -reference:{testProtosOutputDir}\\Google.Protobuf.dll -out:{testProtosOutputDir}\\TestProtos.RefStructCompatibilityTest.OldCompiler.dll {sources}"; + RunOldCsharpCompilerAndCheckSuccess(args, testProtosProjectDir); + } + + /// + /// Invoke an old C# compiler in a subprocess and check it finished successful. + /// + /// + /// + private void RunOldCsharpCompilerAndCheckSuccess(string args, string workingDirectory) + { + using (var process = new Process()) + { + // Get the path to the old C# 5 compiler from .NET framework. This approach is not 100% reliable, but works on most machines. + // Alternative way of getting the framework path is System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + // but it only works with the net45 target. + var oldCsharpCompilerPath = Path.Combine(Environment.GetEnvironmentVariable("WINDIR"), "Microsoft.NET", "Framework", "v4.0.30319", "csc.exe"); + process.StartInfo.FileName = oldCsharpCompilerPath; + process.StartInfo.RedirectStandardOutput = true; + process.StartInfo.RedirectStandardError = true; + process.StartInfo.UseShellExecute = false; + process.StartInfo.Arguments = args; + process.StartInfo.WorkingDirectory = workingDirectory; + + process.OutputDataReceived += (sender, e) => + { + if (e.Data != null) + { + Console.WriteLine(e.Data); + } + }; + process.ErrorDataReceived += (sender, e) => + { + if (e.Data != null) + { + Console.WriteLine(e.Data); + } + }; + + process.Start(); + + process.BeginErrorReadLine(); + process.BeginOutputReadLine(); + + process.WaitForExit(); + Assert.AreEqual(0, process.ExitCode); + } + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs index bfee5f5d43..68b9bd3507 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs @@ -1,4 +1,4 @@ -#region Copyright notice and license +#region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2017 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ @@ -71,25 +71,49 @@ namespace Google.Protobuf.Test.Reflection }; } + [Test] + public void BuiltinOptionsCanBeRetrieved() + { + // non-custom options (that are not extensions but regular fields) can only be accessed via descriptor.Options + var fileOptions = UnittestProto3Reflection.Descriptor.GetOptions(); + Assert.AreEqual("Google.Protobuf.TestProtos", fileOptions.CsharpNamespace); + } + + [Test] + public void OptionPresenceCanBeDetected() + { + // case 1: the descriptor has no options at all so the options message is not present + Assert.IsNull(TestAllTypes.Descriptor.GetOptions()); + + // case 2: the descriptor has some options, but not the one we're looking for + // HasExtension will be false and GetExtension returns extension's default value + Assert.IsFalse(UnittestProto3Reflection.Descriptor.GetOptions().HasExtension(FileOpt1)); + Assert.AreEqual(0, UnittestProto3Reflection.Descriptor.GetOptions().GetExtension(FileOpt1)); + + // case 3: option is present + Assert.IsTrue(UnittestCustomOptionsProto3Reflection.Descriptor.GetOptions().HasExtension(FileOpt1)); + Assert.AreEqual(9876543210UL, UnittestCustomOptionsProto3Reflection.Descriptor.GetOptions().GetExtension(FileOpt1)); + } + [Test] public void ScalarOptions() { var d = CustomOptionOtherValues.Descriptor; - var options = d.CustomOptions; - AssertOption(-100, options.TryGetInt32, Int32Opt, d.GetOption); - AssertOption(12.3456789f, options.TryGetFloat, FloatOpt, d.GetOption); - AssertOption(1.234567890123456789d, options.TryGetDouble, DoubleOpt, d.GetOption); - AssertOption("Hello, \"World\"", options.TryGetString, StringOpt, d.GetOption); - AssertOption(ByteString.CopyFromUtf8("Hello\0World"), options.TryGetBytes, BytesOpt, d.GetOption); - AssertOption(TestEnumType.TestOptionEnumType2, EnumFetcher(options), EnumOpt, d.GetOption); + var customOptions = d.CustomOptions; + AssertOption(-100, customOptions.TryGetInt32, Int32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(12.3456789f, customOptions.TryGetFloat, FloatOpt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(1.234567890123456789d, customOptions.TryGetDouble, DoubleOpt, d.GetOption, d.GetOptions().GetExtension); + AssertOption("Hello, \"World\"", customOptions.TryGetString, StringOpt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(ByteString.CopyFromUtf8("Hello\0World"), customOptions.TryGetBytes, BytesOpt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(TestEnumType.TestOptionEnumType2, EnumFetcher(customOptions), EnumOpt, d.GetOption, d.GetOptions().GetExtension); } [Test] public void MessageOptions() { var d = VariousComplexOptions.Descriptor; - var options = d.CustomOptions; - AssertOption(new ComplexOptionType1 { Foo = 42, Foo4 = { 99, 88 } }, options.TryGetMessage, ComplexOpt1, d.GetOption); + var customOptions = d.CustomOptions; + AssertOption(new ComplexOptionType1 { Foo = 42, Foo4 = { 99, 88 } }, customOptions.TryGetMessage, ComplexOpt1, d.GetOption, d.GetOptions().GetExtension); AssertOption(new ComplexOptionType2 { Baz = 987, @@ -97,85 +121,84 @@ namespace Google.Protobuf.Test.Reflection Fred = new ComplexOptionType4 { Waldo = 321 }, Barney = { new ComplexOptionType4 { Waldo = 101 }, new ComplexOptionType4 { Waldo = 212 } } }, - options.TryGetMessage, ComplexOpt2, d.GetOption); - AssertOption(new ComplexOptionType3 { Qux = 9 }, options.TryGetMessage, ComplexOpt3, d.GetOption); + customOptions.TryGetMessage, ComplexOpt2, d.GetOption, d.GetOptions().GetExtension); + AssertOption(new ComplexOptionType3 { Qux = 9 }, customOptions.TryGetMessage, ComplexOpt3, d.GetOption, d.GetOptions().GetExtension); } [Test] public void OptionLocations() { - var fileOptions = UnittestCustomOptionsProto3Reflection.Descriptor.CustomOptions; - AssertOption(9876543210UL, fileOptions.TryGetUInt64, FileOpt1, UnittestCustomOptionsProto3Reflection.Descriptor.GetOption); + var fileDescriptor = UnittestCustomOptionsProto3Reflection.Descriptor; + AssertOption(9876543210UL, fileDescriptor.CustomOptions.TryGetUInt64, FileOpt1, fileDescriptor.GetOption, fileDescriptor.GetOptions().GetExtension); - var messageOptions = TestMessageWithCustomOptions.Descriptor.CustomOptions; - AssertOption(-56, messageOptions.TryGetInt32, MessageOpt1, TestMessageWithCustomOptions.Descriptor.GetOption); + var messageDescriptor = TestMessageWithCustomOptions.Descriptor; + AssertOption(-56, messageDescriptor.CustomOptions.TryGetInt32, MessageOpt1, messageDescriptor.GetOption, messageDescriptor.GetOptions().GetExtension); - var fieldOptions = TestMessageWithCustomOptions.Descriptor.Fields["field1"].CustomOptions; - AssertOption(8765432109UL, fieldOptions.TryGetFixed64, FieldOpt1, TestMessageWithCustomOptions.Descriptor.Fields["field1"].GetOption); + var fieldDescriptor = TestMessageWithCustomOptions.Descriptor.Fields["field1"]; + AssertOption(8765432109UL, fieldDescriptor.CustomOptions.TryGetFixed64, FieldOpt1, fieldDescriptor.GetOption, fieldDescriptor.GetOptions().GetExtension); - var oneofOptions = TestMessageWithCustomOptions.Descriptor.Oneofs[0].CustomOptions; - AssertOption(-99, oneofOptions.TryGetInt32, OneofOpt1, TestMessageWithCustomOptions.Descriptor.Oneofs[0].GetOption); + var oneofDescriptor = TestMessageWithCustomOptions.Descriptor.Oneofs[0]; + AssertOption(-99, oneofDescriptor.CustomOptions.TryGetInt32, OneofOpt1, oneofDescriptor.GetOption, oneofDescriptor.GetOptions().GetExtension); - var enumOptions = TestMessageWithCustomOptions.Descriptor.EnumTypes[0].CustomOptions; - AssertOption(-789, enumOptions.TryGetSFixed32, EnumOpt1, TestMessageWithCustomOptions.Descriptor.EnumTypes[0].GetOption); + var enumDescriptor = TestMessageWithCustomOptions.Descriptor.EnumTypes[0]; + AssertOption(-789, enumDescriptor.CustomOptions.TryGetSFixed32, EnumOpt1, enumDescriptor.GetOption, enumDescriptor.GetOptions().GetExtension); - var enumValueOptions = TestMessageWithCustomOptions.Descriptor.EnumTypes[0].FindValueByNumber(2).CustomOptions; - AssertOption(123, enumValueOptions.TryGetInt32, EnumValueOpt1, TestMessageWithCustomOptions.Descriptor.EnumTypes[0].FindValueByNumber(2).GetOption); + var enumValueDescriptor = TestMessageWithCustomOptions.Descriptor.EnumTypes[0].FindValueByNumber(2); + AssertOption(123, enumValueDescriptor.CustomOptions.TryGetInt32, EnumValueOpt1, enumValueDescriptor.GetOption, enumValueDescriptor.GetOptions().GetExtension); - var service = UnittestCustomOptionsProto3Reflection.Descriptor.Services + var serviceDescriptor = UnittestCustomOptionsProto3Reflection.Descriptor.Services .Single(s => s.Name == "TestServiceWithCustomOptions"); - var serviceOptions = service.CustomOptions; - AssertOption(-9876543210, serviceOptions.TryGetSInt64, ServiceOpt1, service.GetOption); + AssertOption(-9876543210, serviceDescriptor.CustomOptions.TryGetSInt64, ServiceOpt1, serviceDescriptor.GetOption, serviceDescriptor.GetOptions().GetExtension); - var methodOptions = service.Methods[0].CustomOptions; - AssertOption(UnitTest.Issues.TestProtos.MethodOpt1.Val2, EnumFetcher(methodOptions), UnittestCustomOptionsProto3Extensions.MethodOpt1, service.Methods[0].GetOption); + var methodDescriptor = serviceDescriptor.Methods[0]; + AssertOption(UnitTest.Issues.TestProtos.MethodOpt1.Val2, EnumFetcher(methodDescriptor.CustomOptions), UnittestCustomOptionsProto3Extensions.MethodOpt1, methodDescriptor.GetOption, methodDescriptor.GetOptions().GetExtension); } [Test] public void MinValues() { var d = CustomOptionMinIntegerValues.Descriptor; - var options = d.CustomOptions; - AssertOption(false, options.TryGetBool, BoolOpt, d.GetOption); - AssertOption(int.MinValue, options.TryGetInt32, Int32Opt, d.GetOption); - AssertOption(long.MinValue, options.TryGetInt64, Int64Opt, d.GetOption); - AssertOption(uint.MinValue, options.TryGetUInt32, Uint32Opt, d.GetOption); - AssertOption(ulong.MinValue, options.TryGetUInt64, Uint64Opt, d.GetOption); - AssertOption(int.MinValue, options.TryGetSInt32, Sint32Opt, d.GetOption); - AssertOption(long.MinValue, options.TryGetSInt64, Sint64Opt, d.GetOption); - AssertOption(uint.MinValue, options.TryGetUInt32, Fixed32Opt, d.GetOption); - AssertOption(ulong.MinValue, options.TryGetUInt64, Fixed64Opt, d.GetOption); - AssertOption(int.MinValue, options.TryGetInt32, Sfixed32Opt, d.GetOption); - AssertOption(long.MinValue, options.TryGetInt64, Sfixed64Opt, d.GetOption); + var customOptions = d.CustomOptions; + AssertOption(false, customOptions.TryGetBool, BoolOpt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(int.MinValue, customOptions.TryGetInt32, Int32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(long.MinValue, customOptions.TryGetInt64, Int64Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(uint.MinValue, customOptions.TryGetUInt32, Uint32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(ulong.MinValue, customOptions.TryGetUInt64, Uint64Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(int.MinValue, customOptions.TryGetSInt32, Sint32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(long.MinValue, customOptions.TryGetSInt64, Sint64Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(uint.MinValue, customOptions.TryGetUInt32, Fixed32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(ulong.MinValue, customOptions.TryGetUInt64, Fixed64Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(int.MinValue, customOptions.TryGetInt32, Sfixed32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(long.MinValue, customOptions.TryGetInt64, Sfixed64Opt, d.GetOption, d.GetOptions().GetExtension); } [Test] public void MaxValues() { var d = CustomOptionMaxIntegerValues.Descriptor; - var options = d.CustomOptions; - AssertOption(true, options.TryGetBool, BoolOpt, d.GetOption); - AssertOption(int.MaxValue, options.TryGetInt32, Int32Opt, d.GetOption); - AssertOption(long.MaxValue, options.TryGetInt64, Int64Opt, d.GetOption); - AssertOption(uint.MaxValue, options.TryGetUInt32, Uint32Opt, d.GetOption); - AssertOption(ulong.MaxValue, options.TryGetUInt64, Uint64Opt, d.GetOption); - AssertOption(int.MaxValue, options.TryGetSInt32, Sint32Opt, d.GetOption); - AssertOption(long.MaxValue, options.TryGetSInt64, Sint64Opt, d.GetOption); - AssertOption(uint.MaxValue, options.TryGetFixed32, Fixed32Opt, d.GetOption); - AssertOption(ulong.MaxValue, options.TryGetFixed64, Fixed64Opt, d.GetOption); - AssertOption(int.MaxValue, options.TryGetSFixed32, Sfixed32Opt, d.GetOption); - AssertOption(long.MaxValue, options.TryGetSFixed64, Sfixed64Opt, d.GetOption); + var customOptions = d.CustomOptions; + AssertOption(true, customOptions.TryGetBool, BoolOpt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(int.MaxValue, customOptions.TryGetInt32, Int32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(long.MaxValue, customOptions.TryGetInt64, Int64Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(uint.MaxValue, customOptions.TryGetUInt32, Uint32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(ulong.MaxValue, customOptions.TryGetUInt64, Uint64Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(int.MaxValue, customOptions.TryGetSInt32, Sint32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(long.MaxValue, customOptions.TryGetSInt64, Sint64Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(uint.MaxValue, customOptions.TryGetFixed32, Fixed32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(ulong.MaxValue, customOptions.TryGetFixed64, Fixed64Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(int.MaxValue, customOptions.TryGetSFixed32, Sfixed32Opt, d.GetOption, d.GetOptions().GetExtension); + AssertOption(long.MaxValue, customOptions.TryGetSFixed64, Sfixed64Opt, d.GetOption, d.GetOptions().GetExtension); } [Test] public void AggregateOptions() { // Just two examples - var messageOptions = AggregateMessage.Descriptor.CustomOptions; - AssertOption(new Aggregate { I = 101, S = "MessageAnnotation" }, messageOptions.TryGetMessage, Msgopt, AggregateMessage.Descriptor.GetOption); + var messageDescriptor = AggregateMessage.Descriptor; + AssertOption(new Aggregate { I = 101, S = "MessageAnnotation" }, messageDescriptor.CustomOptions.TryGetMessage, Msgopt, messageDescriptor.GetOption, messageDescriptor.GetOptions().GetExtension); - var fieldOptions = AggregateMessage.Descriptor.Fields["fieldname"].CustomOptions; - AssertOption(new Aggregate { S = "FieldAnnotation" }, fieldOptions.TryGetMessage, Fieldopt, AggregateMessage.Descriptor.Fields["fieldname"].GetOption); + var fieldDescriptor = messageDescriptor.Fields["fieldname"]; + AssertOption(new Aggregate { S = "FieldAnnotation" }, fieldDescriptor.CustomOptions.TryGetMessage, Fieldopt, fieldDescriptor.GetOption, fieldDescriptor.GetOptions().GetExtension); } [Test] @@ -199,16 +222,41 @@ namespace Google.Protobuf.Test.Reflection var descriptor = UnittestIssue6936CReflection.Descriptor; var foo = Foo.Descriptor; var bar = Bar.Descriptor; - AssertOption("foo", foo.CustomOptions.TryGetString, UnittestIssue6936AExtensions.Opt, foo.GetOption); - AssertOption("bar", bar.CustomOptions.TryGetString, UnittestIssue6936AExtensions.Opt, bar.GetOption); + AssertOption("foo", foo.CustomOptions.TryGetString, UnittestIssue6936AExtensions.Opt, foo.GetOption, foo.GetOptions().GetExtension); + AssertOption("bar", bar.CustomOptions.TryGetString, UnittestIssue6936AExtensions.Opt, bar.GetOption, bar.GetOptions().GetExtension); } - private void AssertOption(T expected, OptionFetcher fetcher, Extension extension, Func, T> descriptorOptionFetcher) where D : IExtendableMessage + [Test] + public void SelfReferentialOptions() { - T customOptionsValue; - T extensionValue = descriptorOptionFetcher(extension); - Assert.IsTrue(fetcher(extension.FieldNumber, out customOptionsValue)); + // Custom field option used in definition of the custom option's message. + var fooField = UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Descriptor.FindFieldByName("foo"); + var fooFieldFooExtensionValue = fooField.GetOptions().GetExtension(UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsExtensions.FooOptions); + Assert.AreEqual(1234, fooFieldFooExtensionValue.Foo); + + // Custom field option used on the definition of that field option. + var fileDescriptor = UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsReflection.Descriptor; + var barOptionsField = fileDescriptor.Extensions.UnorderedExtensions.Single(field => field.Name == "bar_options"); + var barExtensionValue = barOptionsField.GetOptions().GetExtension(UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsExtensions.BarOptions); + Assert.AreEqual(1234, barExtensionValue); + + // Custom field option used in definition of the extension message. + var intOptField = UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Descriptor.FindFieldByName("int_opt"); + var intOptFieldFooExtensionValue = intOptField.GetOptions().GetExtension(UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsExtensions.FooOptions); + Assert.AreEqual(1, intOptFieldFooExtensionValue.IntOpt); + Assert.AreEqual(2, intOptFieldFooExtensionValue.GetExtension(UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsExtensions.FooIntOpt)); + Assert.AreEqual(3, intOptFieldFooExtensionValue.GetExtension(UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsExtensions.FooFooOpt).IntOpt); + } + + private void AssertOption(T expected, OptionFetcher customOptionFetcher, Extension extension, Func, T> getOptionFetcher, Func, T> extensionFetcher) where D : IExtendableMessage + { + Assert.IsTrue(customOptionFetcher(extension.FieldNumber, out T customOptionsValue)); Assert.AreEqual(expected, customOptionsValue); + + T getOptionValue = getOptionFetcher(extension); + Assert.AreEqual(expected, getOptionValue); + + T extensionValue = extensionFetcher(extension); Assert.AreEqual(expected, extensionValue); } } diff --git a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs index 482db535e2..fab983d463 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs @@ -32,9 +32,12 @@ using Google.Protobuf.TestProtos; using NUnit.Framework; +using ProtobufUnittest; using System; using System.Collections.Generic; +using System.IO; using System.Linq; +using UnitTest.Issues.TestProtos; namespace Google.Protobuf.Reflection { @@ -69,6 +72,24 @@ namespace Google.Protobuf.Reflection TestFileDescriptor(converted[2], converted[1], converted[0]); } + [Test] + public void FileDescriptor_BuildFromByteStrings_WithExtensionRegistry() + { + var extension = UnittestCustomOptionsProto3Extensions.MessageOpt1; + + var byteStrings = new[] + { + DescriptorReflection.Descriptor.Proto.ToByteString(), + UnittestCustomOptionsProto3Reflection.Descriptor.Proto.ToByteString() + }; + var registry = new ExtensionRegistry { extension }; + + var descriptor = FileDescriptor.BuildFromByteStrings(byteStrings, registry).Last(); + var message = descriptor.MessageTypes.Single(t => t.Name == nameof(TestMessageWithCustomOptions)); + var extensionValue = message.GetOptions().GetExtension(extension); + Assert.AreEqual(-56, extensionValue); + } + private void TestFileDescriptor(FileDescriptor file, FileDescriptor importedFile, FileDescriptor importedPublicFile) { Assert.AreEqual("unittest_proto3.proto", file.Name); @@ -247,6 +268,7 @@ namespace Google.Protobuf.Reflection FieldDescriptor enumField = testAllTypesDescriptor.FindDescriptor("single_nested_enum"); FieldDescriptor foreignMessageField = testAllTypesDescriptor.FindDescriptor("single_foreign_message"); FieldDescriptor importMessageField = testAllTypesDescriptor.FindDescriptor("single_import_message"); + FieldDescriptor fieldInOneof = testAllTypesDescriptor.FindDescriptor("oneof_string"); Assert.AreEqual("single_int32", primitiveField.Name); Assert.AreEqual("protobuf_unittest3.TestAllTypes.single_int32", @@ -268,6 +290,10 @@ namespace Google.Protobuf.Reflection Assert.AreEqual("single_import_message", importMessageField.Name); Assert.AreEqual(FieldType.Message, importMessageField.FieldType); Assert.AreEqual(importMessageDescriptor, importMessageField.MessageType); + + // For a field in a regular onoef, ContainingOneof and RealContainingOneof should be the same. + Assert.AreEqual("oneof_field", fieldInOneof.ContainingOneof.Name); + Assert.AreSame(fieldInOneof.ContainingOneof, fieldInOneof.RealContainingOneof); } [Test] @@ -318,6 +344,7 @@ namespace Google.Protobuf.Reflection public void OneofDescriptor() { OneofDescriptor descriptor = TestAllTypes.Descriptor.FindDescriptor("oneof_field"); + Assert.IsFalse(descriptor.IsSynthetic); Assert.AreEqual("oneof_field", descriptor.Name); Assert.AreEqual("protobuf_unittest3.TestAllTypes.oneof_field", descriptor.FullName); @@ -383,5 +410,48 @@ namespace Google.Protobuf.Reflection var importingDescriptor = TestProtos.OldGenerator.OldExtensions1Reflection.Descriptor; Assert.NotNull(importingDescriptor); } + + [Test] + public void Proto3OptionalDescriptors() + { + var descriptor = TestProto3Optional.Descriptor; + var field = descriptor.Fields[TestProto3Optional.OptionalInt32FieldNumber]; + Assert.NotNull(field.ContainingOneof); + Assert.IsTrue(field.ContainingOneof.IsSynthetic); + Assert.Null(field.RealContainingOneof); + } + + + [Test] + public void SyntheticOneofReflection() + { + // Expect every oneof in TestProto3Optional to be synthetic + var proto3OptionalDescriptor = TestProto3Optional.Descriptor; + Assert.AreEqual(0, proto3OptionalDescriptor.RealOneofCount); + foreach (var oneof in proto3OptionalDescriptor.Oneofs) + { + Assert.True(oneof.IsSynthetic); + } + + // Expect no oneof in the original proto3 unit test file to be synthetic. + foreach (var descriptor in ProtobufTestMessages.Proto3.TestMessagesProto3Reflection.Descriptor.MessageTypes) + { + Assert.AreEqual(descriptor.Oneofs.Count, descriptor.RealOneofCount); + foreach (var oneof in descriptor.Oneofs) + { + Assert.False(oneof.IsSynthetic); + } + } + + // Expect no oneof in the original proto2 unit test file to be synthetic. + foreach (var descriptor in ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes) + { + Assert.AreEqual(descriptor.Oneofs.Count, descriptor.RealOneofCount); + foreach (var oneof in descriptor.Oneofs) + { + Assert.False(oneof.IsSynthetic); + } + } + } } } diff --git a/csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs index 9651ec30d8..b4dcdabdc7 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs @@ -38,6 +38,7 @@ using System.Collections; using System.Collections.Generic; using static Google.Protobuf.TestProtos.Proto2.UnittestExtensions; +using ProtobufUnittest; namespace Google.Protobuf.Reflection { @@ -97,7 +98,48 @@ namespace Google.Protobuf.Reflection } [Test] - public void HasValue_Proto3() + public void HasValue_Proto3_Message() + { + var message = new TestAllTypes(); + var accessor = ((IMessage) message).Descriptor.Fields[TestProtos.TestAllTypes.SingleForeignMessageFieldNumber].Accessor; + Assert.False(accessor.HasValue(message)); + message.SingleForeignMessage = new ForeignMessage(); + Assert.True(accessor.HasValue(message)); + message.SingleForeignMessage = null; + Assert.False(accessor.HasValue(message)); + } + + [Test] + public void HasValue_Proto3_Oneof() + { + TestAllTypes message = new TestAllTypes(); + var accessor = ((IMessage) message).Descriptor.Fields[TestProtos.TestAllTypes.OneofStringFieldNumber].Accessor; + Assert.False(accessor.HasValue(message)); + // Even though it's the default value, we still have a value. + message.OneofString = ""; + Assert.True(accessor.HasValue(message)); + message.OneofString = "hello"; + Assert.True(accessor.HasValue(message)); + message.OneofUint32 = 10; + Assert.False(accessor.HasValue(message)); + } + + [Test] + public void HasValue_Proto3_Primitive_Optional() + { + var message = new TestProto3Optional(); + var accessor = ((IMessage) message).Descriptor.Fields[TestProto3Optional.OptionalInt64FieldNumber].Accessor; + Assert.IsFalse(accessor.HasValue(message)); + message.OptionalInt64 = 5L; + Assert.IsTrue(accessor.HasValue(message)); + message.ClearOptionalInt64(); + Assert.IsFalse(accessor.HasValue(message)); + message.OptionalInt64 = 0L; + Assert.IsTrue(accessor.HasValue(message)); + } + + [Test] + public void HasValue_Proto3_Primitive_NotOptional() { IMessage message = SampleMessages.CreateFullTestAllTypes(); var fields = message.Descriptor.Fields; @@ -105,19 +147,61 @@ namespace Google.Protobuf.Reflection } [Test] - public void HasValue() + public void HasValue_Proto3_Repeated() { - IMessage message = new Proto2.TestAllTypes(); - var fields = message.Descriptor.Fields; - var accessor = fields[Proto2.TestAllTypes.OptionalBoolFieldNumber].Accessor; + var message = new TestAllTypes(); + var accessor = ((IMessage) message).Descriptor.Fields[TestProtos.TestAllTypes.RepeatedBoolFieldNumber].Accessor; + Assert.Throws(() => accessor.HasValue(message)); + } - Assert.False(accessor.HasValue(message)); + [Test] + public void HasValue_Proto2_Primitive() + { + var message = new Proto2.TestAllTypes(); + var accessor = ((IMessage) message).Descriptor.Fields[Proto2.TestAllTypes.OptionalInt64FieldNumber].Accessor; + + Assert.IsFalse(accessor.HasValue(message)); + message.OptionalInt64 = 5L; + Assert.IsTrue(accessor.HasValue(message)); + message.ClearOptionalInt64(); + Assert.IsFalse(accessor.HasValue(message)); + message.OptionalInt64 = 0L; + Assert.IsTrue(accessor.HasValue(message)); + } - accessor.SetValue(message, true); - Assert.True(accessor.HasValue(message)); + [Test] + public void HasValue_Proto2_Message() + { + var message = new Proto2.TestAllTypes(); + var field = ((IMessage) message).Descriptor.Fields[Proto2.TestAllTypes.OptionalForeignMessageFieldNumber]; + Assert.False(field.Accessor.HasValue(message)); + message.OptionalForeignMessage = new Proto2.ForeignMessage(); + Assert.True(field.Accessor.HasValue(message)); + message.OptionalForeignMessage = null; + Assert.False(field.Accessor.HasValue(message)); + } - accessor.Clear(message); + [Test] + public void HasValue_Proto2_Oneof() + { + var message = new Proto2.TestAllTypes(); + var accessor = ((IMessage) message).Descriptor.Fields[Proto2.TestAllTypes.OneofStringFieldNumber].Accessor; Assert.False(accessor.HasValue(message)); + // Even though it's the default value, we still have a value. + message.OneofString = ""; + Assert.True(accessor.HasValue(message)); + message.OneofString = "hello"; + Assert.True(accessor.HasValue(message)); + message.OneofUint32 = 10; + Assert.False(accessor.HasValue(message)); + } + + [Test] + public void HasValue_Proto2_Repeated() + { + var message = new Proto2.TestAllTypes(); + var accessor = ((IMessage) message).Descriptor.Fields[Proto2.TestAllTypes.RepeatedBoolFieldNumber].Accessor; + Assert.Throws(() => accessor.HasValue(message)); } [Test] @@ -225,6 +309,63 @@ namespace Google.Protobuf.Reflection Assert.AreEqual(0, mapMessage.MapStringString.Count); } + [Test] + public void Clear_Proto3Optional() + { + TestProto3Optional message = new TestProto3Optional + { + OptionalInt32 = 0, + OptionalNestedMessage = new TestProto3Optional.Types.NestedMessage() + }; + var primitiveField = TestProto3Optional.Descriptor.Fields[TestProto3Optional.OptionalInt32FieldNumber]; + var messageField = TestProto3Optional.Descriptor.Fields[TestProto3Optional.OptionalNestedMessageFieldNumber]; + + Assert.True(message.HasOptionalInt32); + Assert.NotNull(message.OptionalNestedMessage); + + primitiveField.Accessor.Clear(message); + messageField.Accessor.Clear(message); + + Assert.False(message.HasOptionalInt32); + Assert.Null(message.OptionalNestedMessage); + } + + [Test] + public void Clear_Proto3_Oneof() + { + var message = new TestAllTypes(); + var accessor = ((IMessage) message).Descriptor.Fields[TestProtos.TestAllTypes.OneofUint32FieldNumber].Accessor; + + // The field accessor Clear method only affects a oneof if the current case is the one being cleared. + message.OneofString = "hello"; + Assert.AreEqual(TestProtos.TestAllTypes.OneofFieldOneofCase.OneofString, message.OneofFieldCase); + accessor.Clear(message); + Assert.AreEqual(TestProtos.TestAllTypes.OneofFieldOneofCase.OneofString, message.OneofFieldCase); + + message.OneofUint32 = 100; + Assert.AreEqual(TestProtos.TestAllTypes.OneofFieldOneofCase.OneofUint32, message.OneofFieldCase); + accessor.Clear(message); + Assert.AreEqual(TestProtos.TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); + } + + [Test] + public void Clear_Proto2_Oneof() + { + var message = new Proto2.TestAllTypes(); + var accessor = ((IMessage) message).Descriptor.Fields[Proto2.TestAllTypes.OneofUint32FieldNumber].Accessor; + + // The field accessor Clear method only affects a oneof if the current case is the one being cleared. + message.OneofString = "hello"; + Assert.AreEqual(Proto2.TestAllTypes.OneofFieldOneofCase.OneofString, message.OneofFieldCase); + accessor.Clear(message); + Assert.AreEqual(Proto2.TestAllTypes.OneofFieldOneofCase.OneofString, message.OneofFieldCase); + + message.OneofUint32 = 100; + Assert.AreEqual(Proto2.TestAllTypes.OneofFieldOneofCase.OneofUint32, message.OneofFieldCase); + accessor.Clear(message); + Assert.AreEqual(Proto2.TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); + } + [Test] public void FieldDescriptor_ByName() { @@ -264,5 +405,32 @@ namespace Google.Protobuf.Reflection message.ClearExtension(RepeatedBoolExtension); Assert.IsNull(message.GetExtension(RepeatedBoolExtension)); } + + [Test] + public void HasPresence() + { + // Proto3 + var fields = TestProtos.TestAllTypes.Descriptor.Fields; + Assert.IsFalse(fields[TestProtos.TestAllTypes.SingleBoolFieldNumber].HasPresence); + Assert.IsTrue(fields[TestProtos.TestAllTypes.OneofBytesFieldNumber].HasPresence); + Assert.IsTrue(fields[TestProtos.TestAllTypes.SingleForeignMessageFieldNumber].HasPresence); + Assert.IsFalse(fields[TestProtos.TestAllTypes.RepeatedBoolFieldNumber].HasPresence); + + fields = TestMap.Descriptor.Fields; + Assert.IsFalse(fields[TestMap.MapBoolBoolFieldNumber].HasPresence); + + fields = TestProto3Optional.Descriptor.Fields; + Assert.IsTrue(fields[TestProto3Optional.OptionalBoolFieldNumber].HasPresence); + + // Proto2 + fields = Proto2.TestAllTypes.Descriptor.Fields; + Assert.IsTrue(fields[Proto2.TestAllTypes.OptionalBoolFieldNumber].HasPresence); + Assert.IsTrue(fields[Proto2.TestAllTypes.OneofBytesFieldNumber].HasPresence); + Assert.IsTrue(fields[Proto2.TestAllTypes.OptionalForeignMessageFieldNumber].HasPresence); + Assert.IsFalse(fields[Proto2.TestAllTypes.RepeatedBoolFieldNumber].HasPresence); + + fields = Proto2.TestRequired.Descriptor.Fields; + Assert.IsTrue(fields[Proto2.TestRequired.AFieldNumber].HasPresence); + } } } diff --git a/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs b/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs index 886937d706..15debc1b6c 100644 --- a/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs +++ b/csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs @@ -161,10 +161,10 @@ namespace Google.Protobuf MessageParser discardingParser2 = retainingParser2.WithDiscardUnknownFields(true); // Test parse from byte[] - assertFull(retainingParser1.ParseFrom(data)); - assertFull(retainingParser2.ParseFrom(data)); - assertEmpty(discardingParser1.ParseFrom(data)); - assertEmpty(discardingParser2.ParseFrom(data)); + MessageParsingHelpers.AssertReadingMessage(retainingParser1, data, m => assertFull(m)); + MessageParsingHelpers.AssertReadingMessage(retainingParser2, data, m => assertFull(m)); + MessageParsingHelpers.AssertReadingMessage(discardingParser1, data, m => assertEmpty(m)); + MessageParsingHelpers.AssertReadingMessage(discardingParser2, data, m => assertEmpty(m)); // Test parse from byte[] with offset assertFull(retainingParser1.ParseFrom(data, 0, data.Length)); diff --git a/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs b/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs index 4a425f79aa..5b0e5e8fc1 100644 --- a/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs +++ b/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs @@ -71,18 +71,42 @@ namespace Google.Protobuf.WellKnownTypes Uint64Field = 4 }; - var bytes = message.ToByteArray(); - var parsed = TestWellKnownTypes.Parser.ParseFrom(bytes); - - Assert.AreEqual("x", parsed.StringField); - Assert.AreEqual(ByteString.CopyFrom(1, 2, 3), parsed.BytesField); - Assert.AreEqual(true, parsed.BoolField); - Assert.AreEqual(12.5f, parsed.FloatField); - Assert.AreEqual(12.25d, parsed.DoubleField); - Assert.AreEqual(1, parsed.Int32Field); - Assert.AreEqual(2L, parsed.Int64Field); - Assert.AreEqual(3U, parsed.Uint32Field); - Assert.AreEqual(4UL, parsed.Uint64Field); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestWellKnownTypes.Parser, message, parsed => + { + Assert.AreEqual("x", parsed.StringField); + Assert.AreEqual(ByteString.CopyFrom(1, 2, 3), parsed.BytesField); + Assert.AreEqual(true, parsed.BoolField); + Assert.AreEqual(12.5f, parsed.FloatField); + Assert.AreEqual(12.25d, parsed.DoubleField); + Assert.AreEqual(1, parsed.Int32Field); + Assert.AreEqual(2L, parsed.Int64Field); + Assert.AreEqual(3U, parsed.Uint32Field); + Assert.AreEqual(4UL, parsed.Uint64Field); + }); + } + + [Test] + public void NegativeSingleValues() + { + var message = new TestWellKnownTypes + { + FloatField = -12.5f, + DoubleField = -12.25d, + Int32Field = -1, + Int64Field = -2 + }; + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestWellKnownTypes.Parser, message, parsed => + { + Assert.AreEqual(-12.5f, parsed.FloatField); + Assert.AreEqual(-12.25d, parsed.DoubleField); + Assert.AreEqual(-1, parsed.Int32Field); + Assert.AreEqual(-2L, parsed.Int64Field); + }); } [Test] @@ -101,18 +125,20 @@ namespace Google.Protobuf.WellKnownTypes Uint64Field = 0 }; - var bytes = message.ToByteArray(); - var parsed = TestWellKnownTypes.Parser.ParseFrom(bytes); - - Assert.AreEqual("", parsed.StringField); - Assert.AreEqual(ByteString.Empty, parsed.BytesField); - Assert.AreEqual(false, parsed.BoolField); - Assert.AreEqual(0f, parsed.FloatField); - Assert.AreEqual(0d, parsed.DoubleField); - Assert.AreEqual(0, parsed.Int32Field); - Assert.AreEqual(0L, parsed.Int64Field); - Assert.AreEqual(0U, parsed.Uint32Field); - Assert.AreEqual(0UL, parsed.Uint64Field); + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(TestWellKnownTypes.Parser, message, parsed => + { + Assert.AreEqual("", parsed.StringField); + Assert.AreEqual(ByteString.Empty, parsed.BytesField); + Assert.AreEqual(false, parsed.BoolField); + Assert.AreEqual(0f, parsed.FloatField); + Assert.AreEqual(0d, parsed.DoubleField); + Assert.AreEqual(0, parsed.Int32Field); + Assert.AreEqual(0L, parsed.Int64Field); + Assert.AreEqual(0U, parsed.Uint32Field); + Assert.AreEqual(0UL, parsed.Uint64Field); + }); } [Test] @@ -140,12 +166,13 @@ namespace Google.Protobuf.WellKnownTypes Uint32Field = { uint.MaxValue, uint.MinValue, 0U }, Uint64Field = { ulong.MaxValue, ulong.MinValue, 0UL }, }; - var bytes = message.ToByteArray(); - var parsed = RepeatedWellKnownTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); // Just to test a single value for sanity... Assert.AreEqual("Second", message.StringField[1]); + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(RepeatedWellKnownTypes.Parser, message); } [Test] @@ -170,6 +197,8 @@ namespace Google.Protobuf.WellKnownTypes var message = new RepeatedWellKnownTypes { Int32Field = { 5, 0 } }; var actualBytes = message.ToByteArray(); Assert.AreEqual(expectedBytes, actualBytes); + + MessageParsingHelpers.AssertWritingMessage(message); } [Test] @@ -194,12 +223,12 @@ namespace Google.Protobuf.WellKnownTypes Uint64Field = { { 18, ulong.MaxValue }, { 19, ulong.MinValue }, { 20, 0UL } }, }; - var bytes = message.ToByteArray(); - var parsed = MapWellKnownTypes.Parser.ParseFrom(bytes); - - Assert.AreEqual(message, parsed); // Just to test a single value for sanity... Assert.AreEqual("Second", message.StringField[12]); + + MessageParsingHelpers.AssertWritingMessage(message); + + MessageParsingHelpers.AssertRoundtrip(MapWellKnownTypes.Parser, message); } [Test] @@ -288,10 +317,10 @@ namespace Google.Protobuf.WellKnownTypes private void AssertOneofRoundTrip(OneofWellKnownTypes message) { // Normal roundtrip, but explicitly checking the case... - var bytes = message.ToByteArray(); - var parsed = OneofWellKnownTypes.Parser.ParseFrom(bytes); - Assert.AreEqual(message, parsed); - Assert.AreEqual(message.OneofFieldCase, parsed.OneofFieldCase); + MessageParsingHelpers.AssertRoundtrip(OneofWellKnownTypes.Parser, message, parsed => + { + Assert.AreEqual(message.OneofFieldCase, parsed.OneofFieldCase); + }); } [Test] @@ -406,8 +435,10 @@ namespace Google.Protobuf.WellKnownTypes Assert.AreEqual(8, stream.Length); // tag (1 byte) + length (1 byte) + message (6 bytes) stream.Position = 0; - var message = TestWellKnownTypes.Parser.ParseFrom(stream); - Assert.AreEqual(65536, message.Int32Field); + MessageParsingHelpers.AssertReadingMessage( + TestWellKnownTypes.Parser, + stream.ToArray(), + message => Assert.AreEqual(65536, message.Int32Field)); } [Test] @@ -431,8 +462,10 @@ namespace Google.Protobuf.WellKnownTypes Assert.Less(stream.Length, 8); // tag (1 byte) + length (1 byte) + message stream.Position = 0; - var message = TestWellKnownTypes.Parser.ParseFrom(stream); - Assert.AreEqual(6, message.Int32Field); + MessageParsingHelpers.AssertReadingMessage( + TestWellKnownTypes.Parser, + stream.ToArray(), + message => Assert.AreEqual(6, message.Int32Field)); } [Test] @@ -456,8 +489,10 @@ namespace Google.Protobuf.WellKnownTypes Assert.AreEqual(13, stream.Length); // tag (1 byte) + length (1 byte) + message (11 bytes) stream.Position = 0; - var message = TestWellKnownTypes.Parser.ParseFrom(stream); - Assert.AreEqual(0xfffffffffffffL, message.Int64Field); + MessageParsingHelpers.AssertReadingMessage( + TestWellKnownTypes.Parser, + stream.ToArray(), + message => Assert.AreEqual(0xfffffffffffffL, message.Int64Field)); } [Test] @@ -481,8 +516,10 @@ namespace Google.Protobuf.WellKnownTypes Assert.Less(stream.Length, 12); // tag (1 byte) + length (1 byte) + message stream.Position = 0; - var message = TestWellKnownTypes.Parser.ParseFrom(stream); - Assert.AreEqual(6L, message.Int64Field); + MessageParsingHelpers.AssertReadingMessage( + TestWellKnownTypes.Parser, + stream.ToArray(), + message => Assert.AreEqual(6L, message.Int64Field)); } [Test] diff --git a/csharp/src/Google.Protobuf.Test/testprotos.pb b/csharp/src/Google.Protobuf.Test/testprotos.pb index 424d969005..42ecd3adf8 100644 Binary files a/csharp/src/Google.Protobuf.Test/testprotos.pb and b/csharp/src/Google.Protobuf.Test/testprotos.pb differ diff --git a/csharp/src/Google.Protobuf/ByteString.cs b/csharp/src/Google.Protobuf/ByteString.cs index 3eb00e5bb5..063b543562 100644 --- a/csharp/src/Google.Protobuf/ByteString.cs +++ b/csharp/src/Google.Protobuf/ByteString.cs @@ -34,6 +34,8 @@ using System; using System.Collections; using System.Collections.Generic; using System.IO; +using System.Runtime.InteropServices; +using System.Security; using System.Text; #if !NET35 using System.Threading; @@ -48,40 +50,36 @@ namespace Google.Protobuf /// /// Immutable array of bytes. /// + [SecuritySafeCritical] public sealed class ByteString : IEnumerable, IEquatable { private static readonly ByteString empty = new ByteString(new byte[0]); - private readonly byte[] bytes; + private readonly ReadOnlyMemory bytes; /// - /// Unsafe operations that can cause IO Failure and/or other catastrophic side-effects. + /// Internal use only. Ensure that the provided memory is not mutated and belongs to this instance. /// - internal static class Unsafe + internal static ByteString AttachBytes(ReadOnlyMemory bytes) { - /// - /// Constructs a new ByteString from the given byte array. The array is - /// *not* copied, and must not be modified after this constructor is called. - /// - internal static ByteString FromBytes(byte[] bytes) - { - return new ByteString(bytes); - } + return new ByteString(bytes); } /// - /// Internal use only. Ensure that the provided array is not mutated and belongs to this instance. + /// Internal use only. Ensure that the provided memory is not mutated and belongs to this instance. + /// This method encapsulates converting array to memory. Reduces need for SecuritySafeCritical + /// in .NET Framework. /// internal static ByteString AttachBytes(byte[] bytes) { - return new ByteString(bytes); + return AttachBytes(bytes.AsMemory()); } /// - /// Constructs a new ByteString from the given byte array. The array is + /// Constructs a new ByteString from the given memory. The memory is /// *not* copied, and must not be modified after this constructor is called. /// - private ByteString(byte[] bytes) + private ByteString(ReadOnlyMemory bytes) { this.bytes = bytes; } @@ -110,13 +108,23 @@ namespace Google.Protobuf get { return Length == 0; } } -#if GOOGLE_PROTOBUF_SUPPORT_SYSTEM_MEMORY /// /// Provides read-only access to the data of this . /// No data is copied so this is the most efficient way of accessing. /// - public ReadOnlySpan Span => new ReadOnlySpan(bytes); -#endif + public ReadOnlySpan Span + { + get { return bytes.Span; } + } + + /// + /// Provides read-only access to the data of this . + /// No data is copied so this is the most efficient way of accessing. + /// + public ReadOnlyMemory Memory + { + get { return bytes; } + } /// /// Converts this into a byte array. @@ -125,7 +133,7 @@ namespace Google.Protobuf /// A byte array with the same data as this ByteString. public byte[] ToByteArray() { - return (byte[]) bytes.Clone(); + return bytes.ToArray(); } /// @@ -134,7 +142,16 @@ namespace Google.Protobuf /// A base64 representation of this ByteString. public string ToBase64() { - return Convert.ToBase64String(bytes); + if (MemoryMarshal.TryGetArray(bytes, out ArraySegment segment)) + { + // Fast path. ByteString was created with an array, so pass the underlying array. + return Convert.ToBase64String(segment.Array, segment.Offset, segment.Count); + } + else + { + // Slow path. BytesString is not an array. Convert memory and pass result to ToBase64String. + return Convert.ToBase64String(bytes.ToArray()); + } } /// @@ -160,7 +177,7 @@ namespace Google.Protobuf int capacity = stream.CanSeek ? checked((int) (stream.Length - stream.Position)) : 0; var memoryStream = new MemoryStream(capacity); stream.CopyTo(memoryStream); -#if NETSTANDARD1_0 || NETSTANDARD2_0 +#if NETSTANDARD1_1 || NETSTANDARD2_0 byte[] bytes = memoryStream.ToArray(); #else // Avoid an extra copy if we can. @@ -178,21 +195,10 @@ namespace Google.Protobuf /// The stream to copy into a ByteString. /// The cancellation token to use when reading from the stream, if any. /// A ByteString with content read from the given stream. - public async static Task FromStreamAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) + public static Task FromStreamAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) { ProtoPreconditions.CheckNotNull(stream, nameof(stream)); - int capacity = stream.CanSeek ? checked((int) (stream.Length - stream.Position)) : 0; - var memoryStream = new MemoryStream(capacity); - // We have to specify the buffer size here, as there's no overload accepting the cancellation token - // alone. But it's documented to use 81920 by default if not specified. - await stream.CopyToAsync(memoryStream, 81920, cancellationToken); -#if NETSTANDARD1_0 || NETSTANDARD2_0 - byte[] bytes = memoryStream.ToArray(); -#else - // Avoid an extra copy if we can. - byte[] bytes = memoryStream.Length == memoryStream.Capacity ? memoryStream.GetBuffer() : memoryStream.ToArray(); -#endif - return AttachBytes(bytes); + return ByteStringAsync.FromStreamAsyncCore(stream, cancellationToken); } #endif @@ -218,7 +224,6 @@ namespace Google.Protobuf return new ByteString(portion); } -#if GOOGLE_PROTOBUF_SUPPORT_SYSTEM_MEMORY /// /// Constructs a from a read only span. The contents /// are copied, so further modifications to the span will not @@ -228,7 +233,6 @@ namespace Google.Protobuf { return new ByteString(bytes.ToArray()); } -#endif /// /// Creates a new by encoding the specified text with @@ -248,11 +252,11 @@ namespace Google.Protobuf } /// - /// Retuns the byte at the given index. + /// Returns the byte at the given index. /// public byte this[int index] { - get { return bytes[index]; } + get { return bytes.Span[index]; } } /// @@ -266,7 +270,18 @@ namespace Google.Protobuf /// The result of decoding the binary data with the given decoding. public string ToString(Encoding encoding) { - return encoding.GetString(bytes, 0, bytes.Length); + if (MemoryMarshal.TryGetArray(bytes, out ArraySegment segment)) + { + // Fast path. ByteString was created with an array. + return encoding.GetString(segment.Array, segment.Offset, segment.Count); + } + else + { + // Slow path. BytesString is not an array. Convert memory and pass result to GetString. + // TODO: Consider using GetString overload that takes a pointer. + byte[] array = bytes.ToArray(); + return encoding.GetString(array, 0, array.Length); + } } /// @@ -286,9 +301,10 @@ namespace Google.Protobuf /// Returns an iterator over the bytes in this . /// /// An iterator over the bytes in this object. + [SecuritySafeCritical] public IEnumerator GetEnumerator() { - return ((IEnumerable) bytes).GetEnumerator(); + return MemoryMarshal.ToEnumerable(bytes).GetEnumerator(); } /// @@ -306,7 +322,17 @@ namespace Google.Protobuf public CodedInputStream CreateCodedInput() { // We trust CodedInputStream not to reveal the provided byte array or modify it - return new CodedInputStream(bytes); + if (MemoryMarshal.TryGetArray(bytes, out ArraySegment segment) && segment.Count == bytes.Length) + { + // Fast path. ByteString was created with a complete array. + return new CodedInputStream(segment.Array, segment.Offset, segment.Count); + } + else + { + // Slow path. BytesString is not an array, or is a slice of an array. + // Convert memory and pass result to WriteRawBytes. + return new CodedInputStream(bytes.ToArray()); + } } /// @@ -325,18 +351,8 @@ namespace Google.Protobuf { return false; } - if (lhs.bytes.Length != rhs.bytes.Length) - { - return false; - } - for (int i = 0; i < lhs.Length; i++) - { - if (rhs.bytes[i] != lhs.bytes[i]) - { - return false; - } - } - return true; + + return lhs.bytes.Span.SequenceEqual(rhs.bytes.Span); } /// @@ -355,6 +371,7 @@ namespace Google.Protobuf /// /// The object to compare this with. /// true if refers to an equal ; false otherwise. + [SecuritySafeCritical] public override bool Equals(object obj) { return this == (obj as ByteString); @@ -365,12 +382,15 @@ namespace Google.Protobuf /// will return the same hash code. /// /// A hash code for this object. + [SecuritySafeCritical] public override int GetHashCode() { + ReadOnlySpan b = bytes.Span; + int ret = 23; - foreach (byte b in bytes) + for (int i = 0; i < b.Length; i++) { - ret = (ret * 31) + b; + ret = (ret * 31) + b[i]; } return ret; } @@ -385,20 +405,12 @@ namespace Google.Protobuf return this == other; } - /// - /// Used internally by CodedOutputStream to avoid creating a copy for the write - /// - internal void WriteRawBytesTo(CodedOutputStream outputStream) - { - outputStream.WriteRawBytes(bytes, 0, bytes.Length); - } - /// /// Copies the entire byte array to the destination array provided at the offset specified. /// public void CopyTo(byte[] array, int position) { - ByteArray.Copy(bytes, 0, array, position, bytes.Length); + bytes.CopyTo(array.AsMemory(position)); } /// @@ -406,7 +418,17 @@ namespace Google.Protobuf /// public void WriteTo(Stream outputStream) { - outputStream.Write(bytes, 0, bytes.Length); + if (MemoryMarshal.TryGetArray(bytes, out ArraySegment segment)) + { + // Fast path. ByteString was created with an array, so pass the underlying array. + outputStream.Write(segment.Array, segment.Offset, segment.Count); + } + else + { + // Slow path. BytesString is not an array. Convert memory and pass result to WriteRawBytes. + var array = bytes.ToArray(); + outputStream.Write(array, 0, array.Length); + } } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/ByteStringAsync.cs b/csharp/src/Google.Protobuf/ByteStringAsync.cs new file mode 100644 index 0000000000..3465cc67b4 --- /dev/null +++ b/csharp/src/Google.Protobuf/ByteStringAsync.cs @@ -0,0 +1,64 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Google.Protobuf +{ + /// + /// SecuritySafeCritical attribute can not be placed on types with async methods. + /// This class has ByteString's async methods so it can be marked with SecuritySafeCritical. + /// + internal static class ByteStringAsync + { +#if !NET35 + internal static async Task FromStreamAsyncCore(Stream stream, CancellationToken cancellationToken) + { + int capacity = stream.CanSeek ? checked((int)(stream.Length - stream.Position)) : 0; + var memoryStream = new MemoryStream(capacity); + // We have to specify the buffer size here, as there's no overload accepting the cancellation token + // alone. But it's documented to use 81920 by default if not specified. + await stream.CopyToAsync(memoryStream, 81920, cancellationToken); +#if NETSTANDARD1_1 + byte[] bytes = memoryStream.ToArray(); +#else + // Avoid an extra copy if we can. + byte[] bytes = memoryStream.Length == memoryStream.Capacity ? memoryStream.GetBuffer() : memoryStream.ToArray(); +#endif + return ByteString.AttachBytes(bytes); + } +#endif + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/CodedInputStream.cs b/csharp/src/Google.Protobuf/CodedInputStream.cs index 9976f58234..27b23c0d9c 100644 --- a/csharp/src/Google.Protobuf/CodedInputStream.cs +++ b/csharp/src/Google.Protobuf/CodedInputStream.cs @@ -34,6 +34,9 @@ using Google.Protobuf.Collections; using System; using System.Collections.Generic; using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; namespace Google.Protobuf { @@ -51,6 +54,7 @@ namespace Google.Protobuf /// and to serialize such fields. /// /// + [SecuritySafeCritical] public sealed class CodedInputStream : IDisposable { /// @@ -64,17 +68,6 @@ namespace Google.Protobuf /// private readonly byte[] buffer; - /// - /// The index of the buffer at which we need to refill from the stream (if there is one). - /// - private int bufferSize; - - private int bufferSizeAfterLimit = 0; - /// - /// The position within the current buffer (i.e. the next byte to read) - /// - private int bufferPos = 0; - /// /// The stream to read further input from, or null if the byte array buffer was provided /// directly on construction, with no further data available. @@ -82,38 +75,15 @@ namespace Google.Protobuf private readonly Stream input; /// - /// The last tag we read. 0 indicates we've read to the end of the stream - /// (or haven't read anything yet). + /// The parser state is kept separately so that other parse implementations can reuse the same + /// parsing primitives. /// - private uint lastTag = 0; - - /// - /// The next tag, used to store the value read by PeekTag. - /// - private uint nextTag = 0; - private bool hasNextTag = false; + private ParserInternalState state; internal const int DefaultRecursionLimit = 100; internal const int DefaultSizeLimit = Int32.MaxValue; internal const int BufferSize = 4096; - /// - /// The total number of bytes read before the current buffer. The - /// total bytes read up to the current position can be computed as - /// totalBytesRetired + bufferPos. - /// - private int totalBytesRetired = 0; - - /// - /// The absolute position of the end of the current message. - /// - private int currentLimit = int.MaxValue; - - private int recursionDepth = 0; - - private readonly int recursionLimit; - private readonly int sizeLimit; - #region Construction // Note that the checks are performed such that we don't end up checking obviously-valid things // like non-null references for arrays we've just created. @@ -170,11 +140,14 @@ namespace Google.Protobuf { this.input = input; this.buffer = buffer; - this.bufferPos = bufferPos; - this.bufferSize = bufferSize; - this.sizeLimit = DefaultSizeLimit; - this.recursionLimit = DefaultRecursionLimit; + this.state.bufferPos = bufferPos; + this.state.bufferSize = bufferSize; + this.state.sizeLimit = DefaultSizeLimit; + this.state.recursionLimit = DefaultRecursionLimit; + SegmentedBufferHelper.Initialize(this, out this.state.segmentedBufferHelper); this.leaveOpen = leaveOpen; + + this.state.currentLimit = int.MaxValue; } /// @@ -196,8 +169,8 @@ namespace Google.Protobuf { throw new ArgumentOutOfRangeException("recursionLimit!", "Recursion limit must be positive"); } - this.sizeLimit = sizeLimit; - this.recursionLimit = recursionLimit; + this.state.sizeLimit = sizeLimit; + this.state.recursionLimit = recursionLimit; } #endregion @@ -230,9 +203,9 @@ namespace Google.Protobuf { if (input != null) { - return input.Position - ((bufferSize + bufferSizeAfterLimit) - bufferPos); + return input.Position - ((state.bufferSize + state.bufferSizeAfterLimit) - state.bufferPos); } - return bufferPos; + return state.bufferPos; } } @@ -240,7 +213,7 @@ namespace Google.Protobuf /// Returns the last tag read, or 0 if no tags have been read or we've read beyond /// the end of the stream. /// - internal uint LastTag { get { return lastTag; } } + internal uint LastTag { get { return state.lastTag; } } /// /// Returns the size limit for this stream. @@ -253,7 +226,7 @@ namespace Google.Protobuf /// /// The size limit. /// - public int SizeLimit { get { return sizeLimit; } } + public int SizeLimit { get { return state.sizeLimit; } } /// /// Returns the recursion limit for this stream. This limit is applied whilst reading messages, @@ -265,17 +238,31 @@ namespace Google.Protobuf /// /// The recursion limit for this stream. /// - public int RecursionLimit { get { return recursionLimit; } } + public int RecursionLimit { get { return state.recursionLimit; } } /// /// Internal-only property; when set to true, unknown fields will be discarded while parsing. /// - internal bool DiscardUnknownFields { get; set; } + internal bool DiscardUnknownFields + { + get { return state.DiscardUnknownFields; } + set { state.DiscardUnknownFields = value; } + } /// /// Internal-only property; provides extension identifiers to compatible messages while parsing. /// - internal ExtensionRegistry ExtensionRegistry { get; set; } + internal ExtensionRegistry ExtensionRegistry + { + get { return state.ExtensionRegistry; } + set { state.ExtensionRegistry = value; } + } + + internal byte[] InternalBuffer => buffer; + + internal Stream InternalInputStream => input; + + internal ref ParserInternalState InternalState => ref state; /// /// Disposes of this instance, potentially closing any underlying stream. @@ -302,17 +289,7 @@ namespace Google.Protobuf /// tag read was not the one specified internal void CheckReadEndOfStreamTag() { - if (lastTag != 0) - { - throw InvalidProtocolBufferException.MoreDataAvailable(); - } - } - - internal void CheckLastTagWas(uint expectedTag) - { - if (lastTag != expectedTag) { - throw InvalidProtocolBufferException.InvalidEndTag(); - } + ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref state); } #endregion @@ -325,16 +302,8 @@ namespace Google.Protobuf /// public uint PeekTag() { - if (hasNextTag) - { - return nextTag; - } - - uint savedLast = lastTag; - nextTag = ReadTag(); - hasNextTag = true; - lastTag = savedLast; // Undo the side effect of ReadTag - return nextTag; + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.PeekTag(ref span, ref state); } /// @@ -348,54 +317,8 @@ namespace Google.Protobuf /// The next field tag, or 0 for end of stream. (0 is never a valid tag.) public uint ReadTag() { - if (hasNextTag) - { - lastTag = nextTag; - hasNextTag = false; - return lastTag; - } - - // Optimize for the incredibly common case of having at least two bytes left in the buffer, - // and those two bytes being enough to get the tag. This will be true for fields up to 4095. - if (bufferPos + 2 <= bufferSize) - { - int tmp = buffer[bufferPos++]; - if (tmp < 128) - { - lastTag = (uint)tmp; - } - else - { - int result = tmp & 0x7f; - if ((tmp = buffer[bufferPos++]) < 128) - { - result |= tmp << 7; - lastTag = (uint) result; - } - else - { - // Nope, rewind and go the potentially slow route. - bufferPos -= 2; - lastTag = ReadRawVarint32(); - } - } - } - else - { - if (IsAtEnd) - { - lastTag = 0; - return 0; - } - - lastTag = ReadRawVarint32(); - } - if (WireFormat.GetTagFieldNumber(lastTag) == 0) - { - // If we actually read a tag with a field of 0, that's not a valid tag. - throw InvalidProtocolBufferException.InvalidTag(); - } - return lastTag; + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseTag(ref span, ref state); } /// @@ -413,32 +336,8 @@ namespace Google.Protobuf /// The last read operation read to the end of the logical stream public void SkipLastField() { - if (lastTag == 0) - { - throw new InvalidOperationException("SkipLastField cannot be called at the end of a stream"); - } - switch (WireFormat.GetTagWireType(lastTag)) - { - case WireFormat.WireType.StartGroup: - SkipGroup(lastTag); - break; - case WireFormat.WireType.EndGroup: - throw new InvalidProtocolBufferException( - "SkipLastField called on an end-group tag, indicating that the corresponding start-group was missing"); - case WireFormat.WireType.Fixed32: - ReadFixed32(); - break; - case WireFormat.WireType.Fixed64: - ReadFixed64(); - break; - case WireFormat.WireType.LengthDelimited: - var length = ReadLength(); - SkipRawBytes(length); - break; - case WireFormat.WireType.Varint: - ReadRawVarint32(); - break; - } + var span = new ReadOnlySpan(buffer); + ParsingPrimitivesMessages.SkipLastField(ref span, ref state); } /// @@ -446,37 +345,8 @@ namespace Google.Protobuf /// internal void SkipGroup(uint startGroupTag) { - // Note: Currently we expect this to be the way that groups are read. We could put the recursion - // depth changes into the ReadTag method instead, potentially... - recursionDepth++; - if (recursionDepth >= recursionLimit) - { - throw InvalidProtocolBufferException.RecursionLimitExceeded(); - } - uint tag; - while (true) - { - tag = ReadTag(); - if (tag == 0) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - // Can't call SkipLastField for this case- that would throw. - if (WireFormat.GetTagWireType(tag) == WireFormat.WireType.EndGroup) - { - break; - } - // This recursion will allow us to handle nested groups. - SkipLastField(); - } - int startField = WireFormat.GetTagFieldNumber(startGroupTag); - int endField = WireFormat.GetTagFieldNumber(tag); - if (startField != endField) - { - throw new InvalidProtocolBufferException( - $"Mismatched end-group tag. Started with field {startField}; ended with field {endField}"); - } - recursionDepth--; + var span = new ReadOnlySpan(buffer); + ParsingPrimitivesMessages.SkipGroup(ref span, ref state, startGroupTag); } /// @@ -484,33 +354,8 @@ namespace Google.Protobuf /// public double ReadDouble() { - if (bufferPos + 8 <= bufferSize) - { - if (BitConverter.IsLittleEndian) - { - var result = BitConverter.ToDouble(buffer, bufferPos); - bufferPos += 8; - return result; - } - else - { - var bytes = new byte[8]; - bytes[0] = buffer[bufferPos + 7]; - bytes[1] = buffer[bufferPos + 6]; - bytes[2] = buffer[bufferPos + 5]; - bytes[3] = buffer[bufferPos + 4]; - bytes[4] = buffer[bufferPos + 3]; - bytes[5] = buffer[bufferPos + 2]; - bytes[6] = buffer[bufferPos + 1]; - bytes[7] = buffer[bufferPos]; - bufferPos += 8; - return BitConverter.ToDouble(bytes, 0); - } - } - else - { - return BitConverter.Int64BitsToDouble((long)ReadRawLittleEndian64()); - } + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseDouble(ref span, ref state); } /// @@ -518,21 +363,8 @@ namespace Google.Protobuf /// public float ReadFloat() { - if (BitConverter.IsLittleEndian && 4 <= bufferSize - bufferPos) - { - float ret = BitConverter.ToSingle(buffer, bufferPos); - bufferPos += 4; - return ret; - } - else - { - byte[] rawBytes = ReadRawBytes(4); - if (!BitConverter.IsLittleEndian) - { - ByteArray.Reverse(rawBytes); - } - return BitConverter.ToSingle(rawBytes, 0); - } + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseFloat(ref span, ref state); } /// @@ -588,22 +420,8 @@ namespace Google.Protobuf /// public string ReadString() { - int length = ReadLength(); - // No need to read any data for an empty string. - if (length == 0) - { - return ""; - } - if (length <= bufferSize - bufferPos && length > 0) - { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - String result = CodedOutputStream.Utf8Encoding.GetString(buffer, bufferPos, length); - bufferPos += length; - return result; - } - // Slow path: Build a byte array first then copy it. - return CodedOutputStream.Utf8Encoding.GetString(ReadRawBytes(length), 0, length); + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ReadString(ref span, ref state); } /// @@ -611,22 +429,21 @@ namespace Google.Protobuf /// public void ReadMessage(IMessage builder) { - int length = ReadLength(); - if (recursionDepth >= recursionLimit) + // TODO(jtattermusch): if the message doesn't implement IBufferMessage (and thus does not provide the InternalMergeFrom method), + // what we're doing here works fine, but could be more efficient. + // What happends is that we first initialize a ParseContext from the current coded input stream only to parse the length of the message, at which point + // we will need to switch back again to CodedInputStream-based parsing (which involves copying and storing the state) to be able to + // invoke the legacy MergeFrom(CodedInputStream) method. + // For now, this inefficiency is fine, considering this is only a backward-compatibility scenario (and regenerating the code fixes it). + ParseContext.Initialize(buffer.AsSpan(), ref state, out ParseContext ctx); + try { - throw InvalidProtocolBufferException.RecursionLimitExceeded(); + ParsingPrimitivesMessages.ReadMessage(ref ctx, builder); } - int oldLimit = PushLimit(length); - ++recursionDepth; - builder.MergeFrom(this); - CheckReadEndOfStreamTag(); - // Check that we've read exactly as much data as expected. - if (!ReachedLimit) + finally { - throw InvalidProtocolBufferException.TruncatedMessage(); + ctx.CopyStateTo(this); } - --recursionDepth; - PopLimit(oldLimit); } /// @@ -634,33 +451,15 @@ namespace Google.Protobuf /// public void ReadGroup(IMessage builder) { - if (recursionDepth >= recursionLimit) + ParseContext.Initialize(this, out ParseContext ctx); + try { - throw InvalidProtocolBufferException.RecursionLimitExceeded(); + ParsingPrimitivesMessages.ReadGroup(ref ctx, builder); } - ++recursionDepth; - - uint tag = lastTag; - int fieldNumber = WireFormat.GetTagFieldNumber(tag); - - builder.MergeFrom(this); - CheckLastTagWas(WireFormat.MakeTag(fieldNumber, WireFormat.WireType.EndGroup)); - --recursionDepth; - } - - /// - /// Reads an embedded group unknown field from the stream. - /// - internal void ReadGroup(int fieldNumber, UnknownFieldSet set) - { - if (recursionDepth >= recursionLimit) + finally { - throw InvalidProtocolBufferException.RecursionLimitExceeded(); + ctx.CopyStateTo(this); } - ++recursionDepth; - set.MergeGroupFrom(this); - CheckLastTagWas(WireFormat.MakeTag(fieldNumber, WireFormat.WireType.EndGroup)); - --recursionDepth; } /// @@ -668,20 +467,8 @@ namespace Google.Protobuf /// public ByteString ReadBytes() { - int length = ReadLength(); - if (length <= bufferSize - bufferPos && length > 0) - { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - ByteString result = ByteString.CopyFrom(buffer, bufferPos, length); - bufferPos += length; - return result; - } - else - { - // Slow path: Build a byte array and attach it to a new ByteString. - return ByteString.AttachBytes(ReadRawBytes(length)); - } + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ReadBytes(ref span, ref state); } /// @@ -722,7 +509,7 @@ namespace Google.Protobuf /// public int ReadSInt32() { - return DecodeZigZag32(ReadRawVarint32()); + return ParsingPrimitives.DecodeZigZag32(ReadRawVarint32()); } /// @@ -730,7 +517,7 @@ namespace Google.Protobuf /// public long ReadSInt64() { - return DecodeZigZag64(ReadRawVarint64()); + return ParsingPrimitives.DecodeZigZag64(ReadRawVarint64()); } /// @@ -742,7 +529,8 @@ namespace Google.Protobuf /// public int ReadLength() { - return (int) ReadRawVarint32(); + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseLength(ref span, ref state); } /// @@ -752,323 +540,14 @@ namespace Google.Protobuf /// public bool MaybeConsumeTag(uint tag) { - if (PeekTag() == tag) - { - hasNextTag = false; - return true; - } - return false; - } - - internal static float? ReadFloatWrapperLittleEndian(CodedInputStream input) - { - // length:1 + tag:1 + value:4 = 6 bytes - if (input.bufferPos + 6 <= input.bufferSize) - { - // The entire wrapper message is already contained in `buffer`. - int length = input.buffer[input.bufferPos]; - if (length == 0) - { - input.bufferPos++; - return 0F; - } - // tag:1 + value:4 = length of 5 bytes - // field=1, type=32-bit = tag of 13 - if (length != 5 || input.buffer[input.bufferPos + 1] != 13) - { - return ReadFloatWrapperSlow(input); - } - var result = BitConverter.ToSingle(input.buffer, input.bufferPos + 2); - input.bufferPos += 6; - return result; - } - else - { - return ReadFloatWrapperSlow(input); - } - } - - internal static float? ReadFloatWrapperSlow(CodedInputStream input) - { - int length = input.ReadLength(); - if (length == 0) - { - return 0F; - } - int finalBufferPos = input.totalBytesRetired + input.bufferPos + length; - float result = 0F; - do - { - // field=1, type=32-bit = tag of 13 - if (input.ReadTag() == 13) - { - result = input.ReadFloat(); - } - else - { - input.SkipLastField(); - } - } - while (input.totalBytesRetired + input.bufferPos < finalBufferPos); - return result; - } - - internal static double? ReadDoubleWrapperLittleEndian(CodedInputStream input) - { - // length:1 + tag:1 + value:8 = 10 bytes - if (input.bufferPos + 10 <= input.bufferSize) - { - // The entire wrapper message is already contained in `buffer`. - int length = input.buffer[input.bufferPos]; - if (length == 0) - { - input.bufferPos++; - return 0D; - } - // tag:1 + value:8 = length of 9 bytes - // field=1, type=64-bit = tag of 9 - if (length != 9 || input.buffer[input.bufferPos + 1] != 9) - { - return ReadDoubleWrapperSlow(input); - } - var result = BitConverter.ToDouble(input.buffer, input.bufferPos + 2); - input.bufferPos += 10; - return result; - } - else - { - return ReadDoubleWrapperSlow(input); - } - } - - internal static double? ReadDoubleWrapperSlow(CodedInputStream input) - { - int length = input.ReadLength(); - if (length == 0) - { - return 0D; - } - int finalBufferPos = input.totalBytesRetired + input.bufferPos + length; - double result = 0D; - do - { - // field=1, type=64-bit = tag of 9 - if (input.ReadTag() == 9) - { - result = input.ReadDouble(); - } - else - { - input.SkipLastField(); - } - } - while (input.totalBytesRetired + input.bufferPos < finalBufferPos); - return result; - } - - internal static bool? ReadBoolWrapper(CodedInputStream input) - { - return ReadUInt64Wrapper(input) != 0; - } - - internal static uint? ReadUInt32Wrapper(CodedInputStream input) - { - // length:1 + tag:1 + value:5(varint32-max) = 7 bytes - if (input.bufferPos + 7 <= input.bufferSize) - { - // The entire wrapper message is already contained in `buffer`. - int pos0 = input.bufferPos; - int length = input.buffer[input.bufferPos++]; - if (length == 0) - { - return 0; - } - // Length will always fit in a single byte. - if (length >= 128) - { - input.bufferPos = pos0; - return ReadUInt32WrapperSlow(input); - } - int finalBufferPos = input.bufferPos + length; - // field=1, type=varint = tag of 8 - if (input.buffer[input.bufferPos++] != 8) - { - input.bufferPos = pos0; - return ReadUInt32WrapperSlow(input); - } - var result = input.ReadUInt32(); - // Verify this message only contained a single field. - if (input.bufferPos != finalBufferPos) - { - input.bufferPos = pos0; - return ReadUInt32WrapperSlow(input); - } - return result; - } - else - { - return ReadUInt32WrapperSlow(input); - } - } - - private static uint? ReadUInt32WrapperSlow(CodedInputStream input) - { - int length = input.ReadLength(); - if (length == 0) - { - return 0; - } - int finalBufferPos = input.totalBytesRetired + input.bufferPos + length; - uint result = 0; - do - { - // field=1, type=varint = tag of 8 - if (input.ReadTag() == 8) - { - result = input.ReadUInt32(); - } - else - { - input.SkipLastField(); - } - } - while (input.totalBytesRetired + input.bufferPos < finalBufferPos); - return result; - } - - internal static int? ReadInt32Wrapper(CodedInputStream input) - { - return (int?)ReadUInt32Wrapper(input); - } - - internal static ulong? ReadUInt64Wrapper(CodedInputStream input) - { - // field=1, type=varint = tag of 8 - const int expectedTag = 8; - // length:1 + tag:1 + value:10(varint64-max) = 12 bytes - if (input.bufferPos + 12 <= input.bufferSize) - { - // The entire wrapper message is already contained in `buffer`. - int pos0 = input.bufferPos; - int length = input.buffer[input.bufferPos++]; - if (length == 0) - { - return 0L; - } - // Length will always fit in a single byte. - if (length >= 128) - { - input.bufferPos = pos0; - return ReadUInt64WrapperSlow(input); - } - int finalBufferPos = input.bufferPos + length; - if (input.buffer[input.bufferPos++] != expectedTag) - { - input.bufferPos = pos0; - return ReadUInt64WrapperSlow(input); - } - var result = input.ReadUInt64(); - // Verify this message only contained a single field. - if (input.bufferPos != finalBufferPos) - { - input.bufferPos = pos0; - return ReadUInt64WrapperSlow(input); - } - return result; - } - else - { - return ReadUInt64WrapperSlow(input); - } - } - - internal static ulong? ReadUInt64WrapperSlow(CodedInputStream input) - { - // field=1, type=varint = tag of 8 - const int expectedTag = 8; - int length = input.ReadLength(); - if (length == 0) - { - return 0L; - } - int finalBufferPos = input.totalBytesRetired + input.bufferPos + length; - ulong result = 0L; - do - { - if (input.ReadTag() == expectedTag) - { - result = input.ReadUInt64(); - } - else - { - input.SkipLastField(); - } - } - while (input.totalBytesRetired + input.bufferPos < finalBufferPos); - return result; - } - - internal static long? ReadInt64Wrapper(CodedInputStream input) - { - return (long?)ReadUInt64Wrapper(input); + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.MaybeConsumeTag(ref span, ref state, tag); } #endregion #region Underlying reading primitives - /// - /// Same code as ReadRawVarint32, but read each byte individually, checking for - /// buffer overflow. - /// - private uint SlowReadRawVarint32() - { - int tmp = ReadRawByte(); - if (tmp < 128) - { - return (uint) tmp; - } - int result = tmp & 0x7f; - if ((tmp = ReadRawByte()) < 128) - { - result |= tmp << 7; - } - else - { - result |= (tmp & 0x7f) << 7; - if ((tmp = ReadRawByte()) < 128) - { - result |= tmp << 14; - } - else - { - result |= (tmp & 0x7f) << 14; - if ((tmp = ReadRawByte()) < 128) - { - result |= tmp << 21; - } - else - { - result |= (tmp & 0x7f) << 21; - result |= (tmp = ReadRawByte()) << 28; - if (tmp >= 128) - { - // Discard upper 32 bits. - for (int i = 0; i < 5; i++) - { - if (ReadRawByte() < 128) - { - return (uint) result; - } - } - throw InvalidProtocolBufferException.MalformedVarint(); - } - } - } - } - return (uint) result; - } - /// /// Reads a raw Varint from the stream. If larger than 32 bits, discard the upper bits. /// This method is optimised for the case where we've got lots of data in the buffer. @@ -1077,58 +556,8 @@ namespace Google.Protobuf /// internal uint ReadRawVarint32() { - if (bufferPos + 5 > bufferSize) - { - return SlowReadRawVarint32(); - } - - int tmp = buffer[bufferPos++]; - if (tmp < 128) - { - return (uint) tmp; - } - int result = tmp & 0x7f; - if ((tmp = buffer[bufferPos++]) < 128) - { - result |= tmp << 7; - } - else - { - result |= (tmp & 0x7f) << 7; - if ((tmp = buffer[bufferPos++]) < 128) - { - result |= tmp << 14; - } - else - { - result |= (tmp & 0x7f) << 14; - if ((tmp = buffer[bufferPos++]) < 128) - { - result |= tmp << 21; - } - else - { - result |= (tmp & 0x7f) << 21; - result |= (tmp = buffer[bufferPos++]) << 28; - if (tmp >= 128) - { - // Discard upper 32 bits. - // Note that this has to use ReadRawByte() as we only ensure we've - // got at least 5 bytes at the start of the method. This lets us - // use the fast path in more cases, and we rarely hit this section of code. - for (int i = 0; i < 5; i++) - { - if (ReadRawByte() < 128) - { - return (uint) result; - } - } - throw InvalidProtocolBufferException.MalformedVarint(); - } - } - } - } - return (uint) result; + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseRawVarint32(ref span, ref state); } /// @@ -1142,35 +571,7 @@ namespace Google.Protobuf /// internal static uint ReadRawVarint32(Stream input) { - int result = 0; - int offset = 0; - for (; offset < 32; offset += 7) - { - int b = input.ReadByte(); - if (b == -1) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - result |= (b & 0x7f) << offset; - if ((b & 0x80) == 0) - { - return (uint) result; - } - } - // Keep reading up to 64 bits. - for (; offset < 64; offset += 7) - { - int b = input.ReadByte(); - if (b == -1) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - if ((b & 0x80) == 0) - { - return (uint) result; - } - } - throw InvalidProtocolBufferException.MalformedVarint(); + return ParsingPrimitives.ReadRawVarint32(input); } /// @@ -1178,44 +579,8 @@ namespace Google.Protobuf /// internal ulong ReadRawVarint64() { - if (bufferPos + 10 <= bufferSize) - { - ulong result = buffer[bufferPos++]; - if (result < 128) - { - return result; - } - result &= 0x7f; - int shift = 7; - do - { - byte b = buffer[bufferPos++]; - result |= (ulong)(b & 0x7F) << shift; - if (b < 0x80) - { - return result; - } - shift += 7; - } - while (shift < 64); - } - else - { - int shift = 0; - ulong result = 0; - do - { - byte b = ReadRawByte(); - result |= (ulong)(b & 0x7F) << shift; - if (b < 0x80) - { - return result; - } - shift += 7; - } - while (shift < 64); - } - throw InvalidProtocolBufferException.MalformedVarint(); + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseRawVarint64(ref span, ref state); } /// @@ -1223,32 +588,8 @@ namespace Google.Protobuf /// internal uint ReadRawLittleEndian32() { - if (bufferPos + 4 <= bufferSize) - { - if (BitConverter.IsLittleEndian) - { - var result = BitConverter.ToUInt32(buffer, bufferPos); - bufferPos += 4; - return result; - } - else - { - uint b1 = buffer[bufferPos]; - uint b2 = buffer[bufferPos + 1]; - uint b3 = buffer[bufferPos + 2]; - uint b4 = buffer[bufferPos + 3]; - bufferPos += 4; - return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24); - } - } - else - { - uint b1 = ReadRawByte(); - uint b2 = ReadRawByte(); - uint b3 = ReadRawByte(); - uint b4 = ReadRawByte(); - return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24); - } + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseRawLittleEndian32(ref span, ref state); } /// @@ -1256,70 +597,8 @@ namespace Google.Protobuf /// internal ulong ReadRawLittleEndian64() { - if (bufferPos + 8 <= bufferSize) - { - if (BitConverter.IsLittleEndian) - { - var result = BitConverter.ToUInt64(buffer, bufferPos); - bufferPos += 8; - return result; - } - else - { - ulong b1 = buffer[bufferPos]; - ulong b2 = buffer[bufferPos + 1]; - ulong b3 = buffer[bufferPos + 2]; - ulong b4 = buffer[bufferPos + 3]; - ulong b5 = buffer[bufferPos + 4]; - ulong b6 = buffer[bufferPos + 5]; - ulong b7 = buffer[bufferPos + 6]; - ulong b8 = buffer[bufferPos + 7]; - bufferPos += 8; - return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24) - | (b5 << 32) | (b6 << 40) | (b7 << 48) | (b8 << 56); - } - } - else - { - ulong b1 = ReadRawByte(); - ulong b2 = ReadRawByte(); - ulong b3 = ReadRawByte(); - ulong b4 = ReadRawByte(); - ulong b5 = ReadRawByte(); - ulong b6 = ReadRawByte(); - ulong b7 = ReadRawByte(); - ulong b8 = ReadRawByte(); - return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24) - | (b5 << 32) | (b6 << 40) | (b7 << 48) | (b8 << 56); - } - } - - /// - /// Decode a 32-bit value with ZigZag encoding. - /// - /// - /// ZigZag encodes signed integers into values that can be efficiently - /// encoded with varint. (Otherwise, negative values must be - /// sign-extended to 64 bits to be varint encoded, thus always taking - /// 10 bytes on the wire.) - /// - internal static int DecodeZigZag32(uint n) - { - return (int)(n >> 1) ^ -(int)(n & 1); - } - - /// - /// Decode a 32-bit value with ZigZag encoding. - /// - /// - /// ZigZag encodes signed integers into values that can be efficiently - /// encoded with varint. (Otherwise, negative values must be - /// sign-extended to 64 bits to be varint encoded, thus always taking - /// 10 bytes on the wire.) - /// - internal static long DecodeZigZag64(ulong n) - { - return (long)(n >> 1) ^ -(long)(n & 1); + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ParseRawLittleEndian64(ref span, ref state); } #endregion @@ -1333,37 +612,7 @@ namespace Google.Protobuf /// The old limit. internal int PushLimit(int byteLimit) { - if (byteLimit < 0) - { - throw InvalidProtocolBufferException.NegativeSize(); - } - byteLimit += totalBytesRetired + bufferPos; - int oldLimit = currentLimit; - if (byteLimit > oldLimit) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - currentLimit = byteLimit; - - RecomputeBufferSizeAfterLimit(); - - return oldLimit; - } - - private void RecomputeBufferSizeAfterLimit() - { - bufferSize += bufferSizeAfterLimit; - int bufferEnd = totalBytesRetired + bufferSize; - if (bufferEnd > currentLimit) - { - // Limit is in current buffer. - bufferSizeAfterLimit = bufferEnd - currentLimit; - bufferSize -= bufferSizeAfterLimit; - } - else - { - bufferSizeAfterLimit = 0; - } + return SegmentedBufferHelper.PushLimit(ref state, byteLimit); } /// @@ -1371,8 +620,7 @@ namespace Google.Protobuf /// internal void PopLimit(int oldLimit) { - currentLimit = oldLimit; - RecomputeBufferSizeAfterLimit(); + SegmentedBufferHelper.PopLimit(ref state, oldLimit); } /// @@ -1383,12 +631,7 @@ namespace Google.Protobuf { get { - if (currentLimit == int.MaxValue) - { - return false; - } - int currentAbsolutePosition = totalBytesRetired + bufferPos; - return currentAbsolutePosition >= currentLimit; + return SegmentedBufferHelper.IsReachedLimit(ref state); } } @@ -1399,12 +642,16 @@ namespace Google.Protobuf /// public bool IsAtEnd { - get { return bufferPos == bufferSize && !RefillBuffer(false); } + get + { + var span = new ReadOnlySpan(buffer); + return SegmentedBufferHelper.IsAtEnd(ref span, ref state); + } } /// /// Called when buffer is empty to read more bytes from the - /// input. If is true, RefillBuffer() gurantees that + /// input. If is true, RefillBuffer() guarantees that /// either there will be at least one byte in the buffer when it returns /// or it will throw an exception. If is false, /// RefillBuffer() returns false if no more bytes were available. @@ -1413,69 +660,8 @@ namespace Google.Protobuf /// private bool RefillBuffer(bool mustSucceed) { - if (bufferPos < bufferSize) - { - throw new InvalidOperationException("RefillBuffer() called when buffer wasn't empty."); - } - - if (totalBytesRetired + bufferSize == currentLimit) - { - // Oops, we hit a limit. - if (mustSucceed) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - else - { - return false; - } - } - - totalBytesRetired += bufferSize; - - bufferPos = 0; - bufferSize = (input == null) ? 0 : input.Read(buffer, 0, buffer.Length); - if (bufferSize < 0) - { - throw new InvalidOperationException("Stream.Read returned a negative count"); - } - if (bufferSize == 0) - { - if (mustSucceed) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - else - { - return false; - } - } - else - { - RecomputeBufferSizeAfterLimit(); - int totalBytesRead = - totalBytesRetired + bufferSize + bufferSizeAfterLimit; - if (totalBytesRead < 0 || totalBytesRead > sizeLimit) - { - throw InvalidProtocolBufferException.SizeLimitExceeded(); - } - return true; - } - } - - /// - /// Read one byte from the input. - /// - /// - /// the end of the stream or the current limit was reached - /// - internal byte ReadRawByte() - { - if (bufferPos == bufferSize) - { - RefillBuffer(true); - } - return buffer[bufferPos++]; + var span = new ReadOnlySpan(buffer); + return state.segmentedBufferHelper.RefillBuffer(ref span, ref state, mustSucceed); } /// @@ -1486,193 +672,25 @@ namespace Google.Protobuf /// internal byte[] ReadRawBytes(int size) { - if (size < 0) - { - throw InvalidProtocolBufferException.NegativeSize(); - } - - if (totalBytesRetired + bufferPos + size > currentLimit) - { - // Read to the end of the stream (up to the current limit) anyway. - SkipRawBytes(currentLimit - totalBytesRetired - bufferPos); - // Then fail. - throw InvalidProtocolBufferException.TruncatedMessage(); - } - - if (size <= bufferSize - bufferPos) - { - // We have all the bytes we need already. - byte[] bytes = new byte[size]; - ByteArray.Copy(buffer, bufferPos, bytes, 0, size); - bufferPos += size; - return bytes; - } - else if (size < buffer.Length) - { - // Reading more bytes than are in the buffer, but not an excessive number - // of bytes. We can safely allocate the resulting array ahead of time. - - // First copy what we have. - byte[] bytes = new byte[size]; - int pos = bufferSize - bufferPos; - ByteArray.Copy(buffer, bufferPos, bytes, 0, pos); - bufferPos = bufferSize; - - // We want to use RefillBuffer() and then copy from the buffer into our - // byte array rather than reading directly into our byte array because - // the input may be unbuffered. - RefillBuffer(true); - - while (size - pos > bufferSize) - { - Buffer.BlockCopy(buffer, 0, bytes, pos, bufferSize); - pos += bufferSize; - bufferPos = bufferSize; - RefillBuffer(true); - } - - ByteArray.Copy(buffer, 0, bytes, pos, size - pos); - bufferPos = size - pos; - - return bytes; - } - else - { - // The size is very large. For security reasons, we can't allocate the - // entire byte array yet. The size comes directly from the input, so a - // maliciously-crafted message could provide a bogus very large size in - // order to trick the app into allocating a lot of memory. We avoid this - // by allocating and reading only a small chunk at a time, so that the - // malicious message must actually *be* extremely large to cause - // problems. Meanwhile, we limit the allowed size of a message elsewhere. - - // Remember the buffer markers since we'll have to copy the bytes out of - // it later. - int originalBufferPos = bufferPos; - int originalBufferSize = bufferSize; - - // Mark the current buffer consumed. - totalBytesRetired += bufferSize; - bufferPos = 0; - bufferSize = 0; - - // Read all the rest of the bytes we need. - int sizeLeft = size - (originalBufferSize - originalBufferPos); - List chunks = new List(); - - while (sizeLeft > 0) - { - byte[] chunk = new byte[Math.Min(sizeLeft, buffer.Length)]; - int pos = 0; - while (pos < chunk.Length) - { - int n = (input == null) ? -1 : input.Read(chunk, pos, chunk.Length - pos); - if (n <= 0) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - totalBytesRetired += n; - pos += n; - } - sizeLeft -= chunk.Length; - chunks.Add(chunk); - } - - // OK, got everything. Now concatenate it all into one buffer. - byte[] bytes = new byte[size]; - - // Start by copying the leftover bytes from this.buffer. - int newPos = originalBufferSize - originalBufferPos; - ByteArray.Copy(buffer, originalBufferPos, bytes, 0, newPos); - - // And now all the chunks. - foreach (byte[] chunk in chunks) - { - Buffer.BlockCopy(chunk, 0, bytes, newPos, chunk.Length); - newPos += chunk.Length; - } - - // Done. - return bytes; - } - } - - /// - /// Reads and discards bytes. - /// - /// the end of the stream - /// or the current limit was reached - private void SkipRawBytes(int size) - { - if (size < 0) - { - throw InvalidProtocolBufferException.NegativeSize(); - } - - if (totalBytesRetired + bufferPos + size > currentLimit) - { - // Read to the end of the stream anyway. - SkipRawBytes(currentLimit - totalBytesRetired - bufferPos); - // Then fail. - throw InvalidProtocolBufferException.TruncatedMessage(); - } - - if (size <= bufferSize - bufferPos) - { - // We have all the bytes we need already. - bufferPos += size; - } - else - { - // Skipping more bytes than are in the buffer. First skip what we have. - int pos = bufferSize - bufferPos; - - // ROK 5/7/2013 Issue #54: should retire all bytes in buffer (bufferSize) - // totalBytesRetired += pos; - totalBytesRetired += bufferSize; - - bufferPos = 0; - bufferSize = 0; - - // Then skip directly from the InputStream for the rest. - if (pos < size) - { - if (input == null) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - SkipImpl(size - pos); - totalBytesRetired += size - pos; - } - } + var span = new ReadOnlySpan(buffer); + return ParsingPrimitives.ReadRawBytes(ref span, ref state, size); } /// - /// Abstraction of skipping to cope with streams which can't really skip. + /// Reads a top-level message or a nested message after the limits for this message have been pushed. + /// (parser will proceed until the end of the current limit) + /// NOTE: this method needs to be public because it's invoked by the generated code - e.g. msg.MergeFrom(CodedInputStream input) method /// - private void SkipImpl(int amountToSkip) + public void ReadRawMessage(IMessage message) { - if (input.CanSeek) + ParseContext.Initialize(this, out ParseContext ctx); + try { - long previousPosition = input.Position; - input.Position += amountToSkip; - if (input.Position != previousPosition + amountToSkip) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } + ParsingPrimitivesMessages.ReadRawMessage(ref ctx, message); } - else + finally { - byte[] skipBuffer = new byte[Math.Min(1024, amountToSkip)]; - while (amountToSkip > 0) - { - int bytesRead = input.Read(skipBuffer, 0, Math.Min(skipBuffer.Length, amountToSkip)); - if (bytesRead <= 0) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - amountToSkip -= bytesRead; - } + ctx.CopyStateTo(this); } } #endregion diff --git a/csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs b/csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs index aa7932470b..cb923549d4 100644 --- a/csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs +++ b/csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs @@ -132,7 +132,7 @@ namespace Google.Protobuf /// public static int ComputeStringSize(String value) { - int byteArraySize = Utf8Encoding.GetByteCount(value); + int byteArraySize = WritingPrimitives.Utf8Encoding.GetByteCount(value); return ComputeLengthSize(byteArraySize) + byteArraySize; } @@ -208,7 +208,7 @@ namespace Google.Protobuf /// public static int ComputeSInt32Size(int value) { - return ComputeRawVarint32Size(EncodeZigZag32(value)); + return ComputeRawVarint32Size(WritingPrimitives.EncodeZigZag32(value)); } /// @@ -217,7 +217,7 @@ namespace Google.Protobuf /// public static int ComputeSInt64Size(long value) { - return ComputeRawVarint64Size(EncodeZigZag64(value)); + return ComputeRawVarint64Size(WritingPrimitives.EncodeZigZag64(value)); } /// diff --git a/csharp/src/Google.Protobuf/CodedOutputStream.cs b/csharp/src/Google.Protobuf/CodedOutputStream.cs index 1d76d27602..20d88ea7dc 100644 --- a/csharp/src/Google.Protobuf/CodedOutputStream.cs +++ b/csharp/src/Google.Protobuf/CodedOutputStream.cs @@ -33,6 +33,7 @@ using Google.Protobuf.Collections; using System; using System.IO; +using System.Security; using System.Text; namespace Google.Protobuf @@ -55,11 +56,9 @@ namespace Google.Protobuf /// and MapField<TKey, TValue> to serialize such fields. /// /// + [SecuritySafeCritical] public sealed partial class CodedOutputStream : IDisposable { - // "Local" copy of Encoding.UTF8, for efficiency. (Yes, it makes a difference.) - internal static readonly Encoding Utf8Encoding = Encoding.UTF8; - /// /// The buffer size used by CreateInstance(Stream). /// @@ -67,8 +66,8 @@ namespace Google.Protobuf private readonly bool leaveOpen; private readonly byte[] buffer; - private readonly int limit; - private int position; + private WriterInternalState state; + private readonly Stream output; #region Construction @@ -90,8 +89,9 @@ namespace Google.Protobuf { this.output = null; this.buffer = ProtoPreconditions.CheckNotNull(buffer, nameof(buffer)); - this.position = offset; - this.limit = offset + length; + this.state.position = offset; + this.state.limit = offset + length; + WriteBufferHelper.Initialize(this, out this.state.writeBufferHelper); leaveOpen = true; // Simple way of avoiding trying to dispose of a null reference } @@ -99,8 +99,9 @@ namespace Google.Protobuf { this.output = ProtoPreconditions.CheckNotNull(output, nameof(output)); this.buffer = buffer; - this.position = 0; - this.limit = buffer.Length; + this.state.position = 0; + this.state.limit = buffer.Length; + WriteBufferHelper.Initialize(this, out this.state.writeBufferHelper); this.leaveOpen = leaveOpen; } @@ -155,9 +156,9 @@ namespace Google.Protobuf { if (output != null) { - return output.Position + position; + return output.Position + state.position; } - return position; + return state.position; } } @@ -169,7 +170,8 @@ namespace Google.Protobuf /// The value to write public void WriteDouble(double value) { - WriteRawLittleEndian64((ulong)BitConverter.DoubleToInt64Bits(value)); + var span = new Span(buffer); + WritingPrimitives.WriteDouble(ref span, ref state, value); } /// @@ -178,23 +180,8 @@ namespace Google.Protobuf /// The value to write public void WriteFloat(float value) { - byte[] rawBytes = BitConverter.GetBytes(value); - if (!BitConverter.IsLittleEndian) - { - ByteArray.Reverse(rawBytes); - } - - if (limit - position >= 4) - { - buffer[position++] = rawBytes[0]; - buffer[position++] = rawBytes[1]; - buffer[position++] = rawBytes[2]; - buffer[position++] = rawBytes[3]; - } - else - { - WriteRawBytes(rawBytes, 0, 4); - } + var span = new Span(buffer); + WritingPrimitives.WriteFloat(ref span, ref state, value); } /// @@ -203,7 +190,8 @@ namespace Google.Protobuf /// The value to write public void WriteUInt64(ulong value) { - WriteRawVarint64(value); + var span = new Span(buffer); + WritingPrimitives.WriteUInt64(ref span, ref state, value); } /// @@ -212,7 +200,8 @@ namespace Google.Protobuf /// The value to write public void WriteInt64(long value) { - WriteRawVarint64((ulong) value); + var span = new Span(buffer); + WritingPrimitives.WriteInt64(ref span, ref state, value); } /// @@ -221,15 +210,8 @@ namespace Google.Protobuf /// The value to write public void WriteInt32(int value) { - if (value >= 0) - { - WriteRawVarint32((uint) value); - } - else - { - // Must sign-extend. - WriteRawVarint64((ulong) value); - } + var span = new Span(buffer); + WritingPrimitives.WriteInt32(ref span, ref state, value); } /// @@ -238,7 +220,8 @@ namespace Google.Protobuf /// The value to write public void WriteFixed64(ulong value) { - WriteRawLittleEndian64(value); + var span = new Span(buffer); + WritingPrimitives.WriteFixed64(ref span, ref state, value); } /// @@ -247,7 +230,8 @@ namespace Google.Protobuf /// The value to write public void WriteFixed32(uint value) { - WriteRawLittleEndian32(value); + var span = new Span(buffer); + WritingPrimitives.WriteFixed32(ref span, ref state, value); } /// @@ -256,7 +240,8 @@ namespace Google.Protobuf /// The value to write public void WriteBool(bool value) { - WriteRawByte(value ? (byte) 1 : (byte) 0); + var span = new Span(buffer); + WritingPrimitives.WriteBool(ref span, ref state, value); } /// @@ -266,41 +251,52 @@ namespace Google.Protobuf /// The value to write public void WriteString(string value) { - // Optimise the case where we have enough space to write - // the string directly to the buffer, which should be common. - int length = Utf8Encoding.GetByteCount(value); - WriteLength(length); - if (limit - position >= length) + var span = new Span(buffer); + WritingPrimitives.WriteString(ref span, ref state, value); + } + + /// + /// Writes a message, without a tag, to the stream. + /// The data is length-prefixed. + /// + /// The value to write + public void WriteMessage(IMessage value) + { + // TODO(jtattermusch): if the message doesn't implement IBufferMessage (and thus does not provide the InternalWriteTo method), + // what we're doing here works fine, but could be more efficient. + // For now, this inefficiency is fine, considering this is only a backward-compatibility scenario (and regenerating the code fixes it). + var span = new Span(buffer); + WriteContext.Initialize(ref span, ref state, out WriteContext ctx); + try { - if (length == value.Length) // Must be all ASCII... - { - for (int i = 0; i < length; i++) - { - buffer[position + i] = (byte)value[i]; - } - } - else - { - Utf8Encoding.GetBytes(value, 0, value.Length, buffer, position); - } - position += length; + WritingPrimitivesMessages.WriteMessage(ref ctx, value); } - else + finally { - byte[] bytes = Utf8Encoding.GetBytes(value); - WriteRawBytes(bytes); + ctx.CopyStateTo(this); } } /// /// Writes a message, without a tag, to the stream. - /// The data is length-prefixed. + /// Only the message data is written, without a length-delimiter. /// /// The value to write - public void WriteMessage(IMessage value) - { - WriteLength(value.CalculateSize()); - value.WriteTo(this); + public void WriteRawMessage(IMessage value) + { + // TODO(jtattermusch): if the message doesn't implement IBufferMessage (and thus does not provide the InternalWriteTo method), + // what we're doing here works fine, but could be more efficient. + // For now, this inefficiency is fine, considering this is only a backward-compatibility scenario (and regenerating the code fixes it). + var span = new Span(buffer); + WriteContext.Initialize(ref span, ref state, out WriteContext ctx); + try + { + WritingPrimitivesMessages.WriteRawMessage(ref ctx, value); + } + finally + { + ctx.CopyStateTo(this); + } } /// @@ -309,7 +305,16 @@ namespace Google.Protobuf /// The value to write public void WriteGroup(IMessage value) { - value.WriteTo(this); + var span = new Span(buffer); + WriteContext.Initialize(ref span, ref state, out WriteContext ctx); + try + { + WritingPrimitivesMessages.WriteGroup(ref ctx, value); + } + finally + { + ctx.CopyStateTo(this); + } } /// @@ -319,8 +324,8 @@ namespace Google.Protobuf /// The value to write public void WriteBytes(ByteString value) { - WriteLength(value.Length); - value.WriteRawBytesTo(this); + var span = new Span(buffer); + WritingPrimitives.WriteBytes(ref span, ref state, value); } /// @@ -329,7 +334,8 @@ namespace Google.Protobuf /// The value to write public void WriteUInt32(uint value) { - WriteRawVarint32(value); + var span = new Span(buffer); + WritingPrimitives.WriteUInt32(ref span, ref state, value); } /// @@ -338,7 +344,8 @@ namespace Google.Protobuf /// The value to write public void WriteEnum(int value) { - WriteInt32(value); + var span = new Span(buffer); + WritingPrimitives.WriteEnum(ref span, ref state, value); } /// @@ -347,7 +354,8 @@ namespace Google.Protobuf /// The value to write. public void WriteSFixed32(int value) { - WriteRawLittleEndian32((uint) value); + var span = new Span(buffer); + WritingPrimitives.WriteSFixed32(ref span, ref state, value); } /// @@ -356,7 +364,8 @@ namespace Google.Protobuf /// The value to write public void WriteSFixed64(long value) { - WriteRawLittleEndian64((ulong) value); + var span = new Span(buffer); + WritingPrimitives.WriteSFixed64(ref span, ref state, value); } /// @@ -365,7 +374,8 @@ namespace Google.Protobuf /// The value to write public void WriteSInt32(int value) { - WriteRawVarint32(EncodeZigZag32(value)); + var span = new Span(buffer); + WritingPrimitives.WriteSInt32(ref span, ref state, value); } /// @@ -374,7 +384,8 @@ namespace Google.Protobuf /// The value to write public void WriteSInt64(long value) { - WriteRawVarint64(EncodeZigZag64(value)); + var span = new Span(buffer); + WritingPrimitives.WriteSInt64(ref span, ref state, value); } /// @@ -386,7 +397,8 @@ namespace Google.Protobuf /// Length value, in bytes. public void WriteLength(int length) { - WriteRawVarint32((uint) length); + var span = new Span(buffer); + WritingPrimitives.WriteLength(ref span, ref state, length); } #endregion @@ -399,7 +411,8 @@ namespace Google.Protobuf /// The wire format type of the tag to write public void WriteTag(int fieldNumber, WireFormat.WireType type) { - WriteRawVarint32(WireFormat.MakeTag(fieldNumber, type)); + var span = new Span(buffer); + WritingPrimitives.WriteTag(ref span, ref state, fieldNumber, type); } /// @@ -408,7 +421,8 @@ namespace Google.Protobuf /// The encoded tag public void WriteTag(uint tag) { - WriteRawVarint32(tag); + var span = new Span(buffer); + WritingPrimitives.WriteTag(ref span, ref state, tag); } /// @@ -417,7 +431,8 @@ namespace Google.Protobuf /// The encoded tag public void WriteRawTag(byte b1) { - WriteRawByte(b1); + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1); } /// @@ -427,8 +442,8 @@ namespace Google.Protobuf /// The second byte of the encoded tag public void WriteRawTag(byte b1, byte b2) { - WriteRawByte(b1); - WriteRawByte(b2); + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2); } /// @@ -439,9 +454,8 @@ namespace Google.Protobuf /// The third byte of the encoded tag public void WriteRawTag(byte b1, byte b2, byte b3) { - WriteRawByte(b1); - WriteRawByte(b2); - WriteRawByte(b3); + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3); } /// @@ -453,10 +467,8 @@ namespace Google.Protobuf /// The fourth byte of the encoded tag public void WriteRawTag(byte b1, byte b2, byte b3, byte b4) { - WriteRawByte(b1); - WriteRawByte(b2); - WriteRawByte(b3); - WriteRawByte(b4); + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3, b4); } /// @@ -469,15 +481,13 @@ namespace Google.Protobuf /// The fifth byte of the encoded tag public void WriteRawTag(byte b1, byte b2, byte b3, byte b4, byte b5) { - WriteRawByte(b1); - WriteRawByte(b2); - WriteRawByte(b3); - WriteRawByte(b4); - WriteRawByte(b5); + var span = new Span(buffer); + WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3, b4, b5); } #endregion #region Underlying writing primitives + /// /// Writes a 32 bit value as a varint. The fast route is taken when /// there's enough buffer space left to whizz through without checking @@ -485,112 +495,26 @@ namespace Google.Protobuf /// internal void WriteRawVarint32(uint value) { - // Optimize for the common case of a single byte value - if (value < 128 && position < limit) - { - buffer[position++] = (byte)value; - return; - } - - while (value > 127 && position < limit) - { - buffer[position++] = (byte) ((value & 0x7F) | 0x80); - value >>= 7; - } - while (value > 127) - { - WriteRawByte((byte) ((value & 0x7F) | 0x80)); - value >>= 7; - } - if (position < limit) - { - buffer[position++] = (byte) value; - } - else - { - WriteRawByte((byte) value); - } + var span = new Span(buffer); + WritingPrimitives.WriteRawVarint32(ref span, ref state, value); } internal void WriteRawVarint64(ulong value) { - while (value > 127 && position < limit) - { - buffer[position++] = (byte) ((value & 0x7F) | 0x80); - value >>= 7; - } - while (value > 127) - { - WriteRawByte((byte) ((value & 0x7F) | 0x80)); - value >>= 7; - } - if (position < limit) - { - buffer[position++] = (byte) value; - } - else - { - WriteRawByte((byte) value); - } + var span = new Span(buffer); + WritingPrimitives.WriteRawVarint64(ref span, ref state, value); } internal void WriteRawLittleEndian32(uint value) { - if (position + 4 > limit) - { - WriteRawByte((byte) value); - WriteRawByte((byte) (value >> 8)); - WriteRawByte((byte) (value >> 16)); - WriteRawByte((byte) (value >> 24)); - } - else - { - buffer[position++] = ((byte) value); - buffer[position++] = ((byte) (value >> 8)); - buffer[position++] = ((byte) (value >> 16)); - buffer[position++] = ((byte) (value >> 24)); - } + var span = new Span(buffer); + WritingPrimitives.WriteRawLittleEndian32(ref span, ref state, value); } internal void WriteRawLittleEndian64(ulong value) { - if (position + 8 > limit) - { - WriteRawByte((byte) value); - WriteRawByte((byte) (value >> 8)); - WriteRawByte((byte) (value >> 16)); - WriteRawByte((byte) (value >> 24)); - WriteRawByte((byte) (value >> 32)); - WriteRawByte((byte) (value >> 40)); - WriteRawByte((byte) (value >> 48)); - WriteRawByte((byte) (value >> 56)); - } - else - { - buffer[position++] = ((byte) value); - buffer[position++] = ((byte) (value >> 8)); - buffer[position++] = ((byte) (value >> 16)); - buffer[position++] = ((byte) (value >> 24)); - buffer[position++] = ((byte) (value >> 32)); - buffer[position++] = ((byte) (value >> 40)); - buffer[position++] = ((byte) (value >> 48)); - buffer[position++] = ((byte) (value >> 56)); - } - } - - internal void WriteRawByte(byte value) - { - if (position == limit) - { - RefreshBuffer(); - } - - buffer[position++] = value; - } - - internal void WriteRawByte(uint value) - { - WriteRawByte((byte) value); + var span = new Span(buffer); + WritingPrimitives.WriteRawLittleEndian64(ref span, ref state, value); } /// @@ -606,85 +530,12 @@ namespace Google.Protobuf /// internal void WriteRawBytes(byte[] value, int offset, int length) { - if (limit - position >= length) - { - ByteArray.Copy(value, offset, buffer, position, length); - // We have room in the current buffer. - position += length; - } - else - { - // Write extends past current buffer. Fill the rest of this buffer and - // flush. - int bytesWritten = limit - position; - ByteArray.Copy(value, offset, buffer, position, bytesWritten); - offset += bytesWritten; - length -= bytesWritten; - position = limit; - RefreshBuffer(); - - // Now deal with the rest. - // Since we have an output stream, this is our buffer - // and buffer offset == 0 - if (length <= limit) - { - // Fits in new buffer. - ByteArray.Copy(value, offset, buffer, 0, length); - position = length; - } - else - { - // Write is very big. Let's do it all at once. - output.Write(value, offset, length); - } - } + var span = new Span(buffer); + WritingPrimitives.WriteRawBytes(ref span, ref state, value, offset, length); } #endregion - /// - /// Encode a 32-bit value with ZigZag encoding. - /// - /// - /// ZigZag encodes signed integers into values that can be efficiently - /// encoded with varint. (Otherwise, negative values must be - /// sign-extended to 64 bits to be varint encoded, thus always taking - /// 10 bytes on the wire.) - /// - internal static uint EncodeZigZag32(int n) - { - // Note: the right-shift must be arithmetic - return (uint) ((n << 1) ^ (n >> 31)); - } - - /// - /// Encode a 64-bit value with ZigZag encoding. - /// - /// - /// ZigZag encodes signed integers into values that can be efficiently - /// encoded with varint. (Otherwise, negative values must be - /// sign-extended to 64 bits to be varint encoded, thus always taking - /// 10 bytes on the wire.) - /// - internal static ulong EncodeZigZag64(long n) - { - return (ulong) ((n << 1) ^ (n >> 63)); - } - - private void RefreshBuffer() - { - if (output == null) - { - // We're writing to a single buffer. - throw new OutOfSpaceException(); - } - - // Since we have an output stream, this is our buffer - // and buffer offset == 0 - output.Write(buffer, 0, position); - position = 0; - } - /// /// Indicates that a CodedOutputStream wrapping a flat byte array /// ran out of space. @@ -726,45 +577,31 @@ namespace Google.Protobuf /// public void Flush() { - if (output != null) - { - RefreshBuffer(); - } + var span = new Span(buffer); + WriteBufferHelper.Flush(ref span, ref state); } /// /// Verifies that SpaceLeft returns zero. It's common to create a byte array /// that is exactly big enough to hold a message, then write to it with /// a CodedOutputStream. Calling CheckNoSpaceLeft after writing verifies that - /// the message was actually as big as expected, which can help bugs. + /// the message was actually as big as expected, which can help finding bugs. /// public void CheckNoSpaceLeft() { - if (SpaceLeft != 0) - { - throw new InvalidOperationException("Did not write as much data as expected."); - } + WriteBufferHelper.CheckNoSpaceLeft(ref state); } /// /// If writing to a flat array, returns the space left in the array. Otherwise, /// throws an InvalidOperationException. /// - public int SpaceLeft - { - get - { - if (output == null) - { - return limit - position; - } - else - { - throw new InvalidOperationException( - "SpaceLeft can only be called on CodedOutputStreams that are " + - "writing to a flat array."); - } - } - } + public int SpaceLeft => WriteBufferHelper.GetSpaceLeft(ref state); + + internal byte[] InternalBuffer => buffer; + + internal Stream InternalOutputStream => output; + + internal ref WriterInternalState InternalState => ref state; } } diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs index 1924439e5c..6b7d0f101a 100644 --- a/csharp/src/Google.Protobuf/Collections/MapField.cs +++ b/csharp/src/Google.Protobuf/Collections/MapField.cs @@ -33,10 +33,12 @@ using Google.Protobuf.Compatibility; using Google.Protobuf.Reflection; using System; +using System.Buffers; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Security; namespace Google.Protobuf.Collections { @@ -422,13 +424,35 @@ namespace Google.Protobuf.Collections /// Codec describing how the key/value pairs are encoded public void AddEntriesFrom(CodedInputStream input, Codec codec) { - var adapter = new Codec.MessageAdapter(codec); + ParseContext.Initialize(input, out ParseContext ctx); + try + { + AddEntriesFrom(ref ctx, codec); + } + finally + { + ctx.CopyStateTo(input); + } + } + + /// + /// Adds entries to the map from the given parse context. + /// + /// + /// It is assumed that the input is initially positioned after the tag specified by the codec. + /// This method will continue reading entries from the input until the end is reached, or + /// a different tag is encountered. + /// + /// Input to read from + /// Codec describing how the key/value pairs are encoded + [SecuritySafeCritical] + public void AddEntriesFrom(ref ParseContext ctx, Codec codec) + { do { - adapter.Reset(); - input.ReadMessage(adapter); - this[adapter.Key] = adapter.Value; - } while (input.MaybeConsumeTag(codec.MapTag)); + KeyValuePair entry = ParsingPrimitivesMessages.ReadMapEntry(ref ctx, codec); + this[entry.Key] = entry.Value; + } while (ParsingPrimitives.MaybeConsumeTag(ref ctx.buffer, ref ctx.state, codec.MapTag)); } /// @@ -439,13 +463,33 @@ namespace Google.Protobuf.Collections /// The codec to use for each entry. public void WriteTo(CodedOutputStream output, Codec codec) { - var message = new Codec.MessageAdapter(codec); + WriteContext.Initialize(output, out WriteContext ctx); + try + { + WriteTo(ref ctx, codec); + } + finally + { + ctx.CopyStateTo(output); + } + } + + /// + /// Writes the contents of this map to the given write context, using the specified codec + /// to encode each entry. + /// + /// The write context to write to. + /// The codec to use for each entry. + [SecuritySafeCritical] + public void WriteTo(ref WriteContext ctx, Codec codec) + { foreach (var entry in list) { - message.Key = entry.Key; - message.Value = entry.Value; - output.WriteTag(codec.MapTag); - output.WriteMessage(message); + ctx.WriteTag(codec.MapTag); + + WritingPrimitives.WriteLength(ref ctx.buffer, ref ctx.state, CalculateEntrySize(codec, entry)); + codec.KeyCodec.WriteTagAndValue(ref ctx, entry.Key); + codec.ValueCodec.WriteTagAndValue(ref ctx, entry.Value); } } @@ -460,18 +504,22 @@ namespace Google.Protobuf.Collections { return 0; } - var message = new Codec.MessageAdapter(codec); int size = 0; foreach (var entry in list) { - message.Key = entry.Key; - message.Value = entry.Value; + int entrySize = CalculateEntrySize(codec, entry); + size += CodedOutputStream.ComputeRawVarint32Size(codec.MapTag); - size += CodedOutputStream.ComputeMessageSize(message); + size += CodedOutputStream.ComputeLengthSize(entrySize) + entrySize; } return size; } + private static int CalculateEntrySize(Codec codec, KeyValuePair entry) + { + return codec.KeyCodec.CalculateSizeWithTag(entry.Key) + codec.ValueCodec.CalculateSizeWithTag(entry.Value); + } + /// /// Returns a string representation of this repeated field, in the same /// way as it would be represented by the default JSON formatter. @@ -609,76 +657,19 @@ namespace Google.Protobuf.Collections } /// - /// The tag used in the enclosing message to indicate map entries. + /// The key codec. /// - internal uint MapTag { get { return mapTag; } } + internal FieldCodec KeyCodec => keyCodec; /// - /// A mutable message class, used for parsing and serializing. This - /// delegates the work to a codec, but implements the interface - /// for interop with and . - /// This is nested inside Codec as it's tightly coupled to the associated codec, - /// and it's simpler if it has direct access to all its fields. + /// The value codec. /// - internal class MessageAdapter : IMessage - { - private static readonly byte[] ZeroLengthMessageStreamData = new byte[] { 0 }; - - private readonly Codec codec; - internal TKey Key { get; set; } - internal TValue Value { get; set; } + internal FieldCodec ValueCodec => valueCodec; - internal MessageAdapter(Codec codec) - { - this.codec = codec; - } - - internal void Reset() - { - Key = codec.keyCodec.DefaultValue; - Value = codec.valueCodec.DefaultValue; - } - - public void MergeFrom(CodedInputStream input) - { - uint tag; - while ((tag = input.ReadTag()) != 0) - { - if (tag == codec.keyCodec.Tag) - { - Key = codec.keyCodec.Read(input); - } - else if (tag == codec.valueCodec.Tag) - { - Value = codec.valueCodec.Read(input); - } - else - { - input.SkipLastField(); - } - } - - // Corner case: a map entry with a key but no value, where the value type is a message. - // Read it as if we'd seen an input stream with no data (i.e. create a "default" message). - if (Value == null) - { - Value = codec.valueCodec.Read(new CodedInputStream(ZeroLengthMessageStreamData)); - } - } - - public void WriteTo(CodedOutputStream output) - { - codec.keyCodec.WriteTagAndValue(output, Key); - codec.valueCodec.WriteTagAndValue(output, Value); - } - - public int CalculateSize() - { - return codec.keyCodec.CalculateSizeWithTag(Key) + codec.valueCodec.CalculateSizeWithTag(Value); - } - - MessageDescriptor IMessage.Descriptor { get { return null; } } - } + /// + /// The tag used in the enclosing message to indicate map entries. + /// + internal uint MapTag => mapTag; } private class MapView : ICollection, ICollection diff --git a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs index 0e8bb61764..19114caa24 100644 --- a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs +++ b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs @@ -34,6 +34,8 @@ using System; using System.Collections; using System.Collections.Generic; using System.IO; +using System.Security; +using System.Threading; namespace Google.Protobuf.Collections { @@ -94,23 +96,64 @@ namespace Google.Protobuf.Collections /// The input stream to read from. /// The codec to use in order to read each entry. public void AddEntriesFrom(CodedInputStream input, FieldCodec codec) + { + ParseContext.Initialize(input, out ParseContext ctx); + try + { + AddEntriesFrom(ref ctx, codec); + } + finally + { + ctx.CopyStateTo(input); + } + } + + /// + /// Adds the entries from the given parse context, decoding them with the specified codec. + /// + /// The input to read from. + /// The codec to use in order to read each entry. + [SecuritySafeCritical] + public void AddEntriesFrom(ref ParseContext ctx, FieldCodec codec) { // TODO: Inline some of the Add code, so we can avoid checking the size on every // iteration. - uint tag = input.LastTag; + uint tag = ctx.state.lastTag; var reader = codec.ValueReader; // Non-nullable value types can be packed or not. if (FieldCodec.IsPackedRepeatedField(tag)) { - int length = input.ReadLength(); + int length = ctx.ReadLength(); if (length > 0) { - int oldLimit = input.PushLimit(length); - while (!input.ReachedLimit) + int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, length); + + // If the content is fixed size then we can calculate the length + // of the repeated field and pre-initialize the underlying collection. + // + // Check that the supplied length doesn't exceed the underlying buffer. + // That prevents a malicious length from initializing a very large collection. + if (codec.FixedSize > 0 && length % codec.FixedSize == 0 && ParsingPrimitives.IsDataAvailable(ref ctx.state, length)) + { + EnsureSize(count + (length / codec.FixedSize)); + + while (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) + { + // Only FieldCodecs with a fixed size can reach here, and they are all known + // types that don't allow the user to specify a custom reader action. + // reader action will never return null. + array[count++] = reader(ref ctx); + } + } + else { - Add(reader(input)); + // Content is variable size so add until we reach the limit. + while (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) + { + Add(reader(ref ctx)); + } } - input.PopLimit(oldLimit); + SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit); } // Empty packed field. Odd, but valid - just ignore. } @@ -119,8 +162,8 @@ namespace Google.Protobuf.Collections // Not packed... (possibly not packable) do { - Add(reader(input)); - } while (input.MaybeConsumeTag(tag)); + Add(reader(ref ctx)); + } while (ParsingPrimitives.MaybeConsumeTag(ref ctx.buffer, ref ctx.state, tag)); } } @@ -128,7 +171,7 @@ namespace Google.Protobuf.Collections /// Calculates the size of this collection based on the given codec. /// /// The codec to use when encoding each field. - /// The number of bytes that would be written to a by , + /// The number of bytes that would be written to an output by one of the WriteTo methods, /// using the same codec. public int CalculateSize(FieldCodec codec) { @@ -186,6 +229,26 @@ namespace Google.Protobuf.Collections /// The output stream to write to. /// The codec to use when encoding each value. public void WriteTo(CodedOutputStream output, FieldCodec codec) + { + WriteContext.Initialize(output, out WriteContext ctx); + try + { + WriteTo(ref ctx, codec); + } + finally + { + ctx.CopyStateTo(output); + } + } + + /// + /// Writes the contents of this collection to the given write context, + /// encoding each value using the specified codec. + /// + /// The write context to write to. + /// The codec to use when encoding each value. + [SecuritySafeCritical] + public void WriteTo(ref WriteContext ctx, FieldCodec codec) { if (count == 0) { @@ -196,12 +259,12 @@ namespace Google.Protobuf.Collections if (codec.PackedRepeatedField) { // Packed primitive type - uint size = (uint)CalculatePackedDataSize(codec); - output.WriteTag(tag); - output.WriteRawVarint32(size); + int size = CalculatePackedDataSize(codec); + ctx.WriteTag(tag); + ctx.WriteLength(size); for (int i = 0; i < count; i++) { - writer(output, array[i]); + writer(ref ctx, array[i]); } } else @@ -210,11 +273,11 @@ namespace Google.Protobuf.Collections // Can't use codec.WriteTagAndValue, as that omits default values. for (int i = 0; i < count; i++) { - output.WriteTag(tag); - writer(output, array[i]); + ctx.WriteTag(tag); + writer(ref ctx, array[i]); if (codec.EndTag != 0) { - output.WriteTag(codec.EndTag); + ctx.WriteTag(codec.EndTag); } } } diff --git a/csharp/src/Google.Protobuf/Extension.cs b/csharp/src/Google.Protobuf/Extension.cs index a96f8d29b6..6dd1ceaa8e 100644 --- a/csharp/src/Google.Protobuf/Extension.cs +++ b/csharp/src/Google.Protobuf/Extension.cs @@ -55,6 +55,8 @@ namespace Google.Protobuf /// Gets the field number of this extension /// public int FieldNumber { get; } + + internal abstract bool IsRepeated { get; } } /// @@ -79,6 +81,8 @@ namespace Google.Protobuf internal override Type TargetType => typeof(TTarget); + internal override bool IsRepeated => false; + internal override IExtensionValue CreateValue() { return new ExtensionValue(codec); @@ -105,6 +109,8 @@ namespace Google.Protobuf internal override Type TargetType => typeof(TTarget); + internal override bool IsRepeated => true; + internal override IExtensionValue CreateValue() { return new RepeatedExtensionValue(codec); diff --git a/csharp/src/Google.Protobuf/ExtensionRegistry.cs b/csharp/src/Google.Protobuf/ExtensionRegistry.cs index d3d7ebdc5d..e72314b22c 100644 --- a/csharp/src/Google.Protobuf/ExtensionRegistry.cs +++ b/csharp/src/Google.Protobuf/ExtensionRegistry.cs @@ -80,9 +80,9 @@ namespace Google.Protobuf /// bool ICollection.IsReadOnly => false; - internal bool ContainsInputField(CodedInputStream stream, Type target, out Extension extension) + internal bool ContainsInputField(uint lastTag, Type target, out Extension extension) { - return extensions.TryGetValue(new ObjectIntPair(target, WireFormat.GetTagFieldNumber(stream.LastTag)), out extension); + return extensions.TryGetValue(new ObjectIntPair(target, WireFormat.GetTagFieldNumber(lastTag)), out extension); } /// diff --git a/csharp/src/Google.Protobuf/ExtensionSet.cs b/csharp/src/Google.Protobuf/ExtensionSet.cs index d1bbf69102..895b9ae6ea 100644 --- a/csharp/src/Google.Protobuf/ExtensionSet.cs +++ b/csharp/src/Google.Protobuf/ExtensionSet.cs @@ -34,6 +34,7 @@ using Google.Protobuf.Collections; using System; using System.Collections.Generic; using System.Linq; +using System.Security; namespace Google.Protobuf { @@ -182,20 +183,37 @@ namespace Google.Protobuf /// If the set is null or the field was not otherwise merged, this returns false. /// public static bool TryMergeFieldFrom(ref ExtensionSet set, CodedInputStream stream) where TTarget : IExtendableMessage + { + ParseContext.Initialize(stream, out ParseContext ctx); + try + { + return TryMergeFieldFrom(ref set, ref ctx); + } + finally + { + ctx.CopyStateTo(stream); + } + } + + /// + /// Tries to merge a field from the coded input, returning true if the field was merged. + /// If the set is null or the field was not otherwise merged, this returns false. + /// + public static bool TryMergeFieldFrom(ref ExtensionSet set, ref ParseContext ctx) where TTarget : IExtendableMessage { Extension extension; - int lastFieldNumber = WireFormat.GetTagFieldNumber(stream.LastTag); - + int lastFieldNumber = WireFormat.GetTagFieldNumber(ctx.LastTag); + IExtensionValue extensionValue; if (set != null && set.ValuesByNumber.TryGetValue(lastFieldNumber, out extensionValue)) { - extensionValue.MergeFrom(stream); + extensionValue.MergeFrom(ref ctx); return true; } - else if (stream.ExtensionRegistry != null && stream.ExtensionRegistry.ContainsInputField(stream, typeof(TTarget), out extension)) + else if (ctx.ExtensionRegistry != null && ctx.ExtensionRegistry.ContainsInputField(ctx.LastTag, typeof(TTarget), out extension)) { IExtensionValue value = extension.CreateValue(); - value.MergeFrom(stream); + value.MergeFrom(ref ctx); set = (set ?? new ExtensionSet()); set.ValuesByNumber.Add(extension.FieldNumber, value); return true; @@ -326,10 +344,28 @@ namespace Google.Protobuf /// Writes the extension values in this set to the output stream /// public void WriteTo(CodedOutputStream stream) + { + + WriteContext.Initialize(stream, out WriteContext ctx); + try + { + WriteTo(ref ctx); + } + finally + { + ctx.CopyStateTo(stream); + } + } + + /// + /// Writes the extension values in this set to the write context + /// + [SecuritySafeCritical] + public void WriteTo(ref WriteContext ctx) { foreach (var value in ValuesByNumber.Values) { - value.WriteTo(stream); + value.WriteTo(ref ctx); } } diff --git a/csharp/src/Google.Protobuf/ExtensionValue.cs b/csharp/src/Google.Protobuf/ExtensionValue.cs index 6ee737a7b0..5257c4c955 100644 --- a/csharp/src/Google.Protobuf/ExtensionValue.cs +++ b/csharp/src/Google.Protobuf/ExtensionValue.cs @@ -38,9 +38,10 @@ namespace Google.Protobuf { internal interface IExtensionValue : IEquatable, IDeepCloneable { - void MergeFrom(CodedInputStream input); + void MergeFrom(ref ParseContext ctx); + void MergeFrom(IExtensionValue value); - void WriteTo(CodedOutputStream output); + void WriteTo(ref WriteContext ctx); int CalculateSize(); bool IsInitialized(); } @@ -58,7 +59,7 @@ namespace Google.Protobuf public int CalculateSize() { - return codec.CalculateSizeWithTag(field); + return codec.CalculateUnconditionalSizeWithTag(field); } public IExtensionValue Clone() @@ -91,27 +92,27 @@ namespace Google.Protobuf } } - public void MergeFrom(CodedInputStream input) + public void MergeFrom(ref ParseContext ctx) { - codec.ValueMerger(input, ref field); + codec.ValueMerger(ref ctx, ref field); } public void MergeFrom(IExtensionValue value) { if (value is ExtensionValue) { - var extensionValue = value as ExtensionValue; + var extensionValue = value as ExtensionValue; codec.FieldMerger(ref field, extensionValue.field); } } - public void WriteTo(CodedOutputStream output) + public void WriteTo(ref WriteContext ctx) { - output.WriteTag(codec.Tag); - codec.ValueWriter(output, field); + ctx.WriteTag(codec.Tag); + codec.ValueWriter(ref ctx, field); if (codec.EndTag != 0) { - output.WriteTag(codec.EndTag); + ctx.WriteTag(codec.EndTag); } } @@ -124,13 +125,13 @@ namespace Google.Protobuf public bool IsInitialized() { - if (field is IMessage) - { - return (field as IMessage).IsInitialized(); + if (field is IMessage) + { + return (field as IMessage).IsInitialized(); } - else - { - return true; + else + { + return true; } } } @@ -180,9 +181,9 @@ namespace Google.Protobuf } } - public void MergeFrom(CodedInputStream input) + public void MergeFrom(ref ParseContext ctx) { - field.AddEntriesFrom(input, codec); + field.AddEntriesFrom(ref ctx, codec); } public void MergeFrom(IExtensionValue value) @@ -193,29 +194,29 @@ namespace Google.Protobuf } } - public void WriteTo(CodedOutputStream output) + public void WriteTo(ref WriteContext ctx) { - field.WriteTo(output, codec); + field.WriteTo(ref ctx, codec); } public RepeatedField GetValue() => field; public bool IsInitialized() { - for (int i = 0; i < field.Count; i++) - { - var element = field[i]; - if (element is IMessage) - { - if (!(element as IMessage).IsInitialized()) - { - return false; - } - } - else - { - break; - } + for (int i = 0; i < field.Count; i++) + { + var element = field[i]; + if (element is IMessage) + { + if (!(element as IMessage).IsInitialized()) + { + return false; + } + } + else + { + break; + } } return true; diff --git a/csharp/src/Google.Protobuf/FieldCodec.cs b/csharp/src/Google.Protobuf/FieldCodec.cs index 1971261649..ee6bd6a0eb 100644 --- a/csharp/src/Google.Protobuf/FieldCodec.cs +++ b/csharp/src/Google.Protobuf/FieldCodec.cs @@ -35,6 +35,7 @@ using Google.Protobuf.Compatibility; using Google.Protobuf.WellKnownTypes; using System; using System.Collections.Generic; +using System.Security; namespace Google.Protobuf { @@ -218,7 +219,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForString(uint tag, string defaultValue) { - return new FieldCodec(input => input.ReadString(), (output, value) => output.WriteString(value), CodedOutputStream.ComputeStringSize, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadString(), (ref WriteContext ctx, string value) => ctx.WriteString(value), CodedOutputStream.ComputeStringSize, tag, defaultValue); } /// @@ -229,7 +230,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForBytes(uint tag, ByteString defaultValue) { - return new FieldCodec(input => input.ReadBytes(), (output, value) => output.WriteBytes(value), CodedOutputStream.ComputeBytesSize, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadBytes(), (ref WriteContext ctx, ByteString value) => ctx.WriteBytes(value), CodedOutputStream.ComputeBytesSize, tag, defaultValue); } /// @@ -240,7 +241,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForBool(uint tag, bool defaultValue) { - return new FieldCodec(input => input.ReadBool(), (output, value) => output.WriteBool(value), CodedOutputStream.BoolSize, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadBool(), (ref WriteContext ctx, bool value) => ctx.WriteBool(value), CodedOutputStream.BoolSize, tag, defaultValue); } /// @@ -251,7 +252,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForInt32(uint tag, int defaultValue) { - return new FieldCodec(input => input.ReadInt32(), (output, value) => output.WriteInt32(value), CodedOutputStream.ComputeInt32Size, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadInt32(), (ref WriteContext output, int value) => output.WriteInt32(value), CodedOutputStream.ComputeInt32Size, tag, defaultValue); } /// @@ -262,7 +263,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForSInt32(uint tag, int defaultValue) { - return new FieldCodec(input => input.ReadSInt32(), (output, value) => output.WriteSInt32(value), CodedOutputStream.ComputeSInt32Size, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadSInt32(), (ref WriteContext output, int value) => output.WriteSInt32(value), CodedOutputStream.ComputeSInt32Size, tag, defaultValue); } /// @@ -273,7 +274,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForFixed32(uint tag, uint defaultValue) { - return new FieldCodec(input => input.ReadFixed32(), (output, value) => output.WriteFixed32(value), 4, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadFixed32(), (ref WriteContext output, uint value) => output.WriteFixed32(value), 4, tag, defaultValue); } /// @@ -284,7 +285,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForSFixed32(uint tag, int defaultValue) { - return new FieldCodec(input => input.ReadSFixed32(), (output, value) => output.WriteSFixed32(value), 4, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadSFixed32(), (ref WriteContext output, int value) => output.WriteSFixed32(value), 4, tag, defaultValue); } /// @@ -295,7 +296,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForUInt32(uint tag, uint defaultValue) { - return new FieldCodec(input => input.ReadUInt32(), (output, value) => output.WriteUInt32(value), CodedOutputStream.ComputeUInt32Size, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadUInt32(), (ref WriteContext output, uint value) => output.WriteUInt32(value), CodedOutputStream.ComputeUInt32Size, tag, defaultValue); } /// @@ -306,7 +307,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForInt64(uint tag, long defaultValue) { - return new FieldCodec(input => input.ReadInt64(), (output, value) => output.WriteInt64(value), CodedOutputStream.ComputeInt64Size, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadInt64(), (ref WriteContext output, long value) => output.WriteInt64(value), CodedOutputStream.ComputeInt64Size, tag, defaultValue); } /// @@ -317,7 +318,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForSInt64(uint tag, long defaultValue) { - return new FieldCodec(input => input.ReadSInt64(), (output, value) => output.WriteSInt64(value), CodedOutputStream.ComputeSInt64Size, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadSInt64(), (ref WriteContext output, long value) => output.WriteSInt64(value), CodedOutputStream.ComputeSInt64Size, tag, defaultValue); } /// @@ -328,7 +329,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForFixed64(uint tag, ulong defaultValue) { - return new FieldCodec(input => input.ReadFixed64(), (output, value) => output.WriteFixed64(value), 8, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadFixed64(), (ref WriteContext output, ulong value) => output.WriteFixed64(value), 8, tag, defaultValue); } /// @@ -339,7 +340,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForSFixed64(uint tag, long defaultValue) { - return new FieldCodec(input => input.ReadSFixed64(), (output, value) => output.WriteSFixed64(value), 8, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadSFixed64(), (ref WriteContext output, long value) => output.WriteSFixed64(value), 8, tag, defaultValue); } /// @@ -350,7 +351,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForUInt64(uint tag, ulong defaultValue) { - return new FieldCodec(input => input.ReadUInt64(), (output, value) => output.WriteUInt64(value), CodedOutputStream.ComputeUInt64Size, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadUInt64(), (ref WriteContext output, ulong value) => output.WriteUInt64(value), CodedOutputStream.ComputeUInt64Size, tag, defaultValue); } /// @@ -361,7 +362,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForFloat(uint tag, float defaultValue) { - return new FieldCodec(input => input.ReadFloat(), (output, value) => output.WriteFloat(value), CodedOutputStream.FloatSize, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadFloat(), (ref WriteContext output, float value) => output.WriteFloat(value), CodedOutputStream.FloatSize, tag, defaultValue); } /// @@ -372,7 +373,7 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForDouble(uint tag, double defaultValue) { - return new FieldCodec(input => input.ReadDouble(), (output, value) => output.WriteDouble(value), CodedOutputStream.DoubleSize, tag, defaultValue); + return new FieldCodec((ref ParseContext ctx) => ctx.ReadDouble(), (ref WriteContext output, double value) => output.WriteDouble(value), CodedOutputStream.DoubleSize, tag, defaultValue); } // Enums are tricky. We can probably use expression trees to build these delegates automatically, @@ -388,9 +389,9 @@ namespace Google.Protobuf /// A codec for the given tag. public static FieldCodec ForEnum(uint tag, Func toInt32, Func fromInt32, T defaultValue) { - return new FieldCodec(input => fromInt32( - input.ReadEnum()), - (output, value) => output.WriteEnum(toInt32(value)), + return new FieldCodec((ref ParseContext ctx) => fromInt32( + ctx.ReadEnum()), + (ref WriteContext output, T value) => output.WriteEnum(toInt32(value)), value => CodedOutputStream.ComputeEnumSize(toInt32(value)), tag, defaultValue); } @@ -403,21 +404,21 @@ namespace Google.Protobuf public static FieldCodec ForMessage(uint tag, MessageParser parser) where T : class, IMessage { return new FieldCodec( - input => + (ref ParseContext ctx) => { T message = parser.CreateTemplate(); - input.ReadMessage(message); + ctx.ReadMessage(message); return message; }, - (output, value) => output.WriteMessage(value), - (CodedInputStream i, ref T v) => + (ref WriteContext output, T value) => output.WriteMessage(value), + (ref ParseContext ctx, ref T v) => { if (v == null) { v = parser.CreateTemplate(); } - i.ReadMessage(v); + ctx.ReadMessage(v); }, (ref T v, T v2) => { @@ -448,21 +449,21 @@ namespace Google.Protobuf public static FieldCodec ForGroup(uint startTag, uint endTag, MessageParser parser) where T : class, IMessage { return new FieldCodec( - input => + (ref ParseContext ctx) => { T message = parser.CreateTemplate(); - input.ReadGroup(message); + ctx.ReadGroup(message); return message; }, - (output, value) => output.WriteGroup(value), - (CodedInputStream i, ref T v) => + (ref WriteContext output, T value) => output.WriteGroup(value), + (ref ParseContext ctx, ref T v) => { if (v == null) { v = parser.CreateTemplate(); } - i.ReadGroup(v); + ctx.ReadGroup(v); }, (ref T v, T v2) => { @@ -490,9 +491,9 @@ namespace Google.Protobuf { var nestedCodec = WrapperCodecs.GetCodec(); return new FieldCodec( - input => WrapperCodecs.Read(input, nestedCodec), - (output, value) => WrapperCodecs.Write(output, value, nestedCodec), - (CodedInputStream i, ref T v) => v = WrapperCodecs.Read(i, nestedCodec), + (ref ParseContext ctx) => WrapperCodecs.Read(ref ctx, nestedCodec), + (ref WriteContext output, T value) => WrapperCodecs.Write(ref output, value, nestedCodec), + (ref ParseContext ctx, ref T v) => v = WrapperCodecs.Read(ref ctx, nestedCodec), (ref T v, T v2) => { v = v2; return v == null; }, value => WrapperCodecs.CalculateSize(value, nestedCodec), tag, 0, @@ -508,8 +509,8 @@ namespace Google.Protobuf var nestedCodec = WrapperCodecs.GetCodec(); return new FieldCodec( WrapperCodecs.GetReader(), - (output, value) => WrapperCodecs.Write(output, value.Value, nestedCodec), - (CodedInputStream i, ref T? v) => v = WrapperCodecs.Read(i, nestedCodec), + (ref WriteContext output, T? value) => WrapperCodecs.Write(ref output, value.Value, nestedCodec), + (ref ParseContext ctx, ref T? v) => v = WrapperCodecs.Read(ref ctx, nestedCodec), (ref T? v, T? v2) => { if (v2.HasValue) { v = v2; } return v.HasValue; }, value => value == null ? 0 : WrapperCodecs.CalculateSize(value.Value, nestedCodec), tag, 0, @@ -542,17 +543,17 @@ namespace Google.Protobuf private static readonly Dictionary Readers = new Dictionary { // TODO: Provide more optimized readers. - { typeof(bool), (Func)CodedInputStream.ReadBoolWrapper }, - { typeof(int), (Func)CodedInputStream.ReadInt32Wrapper }, - { typeof(long), (Func)CodedInputStream.ReadInt64Wrapper }, - { typeof(uint), (Func)CodedInputStream.ReadUInt32Wrapper }, - { typeof(ulong), (Func)CodedInputStream.ReadUInt64Wrapper }, + { typeof(bool), (ValueReader)ParsingPrimitivesWrappers.ReadBoolWrapper }, + { typeof(int), (ValueReader)ParsingPrimitivesWrappers.ReadInt32Wrapper }, + { typeof(long), (ValueReader)ParsingPrimitivesWrappers.ReadInt64Wrapper }, + { typeof(uint), (ValueReader)ParsingPrimitivesWrappers.ReadUInt32Wrapper }, + { typeof(ulong), (ValueReader)ParsingPrimitivesWrappers.ReadUInt64Wrapper }, { typeof(float), BitConverter.IsLittleEndian ? - (Func)CodedInputStream.ReadFloatWrapperLittleEndian : - (Func)CodedInputStream.ReadFloatWrapperSlow }, + (ValueReader)ParsingPrimitivesWrappers.ReadFloatWrapperLittleEndian : + (ValueReader)ParsingPrimitivesWrappers.ReadFloatWrapperSlow }, { typeof(double), BitConverter.IsLittleEndian ? - (Func)CodedInputStream.ReadDoubleWrapperLittleEndian : - (Func)CodedInputStream.ReadDoubleWrapperSlow }, + (ValueReader)ParsingPrimitivesWrappers.ReadDoubleWrapperLittleEndian : + (ValueReader)ParsingPrimitivesWrappers.ReadDoubleWrapperSlow }, // `string` and `ByteString` less performance-sensitive. Do not implement for now. { typeof(string), null }, { typeof(ByteString), null }, @@ -572,7 +573,7 @@ namespace Google.Protobuf return (FieldCodec) value; } - internal static Func GetReader() where T : struct + internal static ValueReader GetReader() where T : struct { object value; if (!Readers.TryGetValue(typeof(T), out value)) @@ -583,41 +584,42 @@ namespace Google.Protobuf { // Return default unoptimized reader for the wrapper type. var nestedCoded = GetCodec(); - return input => Read(input, nestedCoded); + return (ref ParseContext ctx) => Read(ref ctx, nestedCoded); } // Return optimized read for the wrapper type. - return (Func)value; + return (ValueReader)value; } - internal static T Read(CodedInputStream input, FieldCodec codec) + [SecuritySafeCritical] + internal static T Read(ref ParseContext ctx, FieldCodec codec) { - int length = input.ReadLength(); - int oldLimit = input.PushLimit(length); + int length = ctx.ReadLength(); + int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, length); uint tag; T value = codec.DefaultValue; - while ((tag = input.ReadTag()) != 0) + while ((tag = ctx.ReadTag()) != 0) { if (tag == codec.Tag) { - value = codec.Read(input); + value = codec.Read(ref ctx); } else { - input.SkipLastField(); + ParsingPrimitivesMessages.SkipLastField(ref ctx.buffer, ref ctx.state); } } - input.CheckReadEndOfStreamTag(); - input.PopLimit(oldLimit); + ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref ctx.state); + SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit); return value; } - internal static void Write(CodedOutputStream output, T value, FieldCodec codec) + internal static void Write(ref WriteContext ctx, T value, FieldCodec codec) { - output.WriteLength(codec.CalculateSizeWithTag(value)); - codec.WriteTagAndValue(output, value); + ctx.WriteLength(codec.CalculateSizeWithTag(value)); + codec.WriteTagAndValue(ref ctx, value); } internal static int CalculateSize(T value, FieldCodec codec) @@ -628,6 +630,9 @@ namespace Google.Protobuf } } + internal delegate TValue ValueReader(ref ParseContext ctx); + internal delegate void ValueWriter(ref WriteContext ctx, T value); + /// /// /// An encode/decode pair for a single field. This effectively encapsulates @@ -653,7 +658,7 @@ namespace Google.Protobuf /// /// Merges an input stream into a value /// - internal delegate void InputMerger(CodedInputStream input, ref T value); + internal delegate void InputMerger(ref ParseContext ctx, ref T value); /// /// Merges a value into a reference to another value, returning a boolean if the value was set @@ -681,7 +686,7 @@ namespace Google.Protobuf /// /// Returns a delegate to write a value (unconditionally) to a coded output stream. /// - internal Action ValueWriter { get; } + internal ValueWriter ValueWriter { get; } /// /// Returns the size calculator for just a value. @@ -692,7 +697,7 @@ namespace Google.Protobuf /// Returns a delegate to read a value from a coded input stream. It is assumed that /// the stream is already positioned on the appropriate tag. /// - internal Func ValueReader { get; } + internal ValueReader ValueReader { get; } /// /// Returns a delegate to merge a value from a coded input stream. @@ -739,8 +744,8 @@ namespace Google.Protobuf private readonly int tagSize; internal FieldCodec( - Func reader, - Action writer, + ValueReader reader, + ValueWriter writer, int fixedSize, uint tag, T defaultValue) : this(reader, writer, _ => fixedSize, tag, defaultValue) @@ -749,17 +754,17 @@ namespace Google.Protobuf } internal FieldCodec( - Func reader, - Action writer, + ValueReader reader, + ValueWriter writer, Func sizeCalculator, uint tag, - T defaultValue) : this(reader, writer, (CodedInputStream i, ref T v) => v = reader(i), (ref T v, T v2) => { v = v2; return true; }, sizeCalculator, tag, 0, defaultValue) + T defaultValue) : this(reader, writer, (ref ParseContext ctx, ref T v) => v = reader(ref ctx), (ref T v, T v2) => { v = v2; return true; }, sizeCalculator, tag, 0, defaultValue) { } internal FieldCodec( - Func reader, - Action writer, + ValueReader reader, + ValueWriter writer, InputMerger inputMerger, ValuesMerger valuesMerger, Func sizeCalculator, @@ -769,8 +774,8 @@ namespace Google.Protobuf } internal FieldCodec( - Func reader, - Action writer, + ValueReader reader, + ValueWriter writer, InputMerger inputMerger, ValuesMerger valuesMerger, Func sizeCalculator, @@ -798,14 +803,41 @@ namespace Google.Protobuf /// Write a tag and the given value, *if* the value is not the default. /// public void WriteTagAndValue(CodedOutputStream output, T value) + { + WriteContext.Initialize(output, out WriteContext ctx); + try + { + WriteTagAndValue(ref ctx, value); + } + finally + { + ctx.CopyStateTo(output); + } + + + //if (!IsDefault(value)) + //{ + // output.WriteTag(Tag); + // ValueWriter(output, value); + // if (EndTag != 0) + // { + // output.WriteTag(EndTag); + // } + //} + } + + /// + /// Write a tag and the given value, *if* the value is not the default. + /// + public void WriteTagAndValue(ref WriteContext ctx, T value) { if (!IsDefault(value)) { - output.WriteTag(Tag); - ValueWriter(output, value); + ctx.WriteTag(Tag); + ValueWriter(ref ctx, value); if (EndTag != 0) { - output.WriteTag(EndTag); + ctx.WriteTag(EndTag); } } } @@ -815,7 +847,28 @@ namespace Google.Protobuf /// /// The input stream to read from. /// The value read from the stream. - public T Read(CodedInputStream input) => ValueReader(input); + public T Read(CodedInputStream input) + { + ParseContext.Initialize(input, out ParseContext ctx); + try + { + return ValueReader(ref ctx); + } + finally + { + ctx.CopyStateTo(input); + } + } + + /// + /// Reads a value of the codec type from the given . + /// + /// The parse context to read from. + /// The value read. + public T Read(ref ParseContext ctx) + { + return ValueReader(ref ctx); + } /// /// Calculates the size required to write the given value, with a tag, @@ -823,6 +876,12 @@ namespace Google.Protobuf /// public int CalculateSizeWithTag(T value) => IsDefault(value) ? 0 : ValueSizeCalculator(value) + tagSize; + /// + /// Calculates the size required to write the given value, with a tag, even + /// if the value is the default. + /// + internal int CalculateUnconditionalSizeWithTag(T value) => ValueSizeCalculator(value) + tagSize; + private bool IsDefault(T value) => EqualityComparer.Equals(value, DefaultValue); } } diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index 53f45febc7..41b2b64d8c 100644 --- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj @@ -4,39 +4,47 @@ C# runtime library for Protocol Buffers - Google's data interchange format. Copyright 2015, Google Inc. Google Protocol Buffers - 3.11.4 - 6 + 3.17.3 + + 7.2 Google Inc. - netstandard1.0;netstandard2.0;net45 + netstandard1.1;netstandard2.0;net45;net50 true ../../keys/Google.Protobuf.snk true - true Protocol;Buffers;Binary;Serialization;Format;Google;proto;proto3 C# proto3 support https://github.com/protocolbuffers/protobuf https://github.com/protocolbuffers/protobuf/blob/master/LICENSE git https://github.com/protocolbuffers/protobuf.git + True $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - - $(DefineConstants);GOOGLE_PROTOBUF_SUPPORT_SYSTEM_MEMORY + + $(DefineConstants);GOOGLE_PROTOBUF_SUPPORT_FAST_STRING + + + + $(DefineConstants);GOOGLE_PROTOBUF_SUPPORT_FAST_STRING;GOOGLE_PROTOBUF_SIMD - - + + + - - + + - - + + + + diff --git a/java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto b/csharp/src/Google.Protobuf/IBufferMessage.cs similarity index 66% rename from java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto rename to csharp/src/Google.Protobuf/IBufferMessage.cs index d41b7a11cc..05c15db4c6 100644 --- a/java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto +++ b/csharp/src/Google.Protobuf/IBufferMessage.cs @@ -1,3 +1,4 @@ +#region Copyright notice and license // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ @@ -27,30 +28,26 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion -// Author: Darick Tong (darick@google.com) -syntax = "proto2"; +namespace Google.Protobuf +{ + /// + /// Interface for a Protocol Buffers message, supporting + /// parsing from and writing to . + /// + public interface IBufferMessage : IMessage + { + /// + /// Internal implementation of merging data from given parse context into this message. + /// Users should never invoke this method directly. + /// + void InternalMergeFrom(ref ParseContext ctx); -package protobuf_unittest; - -message Proto1 { - option experimental_java_message_interface = - "com.google.protobuf.ExtraInterfaces.HasBoolValue"; - option experimental_java_message_interface = - "com.google.protobuf.ExtraInterfaces.HasStringValue"; - option experimental_java_builder_interface = - "com.google.protobuf.ExtraInterfaces.HasStringValueBuilder" - ""; - - optional string string_value = 1; - optional bool bool_value = 2; - optional bytes byte_value = 3; - optional int32 int_value = 4; -} - -message Proto2 { - option experimental_java_message_interface = - "com.google.protobuf.ExtraInterfaces.HasBoolValue"; - - optional bool bool_value = 1; + /// + /// Internal implementation of writing this message to a given write context. + /// Users should never invoke this method directly. + /// + void InternalWriteTo(ref WriteContext ctx); + } } diff --git a/csharp/src/Google.Protobuf/JsonFormatter.cs b/csharp/src/Google.Protobuf/JsonFormatter.cs index 5aaefe7a89..4bffd58c1f 100644 --- a/csharp/src/Google.Protobuf/JsonFormatter.cs +++ b/csharp/src/Google.Protobuf/JsonFormatter.cs @@ -221,19 +221,12 @@ namespace Google.Protobuf foreach (var field in fields.InFieldNumberOrder()) { var accessor = field.Accessor; - if (field.ContainingOneof != null && field.ContainingOneof.Accessor.GetCaseFieldDescriptor(message) != field) - { - continue; - } - // Omit default values unless we're asked to format them, or they're oneofs (where the default - // value is still formatted regardless, because that's how we preserve the oneof case). - object value = accessor.GetValue(message); - if (field.ContainingOneof == null && !settings.FormatDefaultValues && IsDefaultValue(accessor, value)) + var value = accessor.GetValue(message); + if (!ShouldFormatFieldValue(message, field, value)) { continue; } - // Okay, all tests complete: let's write the field value... if (!first) { writer.Write(PropertySeparator); @@ -248,6 +241,18 @@ namespace Google.Protobuf return !first; } + /// + /// Determines whether or not a field value should be serialized according to the field, + /// its value in the message, and the settings of this formatter. + /// + private bool ShouldFormatFieldValue(IMessage message, FieldDescriptor field, object value) => + field.HasPresence + // Fields that support presence *just* use that + ? field.Accessor.HasValue(message) + // Otherwise, format if either we've been asked to format default values, or if it's + // not a default value anyway. + : settings.FormatDefaultValues || !IsDefaultValue(field, value); + // Converted from java/core/src/main/java/com/google/protobuf/Descriptors.java internal static string ToJsonName(string name) { @@ -295,19 +300,19 @@ namespace Google.Protobuf writer.Write("null"); } - private static bool IsDefaultValue(IFieldAccessor accessor, object value) + private static bool IsDefaultValue(FieldDescriptor descriptor, object value) { - if (accessor.Descriptor.IsMap) + if (descriptor.IsMap) { IDictionary dictionary = (IDictionary) value; return dictionary.Count == 0; } - if (accessor.Descriptor.IsRepeated) + if (descriptor.IsRepeated) { IList list = (IList) value; return list.Count == 0; } - switch (accessor.Descriptor.FieldType) + switch (descriptor.FieldType) { case FieldType.Bool: return (bool) value == false; @@ -352,7 +357,7 @@ namespace Google.Protobuf /// The value to write. May be null. public void WriteValue(TextWriter writer, object value) { - if (value == null) + if (value == null || value is NullValue) { WriteNull(writer); } @@ -793,8 +798,10 @@ namespace Google.Protobuf } /// - /// Whether fields whose values are the default for the field type (e.g. 0 for integers) - /// should be formatted (true) or omitted (false). + /// Whether fields which would otherwise not be included in the formatted data + /// should be formatted even when the value is not present, or has the default value. + /// This option only affects fields which don't support "presence" (e.g. + /// singular non-optional proto3 primitive fields). /// public bool FormatDefaultValues { get; } diff --git a/csharp/src/Google.Protobuf/JsonParser.cs b/csharp/src/Google.Protobuf/JsonParser.cs index 3f88ea38f1..cb5f5a8f21 100644 --- a/csharp/src/Google.Protobuf/JsonParser.cs +++ b/csharp/src/Google.Protobuf/JsonParser.cs @@ -37,6 +37,7 @@ using System.Collections; using System.Collections.Generic; using System.Globalization; using System.IO; +using System.Linq; using System.Text; using System.Text.RegularExpressions; @@ -63,6 +64,7 @@ namespace Google.Protobuf private static readonly Regex DurationRegex = new Regex(@"^(?-)?(?[0-9]{1,12})(?\.[0-9]{1,9})?s$", FrameworkPortability.CompiledRegexWhereAvailable); private static readonly int[] SubsecondScalingFactors = { 0, 100000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10, 1 }; private static readonly char[] FieldMaskPathSeparators = new[] { ',' }; + private static readonly EnumDescriptor NullValueDescriptor = StructReflection.Descriptor.EnumTypes.Single(ed => ed.ClrType == typeof(NullValue)); private static readonly JsonParser defaultInstance = new JsonParser(Settings.Default); @@ -221,10 +223,11 @@ namespace Google.Protobuf if (token.Type == JsonToken.TokenType.Null) { // Clear the field if we see a null token, unless it's for a singular field of type - // google.protobuf.Value. + // google.protobuf.Value or google.protobuf.NullValue. // Note: different from Java API, which just ignores it. // TODO: Bring it more in line? Discuss... - if (field.IsMap || field.IsRepeated || !IsGoogleProtobufValueField(field)) + if (field.IsMap || field.IsRepeated || + !(IsGoogleProtobufValueField(field) || IsGoogleProtobufNullValueField(field))) { field.Accessor.Clear(message); return; @@ -314,6 +317,12 @@ namespace Google.Protobuf field.MessageType.FullName == Value.Descriptor.FullName; } + private static bool IsGoogleProtobufNullValueField(FieldDescriptor field) + { + return field.FieldType == FieldType.Enum && + field.EnumType.FullName == NullValueDescriptor.FullName; + } + private object ParseSingleValue(FieldDescriptor field, JsonTokenizer tokenizer) { var token = tokenizer.Next(); @@ -325,6 +334,10 @@ namespace Google.Protobuf { return Value.ForNull(); } + if (IsGoogleProtobufNullValueField(field)) + { + return NullValue.NullValue; + } return null; } diff --git a/csharp/src/Google.Protobuf/MessageExtensions.cs b/csharp/src/Google.Protobuf/MessageExtensions.cs index 06e0980ec2..c4b3f82343 100644 --- a/csharp/src/Google.Protobuf/MessageExtensions.cs +++ b/csharp/src/Google.Protobuf/MessageExtensions.cs @@ -31,9 +31,12 @@ #endregion using Google.Protobuf.Reflection; +using System.Buffers; using System.Collections; +using System; using System.IO; using System.Linq; +using System.Security; namespace Google.Protobuf { @@ -76,6 +79,15 @@ namespace Google.Protobuf public static void MergeFrom(this IMessage message, Stream input) => MergeFrom(message, input, false, null); + /// + /// Merges data from the given span into an existing message. + /// + /// The message to merge the data into. + /// Span containing the data to merge, which must be protobuf-encoded binary data. + [SecuritySafeCritical] + public static void MergeFrom(this IMessage message, ReadOnlySpan span) => + MergeFrom(message, span, false, null); + /// /// Merges length-delimited data from the given stream into an existing message. /// @@ -127,7 +139,7 @@ namespace Google.Protobuf ProtoPreconditions.CheckNotNull(message, "message"); ProtoPreconditions.CheckNotNull(output, "output"); CodedOutputStream codedOutput = new CodedOutputStream(output); - codedOutput.WriteRawVarint32((uint)message.CalculateSize()); + codedOutput.WriteLength(message.CalculateSize()); message.WriteTo(codedOutput); codedOutput.Flush(); } @@ -143,6 +155,39 @@ namespace Google.Protobuf return ByteString.AttachBytes(message.ToByteArray()); } + /// + /// Writes the given message data to the given buffer writer in protobuf encoding. + /// + /// The message to write to the stream. + /// The stream to write to. + [SecuritySafeCritical] + public static void WriteTo(this IMessage message, IBufferWriter output) + { + ProtoPreconditions.CheckNotNull(message, nameof(message)); + ProtoPreconditions.CheckNotNull(output, nameof(output)); + + WriteContext.Initialize(output, out WriteContext ctx); + WritingPrimitivesMessages.WriteRawMessage(ref ctx, message); + ctx.Flush(); + } + + /// + /// Writes the given message data to the given span in protobuf encoding. + /// The size of the destination span needs to fit the serialized size + /// of the message exactly, otherwise an exception is thrown. + /// + /// The message to write to the stream. + /// The span to write to. Size must match size of the message exactly. + [SecuritySafeCritical] + public static void WriteTo(this IMessage message, Span output) + { + ProtoPreconditions.CheckNotNull(message, nameof(message)); + + WriteContext.Initialize(ref output, out WriteContext ctx); + WritingPrimitivesMessages.WriteRawMessage(ref ctx, message); + ctx.CheckNoSpaceLeft(); + } + /// /// Checks if all required fields in a message have values set. For proto3 messages, this returns true /// @@ -248,6 +293,26 @@ namespace Google.Protobuf codedInput.CheckReadEndOfStreamTag(); } + [SecuritySafeCritical] + internal static void MergeFrom(this IMessage message, ReadOnlySequence data, bool discardUnknownFields, ExtensionRegistry registry) + { + ParseContext.Initialize(data, out ParseContext ctx); + ctx.DiscardUnknownFields = discardUnknownFields; + ctx.ExtensionRegistry = registry; + ParsingPrimitivesMessages.ReadRawMessage(ref ctx, message); + ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref ctx.state); + } + + [SecuritySafeCritical] + internal static void MergeFrom(this IMessage message, ReadOnlySpan data, bool discardUnknownFields, ExtensionRegistry registry) + { + ParseContext.Initialize(data, out ParseContext ctx); + ctx.DiscardUnknownFields = discardUnknownFields; + ctx.ExtensionRegistry = registry; + ParsingPrimitivesMessages.ReadRawMessage(ref ctx, message); + ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref ctx.state); + } + internal static void MergeDelimitedFrom(this IMessage message, Stream input, bool discardUnknownFields, ExtensionRegistry registry) { ProtoPreconditions.CheckNotNull(message, "message"); diff --git a/csharp/src/Google.Protobuf/MessageParser.cs b/csharp/src/Google.Protobuf/MessageParser.cs index 06d0f1059c..30a25a8698 100644 --- a/csharp/src/Google.Protobuf/MessageParser.cs +++ b/csharp/src/Google.Protobuf/MessageParser.cs @@ -31,7 +31,9 @@ #endregion using System; +using System.Buffers; using System.IO; +using System.Security; namespace Google.Protobuf { @@ -113,6 +115,32 @@ namespace Google.Protobuf return message; } + /// + /// Parses a message from the given sequence. + /// + /// The data to parse. + /// The parsed message. + [SecuritySafeCritical] + public IMessage ParseFrom(ReadOnlySequence data) + { + IMessage message = factory(); + message.MergeFrom(data, DiscardUnknownFields, Extensions); + return message; + } + + /// + /// Parses a message from the given span. + /// + /// The data to parse. + /// The parsed message. + [SecuritySafeCritical] + public IMessage ParseFrom(ReadOnlySpan data) + { + IMessage message = factory(); + message.MergeFrom(data, DiscardUnknownFields, Extensions); + return message; + } + /// /// Parses a length-delimited message from the given stream. /// @@ -287,6 +315,32 @@ namespace Google.Protobuf return message; } + /// + /// Parses a message from the given sequence. + /// + /// The data to parse. + /// The parsed message. + [SecuritySafeCritical] + public new T ParseFrom(ReadOnlySequence data) + { + T message = factory(); + message.MergeFrom(data, DiscardUnknownFields, Extensions); + return message; + } + + /// + /// Parses a message from the given span. + /// + /// The data to parse. + /// The parsed message. + [SecuritySafeCritical] + public new T ParseFrom(ReadOnlySpan data) + { + T message = factory(); + message.MergeFrom(data, DiscardUnknownFields, Extensions); + return message; + } + /// /// Parses a length-delimited message from the given stream. /// diff --git a/csharp/src/Google.Protobuf/ParseContext.cs b/csharp/src/Google.Protobuf/ParseContext.cs new file mode 100644 index 0000000000..7b278b5a92 --- /dev/null +++ b/csharp/src/Google.Protobuf/ParseContext.cs @@ -0,0 +1,348 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Buffers; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; +using Google.Protobuf.Collections; + +namespace Google.Protobuf +{ + /// + /// An opaque struct that represents the current parsing state and is passed along + /// as the parsing proceeds. + /// All the public methods are intended to be invoked only by the generated code, + /// users should never invoke them directly. + /// + [SecuritySafeCritical] + public ref struct ParseContext + { + internal const int DefaultRecursionLimit = 100; + internal const int DefaultSizeLimit = Int32.MaxValue; + + internal ReadOnlySpan buffer; + internal ParserInternalState state; + + /// + /// Initialize a , building all from defaults and + /// the given . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void Initialize(ReadOnlySpan buffer, out ParseContext ctx) + { + ParserInternalState state = default; + state.sizeLimit = DefaultSizeLimit; + state.recursionLimit = DefaultRecursionLimit; + state.currentLimit = int.MaxValue; + state.bufferSize = buffer.Length; + + Initialize(buffer, ref state, out ctx); + } + + /// + /// Initialize a using existing , e.g. from . + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void Initialize(ReadOnlySpan buffer, ref ParserInternalState state, out ParseContext ctx) + { + ctx.buffer = buffer; + ctx.state = state; + } + + /// + /// Creates a ParseContext instance from CodedInputStream. + /// WARNING: internally this copies the CodedInputStream's state, so after done with the ParseContext, + /// the CodedInputStream's state needs to be updated. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void Initialize(CodedInputStream input, out ParseContext ctx) + { + ctx.buffer = new ReadOnlySpan(input.InternalBuffer); + // ideally we would use a reference to the original state, but that doesn't seem possible + // so we just copy the struct that holds the state. We will need to later store the state back + // into CodedInputStream if we want to keep it usable. + ctx.state = input.InternalState; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void Initialize(ReadOnlySequence input, out ParseContext ctx) + { + Initialize(input, DefaultRecursionLimit, out ctx); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void Initialize(ReadOnlySequence input, int recursionLimit, out ParseContext ctx) + { + ctx.buffer = default; + ctx.state = default; + ctx.state.lastTag = 0; + ctx.state.recursionDepth = 0; + ctx.state.sizeLimit = DefaultSizeLimit; + ctx.state.recursionLimit = recursionLimit; + ctx.state.currentLimit = int.MaxValue; + SegmentedBufferHelper.Initialize(input, out ctx.state.segmentedBufferHelper, out ctx.buffer); + ctx.state.bufferPos = 0; + ctx.state.bufferSize = ctx.buffer.Length; + + ctx.state.DiscardUnknownFields = false; + ctx.state.ExtensionRegistry = null; + } + + /// + /// Returns the last tag read, or 0 if no tags have been read or we've read beyond + /// the end of the input. + /// + internal uint LastTag { get { return state.lastTag; } } + + /// + /// Internal-only property; when set to true, unknown fields will be discarded while parsing. + /// + internal bool DiscardUnknownFields { + get { return state.DiscardUnknownFields; } + set { state.DiscardUnknownFields = value; } + } + + /// + /// Internal-only property; provides extension identifiers to compatible messages while parsing. + /// + internal ExtensionRegistry ExtensionRegistry + { + get { return state.ExtensionRegistry; } + set { state.ExtensionRegistry = value; } + } + + /// + /// Reads a field tag, returning the tag of 0 for "end of input". + /// + /// + /// If this method returns 0, it doesn't necessarily mean the end of all + /// the data in this CodedInputReader; it may be the end of the logical input + /// for an embedded message, for example. + /// + /// The next field tag, or 0 for end of input. (0 is never a valid tag.) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint ReadTag() + { + return ParsingPrimitives.ParseTag(ref buffer, ref state); + } + + /// + /// Reads a double field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double ReadDouble() + { + return ParsingPrimitives.ParseDouble(ref buffer, ref state); + } + + /// + /// Reads a float field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float ReadFloat() + { + return ParsingPrimitives.ParseFloat(ref buffer, ref state); + } + + /// + /// Reads a uint64 field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ulong ReadUInt64() + { + return ParsingPrimitives.ParseRawVarint64(ref buffer, ref state); + } + + /// + /// Reads an int64 field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public long ReadInt64() + { + return (long)ParsingPrimitives.ParseRawVarint64(ref buffer, ref state); + } + + /// + /// Reads an int32 field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int ReadInt32() + { + return (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } + + /// + /// Reads a fixed64 field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ulong ReadFixed64() + { + return ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state); + } + + /// + /// Reads a fixed32 field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint ReadFixed32() + { + return ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state); + } + + /// + /// Reads a bool field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool ReadBool() + { + return ParsingPrimitives.ParseRawVarint64(ref buffer, ref state) != 0; + } + /// + /// Reads a string field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ReadString() + { + return ParsingPrimitives.ReadString(ref buffer, ref state); + } + + /// + /// Reads an embedded message field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ReadMessage(IMessage message) + { + ParsingPrimitivesMessages.ReadMessage(ref this, message); + } + + /// + /// Reads an embedded group field from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void ReadGroup(IMessage message) + { + ParsingPrimitivesMessages.ReadGroup(ref this, message); + } + + /// + /// Reads a bytes field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ByteString ReadBytes() + { + return ParsingPrimitives.ReadBytes(ref buffer, ref state); + } + /// + /// Reads a uint32 field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint ReadUInt32() + { + return ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } + + /// + /// Reads an enum field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int ReadEnum() + { + // Currently just a pass-through, but it's nice to separate it logically from WriteInt32. + return (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } + + /// + /// Reads an sfixed32 field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int ReadSFixed32() + { + return (int)ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state); + } + + /// + /// Reads an sfixed64 field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public long ReadSFixed64() + { + return (long)ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state); + } + + /// + /// Reads an sint32 field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int ReadSInt32() + { + return ParsingPrimitives.DecodeZigZag32(ParsingPrimitives.ParseRawVarint32(ref buffer, ref state)); + } + + /// + /// Reads an sint64 field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public long ReadSInt64() + { + return ParsingPrimitives.DecodeZigZag64(ParsingPrimitives.ParseRawVarint64(ref buffer, ref state)); + } + + /// + /// Reads a length for length-delimited data. + /// + /// + /// This is internally just reading a varint, but this method exists + /// to make the calling code clearer. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int ReadLength() + { + return (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } + + internal void CopyStateTo(CodedInputStream input) + { + input.InternalState = state; + } + + internal void LoadStateFrom(CodedInputStream input) + { + state = input.InternalState; + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/ParserInternalState.cs b/csharp/src/Google.Protobuf/ParserInternalState.cs new file mode 100644 index 0000000000..cb4f47143c --- /dev/null +++ b/csharp/src/Google.Protobuf/ParserInternalState.cs @@ -0,0 +1,115 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Buffers; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; +using Google.Protobuf.Collections; + +namespace Google.Protobuf +{ + + // warning: this is a mutable struct, so it needs to be only passed as a ref! + internal struct ParserInternalState + { + // NOTE: the Span representing the current buffer is kept separate so that this doesn't have to be a ref struct and so it can + // be included in CodedInputStream's internal state + + /// + /// The position within the current buffer (i.e. the next byte to read) + /// + internal int bufferPos; + + /// + /// Size of the current buffer + /// + internal int bufferSize; + + /// + /// If we are currently inside a length-delimited block, this is the number of + /// bytes in the buffer that are still available once we leave the delimited block. + /// + internal int bufferSizeAfterLimit; + + /// + /// The absolute position of the end of the current length-delimited block (including totalBytesRetired) + /// + internal int currentLimit; + + /// + /// The total number of consumed before the start of the current buffer. The + /// total bytes read up to the current position can be computed as + /// totalBytesRetired + bufferPos. + /// + internal int totalBytesRetired; + + internal int recursionDepth; // current recursion depth + + internal SegmentedBufferHelper segmentedBufferHelper; + + /// + /// The last tag we read. 0 indicates we've read to the end of the stream + /// (or haven't read anything yet). + /// + internal uint lastTag; + + /// + /// The next tag, used to store the value read by PeekTag. + /// + internal uint nextTag; + internal bool hasNextTag; + + // these fields are configuration, they should be readonly + internal int sizeLimit; + internal int recursionLimit; + + // If non-null, the top level parse method was started with given coded input stream as an argument + // which also means we can potentially fallback to calling MergeFrom(CodedInputStream cis) if needed. + internal CodedInputStream CodedInputStream => segmentedBufferHelper.CodedInputStream; + + /// + /// Internal-only property; when set to true, unknown fields will be discarded while parsing. + /// + internal bool DiscardUnknownFields { get; set; } + + /// + /// Internal-only property; provides extension identifiers to compatible messages while parsing. + /// + internal ExtensionRegistry ExtensionRegistry { get; set; } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/ParsingPrimitives.cs b/csharp/src/Google.Protobuf/ParsingPrimitives.cs new file mode 100644 index 0000000000..e270ed8aa1 --- /dev/null +++ b/csharp/src/Google.Protobuf/ParsingPrimitives.cs @@ -0,0 +1,815 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Buffers; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; +using Google.Protobuf.Collections; + +namespace Google.Protobuf +{ + /// + /// Primitives for parsing protobuf wire format. + /// + [SecuritySafeCritical] + internal static class ParsingPrimitives + { + private const int StackallocThreshold = 256; + + /// + /// Reads a length for length-delimited data. + /// + /// + /// This is internally just reading a varint, but this method exists + /// to make the calling code clearer. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ParseLength(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + return (int)ParseRawVarint32(ref buffer, ref state); + } + + /// + /// Parses the next tag. + /// If the end of logical stream was reached, an invalid tag of 0 is returned. + /// + public static uint ParseTag(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + // The "nextTag" logic is there only as an optimization for reading non-packed repeated / map + // fields and is strictly speaking not necessary. + // TODO(jtattermusch): look into simplifying the ParseTag logic. + if (state.hasNextTag) + { + state.lastTag = state.nextTag; + state.hasNextTag = false; + return state.lastTag; + } + + // Optimize for the incredibly common case of having at least two bytes left in the buffer, + // and those two bytes being enough to get the tag. This will be true for fields up to 4095. + if (state.bufferPos + 2 <= state.bufferSize) + { + int tmp = buffer[state.bufferPos++]; + if (tmp < 128) + { + state.lastTag = (uint)tmp; + } + else + { + int result = tmp & 0x7f; + if ((tmp = buffer[state.bufferPos++]) < 128) + { + result |= tmp << 7; + state.lastTag = (uint) result; + } + else + { + // Nope, rewind and go the potentially slow route. + state.bufferPos -= 2; + state.lastTag = ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } + } + } + else + { + if (SegmentedBufferHelper.IsAtEnd(ref buffer, ref state)) + { + state.lastTag = 0; + return 0; + } + + state.lastTag = ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } + if (WireFormat.GetTagFieldNumber(state.lastTag) == 0) + { + // If we actually read a tag with a field of 0, that's not a valid tag. + throw InvalidProtocolBufferException.InvalidTag(); + } + return state.lastTag; + } + + /// + /// Peeks at the next tag in the stream. If it matches , + /// the tag is consumed and the method returns true; otherwise, the + /// stream is left in the original position and the method returns false. + /// + public static bool MaybeConsumeTag(ref ReadOnlySpan buffer, ref ParserInternalState state, uint tag) + { + if (PeekTag(ref buffer, ref state) == tag) + { + state.hasNextTag = false; + return true; + } + return false; + } + + /// + /// Peeks at the next field tag. This is like calling , but the + /// tag is not consumed. (So a subsequent call to will return the + /// same value.) + /// + public static uint PeekTag(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + if (state.hasNextTag) + { + return state.nextTag; + } + + uint savedLast = state.lastTag; + state.nextTag = ParseTag(ref buffer, ref state); + state.hasNextTag = true; + state.lastTag = savedLast; // Undo the side effect of ReadTag + return state.nextTag; + } + + /// + /// Parses a raw varint. + /// + public static ulong ParseRawVarint64(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + if (state.bufferPos + 10 > state.bufferSize) + { + return ParseRawVarint64SlowPath(ref buffer, ref state); + } + + ulong result = buffer[state.bufferPos++]; + if (result < 128) + { + return result; + } + result &= 0x7f; + int shift = 7; + do + { + byte b = buffer[state.bufferPos++]; + result |= (ulong)(b & 0x7F) << shift; + if (b < 0x80) + { + return result; + } + shift += 7; + } + while (shift < 64); + + throw InvalidProtocolBufferException.MalformedVarint(); + } + + private static ulong ParseRawVarint64SlowPath(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + int shift = 0; + ulong result = 0; + do + { + byte b = ReadRawByte(ref buffer, ref state); + result |= (ulong)(b & 0x7F) << shift; + if (b < 0x80) + { + return result; + } + shift += 7; + } + while (shift < 64); + + throw InvalidProtocolBufferException.MalformedVarint(); + } + + /// + /// Parses a raw Varint. If larger than 32 bits, discard the upper bits. + /// This method is optimised for the case where we've got lots of data in the buffer. + /// That means we can check the size just once, then just read directly from the buffer + /// without constant rechecking of the buffer length. + /// + public static uint ParseRawVarint32(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + if (state.bufferPos + 5 > state.bufferSize) + { + return ParseRawVarint32SlowPath(ref buffer, ref state); + } + + int tmp = buffer[state.bufferPos++]; + if (tmp < 128) + { + return (uint)tmp; + } + int result = tmp & 0x7f; + if ((tmp = buffer[state.bufferPos++]) < 128) + { + result |= tmp << 7; + } + else + { + result |= (tmp & 0x7f) << 7; + if ((tmp = buffer[state.bufferPos++]) < 128) + { + result |= tmp << 14; + } + else + { + result |= (tmp & 0x7f) << 14; + if ((tmp = buffer[state.bufferPos++]) < 128) + { + result |= tmp << 21; + } + else + { + result |= (tmp & 0x7f) << 21; + result |= (tmp = buffer[state.bufferPos++]) << 28; + if (tmp >= 128) + { + // Discard upper 32 bits. + // Note that this has to use ReadRawByte() as we only ensure we've + // got at least 5 bytes at the start of the method. This lets us + // use the fast path in more cases, and we rarely hit this section of code. + for (int i = 0; i < 5; i++) + { + if (ReadRawByte(ref buffer, ref state) < 128) + { + return (uint) result; + } + } + throw InvalidProtocolBufferException.MalformedVarint(); + } + } + } + } + return (uint)result; + } + + private static uint ParseRawVarint32SlowPath(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + int tmp = ReadRawByte(ref buffer, ref state); + if (tmp < 128) + { + return (uint) tmp; + } + int result = tmp & 0x7f; + if ((tmp = ReadRawByte(ref buffer, ref state)) < 128) + { + result |= tmp << 7; + } + else + { + result |= (tmp & 0x7f) << 7; + if ((tmp = ReadRawByte(ref buffer, ref state)) < 128) + { + result |= tmp << 14; + } + else + { + result |= (tmp & 0x7f) << 14; + if ((tmp = ReadRawByte(ref buffer, ref state)) < 128) + { + result |= tmp << 21; + } + else + { + result |= (tmp & 0x7f) << 21; + result |= (tmp = ReadRawByte(ref buffer, ref state)) << 28; + if (tmp >= 128) + { + // Discard upper 32 bits. + for (int i = 0; i < 5; i++) + { + if (ReadRawByte(ref buffer, ref state) < 128) + { + return (uint) result; + } + } + throw InvalidProtocolBufferException.MalformedVarint(); + } + } + } + } + return (uint) result; + } + + /// + /// Parses a 32-bit little-endian integer. + /// + public static uint ParseRawLittleEndian32(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + const int uintLength = sizeof(uint); + const int ulongLength = sizeof(ulong); + if (state.bufferPos + ulongLength > state.bufferSize) + { + return ParseRawLittleEndian32SlowPath(ref buffer, ref state); + } + // ReadUInt32LittleEndian is many times slower than ReadUInt64LittleEndian (at least on some runtimes) + // so it's faster better to use ReadUInt64LittleEndian and truncate the result. + uint result = (uint) BinaryPrimitives.ReadUInt64LittleEndian(buffer.Slice(state.bufferPos, ulongLength)); + state.bufferPos += uintLength; + return result; + } + + private static uint ParseRawLittleEndian32SlowPath(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + uint b1 = ReadRawByte(ref buffer, ref state); + uint b2 = ReadRawByte(ref buffer, ref state); + uint b3 = ReadRawByte(ref buffer, ref state); + uint b4 = ReadRawByte(ref buffer, ref state); + return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24); + } + + /// + /// Parses a 64-bit little-endian integer. + /// + public static ulong ParseRawLittleEndian64(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + const int length = sizeof(ulong); + if (state.bufferPos + length > state.bufferSize) + { + return ParseRawLittleEndian64SlowPath(ref buffer, ref state); + } + ulong result = BinaryPrimitives.ReadUInt64LittleEndian(buffer.Slice(state.bufferPos, length)); + state.bufferPos += length; + return result; + } + + private static ulong ParseRawLittleEndian64SlowPath(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + ulong b1 = ReadRawByte(ref buffer, ref state); + ulong b2 = ReadRawByte(ref buffer, ref state); + ulong b3 = ReadRawByte(ref buffer, ref state); + ulong b4 = ReadRawByte(ref buffer, ref state); + ulong b5 = ReadRawByte(ref buffer, ref state); + ulong b6 = ReadRawByte(ref buffer, ref state); + ulong b7 = ReadRawByte(ref buffer, ref state); + ulong b8 = ReadRawByte(ref buffer, ref state); + return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24) + | (b5 << 32) | (b6 << 40) | (b7 << 48) | (b8 << 56); + } + + /// + /// Parses a double value. + /// + public static double ParseDouble(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + const int length = sizeof(double); + if (!BitConverter.IsLittleEndian || state.bufferPos + length > state.bufferSize) + { + return BitConverter.Int64BitsToDouble((long)ParseRawLittleEndian64(ref buffer, ref state)); + } + // ReadUnaligned uses processor architecture for endianness. + double result = Unsafe.ReadUnaligned(ref MemoryMarshal.GetReference(buffer.Slice(state.bufferPos, length))); + state.bufferPos += length; + return result; + } + + /// + /// Parses a float value. + /// + public static float ParseFloat(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + const int length = sizeof(float); + if (!BitConverter.IsLittleEndian || state.bufferPos + length > state.bufferSize) + { + return ParseFloatSlow(ref buffer, ref state); + } + // ReadUnaligned uses processor architecture for endianness. + float result = Unsafe.ReadUnaligned(ref MemoryMarshal.GetReference(buffer.Slice(state.bufferPos, length))); + state.bufferPos += length; + return result; + } + + private static unsafe float ParseFloatSlow(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + const int length = sizeof(float); + byte* stackBuffer = stackalloc byte[length]; + Span tempSpan = new Span(stackBuffer, length); + for (int i = 0; i < length; i++) + { + tempSpan[i] = ReadRawByte(ref buffer, ref state); + } + + // Content is little endian. Reverse if needed to match endianness of architecture. + if (!BitConverter.IsLittleEndian) + { + tempSpan.Reverse(); + } + return Unsafe.ReadUnaligned(ref MemoryMarshal.GetReference(tempSpan)); + } + + /// + /// Reads a fixed size of bytes from the input. + /// + /// + /// the end of the stream or the current limit was reached + /// + public static byte[] ReadRawBytes(ref ReadOnlySpan buffer, ref ParserInternalState state, int size) + { + if (size < 0) + { + throw InvalidProtocolBufferException.NegativeSize(); + } + + if (size <= state.bufferSize - state.bufferPos) + { + // We have all the bytes we need already. + byte[] bytes = new byte[size]; + buffer.Slice(state.bufferPos, size).CopyTo(bytes); + state.bufferPos += size; + return bytes; + } + + return ReadRawBytesSlow(ref buffer, ref state, size); + } + + private static byte[] ReadRawBytesSlow(ref ReadOnlySpan buffer, ref ParserInternalState state, int size) + { + ValidateCurrentLimit(ref buffer, ref state, size); + + if ((!state.segmentedBufferHelper.TotalLength.HasValue && size < buffer.Length) || + IsDataAvailableInSource(ref state, size)) + { + // Reading more bytes than are in the buffer, but not an excessive number + // of bytes. We can safely allocate the resulting array ahead of time. + + byte[] bytes = new byte[size]; + ReadRawBytesIntoSpan(ref buffer, ref state, size, bytes); + return bytes; + } + else + { + // The size is very large. For security reasons, we can't allocate the + // entire byte array yet. The size comes directly from the input, so a + // maliciously-crafted message could provide a bogus very large size in + // order to trick the app into allocating a lot of memory. We avoid this + // by allocating and reading only a small chunk at a time, so that the + // malicious message must actually *be* extremely large to cause + // problems. Meanwhile, we limit the allowed size of a message elsewhere. + + List chunks = new List(); + + int pos = state.bufferSize - state.bufferPos; + byte[] firstChunk = new byte[pos]; + buffer.Slice(state.bufferPos, pos).CopyTo(firstChunk); + chunks.Add(firstChunk); + state.bufferPos = state.bufferSize; + + // Read all the rest of the bytes we need. + int sizeLeft = size - pos; + while (sizeLeft > 0) + { + state.segmentedBufferHelper.RefillBuffer(ref buffer, ref state, true); + byte[] chunk = new byte[Math.Min(sizeLeft, state.bufferSize)]; + + buffer.Slice(0, chunk.Length) + .CopyTo(chunk); + state.bufferPos += chunk.Length; + sizeLeft -= chunk.Length; + chunks.Add(chunk); + } + + // OK, got everything. Now concatenate it all into one buffer. + byte[] bytes = new byte[size]; + int newPos = 0; + foreach (byte[] chunk in chunks) + { + Buffer.BlockCopy(chunk, 0, bytes, newPos, chunk.Length); + newPos += chunk.Length; + } + + // Done. + return bytes; + } + } + + /// + /// Reads and discards bytes. + /// + /// the end of the stream + /// or the current limit was reached + public static void SkipRawBytes(ref ReadOnlySpan buffer, ref ParserInternalState state, int size) + { + if (size < 0) + { + throw InvalidProtocolBufferException.NegativeSize(); + } + + ValidateCurrentLimit(ref buffer, ref state, size); + + if (size <= state.bufferSize - state.bufferPos) + { + // We have all the bytes we need already. + state.bufferPos += size; + } + else + { + // Skipping more bytes than are in the buffer. First skip what we have. + int pos = state.bufferSize - state.bufferPos; + state.bufferPos = state.bufferSize; + + // TODO: If our segmented buffer is backed by a Stream that is seekable, we could skip the bytes more efficiently + // by simply updating stream's Position property. This used to be supported in the past, but the support was dropped + // because it would make the segmentedBufferHelper more complex. Support can be reintroduced if needed. + state.segmentedBufferHelper.RefillBuffer(ref buffer, ref state, true); + + while (size - pos > state.bufferSize) + { + pos += state.bufferSize; + state.bufferPos = state.bufferSize; + state.segmentedBufferHelper.RefillBuffer(ref buffer, ref state, true); + } + + state.bufferPos = size - pos; + } + } + + /// + /// Reads a string field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string ReadString(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + int length = ParsingPrimitives.ParseLength(ref buffer, ref state); + return ParsingPrimitives.ReadRawString(ref buffer, ref state, length); + } + + /// + /// Reads a bytes field value from the input. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ByteString ReadBytes(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + int length = ParsingPrimitives.ParseLength(ref buffer, ref state); + return ByteString.AttachBytes(ParsingPrimitives.ReadRawBytes(ref buffer, ref state, length)); + } + + /// + /// Reads a UTF-8 string from the next "length" bytes. + /// + /// + /// the end of the stream or the current limit was reached + /// + [SecuritySafeCritical] + public static string ReadRawString(ref ReadOnlySpan buffer, ref ParserInternalState state, int length) + { + // No need to read any data for an empty string. + if (length == 0) + { + return string.Empty; + } + + if (length < 0) + { + throw InvalidProtocolBufferException.NegativeSize(); + } + +#if GOOGLE_PROTOBUF_SUPPORT_FAST_STRING + if (length <= state.bufferSize - state.bufferPos) + { + // Fast path: all bytes to decode appear in the same span. + ReadOnlySpan data = buffer.Slice(state.bufferPos, length); + + string value; + unsafe + { + fixed (byte* sourceBytes = &MemoryMarshal.GetReference(data)) + { + value = WritingPrimitives.Utf8Encoding.GetString(sourceBytes, length); + } + } + + state.bufferPos += length; + return value; + } +#endif + + return ReadStringSlow(ref buffer, ref state, length); + } + + /// + /// Reads a string assuming that it is spread across multiple spans in a . + /// + private static string ReadStringSlow(ref ReadOnlySpan buffer, ref ParserInternalState state, int length) + { + ValidateCurrentLimit(ref buffer, ref state, length); + +#if GOOGLE_PROTOBUF_SUPPORT_FAST_STRING + if (IsDataAvailable(ref state, length)) + { + // Read string data into a temporary buffer, either stackalloc'ed or from ArrayPool + // Once all data is read then call Encoding.GetString on buffer and return to pool if needed. + + byte[] byteArray = null; + Span byteSpan = length <= StackallocThreshold ? + stackalloc byte[length] : + (byteArray = ArrayPool.Shared.Rent(length)); + + try + { + unsafe + { + fixed (byte* pByteSpan = &MemoryMarshal.GetReference(byteSpan)) + { + // Compiler doesn't like that a potentially stackalloc'd Span is being used + // in a method with a "ref Span buffer" argument. If the stackalloc'd span was assigned + // to the ref argument then bad things would happen. We'll never do that so it is ok. + // Make compiler happy by passing a new span created from pointer. + var tempSpan = new Span(pByteSpan, byteSpan.Length); + ReadRawBytesIntoSpan(ref buffer, ref state, length, tempSpan); + + return WritingPrimitives.Utf8Encoding.GetString(pByteSpan, length); + } + } + } + finally + { + if (byteArray != null) + { + ArrayPool.Shared.Return(byteArray); + } + } + } +#endif + + // Slow path: Build a byte array first then copy it. + // This will be called when reading from a Stream because we don't know the length of the stream, + // or there is not enough data in the sequence. If there is not enough data then ReadRawBytes will + // throw an exception. + return WritingPrimitives.Utf8Encoding.GetString(ReadRawBytes(ref buffer, ref state, length), 0, length); + } + + /// + /// Validates that the specified size doesn't exceed the current limit. If it does then remaining bytes + /// are skipped and an error is thrown. + /// + private static void ValidateCurrentLimit(ref ReadOnlySpan buffer, ref ParserInternalState state, int size) + { + if (state.totalBytesRetired + state.bufferPos + size > state.currentLimit) + { + // Read to the end of the stream (up to the current limit) anyway. + SkipRawBytes(ref buffer, ref state, state.currentLimit - state.totalBytesRetired - state.bufferPos); + // Then fail. + throw InvalidProtocolBufferException.TruncatedMessage(); + } + } + + [SecuritySafeCritical] + private static byte ReadRawByte(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + if (state.bufferPos == state.bufferSize) + { + state.segmentedBufferHelper.RefillBuffer(ref buffer, ref state, true); + } + return buffer[state.bufferPos++]; + } + + /// + /// Reads a varint from the input one byte at a time, so that it does not + /// read any bytes after the end of the varint. If you simply wrapped the + /// stream in a CodedInputStream and used ReadRawVarint32(Stream) + /// then you would probably end up reading past the end of the varint since + /// CodedInputStream buffers its input. + /// + /// + /// + public static uint ReadRawVarint32(Stream input) + { + int result = 0; + int offset = 0; + for (; offset < 32; offset += 7) + { + int b = input.ReadByte(); + if (b == -1) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + result |= (b & 0x7f) << offset; + if ((b & 0x80) == 0) + { + return (uint) result; + } + } + // Keep reading up to 64 bits. + for (; offset < 64; offset += 7) + { + int b = input.ReadByte(); + if (b == -1) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + if ((b & 0x80) == 0) + { + return (uint) result; + } + } + throw InvalidProtocolBufferException.MalformedVarint(); + } + + /// + /// Decode a 32-bit value with ZigZag encoding. + /// + /// + /// ZigZag encodes signed integers into values that can be efficiently + /// encoded with varint. (Otherwise, negative values must be + /// sign-extended to 32 bits to be varint encoded, thus always taking + /// 5 bytes on the wire.) + /// + public static int DecodeZigZag32(uint n) + { + return (int)(n >> 1) ^ -(int)(n & 1); + } + + /// + /// Decode a 64-bit value with ZigZag encoding. + /// + /// + /// ZigZag encodes signed integers into values that can be efficiently + /// encoded with varint. (Otherwise, negative values must be + /// sign-extended to 64 bits to be varint encoded, thus always taking + /// 10 bytes on the wire.) + /// + public static long DecodeZigZag64(ulong n) + { + return (long)(n >> 1) ^ -(long)(n & 1); + } + + /// + /// Checks whether there is known data available of the specified size remaining to parse. + /// When parsing from a Stream this can return false because we have no knowledge of the amount + /// of data remaining in the stream until it is read. + /// + public static bool IsDataAvailable(ref ParserInternalState state, int size) + { + // Data fits in remaining buffer + if (size <= state.bufferSize - state.bufferPos) + { + return true; + } + + return IsDataAvailableInSource(ref state, size); + } + + /// + /// Checks whether there is known data available of the specified size remaining to parse + /// in the underlying data source. + /// When parsing from a Stream this will return false because we have no knowledge of the amount + /// of data remaining in the stream until it is read. + /// + private static bool IsDataAvailableInSource(ref ParserInternalState state, int size) + { + // Data fits in remaining source data. + // Note that this will never be true when reading from a stream as the total length is unknown. + return size <= state.segmentedBufferHelper.TotalLength - state.totalBytesRetired - state.bufferPos; + } + + /// + /// Read raw bytes of the specified length into a span. The amount of data available and the current limit should + /// be checked before calling this method. + /// + private static void ReadRawBytesIntoSpan(ref ReadOnlySpan buffer, ref ParserInternalState state, int length, Span byteSpan) + { + int remainingByteLength = length; + while (remainingByteLength > 0) + { + if (state.bufferSize - state.bufferPos == 0) + { + state.segmentedBufferHelper.RefillBuffer(ref buffer, ref state, true); + } + + ReadOnlySpan unreadSpan = buffer.Slice(state.bufferPos, Math.Min(remainingByteLength, state.bufferSize - state.bufferPos)); + unreadSpan.CopyTo(byteSpan.Slice(length - remainingByteLength)); + + remainingByteLength -= unreadSpan.Length; + state.bufferPos += unreadSpan.Length; + } + } + } +} diff --git a/csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs b/csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs new file mode 100644 index 0000000000..eabaf96d5c --- /dev/null +++ b/csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs @@ -0,0 +1,292 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Buffers; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Security; +using Google.Protobuf.Collections; + +namespace Google.Protobuf +{ + /// + /// Reading and skipping messages / groups + /// + [SecuritySafeCritical] + internal static class ParsingPrimitivesMessages + { + private static readonly byte[] ZeroLengthMessageStreamData = new byte[] { 0 }; + + public static void SkipLastField(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + if (state.lastTag == 0) + { + throw new InvalidOperationException("SkipLastField cannot be called at the end of a stream"); + } + switch (WireFormat.GetTagWireType(state.lastTag)) + { + case WireFormat.WireType.StartGroup: + SkipGroup(ref buffer, ref state, state.lastTag); + break; + case WireFormat.WireType.EndGroup: + throw new InvalidProtocolBufferException( + "SkipLastField called on an end-group tag, indicating that the corresponding start-group was missing"); + case WireFormat.WireType.Fixed32: + ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state); + break; + case WireFormat.WireType.Fixed64: + ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state); + break; + case WireFormat.WireType.LengthDelimited: + var length = ParsingPrimitives.ParseLength(ref buffer, ref state); + ParsingPrimitives.SkipRawBytes(ref buffer, ref state, length); + break; + case WireFormat.WireType.Varint: + ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + break; + } + } + + /// + /// Skip a group. + /// + public static void SkipGroup(ref ReadOnlySpan buffer, ref ParserInternalState state, uint startGroupTag) + { + // Note: Currently we expect this to be the way that groups are read. We could put the recursion + // depth changes into the ReadTag method instead, potentially... + state.recursionDepth++; + if (state.recursionDepth >= state.recursionLimit) + { + throw InvalidProtocolBufferException.RecursionLimitExceeded(); + } + uint tag; + while (true) + { + tag = ParsingPrimitives.ParseTag(ref buffer, ref state); + if (tag == 0) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + // Can't call SkipLastField for this case- that would throw. + if (WireFormat.GetTagWireType(tag) == WireFormat.WireType.EndGroup) + { + break; + } + // This recursion will allow us to handle nested groups. + SkipLastField(ref buffer, ref state); + } + int startField = WireFormat.GetTagFieldNumber(startGroupTag); + int endField = WireFormat.GetTagFieldNumber(tag); + if (startField != endField) + { + throw new InvalidProtocolBufferException( + $"Mismatched end-group tag. Started with field {startField}; ended with field {endField}"); + } + state.recursionDepth--; + } + + public static void ReadMessage(ref ParseContext ctx, IMessage message) + { + int length = ParsingPrimitives.ParseLength(ref ctx.buffer, ref ctx.state); + if (ctx.state.recursionDepth >= ctx.state.recursionLimit) + { + throw InvalidProtocolBufferException.RecursionLimitExceeded(); + } + int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, length); + ++ctx.state.recursionDepth; + + ReadRawMessage(ref ctx, message); + + CheckReadEndOfStreamTag(ref ctx.state); + // Check that we've read exactly as much data as expected. + if (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + --ctx.state.recursionDepth; + SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit); + } + + public static KeyValuePair ReadMapEntry(ref ParseContext ctx, MapField.Codec codec) + { + int length = ParsingPrimitives.ParseLength(ref ctx.buffer, ref ctx.state); + if (ctx.state.recursionDepth >= ctx.state.recursionLimit) + { + throw InvalidProtocolBufferException.RecursionLimitExceeded(); + } + int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, length); + ++ctx.state.recursionDepth; + + TKey key = codec.KeyCodec.DefaultValue; + TValue value = codec.ValueCodec.DefaultValue; + + uint tag; + while ((tag = ctx.ReadTag()) != 0) + { + if (tag == codec.KeyCodec.Tag) + { + key = codec.KeyCodec.Read(ref ctx); + } + else if (tag == codec.ValueCodec.Tag) + { + value = codec.ValueCodec.Read(ref ctx); + } + else + { + SkipLastField(ref ctx.buffer, ref ctx.state); + } + } + + // Corner case: a map entry with a key but no value, where the value type is a message. + // Read it as if we'd seen input with no data (i.e. create a "default" message). + if (value == null) + { + if (ctx.state.CodedInputStream != null) + { + // the decoded message might not support parsing from ParseContext, so + // we need to allow fallback to the legacy MergeFrom(CodedInputStream) parsing. + value = codec.ValueCodec.Read(new CodedInputStream(ZeroLengthMessageStreamData)); + } + else + { + ParseContext.Initialize(new ReadOnlySequence(ZeroLengthMessageStreamData), out ParseContext zeroLengthCtx); + value = codec.ValueCodec.Read(ref zeroLengthCtx); + } + } + + CheckReadEndOfStreamTag(ref ctx.state); + // Check that we've read exactly as much data as expected. + if (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state)) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + --ctx.state.recursionDepth; + SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit); + + return new KeyValuePair(key, value); + } + + public static void ReadGroup(ref ParseContext ctx, IMessage message) + { + if (ctx.state.recursionDepth >= ctx.state.recursionLimit) + { + throw InvalidProtocolBufferException.RecursionLimitExceeded(); + } + ++ctx.state.recursionDepth; + + uint tag = ctx.state.lastTag; + int fieldNumber = WireFormat.GetTagFieldNumber(tag); + ReadRawMessage(ref ctx, message); + CheckLastTagWas(ref ctx.state, WireFormat.MakeTag(fieldNumber, WireFormat.WireType.EndGroup)); + + --ctx.state.recursionDepth; + } + + public static void ReadGroup(ref ParseContext ctx, int fieldNumber, UnknownFieldSet set) + { + if (ctx.state.recursionDepth >= ctx.state.recursionLimit) + { + throw InvalidProtocolBufferException.RecursionLimitExceeded(); + } + ++ctx.state.recursionDepth; + + set.MergeGroupFrom(ref ctx); + CheckLastTagWas(ref ctx.state, WireFormat.MakeTag(fieldNumber, WireFormat.WireType.EndGroup)); + + --ctx.state.recursionDepth; + } + + public static void ReadRawMessage(ref ParseContext ctx, IMessage message) + { + if (message is IBufferMessage bufferMessage) + { + bufferMessage.InternalMergeFrom(ref ctx); + } + else + { + // If we reached here, it means we've ran into a nested message with older generated code + // which doesn't provide the InternalMergeFrom method that takes a ParseContext. + // With a slight performance overhead, we can still parse this message just fine, + // but we need to find the original CodedInputStream instance that initiated this + // parsing process and make sure its internal state is up to date. + // Note that this performance overhead is not very high (basically copying contents of a struct) + // and it will only be incurred in case the application mixes older and newer generated code. + // Regenerating the code from .proto files will remove this overhead because it will + // generate the InternalMergeFrom method we need. + + if (ctx.state.CodedInputStream == null) + { + // This can only happen when the parsing started without providing a CodedInputStream instance + // (e.g. ParseContext was created directly from a ReadOnlySequence). + // That also means that one of the new parsing APIs was used at the top level + // and in such case it is reasonable to require that all the nested message provide + // up-to-date generated code with ParseContext support (and fail otherwise). + throw new InvalidProtocolBufferException($"Message {message.GetType().Name} doesn't provide the generated method that enables ParseContext-based parsing. You might need to regenerate the generated protobuf code."); + } + + ctx.CopyStateTo(ctx.state.CodedInputStream); + try + { + // fallback parse using the CodedInputStream that started current parsing tree + message.MergeFrom(ctx.state.CodedInputStream); + } + finally + { + ctx.LoadStateFrom(ctx.state.CodedInputStream); + } + } + } + + /// + /// Verifies that the last call to ReadTag() returned tag 0 - in other words, + /// we've reached the end of the stream when we expected to. + /// + /// The + /// tag read was not the one specified + public static void CheckReadEndOfStreamTag(ref ParserInternalState state) + { + if (state.lastTag != 0) + { + throw InvalidProtocolBufferException.MoreDataAvailable(); + } + } + + private static void CheckLastTagWas(ref ParserInternalState state, uint expectedTag) + { + if (state.lastTag != expectedTag) { + throw InvalidProtocolBufferException.InvalidEndTag(); + } + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs b/csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs new file mode 100644 index 0000000000..629ec32bd8 --- /dev/null +++ b/csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs @@ -0,0 +1,355 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Buffers; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; +using Google.Protobuf.Collections; + +namespace Google.Protobuf +{ + /// + /// Fast parsing primitives for wrapper types + /// + [SecuritySafeCritical] + internal static class ParsingPrimitivesWrappers + { + internal static float? ReadFloatWrapperLittleEndian(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + // length:1 + tag:1 + value:4 = 6 bytes + if (state.bufferPos + 6 <= state.bufferSize) + { + // The entire wrapper message is already contained in `buffer`. + int length = buffer[state.bufferPos]; + if (length == 0) + { + state.bufferPos++; + return 0F; + } + // tag:1 + value:4 = length of 5 bytes + // field=1, type=32-bit = tag of 13 + if (length != 5 || buffer[state.bufferPos + 1] != 13) + { + return ReadFloatWrapperSlow(ref buffer, ref state); + } + state.bufferPos += 2; + return ParsingPrimitives.ParseFloat(ref buffer, ref state); + } + else + { + return ReadFloatWrapperSlow(ref buffer, ref state); + } + } + + internal static float? ReadFloatWrapperSlow(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + int length = ParsingPrimitives.ParseLength(ref buffer, ref state); + if (length == 0) + { + return 0F; + } + int finalBufferPos = state.totalBytesRetired + state.bufferPos + length; + float result = 0F; + do + { + // field=1, type=32-bit = tag of 13 + if (ParsingPrimitives.ParseTag(ref buffer, ref state) == 13) + { + result = ParsingPrimitives.ParseFloat(ref buffer, ref state); + } + else + { + ParsingPrimitivesMessages.SkipLastField(ref buffer, ref state); + } + } + while (state.totalBytesRetired + state.bufferPos < finalBufferPos); + return result; + } + + internal static double? ReadDoubleWrapperLittleEndian(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + // length:1 + tag:1 + value:8 = 10 bytes + if (state.bufferPos + 10 <= state.bufferSize) + { + // The entire wrapper message is already contained in `buffer`. + int length = buffer[state.bufferPos]; + if (length == 0) + { + state.bufferPos++; + return 0D; + } + // tag:1 + value:8 = length of 9 bytes + // field=1, type=64-bit = tag of 9 + if (length != 9 || buffer[state.bufferPos + 1] != 9) + { + return ReadDoubleWrapperSlow(ref buffer, ref state); + } + state.bufferPos += 2; + return ParsingPrimitives.ParseDouble(ref buffer, ref state); + } + else + { + return ReadDoubleWrapperSlow(ref buffer, ref state); + } + } + + internal static double? ReadDoubleWrapperSlow(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + int length = ParsingPrimitives.ParseLength(ref buffer, ref state); + if (length == 0) + { + return 0D; + } + int finalBufferPos = state.totalBytesRetired + state.bufferPos + length; + double result = 0D; + do + { + // field=1, type=64-bit = tag of 9 + if (ParsingPrimitives.ParseTag(ref buffer, ref state) == 9) + { + result = ParsingPrimitives.ParseDouble(ref buffer, ref state); + } + else + { + ParsingPrimitivesMessages.SkipLastField(ref buffer, ref state); + } + } + while (state.totalBytesRetired + state.bufferPos < finalBufferPos); + return result; + } + + internal static bool? ReadBoolWrapper(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + return ReadUInt64Wrapper(ref buffer, ref state) != 0; + } + + internal static uint? ReadUInt32Wrapper(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + // field=1, type=varint = tag of 8 + const int expectedTag = 8; + // length:1 + tag:1 + value:10(varint64-max) = 12 bytes + // Value can be 64 bits for negative integers + if (state.bufferPos + 12 <= state.bufferSize) + { + // The entire wrapper message is already contained in `buffer`. + int pos0 = state.bufferPos; + int length = buffer[state.bufferPos++]; + if (length == 0) + { + return 0; + } + // Length will always fit in a single byte. + if (length >= 128) + { + state.bufferPos = pos0; + return ReadUInt32WrapperSlow(ref buffer, ref state); + } + int finalBufferPos = state.bufferPos + length; + if (buffer[state.bufferPos++] != expectedTag) + { + state.bufferPos = pos0; + return ReadUInt32WrapperSlow(ref buffer, ref state); + } + var result = ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + // Verify this message only contained a single field. + if (state.bufferPos != finalBufferPos) + { + state.bufferPos = pos0; + return ReadUInt32WrapperSlow(ref buffer, ref state); + } + return result; + } + else + { + return ReadUInt32WrapperSlow(ref buffer, ref state); + } + } + + internal static uint? ReadUInt32WrapperSlow(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + int length = ParsingPrimitives.ParseLength(ref buffer, ref state); + if (length == 0) + { + return 0; + } + int finalBufferPos = state.totalBytesRetired + state.bufferPos + length; + uint result = 0; + do + { + // field=1, type=varint = tag of 8 + if (ParsingPrimitives.ParseTag(ref buffer, ref state) == 8) + { + result = ParsingPrimitives.ParseRawVarint32(ref buffer, ref state); + } + else + { + ParsingPrimitivesMessages.SkipLastField(ref buffer, ref state); + } + } + while (state.totalBytesRetired + state.bufferPos < finalBufferPos); + return result; + } + + internal static int? ReadInt32Wrapper(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + return (int?)ReadUInt32Wrapper(ref buffer, ref state); + } + + internal static ulong? ReadUInt64Wrapper(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + // field=1, type=varint = tag of 8 + const int expectedTag = 8; + // length:1 + tag:1 + value:10(varint64-max) = 12 bytes + if (state.bufferPos + 12 <= state.bufferSize) + { + // The entire wrapper message is already contained in `buffer`. + int pos0 = state.bufferPos; + int length = buffer[state.bufferPos++]; + if (length == 0) + { + return 0L; + } + // Length will always fit in a single byte. + if (length >= 128) + { + state.bufferPos = pos0; + return ReadUInt64WrapperSlow(ref buffer, ref state); + } + int finalBufferPos = state.bufferPos + length; + if (buffer[state.bufferPos++] != expectedTag) + { + state.bufferPos = pos0; + return ReadUInt64WrapperSlow(ref buffer, ref state); + } + var result = ParsingPrimitives.ParseRawVarint64(ref buffer, ref state); + // Verify this message only contained a single field. + if (state.bufferPos != finalBufferPos) + { + state.bufferPos = pos0; + return ReadUInt64WrapperSlow(ref buffer, ref state); + } + return result; + } + else + { + return ReadUInt64WrapperSlow(ref buffer, ref state); + } + } + + internal static ulong? ReadUInt64WrapperSlow(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + // field=1, type=varint = tag of 8 + const int expectedTag = 8; + int length = ParsingPrimitives.ParseLength(ref buffer, ref state); + if (length == 0) + { + return 0L; + } + int finalBufferPos = state.totalBytesRetired + state.bufferPos + length; + ulong result = 0L; + do + { + if (ParsingPrimitives.ParseTag(ref buffer, ref state) == expectedTag) + { + result = ParsingPrimitives.ParseRawVarint64(ref buffer, ref state); + } + else + { + ParsingPrimitivesMessages.SkipLastField(ref buffer, ref state); + } + } + while (state.totalBytesRetired + state.bufferPos < finalBufferPos); + return result; + } + + internal static long? ReadInt64Wrapper(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + return (long?)ReadUInt64Wrapper(ref buffer, ref state); + } + + internal static float? ReadFloatWrapperLittleEndian(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadFloatWrapperLittleEndian(ref ctx.buffer, ref ctx.state); + } + + internal static float? ReadFloatWrapperSlow(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadFloatWrapperSlow(ref ctx.buffer, ref ctx.state); + } + + internal static double? ReadDoubleWrapperLittleEndian(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadDoubleWrapperLittleEndian(ref ctx.buffer, ref ctx.state); + } + + internal static double? ReadDoubleWrapperSlow(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadDoubleWrapperSlow(ref ctx.buffer, ref ctx.state); + } + + internal static bool? ReadBoolWrapper(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadBoolWrapper(ref ctx.buffer, ref ctx.state); + } + + internal static uint? ReadUInt32Wrapper(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadUInt32Wrapper(ref ctx.buffer, ref ctx.state); + } + + internal static int? ReadInt32Wrapper(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadInt32Wrapper(ref ctx.buffer, ref ctx.state); + } + + internal static ulong? ReadUInt64Wrapper(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadUInt64Wrapper(ref ctx.buffer, ref ctx.state); + } + + internal static ulong? ReadUInt64WrapperSlow(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadUInt64WrapperSlow(ref ctx.buffer, ref ctx.state); + } + + internal static long? ReadInt64Wrapper(ref ParseContext ctx) + { + return ParsingPrimitivesWrappers.ReadInt64Wrapper(ref ctx.buffer, ref ctx.state); + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs b/csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs index 9b179bd7cd..130bcf0004 100644 --- a/csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs +++ b/csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs @@ -47,3 +47,10 @@ using System.Security; "981207041fd5b2da3b498346fcfcd94910d52f25537c4a43ce3fbe17dc7d43e6cbdb4d8f1242dc" + "b6bd9b5906be74da8daa7d7280f97130f318a16c07baf118839b156299a48522f9fae2371c9665" + "c5ae9cb6")] + +[assembly: InternalsVisibleTo("Google.Protobuf.Benchmarks, PublicKey=" + + "002400000480000094000000060200000024000052534131000400000100010025800fbcfc63a1" + + "7c66b303aae80b03a6beaa176bb6bef883be436f2a1579edd80ce23edf151a1f4ced97af83abcd" + + "981207041fd5b2da3b498346fcfcd94910d52f25537c4a43ce3fbe17dc7d43e6cbdb4d8f1242dc" + + "b6bd9b5906be74da8daa7d7280f97130f318a16c07baf118839b156299a48522f9fae2371c9665" + + "c5ae9cb6")] diff --git a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs index c9ba6328b9..5cae6ac9b2 100644 --- a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs @@ -107,57 +107,57 @@ namespace Google.Protobuf.Reflection { "eV9wYWNrYWdlGC0gASgJEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMo", "CzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uIjoKDE9w", "dGltaXplTW9kZRIJCgVTUEVFRBABEg0KCUNPREVfU0laRRACEhAKDExJVEVf", - "UlVOVElNRRADKgkI6AcQgICAgAJKBAgmECci8gEKDk1lc3NhZ2VPcHRpb25z", + "UlVOVElNRRADKgkI6AcQgICAgAJKBAgmECcihAIKDk1lc3NhZ2VPcHRpb25z", "EiYKF21lc3NhZ2Vfc2V0X3dpcmVfZm9ybWF0GAEgASgIOgVmYWxzZRIuCh9u", "b19zdGFuZGFyZF9kZXNjcmlwdG9yX2FjY2Vzc29yGAIgASgIOgVmYWxzZRIZ", "CgpkZXByZWNhdGVkGAMgASgIOgVmYWxzZRIRCgltYXBfZW50cnkYByABKAgS", "QwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3Rv", - "YnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAkoECAgQCUoECAkQ", - "CiKeAwoMRmllbGRPcHRpb25zEjoKBWN0eXBlGAEgASgOMiMuZ29vZ2xlLnBy", - "b3RvYnVmLkZpZWxkT3B0aW9ucy5DVHlwZToGU1RSSU5HEg4KBnBhY2tlZBgC", - "IAEoCBI/CgZqc3R5cGUYBiABKA4yJC5nb29nbGUucHJvdG9idWYuRmllbGRP", - "cHRpb25zLkpTVHlwZToJSlNfTk9STUFMEhMKBGxhenkYBSABKAg6BWZhbHNl", - "EhkKCmRlcHJlY2F0ZWQYAyABKAg6BWZhbHNlEhMKBHdlYWsYCiABKAg6BWZh", - "bHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5w", - "cm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uIi8KBUNUeXBlEgoKBlNUUklO", - "RxAAEggKBENPUkQQARIQCgxTVFJJTkdfUElFQ0UQAiI1CgZKU1R5cGUSDQoJ", - "SlNfTk9STUFMEAASDQoJSlNfU1RSSU5HEAESDQoJSlNfTlVNQkVSEAIqCQjo", - "BxCAgICAAkoECAQQBSJeCgxPbmVvZk9wdGlvbnMSQwoUdW5pbnRlcnByZXRl", - "ZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0", - "ZWRPcHRpb24qCQjoBxCAgICAAiKTAQoLRW51bU9wdGlvbnMSEwoLYWxsb3df", - "YWxpYXMYAiABKAgSGQoKZGVwcmVjYXRlZBgDIAEoCDoFZmFsc2USQwoUdW5p", - "bnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVu", - "aW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAkoECAUQBiJ9ChBFbnVtVmFs", - "dWVPcHRpb25zEhkKCmRlcHJlY2F0ZWQYASABKAg6BWZhbHNlEkMKFHVuaW50", - "ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5Vbmlu", - "dGVycHJldGVkT3B0aW9uKgkI6AcQgICAgAIiewoOU2VydmljZU9wdGlvbnMS", - "GQoKZGVwcmVjYXRlZBghIAEoCDoFZmFsc2USQwoUdW5pbnRlcnByZXRlZF9v", - "cHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRP", - "cHRpb24qCQjoBxCAgICAAiKtAgoNTWV0aG9kT3B0aW9ucxIZCgpkZXByZWNh", - "dGVkGCEgASgIOgVmYWxzZRJfChFpZGVtcG90ZW5jeV9sZXZlbBgiIAEoDjIv", - "Lmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zLklkZW1wb3RlbmN5TGV2", - "ZWw6E0lERU1QT1RFTkNZX1VOS05PV04SQwoUdW5pbnRlcnByZXRlZF9vcHRp", - "b24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRp", - "b24iUAoQSWRlbXBvdGVuY3lMZXZlbBIXChNJREVNUE9URU5DWV9VTktOT1dO", - "EAASEwoPTk9fU0lERV9FRkZFQ1RTEAESDgoKSURFTVBPVEVOVBACKgkI6AcQ", - "gICAgAIingIKE1VuaW50ZXJwcmV0ZWRPcHRpb24SOwoEbmFtZRgCIAMoCzIt", - "Lmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uLk5hbWVQYXJ0", - "EhgKEGlkZW50aWZpZXJfdmFsdWUYAyABKAkSGgoScG9zaXRpdmVfaW50X3Zh", - "bHVlGAQgASgEEhoKEm5lZ2F0aXZlX2ludF92YWx1ZRgFIAEoAxIUCgxkb3Vi", - "bGVfdmFsdWUYBiABKAESFAoMc3RyaW5nX3ZhbHVlGAcgASgMEhcKD2FnZ3Jl", - "Z2F0ZV92YWx1ZRgIIAEoCRozCghOYW1lUGFydBIRCgluYW1lX3BhcnQYASAC", - "KAkSFAoMaXNfZXh0ZW5zaW9uGAIgAigIItUBCg5Tb3VyY2VDb2RlSW5mbxI6", - "Cghsb2NhdGlvbhgBIAMoCzIoLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb2Rl", - "SW5mby5Mb2NhdGlvbhqGAQoITG9jYXRpb24SEAoEcGF0aBgBIAMoBUICEAES", - "EAoEc3BhbhgCIAMoBUICEAESGAoQbGVhZGluZ19jb21tZW50cxgDIAEoCRIZ", - "ChF0cmFpbGluZ19jb21tZW50cxgEIAEoCRIhChlsZWFkaW5nX2RldGFjaGVk", - "X2NvbW1lbnRzGAYgAygJIqcBChFHZW5lcmF0ZWRDb2RlSW5mbxJBCgphbm5v", - "dGF0aW9uGAEgAygLMi0uZ29vZ2xlLnByb3RvYnVmLkdlbmVyYXRlZENvZGVJ", - "bmZvLkFubm90YXRpb24aTwoKQW5ub3RhdGlvbhIQCgRwYXRoGAEgAygFQgIQ", - "ARITCgtzb3VyY2VfZmlsZRgCIAEoCRINCgViZWdpbhgDIAEoBRILCgNlbmQY", - "BCABKAVCjwEKE2NvbS5nb29nbGUucHJvdG9idWZCEERlc2NyaXB0b3JQcm90", - "b3NIAVo+Z2l0aHViLmNvbS9nb2xhbmcvcHJvdG9idWYvcHJvdG9jLWdlbi1n", - "by9kZXNjcmlwdG9yO2Rlc2NyaXB0b3L4AQGiAgNHUEKqAhpHb29nbGUuUHJv", + "YnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAkoECAQQBUoECAUQ", + "BkoECAYQB0oECAgQCUoECAkQCiKeAwoMRmllbGRPcHRpb25zEjoKBWN0eXBl", + "GAEgASgOMiMuZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucy5DVHlwZToG", + "U1RSSU5HEg4KBnBhY2tlZBgCIAEoCBI/CgZqc3R5cGUYBiABKA4yJC5nb29n", + "bGUucHJvdG9idWYuRmllbGRPcHRpb25zLkpTVHlwZToJSlNfTk9STUFMEhMK", + "BGxhenkYBSABKAg6BWZhbHNlEhkKCmRlcHJlY2F0ZWQYAyABKAg6BWZhbHNl", + "EhMKBHdlYWsYCiABKAg6BWZhbHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9u", + "GOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9u", + "Ii8KBUNUeXBlEgoKBlNUUklORxAAEggKBENPUkQQARIQCgxTVFJJTkdfUElF", + "Q0UQAiI1CgZKU1R5cGUSDQoJSlNfTk9STUFMEAASDQoJSlNfU1RSSU5HEAES", + "DQoJSlNfTlVNQkVSEAIqCQjoBxCAgICAAkoECAQQBSJeCgxPbmVvZk9wdGlv", + "bnMSQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnBy", + "b3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiKTAQoLRW51", + "bU9wdGlvbnMSEwoLYWxsb3dfYWxpYXMYAiABKAgSGQoKZGVwcmVjYXRlZBgD", + "IAEoCDoFZmFsc2USQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQu", + "Z29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICA", + "AkoECAUQBiJ9ChBFbnVtVmFsdWVPcHRpb25zEhkKCmRlcHJlY2F0ZWQYASAB", + "KAg6BWZhbHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdv", + "b2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uKgkI6AcQgICAgAIi", + "ewoOU2VydmljZU9wdGlvbnMSGQoKZGVwcmVjYXRlZBghIAEoCDoFZmFsc2US", + "QwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3Rv", + "YnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiKtAgoNTWV0aG9k", + "T3B0aW9ucxIZCgpkZXByZWNhdGVkGCEgASgIOgVmYWxzZRJfChFpZGVtcG90", + "ZW5jeV9sZXZlbBgiIAEoDjIvLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRp", + "b25zLklkZW1wb3RlbmN5TGV2ZWw6E0lERU1QT1RFTkNZX1VOS05PV04SQwoU", + "dW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVm", + "LlVuaW50ZXJwcmV0ZWRPcHRpb24iUAoQSWRlbXBvdGVuY3lMZXZlbBIXChNJ", + "REVNUE9URU5DWV9VTktOT1dOEAASEwoPTk9fU0lERV9FRkZFQ1RTEAESDgoK", + "SURFTVBPVEVOVBACKgkI6AcQgICAgAIingIKE1VuaW50ZXJwcmV0ZWRPcHRp", + "b24SOwoEbmFtZRgCIAMoCzItLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJl", + "dGVkT3B0aW9uLk5hbWVQYXJ0EhgKEGlkZW50aWZpZXJfdmFsdWUYAyABKAkS", + "GgoScG9zaXRpdmVfaW50X3ZhbHVlGAQgASgEEhoKEm5lZ2F0aXZlX2ludF92", + "YWx1ZRgFIAEoAxIUCgxkb3VibGVfdmFsdWUYBiABKAESFAoMc3RyaW5nX3Zh", + "bHVlGAcgASgMEhcKD2FnZ3JlZ2F0ZV92YWx1ZRgIIAEoCRozCghOYW1lUGFy", + "dBIRCgluYW1lX3BhcnQYASACKAkSFAoMaXNfZXh0ZW5zaW9uGAIgAigIItUB", + "Cg5Tb3VyY2VDb2RlSW5mbxI6Cghsb2NhdGlvbhgBIAMoCzIoLmdvb2dsZS5w", + "cm90b2J1Zi5Tb3VyY2VDb2RlSW5mby5Mb2NhdGlvbhqGAQoITG9jYXRpb24S", + "EAoEcGF0aBgBIAMoBUICEAESEAoEc3BhbhgCIAMoBUICEAESGAoQbGVhZGlu", + "Z19jb21tZW50cxgDIAEoCRIZChF0cmFpbGluZ19jb21tZW50cxgEIAEoCRIh", + "ChlsZWFkaW5nX2RldGFjaGVkX2NvbW1lbnRzGAYgAygJIqcBChFHZW5lcmF0", + "ZWRDb2RlSW5mbxJBCgphbm5vdGF0aW9uGAEgAygLMi0uZ29vZ2xlLnByb3Rv", + "YnVmLkdlbmVyYXRlZENvZGVJbmZvLkFubm90YXRpb24aTwoKQW5ub3RhdGlv", + "bhIQCgRwYXRoGAEgAygFQgIQARITCgtzb3VyY2VfZmlsZRgCIAEoCRINCgVi", + "ZWdpbhgDIAEoBRILCgNlbmQYBCABKAVCfgoTY29tLmdvb2dsZS5wcm90b2J1", + "ZkIQRGVzY3JpcHRvclByb3Rvc0gBWi1nb29nbGUuZ29sYW5nLm9yZy9wcm90", + "b2J1Zi90eXBlcy9kZXNjcmlwdG9ycGL4AQGiAgNHUEKqAhpHb29nbGUuUHJv", "dG9idWYuUmVmbGVjdGlvbg==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, @@ -194,23 +194,31 @@ namespace Google.Protobuf.Reflection { /// The protocol compiler can output a FileDescriptorSet containing the .proto /// files it parses. /// - public sealed partial class FileDescriptorSet : pb::IMessage { + public sealed partial class FileDescriptorSet : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorSet()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FileDescriptorSet() { OnConstruction(); } @@ -218,12 +226,14 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FileDescriptorSet(FileDescriptorSet other) : this() { file_ = other.file_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FileDescriptorSet Clone() { return new FileDescriptorSet(this); } @@ -234,16 +244,19 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.FileDescriptorProto.Parser); private readonly pbc::RepeatedField file_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField File { get { return file_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FileDescriptorSet); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FileDescriptorSet other) { if (ReferenceEquals(other, null)) { return false; @@ -256,6 +269,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= file_.GetHashCode(); @@ -266,19 +280,37 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else file_.WriteTo(output, _repeated_file_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + file_.WriteTo(ref output, _repeated_file_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += file_.CalculateSize(_repeated_file_codec); @@ -289,6 +321,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FileDescriptorSet other) { if (other == null) { return; @@ -298,7 +331,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -311,30 +348,58 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + file_.AddEntriesFrom(ref input, _repeated_file_codec); + break; + } + } + } } + #endif } /// /// Describes a complete .proto file. /// - public sealed partial class FileDescriptorProto : pb::IMessage { + public sealed partial class FileDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FileDescriptorProto() { OnConstruction(); } @@ -342,6 +407,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FileDescriptorProto(FileDescriptorProto other) : this() { name_ = other.name_; package_ = other.package_; @@ -352,13 +418,14 @@ namespace Google.Protobuf.Reflection { enumType_ = other.enumType_.Clone(); service_ = other.service_.Clone(); extension_ = other.extension_.Clone(); - options_ = other.HasOptions ? other.options_.Clone() : null; - sourceCodeInfo_ = other.HasSourceCodeInfo ? other.sourceCodeInfo_.Clone() : null; + options_ = other.options_ != null ? other.options_.Clone() : null; + sourceCodeInfo_ = other.sourceCodeInfo_ != null ? other.sourceCodeInfo_.Clone() : null; syntax_ = other.syntax_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FileDescriptorProto Clone() { return new FileDescriptorProto(this); } @@ -372,6 +439,7 @@ namespace Google.Protobuf.Reflection { /// file name, relative to root of source tree /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_ ?? NameDefaultValue; } set { @@ -380,11 +448,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasName { get { return name_ != null; } } /// Clears the value of the "name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearName() { name_ = null; } @@ -398,6 +468,7 @@ namespace Google.Protobuf.Reflection { /// e.g. "foo", "foo.bar", etc. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Package { get { return package_ ?? PackageDefaultValue; } set { @@ -406,11 +477,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "package" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPackage { get { return package_ != null; } } /// Clears the value of the "package" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPackage() { package_ = null; } @@ -424,6 +497,7 @@ namespace Google.Protobuf.Reflection { /// Names of files imported by this file. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Dependency { get { return dependency_; } } @@ -437,6 +511,7 @@ namespace Google.Protobuf.Reflection { /// Indexes of the public imported files in the dependency list above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField PublicDependency { get { return publicDependency_; } } @@ -451,6 +526,7 @@ namespace Google.Protobuf.Reflection { /// For Google-internal migration only. Do not use. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField WeakDependency { get { return weakDependency_; } } @@ -464,6 +540,7 @@ namespace Google.Protobuf.Reflection { /// All top-level definitions in this file. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField MessageType { get { return messageType_; } } @@ -474,6 +551,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField EnumType { get { return enumType_; } } @@ -484,6 +562,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.ServiceDescriptorProto.Parser); private readonly pbc::RepeatedField service_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Service { get { return service_; } } @@ -494,6 +573,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Extension { get { return extension_; } } @@ -502,22 +582,13 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FileOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.FileOptions Options { get { return options_; } set { options_ = value; } } - /// Gets whether the options field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptions { - get { return options_ != null; } - } - /// Clears the value of the options field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptions() { - options_ = null; - } /// Field number for the "source_code_info" field. public const int SourceCodeInfoFieldNumber = 9; @@ -529,22 +600,13 @@ namespace Google.Protobuf.Reflection { /// development tools. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.SourceCodeInfo SourceCodeInfo { get { return sourceCodeInfo_; } set { sourceCodeInfo_ = value; } } - /// Gets whether the source_code_info field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasSourceCodeInfo { - get { return sourceCodeInfo_ != null; } - } - /// Clears the value of the source_code_info field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearSourceCodeInfo() { - sourceCodeInfo_ = null; - } /// Field number for the "syntax" field. public const int SyntaxFieldNumber = 12; @@ -556,6 +618,7 @@ namespace Google.Protobuf.Reflection { /// The supported values are "proto2" and "proto3". /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Syntax { get { return syntax_ ?? SyntaxDefaultValue; } set { @@ -564,21 +627,25 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "syntax" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSyntax { get { return syntax_ != null; } } /// Clears the value of the "syntax" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSyntax() { syntax_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FileDescriptorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FileDescriptorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -602,6 +669,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasName) hash ^= Name.GetHashCode(); @@ -613,8 +681,8 @@ namespace Google.Protobuf.Reflection { hash ^= enumType_.GetHashCode(); hash ^= service_.GetHashCode(); hash ^= extension_.GetHashCode(); - if (HasOptions) hash ^= Options.GetHashCode(); - if (HasSourceCodeInfo) hash ^= SourceCodeInfo.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); + if (sourceCodeInfo_ != null) hash ^= SourceCodeInfo.GetHashCode(); if (HasSyntax) hash ^= Syntax.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -623,12 +691,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasName) { output.WriteRawTag(10); output.WriteString(Name); @@ -642,11 +715,11 @@ namespace Google.Protobuf.Reflection { enumType_.WriteTo(output, _repeated_enumType_codec); service_.WriteTo(output, _repeated_service_codec); extension_.WriteTo(output, _repeated_extension_codec); - if (HasOptions) { + if (options_ != null) { output.WriteRawTag(66); output.WriteMessage(Options); } - if (HasSourceCodeInfo) { + if (sourceCodeInfo_ != null) { output.WriteRawTag(74); output.WriteMessage(SourceCodeInfo); } @@ -659,9 +732,48 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (HasPackage) { + output.WriteRawTag(18); + output.WriteString(Package); + } + dependency_.WriteTo(ref output, _repeated_dependency_codec); + messageType_.WriteTo(ref output, _repeated_messageType_codec); + enumType_.WriteTo(ref output, _repeated_enumType_codec); + service_.WriteTo(ref output, _repeated_service_codec); + extension_.WriteTo(ref output, _repeated_extension_codec); + if (options_ != null) { + output.WriteRawTag(66); + output.WriteMessage(Options); + } + if (sourceCodeInfo_ != null) { + output.WriteRawTag(74); + output.WriteMessage(SourceCodeInfo); + } + publicDependency_.WriteTo(ref output, _repeated_publicDependency_codec); + weakDependency_.WriteTo(ref output, _repeated_weakDependency_codec); + if (HasSyntax) { + output.WriteRawTag(98); + output.WriteString(Syntax); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasName) { @@ -677,10 +789,10 @@ namespace Google.Protobuf.Reflection { size += enumType_.CalculateSize(_repeated_enumType_codec); size += service_.CalculateSize(_repeated_service_codec); size += extension_.CalculateSize(_repeated_extension_codec); - if (HasOptions) { + if (options_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } - if (HasSourceCodeInfo) { + if (sourceCodeInfo_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceCodeInfo); } if (HasSyntax) { @@ -693,6 +805,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FileDescriptorProto other) { if (other == null) { return; @@ -710,14 +823,14 @@ namespace Google.Protobuf.Reflection { enumType_.Add(other.enumType_); service_.Add(other.service_); extension_.Add(other.extension_); - if (other.HasOptions) { - if (!HasOptions) { + if (other.options_ != null) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.FileOptions(); } Options.MergeFrom(other.Options); } - if (other.HasSourceCodeInfo) { - if (!HasSourceCodeInfo) { + if (other.sourceCodeInfo_ != null) { + if (sourceCodeInfo_ == null) { SourceCodeInfo = new global::Google.Protobuf.Reflection.SourceCodeInfo(); } SourceCodeInfo.MergeFrom(other.SourceCodeInfo); @@ -729,7 +842,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -765,14 +882,14 @@ namespace Google.Protobuf.Reflection { break; } case 66: { - if (!HasOptions) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.FileOptions(); } input.ReadMessage(Options); break; } case 74: { - if (!HasSourceCodeInfo) { + if (sourceCodeInfo_ == null) { SourceCodeInfo = new global::Google.Protobuf.Reflection.SourceCodeInfo(); } input.ReadMessage(SourceCodeInfo); @@ -794,30 +911,110 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Package = input.ReadString(); + break; + } + case 26: { + dependency_.AddEntriesFrom(ref input, _repeated_dependency_codec); + break; + } + case 34: { + messageType_.AddEntriesFrom(ref input, _repeated_messageType_codec); + break; + } + case 42: { + enumType_.AddEntriesFrom(ref input, _repeated_enumType_codec); + break; + } + case 50: { + service_.AddEntriesFrom(ref input, _repeated_service_codec); + break; + } + case 58: { + extension_.AddEntriesFrom(ref input, _repeated_extension_codec); + break; + } + case 66: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.FileOptions(); + } + input.ReadMessage(Options); + break; + } + case 74: { + if (sourceCodeInfo_ == null) { + SourceCodeInfo = new global::Google.Protobuf.Reflection.SourceCodeInfo(); + } + input.ReadMessage(SourceCodeInfo); + break; + } + case 82: + case 80: { + publicDependency_.AddEntriesFrom(ref input, _repeated_publicDependency_codec); + break; + } + case 90: + case 88: { + weakDependency_.AddEntriesFrom(ref input, _repeated_weakDependency_codec); + break; + } + case 98: { + Syntax = input.ReadString(); + break; + } + } + } } + #endif } /// /// Describes a message type. /// - public sealed partial class DescriptorProto : pb::IMessage { + public sealed partial class DescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DescriptorProto() { OnConstruction(); } @@ -825,6 +1022,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DescriptorProto(DescriptorProto other) : this() { name_ = other.name_; field_ = other.field_.Clone(); @@ -833,13 +1031,14 @@ namespace Google.Protobuf.Reflection { enumType_ = other.enumType_.Clone(); extensionRange_ = other.extensionRange_.Clone(); oneofDecl_ = other.oneofDecl_.Clone(); - options_ = other.HasOptions ? other.options_.Clone() : null; + options_ = other.options_ != null ? other.options_.Clone() : null; reservedRange_ = other.reservedRange_.Clone(); reservedName_ = other.reservedName_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public DescriptorProto Clone() { return new DescriptorProto(this); } @@ -850,6 +1049,7 @@ namespace Google.Protobuf.Reflection { private string name_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_ ?? NameDefaultValue; } set { @@ -858,11 +1058,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasName { get { return name_ != null; } } /// Clears the value of the "name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearName() { name_ = null; } @@ -873,6 +1075,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField field_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Field { get { return field_; } } @@ -883,6 +1086,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Extension { get { return extension_; } } @@ -893,6 +1097,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.Reflection.DescriptorProto.Parser); private readonly pbc::RepeatedField nestedType_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField NestedType { get { return nestedType_; } } @@ -903,6 +1108,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField EnumType { get { return enumType_; } } @@ -913,6 +1119,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange.Parser); private readonly pbc::RepeatedField extensionRange_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ExtensionRange { get { return extensionRange_; } } @@ -923,6 +1130,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.Reflection.OneofDescriptorProto.Parser); private readonly pbc::RepeatedField oneofDecl_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField OneofDecl { get { return oneofDecl_; } } @@ -931,22 +1139,13 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 7; private global::Google.Protobuf.Reflection.MessageOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.MessageOptions Options { get { return options_; } set { options_ = value; } } - /// Gets whether the options field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptions { - get { return options_ != null; } - } - /// Clears the value of the options field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptions() { - options_ = null; - } /// Field number for the "reserved_range" field. public const int ReservedRangeFieldNumber = 9; @@ -954,6 +1153,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange.Parser); private readonly pbc::RepeatedField reservedRange_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ReservedRange { get { return reservedRange_; } } @@ -968,16 +1168,19 @@ namespace Google.Protobuf.Reflection { /// A given name may only be reserved once. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ReservedName { get { return reservedName_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as DescriptorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(DescriptorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -999,6 +1202,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasName) hash ^= Name.GetHashCode(); @@ -1008,7 +1212,7 @@ namespace Google.Protobuf.Reflection { hash ^= enumType_.GetHashCode(); hash ^= extensionRange_.GetHashCode(); hash ^= oneofDecl_.GetHashCode(); - if (HasOptions) hash ^= Options.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); hash ^= reservedRange_.GetHashCode(); hash ^= reservedName_.GetHashCode(); if (_unknownFields != null) { @@ -1018,12 +1222,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasName) { output.WriteRawTag(10); output.WriteString(Name); @@ -1033,7 +1242,7 @@ namespace Google.Protobuf.Reflection { enumType_.WriteTo(output, _repeated_enumType_codec); extensionRange_.WriteTo(output, _repeated_extensionRange_codec); extension_.WriteTo(output, _repeated_extension_codec); - if (HasOptions) { + if (options_ != null) { output.WriteRawTag(58); output.WriteMessage(Options); } @@ -1043,9 +1252,37 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + field_.WriteTo(ref output, _repeated_field_codec); + nestedType_.WriteTo(ref output, _repeated_nestedType_codec); + enumType_.WriteTo(ref output, _repeated_enumType_codec); + extensionRange_.WriteTo(ref output, _repeated_extensionRange_codec); + extension_.WriteTo(ref output, _repeated_extension_codec); + if (options_ != null) { + output.WriteRawTag(58); + output.WriteMessage(Options); + } + oneofDecl_.WriteTo(ref output, _repeated_oneofDecl_codec); + reservedRange_.WriteTo(ref output, _repeated_reservedRange_codec); + reservedName_.WriteTo(ref output, _repeated_reservedName_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasName) { @@ -1057,7 +1294,7 @@ namespace Google.Protobuf.Reflection { size += enumType_.CalculateSize(_repeated_enumType_codec); size += extensionRange_.CalculateSize(_repeated_extensionRange_codec); size += oneofDecl_.CalculateSize(_repeated_oneofDecl_codec); - if (HasOptions) { + if (options_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } size += reservedRange_.CalculateSize(_repeated_reservedRange_codec); @@ -1069,6 +1306,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(DescriptorProto other) { if (other == null) { return; @@ -1082,8 +1320,8 @@ namespace Google.Protobuf.Reflection { enumType_.Add(other.enumType_); extensionRange_.Add(other.extensionRange_); oneofDecl_.Add(other.oneofDecl_); - if (other.HasOptions) { - if (!HasOptions) { + if (other.options_ != null) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.MessageOptions(); } Options.MergeFrom(other.Options); @@ -1094,7 +1332,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1126,7 +1368,7 @@ namespace Google.Protobuf.Reflection { break; } case 58: { - if (!HasOptions) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.MessageOptions(); } input.ReadMessage(Options); @@ -1146,30 +1388,98 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + field_.AddEntriesFrom(ref input, _repeated_field_codec); + break; + } + case 26: { + nestedType_.AddEntriesFrom(ref input, _repeated_nestedType_codec); + break; + } + case 34: { + enumType_.AddEntriesFrom(ref input, _repeated_enumType_codec); + break; + } + case 42: { + extensionRange_.AddEntriesFrom(ref input, _repeated_extensionRange_codec); + break; + } + case 50: { + extension_.AddEntriesFrom(ref input, _repeated_extension_codec); + break; + } + case 58: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.MessageOptions(); + } + input.ReadMessage(Options); + break; + } + case 66: { + oneofDecl_.AddEntriesFrom(ref input, _repeated_oneofDecl_codec); + break; + } + case 74: { + reservedRange_.AddEntriesFrom(ref input, _repeated_reservedRange_codec); + break; + } + case 82: { + reservedName_.AddEntriesFrom(ref input, _repeated_reservedName_codec); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the DescriptorProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class ExtensionRange : pb::IMessage { + public sealed partial class ExtensionRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRange()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ExtensionRange() { OnConstruction(); } @@ -1177,15 +1487,17 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ExtensionRange(ExtensionRange other) : this() { _hasBits0 = other._hasBits0; start_ = other.start_; end_ = other.end_; - options_ = other.HasOptions ? other.options_.Clone() : null; + options_ = other.options_ != null ? other.options_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ExtensionRange Clone() { return new ExtensionRange(this); } @@ -1199,6 +1511,7 @@ namespace Google.Protobuf.Reflection { /// Inclusive. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Start { get { if ((_hasBits0 & 1) != 0) { return start_; } else { return StartDefaultValue; } } set { @@ -1208,11 +1521,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "start" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStart { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "start" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStart() { _hasBits0 &= ~1; } @@ -1226,6 +1541,7 @@ namespace Google.Protobuf.Reflection { /// Exclusive. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int End { get { if ((_hasBits0 & 2) != 0) { return end_; } else { return EndDefaultValue; } } set { @@ -1235,11 +1551,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "end" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEnd { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "end" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEnd() { _hasBits0 &= ~2; } @@ -1248,29 +1566,22 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.ExtensionRangeOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.ExtensionRangeOptions Options { get { return options_; } set { options_ = value; } } - /// Gets whether the options field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptions { - get { return options_ != null; } - } - /// Clears the value of the options field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptions() { - options_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ExtensionRange); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ExtensionRange other) { if (ReferenceEquals(other, null)) { return false; @@ -1285,11 +1596,12 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasStart) hash ^= Start.GetHashCode(); if (HasEnd) hash ^= End.GetHashCode(); - if (HasOptions) hash ^= Options.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1297,12 +1609,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasStart) { output.WriteRawTag(8); output.WriteInt32(Start); @@ -1311,16 +1628,40 @@ namespace Google.Protobuf.Reflection { output.WriteRawTag(16); output.WriteInt32(End); } - if (HasOptions) { + if (options_ != null) { output.WriteRawTag(26); output.WriteMessage(Options); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasStart) { + output.WriteRawTag(8); + output.WriteInt32(Start); + } + if (HasEnd) { + output.WriteRawTag(16); + output.WriteInt32(End); + } + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasStart) { @@ -1329,7 +1670,7 @@ namespace Google.Protobuf.Reflection { if (HasEnd) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(End); } - if (HasOptions) { + if (options_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } if (_unknownFields != null) { @@ -1339,6 +1680,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ExtensionRange other) { if (other == null) { return; @@ -1349,8 +1691,8 @@ namespace Google.Protobuf.Reflection { if (other.HasEnd) { End = other.End; } - if (other.HasOptions) { - if (!HasOptions) { + if (other.options_ != null) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.ExtensionRangeOptions(); } Options.MergeFrom(other.Options); @@ -1359,7 +1701,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1375,7 +1721,37 @@ namespace Google.Protobuf.Reflection { break; } case 26: { - if (!HasOptions) { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.ExtensionRangeOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Start = input.ReadInt32(); + break; + } + case 16: { + End = input.ReadInt32(); + break; + } + case 26: { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.ExtensionRangeOptions(); } input.ReadMessage(Options); @@ -1384,6 +1760,7 @@ namespace Google.Protobuf.Reflection { } } } + #endif } @@ -1392,24 +1769,32 @@ namespace Google.Protobuf.Reflection { /// fields or extension ranges in the same message. Reserved ranges may /// not overlap. /// - public sealed partial class ReservedRange : pb::IMessage { + public sealed partial class ReservedRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReservedRange()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ReservedRange() { OnConstruction(); } @@ -1417,6 +1802,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ReservedRange(ReservedRange other) : this() { _hasBits0 = other._hasBits0; start_ = other.start_; @@ -1425,6 +1811,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ReservedRange Clone() { return new ReservedRange(this); } @@ -1438,6 +1825,7 @@ namespace Google.Protobuf.Reflection { /// Inclusive. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Start { get { if ((_hasBits0 & 1) != 0) { return start_; } else { return StartDefaultValue; } } set { @@ -1447,11 +1835,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "start" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStart { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "start" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStart() { _hasBits0 &= ~1; } @@ -1465,6 +1855,7 @@ namespace Google.Protobuf.Reflection { /// Exclusive. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int End { get { if ((_hasBits0 & 2) != 0) { return end_; } else { return EndDefaultValue; } } set { @@ -1474,21 +1865,25 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "end" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEnd { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "end" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEnd() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ReservedRange); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ReservedRange other) { if (ReferenceEquals(other, null)) { return false; @@ -1502,6 +1897,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasStart) hash ^= Start.GetHashCode(); @@ -1513,12 +1909,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasStart) { output.WriteRawTag(8); output.WriteInt32(Start); @@ -1530,9 +1931,29 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasStart) { + output.WriteRawTag(8); + output.WriteInt32(Start); + } + if (HasEnd) { + output.WriteRawTag(16); + output.WriteInt32(End); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasStart) { @@ -1548,6 +1969,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ReservedRange other) { if (other == null) { return; @@ -1562,7 +1984,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1579,8 +2005,32 @@ namespace Google.Protobuf.Reflection { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Start = input.ReadInt32(); + break; + } + case 16: { + End = input.ReadInt32(); + break; + } + } + } + } + #endif + } } @@ -1588,25 +2038,33 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class ExtensionRangeOptions : pb::IExtendableMessage { + public sealed partial class ExtensionRangeOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRangeOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ExtensionRangeOptions() { OnConstruction(); } @@ -1614,6 +2072,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ExtensionRangeOptions(ExtensionRangeOptions other) : this() { uninterpretedOption_ = other.uninterpretedOption_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); @@ -1621,6 +2080,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ExtensionRangeOptions Clone() { return new ExtensionRangeOptions(this); } @@ -1634,16 +2094,19 @@ namespace Google.Protobuf.Reflection { /// The parser stores options it doesn't recognize here. See above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ExtensionRangeOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ExtensionRangeOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -1659,6 +2122,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= uninterpretedOption_.GetHashCode(); @@ -1672,12 +2136,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); if (_extensions != null) { _extensions.WriteTo(output); @@ -1685,9 +2154,25 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); @@ -1701,6 +2186,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ExtensionRangeOptions other) { if (other == null) { return; @@ -1711,7 +2197,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1726,15 +2216,37 @@ namespace Google.Protobuf.Reflection { } } } + #endif } - public TValue GetExtension(pb::Extension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { - return pb::ExtensionSet.Get(ref _extensions, extension); - } - public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 7994: { + uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); + break; + } + } + } + } + #endif + + public TValue GetExtension(pb::Extension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetExtension(pb::RepeatedExtension extension) { + return pb::ExtensionSet.Get(ref _extensions, extension); + } + public pbc::RepeatedField GetOrInitializeExtension(pb::RepeatedExtension extension) { return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); } public void SetExtension(pb::Extension extension, TValue value) { @@ -1755,24 +2267,32 @@ namespace Google.Protobuf.Reflection { /// /// Describes a field within a message. /// - public sealed partial class FieldDescriptorProto : pb::IMessage { + public sealed partial class FieldDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldDescriptorProto()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FieldDescriptorProto() { OnConstruction(); } @@ -1780,6 +2300,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FieldDescriptorProto(FieldDescriptorProto other) : this() { _hasBits0 = other._hasBits0; name_ = other.name_; @@ -1791,12 +2312,13 @@ namespace Google.Protobuf.Reflection { defaultValue_ = other.defaultValue_; oneofIndex_ = other.oneofIndex_; jsonName_ = other.jsonName_; - options_ = other.HasOptions ? other.options_.Clone() : null; + options_ = other.options_ != null ? other.options_.Clone() : null; proto3Optional_ = other.proto3Optional_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FieldDescriptorProto Clone() { return new FieldDescriptorProto(this); } @@ -1807,6 +2329,7 @@ namespace Google.Protobuf.Reflection { private string name_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_ ?? NameDefaultValue; } set { @@ -1815,11 +2338,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasName { get { return name_ != null; } } /// Clears the value of the "name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearName() { name_ = null; } @@ -1830,6 +2355,7 @@ namespace Google.Protobuf.Reflection { private int number_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Number { get { if ((_hasBits0 & 1) != 0) { return number_; } else { return NumberDefaultValue; } } set { @@ -1839,11 +2365,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "number" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNumber { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "number" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNumber() { _hasBits0 &= ~1; } @@ -1854,6 +2382,7 @@ namespace Google.Protobuf.Reflection { private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label label_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label Label { get { if ((_hasBits0 & 2) != 0) { return label_; } else { return LabelDefaultValue; } } set { @@ -1863,11 +2392,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "label" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasLabel { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "label" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearLabel() { _hasBits0 &= ~2; } @@ -1882,6 +2413,7 @@ namespace Google.Protobuf.Reflection { /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type Type { get { if ((_hasBits0 & 4) != 0) { return type_; } else { return TypeDefaultValue; } } set { @@ -1891,11 +2423,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "type" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasType { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "type" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearType() { _hasBits0 &= ~4; } @@ -1913,6 +2447,7 @@ namespace Google.Protobuf.Reflection { /// namespace). /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string TypeName { get { return typeName_ ?? TypeNameDefaultValue; } set { @@ -1921,11 +2456,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "type_name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasTypeName { get { return typeName_ != null; } } /// Clears the value of the "type_name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearTypeName() { typeName_ = null; } @@ -1940,6 +2477,7 @@ namespace Google.Protobuf.Reflection { /// resolved in the same manner as type_name. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Extendee { get { return extendee_ ?? ExtendeeDefaultValue; } set { @@ -1948,11 +2486,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "extendee" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasExtendee { get { return extendee_ != null; } } /// Clears the value of the "extendee" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearExtendee() { extendee_ = null; } @@ -1970,6 +2510,7 @@ namespace Google.Protobuf.Reflection { /// TODO(kenton): Base-64 encode? /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DefaultValue { get { return defaultValue_ ?? DefaultValueDefaultValue; } set { @@ -1978,11 +2519,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "default_value" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDefaultValue { get { return defaultValue_ != null; } } /// Clears the value of the "default_value" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDefaultValue() { defaultValue_ = null; } @@ -1997,6 +2540,7 @@ namespace Google.Protobuf.Reflection { /// list. This field is a member of that oneof. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OneofIndex { get { if ((_hasBits0 & 8) != 0) { return oneofIndex_; } else { return OneofIndexDefaultValue; } } set { @@ -2006,11 +2550,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "oneof_index" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOneofIndex { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "oneof_index" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOneofIndex() { _hasBits0 &= ~8; } @@ -2027,6 +2573,7 @@ namespace Google.Protobuf.Reflection { /// it to camelCase. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string JsonName { get { return jsonName_ ?? JsonNameDefaultValue; } set { @@ -2035,11 +2582,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "json_name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasJsonName { get { return jsonName_ != null; } } /// Clears the value of the "json_name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearJsonName() { jsonName_ = null; } @@ -2048,22 +2597,13 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FieldOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.FieldOptions Options { get { return options_; } set { options_ = value; } } - /// Gets whether the options field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptions { - get { return options_ != null; } - } - /// Clears the value of the options field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptions() { - options_ = null; - } /// Field number for the "proto3_optional" field. public const int Proto3OptionalFieldNumber = 17; @@ -2094,6 +2634,7 @@ namespace Google.Protobuf.Reflection { /// optional with `LABEL_OPTIONAL`. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Proto3Optional { get { if ((_hasBits0 & 16) != 0) { return proto3Optional_; } else { return Proto3OptionalDefaultValue; } } set { @@ -2103,21 +2644,25 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "proto3_optional" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasProto3Optional { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "proto3_optional" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearProto3Optional() { _hasBits0 &= ~16; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FieldDescriptorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FieldDescriptorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -2140,6 +2685,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasName) hash ^= Name.GetHashCode(); @@ -2151,7 +2697,7 @@ namespace Google.Protobuf.Reflection { if (HasDefaultValue) hash ^= DefaultValue.GetHashCode(); if (HasOneofIndex) hash ^= OneofIndex.GetHashCode(); if (HasJsonName) hash ^= JsonName.GetHashCode(); - if (HasOptions) hash ^= Options.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); if (HasProto3Optional) hash ^= Proto3Optional.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); @@ -2160,12 +2706,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasName) { output.WriteRawTag(10); output.WriteString(Name); @@ -2194,7 +2745,7 @@ namespace Google.Protobuf.Reflection { output.WriteRawTag(58); output.WriteString(DefaultValue); } - if (HasOptions) { + if (options_ != null) { output.WriteRawTag(66); output.WriteMessage(Options); } @@ -2213,9 +2764,65 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (HasExtendee) { + output.WriteRawTag(18); + output.WriteString(Extendee); + } + if (HasNumber) { + output.WriteRawTag(24); + output.WriteInt32(Number); + } + if (HasLabel) { + output.WriteRawTag(32); + output.WriteEnum((int) Label); + } + if (HasType) { + output.WriteRawTag(40); + output.WriteEnum((int) Type); + } + if (HasTypeName) { + output.WriteRawTag(50); + output.WriteString(TypeName); + } + if (HasDefaultValue) { + output.WriteRawTag(58); + output.WriteString(DefaultValue); + } + if (options_ != null) { + output.WriteRawTag(66); + output.WriteMessage(Options); + } + if (HasOneofIndex) { + output.WriteRawTag(72); + output.WriteInt32(OneofIndex); + } + if (HasJsonName) { + output.WriteRawTag(82); + output.WriteString(JsonName); + } + if (HasProto3Optional) { + output.WriteRawTag(136, 1); + output.WriteBool(Proto3Optional); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasName) { @@ -2245,7 +2852,7 @@ namespace Google.Protobuf.Reflection { if (HasJsonName) { size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonName); } - if (HasOptions) { + if (options_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } if (HasProto3Optional) { @@ -2258,6 +2865,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FieldDescriptorProto other) { if (other == null) { return; @@ -2289,8 +2897,8 @@ namespace Google.Protobuf.Reflection { if (other.HasJsonName) { JsonName = other.JsonName; } - if (other.HasOptions) { - if (!HasOptions) { + if (other.options_ != null) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.FieldOptions(); } Options.MergeFrom(other.Options); @@ -2302,7 +2910,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2338,7 +2950,69 @@ namespace Google.Protobuf.Reflection { break; } case 66: { - if (!HasOptions) { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.FieldOptions(); + } + input.ReadMessage(Options); + break; + } + case 72: { + OneofIndex = input.ReadInt32(); + break; + } + case 82: { + JsonName = input.ReadString(); + break; + } + case 136: { + Proto3Optional = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Extendee = input.ReadString(); + break; + } + case 24: { + Number = input.ReadInt32(); + break; + } + case 32: { + Label = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label) input.ReadEnum(); + break; + } + case 40: { + Type = (global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type) input.ReadEnum(); + break; + } + case 50: { + TypeName = input.ReadString(); + break; + } + case 58: { + DefaultValue = input.ReadString(); + break; + } + case 66: { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.FieldOptions(); } input.ReadMessage(Options); @@ -2359,10 +3033,12 @@ namespace Google.Protobuf.Reflection { } } } + #endif #region Nested types /// Container for nested types declared in the FieldDescriptorProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum Type { /// @@ -2432,23 +3108,31 @@ namespace Google.Protobuf.Reflection { /// /// Describes a oneof. /// - public sealed partial class OneofDescriptorProto : pb::IMessage { + public sealed partial class OneofDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofDescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofDescriptorProto() { OnConstruction(); } @@ -2456,13 +3140,15 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofDescriptorProto(OneofDescriptorProto other) : this() { name_ = other.name_; - options_ = other.HasOptions ? other.options_.Clone() : null; + options_ = other.options_ != null ? other.options_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofDescriptorProto Clone() { return new OneofDescriptorProto(this); } @@ -2473,6 +3159,7 @@ namespace Google.Protobuf.Reflection { private string name_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_ ?? NameDefaultValue; } set { @@ -2481,11 +3168,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasName { get { return name_ != null; } } /// Clears the value of the "name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearName() { name_ = null; } @@ -2494,29 +3183,22 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 2; private global::Google.Protobuf.Reflection.OneofOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.OneofOptions Options { get { return options_; } set { options_ = value; } } - /// Gets whether the options field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptions { - get { return options_ != null; } - } - /// Clears the value of the options field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptions() { - options_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneofDescriptorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneofDescriptorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -2530,10 +3212,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasName) hash ^= Name.GetHashCode(); - if (HasOptions) hash ^= Options.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2541,32 +3224,57 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasName) { output.WriteRawTag(10); output.WriteString(Name); } - if (HasOptions) { + if (options_ != null) { output.WriteRawTag(18); output.WriteMessage(Options); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (options_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasName) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } - if (HasOptions) { + if (options_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } if (_unknownFields != null) { @@ -2576,6 +3284,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneofDescriptorProto other) { if (other == null) { return; @@ -2583,8 +3292,8 @@ namespace Google.Protobuf.Reflection { if (other.HasName) { Name = other.Name; } - if (other.HasOptions) { - if (!HasOptions) { + if (other.options_ != null) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.OneofOptions(); } Options.MergeFrom(other.Options); @@ -2593,7 +3302,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2605,7 +3318,33 @@ namespace Google.Protobuf.Reflection { break; } case 18: { - if (!HasOptions) { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.OneofOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.OneofOptions(); } input.ReadMessage(Options); @@ -2614,29 +3353,38 @@ namespace Google.Protobuf.Reflection { } } } + #endif } /// /// Describes an enum type. /// - public sealed partial class EnumDescriptorProto : pb::IMessage { + public sealed partial class EnumDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumDescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumDescriptorProto() { OnConstruction(); } @@ -2644,16 +3392,18 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumDescriptorProto(EnumDescriptorProto other) : this() { name_ = other.name_; value_ = other.value_.Clone(); - options_ = other.HasOptions ? other.options_.Clone() : null; + options_ = other.options_ != null ? other.options_.Clone() : null; reservedRange_ = other.reservedRange_.Clone(); reservedName_ = other.reservedName_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumDescriptorProto Clone() { return new EnumDescriptorProto(this); } @@ -2664,6 +3414,7 @@ namespace Google.Protobuf.Reflection { private string name_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_ ?? NameDefaultValue; } set { @@ -2672,11 +3423,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasName { get { return name_ != null; } } /// Clears the value of the "name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearName() { name_ = null; } @@ -2687,6 +3440,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.EnumValueDescriptorProto.Parser); private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Value { get { return value_; } } @@ -2695,22 +3449,13 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.EnumOptions Options { get { return options_; } set { options_ = value; } } - /// Gets whether the options field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptions { - get { return options_ != null; } - } - /// Clears the value of the options field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptions() { - options_ = null; - } /// Field number for the "reserved_range" field. public const int ReservedRangeFieldNumber = 4; @@ -2723,6 +3468,7 @@ namespace Google.Protobuf.Reflection { /// overlap. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ReservedRange { get { return reservedRange_; } } @@ -2737,16 +3483,19 @@ namespace Google.Protobuf.Reflection { /// be reserved once. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ReservedName { get { return reservedName_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as EnumDescriptorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(EnumDescriptorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -2763,11 +3512,12 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasName) hash ^= Name.GetHashCode(); hash ^= value_.GetHashCode(); - if (HasOptions) hash ^= Options.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); hash ^= reservedRange_.GetHashCode(); hash ^= reservedName_.GetHashCode(); if (_unknownFields != null) { @@ -2777,18 +3527,23 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasName) { output.WriteRawTag(10); output.WriteString(Name); } value_.WriteTo(output, _repeated_value_codec); - if (HasOptions) { + if (options_ != null) { output.WriteRawTag(26); output.WriteMessage(Options); } @@ -2797,16 +3552,39 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + value_.WriteTo(ref output, _repeated_value_codec); + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + reservedRange_.WriteTo(ref output, _repeated_reservedRange_codec); + reservedName_.WriteTo(ref output, _repeated_reservedName_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasName) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } size += value_.CalculateSize(_repeated_value_codec); - if (HasOptions) { + if (options_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } size += reservedRange_.CalculateSize(_repeated_reservedRange_codec); @@ -2818,6 +3596,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(EnumDescriptorProto other) { if (other == null) { return; @@ -2826,8 +3605,8 @@ namespace Google.Protobuf.Reflection { Name = other.Name; } value_.Add(other.value_); - if (other.HasOptions) { - if (!HasOptions) { + if (other.options_ != null) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.EnumOptions(); } Options.MergeFrom(other.Options); @@ -2838,7 +3617,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -2854,7 +3637,7 @@ namespace Google.Protobuf.Reflection { break; } case 26: { - if (!HasOptions) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.EnumOptions(); } input.ReadMessage(Options); @@ -2870,11 +3653,51 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + value_.AddEntriesFrom(ref input, _repeated_value_codec); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.EnumOptions(); + } + input.ReadMessage(Options); + break; + } + case 34: { + reservedRange_.AddEntriesFrom(ref input, _repeated_reservedRange_codec); + break; + } + case 42: { + reservedName_.AddEntriesFrom(ref input, _repeated_reservedName_codec); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the EnumDescriptorProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Range of reserved numeric values. Reserved values may not be used by @@ -2884,24 +3707,32 @@ namespace Google.Protobuf.Reflection { /// is inclusive such that it can appropriately represent the entire int32 /// domain. /// - public sealed partial class EnumReservedRange : pb::IMessage { + public sealed partial class EnumReservedRange : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumReservedRange()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.EnumDescriptorProto.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumReservedRange() { OnConstruction(); } @@ -2909,6 +3740,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumReservedRange(EnumReservedRange other) : this() { _hasBits0 = other._hasBits0; start_ = other.start_; @@ -2917,6 +3749,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumReservedRange Clone() { return new EnumReservedRange(this); } @@ -2930,6 +3763,7 @@ namespace Google.Protobuf.Reflection { /// Inclusive. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Start { get { if ((_hasBits0 & 1) != 0) { return start_; } else { return StartDefaultValue; } } set { @@ -2939,11 +3773,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "start" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStart { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "start" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStart() { _hasBits0 &= ~1; } @@ -2957,6 +3793,7 @@ namespace Google.Protobuf.Reflection { /// Inclusive. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int End { get { if ((_hasBits0 & 2) != 0) { return end_; } else { return EndDefaultValue; } } set { @@ -2966,21 +3803,25 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "end" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEnd { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "end" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEnd() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as EnumReservedRange); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(EnumReservedRange other) { if (ReferenceEquals(other, null)) { return false; @@ -2994,6 +3835,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasStart) hash ^= Start.GetHashCode(); @@ -3005,12 +3847,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasStart) { output.WriteRawTag(8); output.WriteInt32(Start); @@ -3022,9 +3869,29 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasStart) { + output.WriteRawTag(8); + output.WriteInt32(Start); + } + if (HasEnd) { + output.WriteRawTag(16); + output.WriteInt32(End); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasStart) { @@ -3040,6 +3907,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(EnumReservedRange other) { if (other == null) { return; @@ -3054,7 +3922,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3071,7 +3943,31 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Start = input.ReadInt32(); + break; + } + case 16: { + End = input.ReadInt32(); + break; + } + } + } } + #endif } @@ -3083,24 +3979,32 @@ namespace Google.Protobuf.Reflection { /// /// Describes a value within an enum. /// - public sealed partial class EnumValueDescriptorProto : pb::IMessage { + public sealed partial class EnumValueDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueDescriptorProto()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumValueDescriptorProto() { OnConstruction(); } @@ -3108,15 +4012,17 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumValueDescriptorProto(EnumValueDescriptorProto other) : this() { _hasBits0 = other._hasBits0; name_ = other.name_; number_ = other.number_; - options_ = other.HasOptions ? other.options_.Clone() : null; + options_ = other.options_ != null ? other.options_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumValueDescriptorProto Clone() { return new EnumValueDescriptorProto(this); } @@ -3127,6 +4033,7 @@ namespace Google.Protobuf.Reflection { private string name_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_ ?? NameDefaultValue; } set { @@ -3135,11 +4042,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasName { get { return name_ != null; } } /// Clears the value of the "name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearName() { name_ = null; } @@ -3150,6 +4059,7 @@ namespace Google.Protobuf.Reflection { private int number_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Number { get { if ((_hasBits0 & 1) != 0) { return number_; } else { return NumberDefaultValue; } } set { @@ -3159,11 +4069,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "number" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNumber { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "number" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNumber() { _hasBits0 &= ~1; } @@ -3172,29 +4084,22 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumValueOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.EnumValueOptions Options { get { return options_; } set { options_ = value; } } - /// Gets whether the options field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptions { - get { return options_ != null; } - } - /// Clears the value of the options field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptions() { - options_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as EnumValueDescriptorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(EnumValueDescriptorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -3209,11 +4114,12 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasName) hash ^= Name.GetHashCode(); if (HasNumber) hash ^= Number.GetHashCode(); - if (HasOptions) hash ^= Options.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3221,12 +4127,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasName) { output.WriteRawTag(10); output.WriteString(Name); @@ -3235,26 +4146,50 @@ namespace Google.Protobuf.Reflection { output.WriteRawTag(16); output.WriteInt32(Number); } - if (HasOptions) { + if (options_ != null) { output.WriteRawTag(26); output.WriteMessage(Options); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (HasName) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + output.WriteRawTag(10); + output.WriteString(Name); } if (HasNumber) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number); + output.WriteRawTag(16); + output.WriteInt32(Number); } - if (HasOptions) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (HasNumber) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number); + } + if (options_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); @@ -3263,6 +4198,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(EnumValueDescriptorProto other) { if (other == null) { return; @@ -3273,8 +4209,8 @@ namespace Google.Protobuf.Reflection { if (other.HasNumber) { Number = other.Number; } - if (other.HasOptions) { - if (!HasOptions) { + if (other.options_ != null) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.EnumValueOptions(); } Options.MergeFrom(other.Options); @@ -3283,7 +4219,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3299,7 +4239,7 @@ namespace Google.Protobuf.Reflection { break; } case 26: { - if (!HasOptions) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.EnumValueOptions(); } input.ReadMessage(Options); @@ -3307,30 +4247,69 @@ namespace Google.Protobuf.Reflection { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + Number = input.ReadInt32(); + break; + } + case 26: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.EnumValueOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + } + #endif + } /// /// Describes a service. /// - public sealed partial class ServiceDescriptorProto : pb::IMessage { + public sealed partial class ServiceDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceDescriptorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ServiceDescriptorProto() { OnConstruction(); } @@ -3338,14 +4317,16 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ServiceDescriptorProto(ServiceDescriptorProto other) : this() { name_ = other.name_; method_ = other.method_.Clone(); - options_ = other.HasOptions ? other.options_.Clone() : null; + options_ = other.options_ != null ? other.options_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ServiceDescriptorProto Clone() { return new ServiceDescriptorProto(this); } @@ -3356,6 +4337,7 @@ namespace Google.Protobuf.Reflection { private string name_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_ ?? NameDefaultValue; } set { @@ -3364,11 +4346,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasName { get { return name_ != null; } } /// Clears the value of the "name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearName() { name_ = null; } @@ -3379,6 +4363,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.MethodDescriptorProto.Parser); private readonly pbc::RepeatedField method_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Method { get { return method_; } } @@ -3387,29 +4372,22 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.ServiceOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.ServiceOptions Options { get { return options_; } set { options_ = value; } } - /// Gets whether the options field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptions { - get { return options_ != null; } - } - /// Clears the value of the options field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptions() { - options_ = null; - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ServiceDescriptorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ServiceDescriptorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -3424,11 +4402,12 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasName) hash ^= Name.GetHashCode(); hash ^= method_.GetHashCode(); - if (HasOptions) hash ^= Options.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -3436,34 +4415,60 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasName) { output.WriteRawTag(10); output.WriteString(Name); } method_.WriteTo(output, _repeated_method_codec); - if (HasOptions) { + if (options_ != null) { output.WriteRawTag(26); output.WriteMessage(Options); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + method_.WriteTo(ref output, _repeated_method_codec); + if (options_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Options); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasName) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } size += method_.CalculateSize(_repeated_method_codec); - if (HasOptions) { + if (options_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } if (_unknownFields != null) { @@ -3473,6 +4478,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ServiceDescriptorProto other) { if (other == null) { return; @@ -3481,8 +4487,8 @@ namespace Google.Protobuf.Reflection { Name = other.Name; } method_.Add(other.method_); - if (other.HasOptions) { - if (!HasOptions) { + if (other.options_ != null) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.ServiceOptions(); } Options.MergeFrom(other.Options); @@ -3491,7 +4497,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3507,7 +4517,37 @@ namespace Google.Protobuf.Reflection { break; } case 26: { - if (!HasOptions) { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.ServiceOptions(); + } + input.ReadMessage(Options); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + method_.AddEntriesFrom(ref input, _repeated_method_codec); + break; + } + case 26: { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.ServiceOptions(); } input.ReadMessage(Options); @@ -3516,30 +4556,39 @@ namespace Google.Protobuf.Reflection { } } } + #endif } /// /// Describes a method of a service. /// - public sealed partial class MethodDescriptorProto : pb::IMessage { + public sealed partial class MethodDescriptorProto : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodDescriptorProto()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MethodDescriptorProto() { OnConstruction(); } @@ -3547,18 +4596,20 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MethodDescriptorProto(MethodDescriptorProto other) : this() { _hasBits0 = other._hasBits0; name_ = other.name_; inputType_ = other.inputType_; outputType_ = other.outputType_; - options_ = other.HasOptions ? other.options_.Clone() : null; + options_ = other.options_ != null ? other.options_.Clone() : null; clientStreaming_ = other.clientStreaming_; serverStreaming_ = other.serverStreaming_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MethodDescriptorProto Clone() { return new MethodDescriptorProto(this); } @@ -3569,6 +4620,7 @@ namespace Google.Protobuf.Reflection { private string name_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_ ?? NameDefaultValue; } set { @@ -3577,11 +4629,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "name" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasName { get { return name_ != null; } } /// Clears the value of the "name" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearName() { name_ = null; } @@ -3596,6 +4650,7 @@ namespace Google.Protobuf.Reflection { /// FieldDescriptorProto.type_name, but must refer to a message type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string InputType { get { return inputType_ ?? InputTypeDefaultValue; } set { @@ -3604,11 +4659,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "input_type" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasInputType { get { return inputType_ != null; } } /// Clears the value of the "input_type" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearInputType() { inputType_ = null; } @@ -3619,6 +4676,7 @@ namespace Google.Protobuf.Reflection { private string outputType_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OutputType { get { return outputType_ ?? OutputTypeDefaultValue; } set { @@ -3627,11 +4685,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "output_type" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOutputType { get { return outputType_ != null; } } /// Clears the value of the "output_type" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOutputType() { outputType_ = null; } @@ -3640,22 +4700,13 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 4; private global::Google.Protobuf.Reflection.MethodOptions options_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.MethodOptions Options { get { return options_; } set { options_ = value; } } - /// Gets whether the options field is set - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HasOptions { - get { return options_ != null; } - } - /// Clears the value of the options field - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptions() { - options_ = null; - } /// Field number for the "client_streaming" field. public const int ClientStreamingFieldNumber = 5; @@ -3666,6 +4717,7 @@ namespace Google.Protobuf.Reflection { /// Identifies if client streams multiple client messages /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool ClientStreaming { get { if ((_hasBits0 & 1) != 0) { return clientStreaming_; } else { return ClientStreamingDefaultValue; } } set { @@ -3675,11 +4727,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "client_streaming" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasClientStreaming { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "client_streaming" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearClientStreaming() { _hasBits0 &= ~1; } @@ -3693,6 +4747,7 @@ namespace Google.Protobuf.Reflection { /// Identifies if server streams multiple server messages /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool ServerStreaming { get { if ((_hasBits0 & 2) != 0) { return serverStreaming_; } else { return ServerStreamingDefaultValue; } } set { @@ -3702,21 +4757,25 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "server_streaming" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasServerStreaming { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "server_streaming" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearServerStreaming() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MethodDescriptorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MethodDescriptorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -3734,12 +4793,13 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasName) hash ^= Name.GetHashCode(); if (HasInputType) hash ^= InputType.GetHashCode(); if (HasOutputType) hash ^= OutputType.GetHashCode(); - if (HasOptions) hash ^= Options.GetHashCode(); + if (options_ != null) hash ^= Options.GetHashCode(); if (HasClientStreaming) hash ^= ClientStreaming.GetHashCode(); if (HasServerStreaming) hash ^= ServerStreaming.GetHashCode(); if (_unknownFields != null) { @@ -3749,12 +4809,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasName) { output.WriteRawTag(10); output.WriteString(Name); @@ -3767,7 +4832,7 @@ namespace Google.Protobuf.Reflection { output.WriteRawTag(26); output.WriteString(OutputType); } - if (HasOptions) { + if (options_ != null) { output.WriteRawTag(34); output.WriteMessage(Options); } @@ -3782,9 +4847,45 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasName) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (HasInputType) { + output.WriteRawTag(18); + output.WriteString(InputType); + } + if (HasOutputType) { + output.WriteRawTag(26); + output.WriteString(OutputType); + } + if (options_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Options); + } + if (HasClientStreaming) { + output.WriteRawTag(40); + output.WriteBool(ClientStreaming); + } + if (HasServerStreaming) { + output.WriteRawTag(48); + output.WriteBool(ServerStreaming); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasName) { @@ -3796,7 +4897,7 @@ namespace Google.Protobuf.Reflection { if (HasOutputType) { size += 1 + pb::CodedOutputStream.ComputeStringSize(OutputType); } - if (HasOptions) { + if (options_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options); } if (HasClientStreaming) { @@ -3812,6 +4913,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MethodDescriptorProto other) { if (other == null) { return; @@ -3825,8 +4927,8 @@ namespace Google.Protobuf.Reflection { if (other.HasOutputType) { OutputType = other.OutputType; } - if (other.HasOptions) { - if (!HasOptions) { + if (other.options_ != null) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.MethodOptions(); } Options.MergeFrom(other.Options); @@ -3841,7 +4943,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -3861,7 +4967,7 @@ namespace Google.Protobuf.Reflection { break; } case 34: { - if (!HasOptions) { + if (options_ == null) { Options = new global::Google.Protobuf.Reflection.MethodOptions(); } input.ReadMessage(Options); @@ -3877,30 +4983,81 @@ namespace Google.Protobuf.Reflection { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + InputType = input.ReadString(); + break; + } + case 26: { + OutputType = input.ReadString(); + break; + } + case 34: { + if (options_ == null) { + Options = new global::Google.Protobuf.Reflection.MethodOptions(); + } + input.ReadMessage(Options); + break; + } + case 40: { + ClientStreaming = input.ReadBool(); + break; + } + case 48: { + ServerStreaming = input.ReadBool(); + break; + } + } + } + } + #endif + } - public sealed partial class FileOptions : pb::IExtendableMessage { + public sealed partial class FileOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FileOptions() { OnConstruction(); } @@ -3908,6 +5065,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FileOptions(FileOptions other) : this() { _hasBits0 = other._hasBits0; javaPackage_ = other.javaPackage_; @@ -3936,6 +5094,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FileOptions Clone() { return new FileOptions(this); } @@ -3952,6 +5111,7 @@ namespace Google.Protobuf.Reflection { /// domain names. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string JavaPackage { get { return javaPackage_ ?? JavaPackageDefaultValue; } set { @@ -3960,11 +5120,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "java_package" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasJavaPackage { get { return javaPackage_ != null; } } /// Clears the value of the "java_package" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearJavaPackage() { javaPackage_ = null; } @@ -3975,13 +5137,14 @@ namespace Google.Protobuf.Reflection { private string javaOuterClassname_; /// - /// If set, all the classes from the .proto file are wrapped in a single - /// outer class with the given name. This applies to both Proto1 - /// (equivalent to the old "--one_java_file" option) and Proto2 (where - /// a .proto always translates to a single class, but you may want to - /// explicitly choose the class name). + /// Controls the name of the wrapper Java class generated for the .proto file. + /// That class will always contain the .proto file's getDescriptor() method as + /// well as any top-level extensions defined in the .proto file. + /// If java_multiple_files is disabled, then all the other classes from the + /// .proto file will be nested inside the single wrapper outer class. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string JavaOuterClassname { get { return javaOuterClassname_ ?? JavaOuterClassnameDefaultValue; } set { @@ -3990,11 +5153,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "java_outer_classname" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasJavaOuterClassname { get { return javaOuterClassname_ != null; } } /// Clears the value of the "java_outer_classname" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearJavaOuterClassname() { javaOuterClassname_ = null; } @@ -4005,14 +5170,15 @@ namespace Google.Protobuf.Reflection { private bool javaMultipleFiles_; /// - /// If set true, then the Java code generator will generate a separate .java + /// If enabled, then the Java code generator will generate a separate .java /// file for each top-level message, enum, and service defined in the .proto - /// file. Thus, these types will *not* be nested inside the outer class - /// named by java_outer_classname. However, the outer class will still be + /// file. Thus, these types will *not* be nested inside the wrapper class + /// named by java_outer_classname. However, the wrapper class will still be /// generated to contain the file's getDescriptor() method as well as any /// top-level extensions defined in the file. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool JavaMultipleFiles { get { if ((_hasBits0 & 2) != 0) { return javaMultipleFiles_; } else { return JavaMultipleFilesDefaultValue; } } set { @@ -4022,11 +5188,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "java_multiple_files" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasJavaMultipleFiles { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "java_multiple_files" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearJavaMultipleFiles() { _hasBits0 &= ~2; } @@ -4041,6 +5209,7 @@ namespace Google.Protobuf.Reflection { /// [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool JavaGenerateEqualsAndHash { get { if ((_hasBits0 & 32) != 0) { return javaGenerateEqualsAndHash_; } else { return JavaGenerateEqualsAndHashDefaultValue; } } set { @@ -4051,12 +5220,14 @@ namespace Google.Protobuf.Reflection { /// Gets whether the "java_generate_equals_and_hash" field is set [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasJavaGenerateEqualsAndHash { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "java_generate_equals_and_hash" field [global::System.ObsoleteAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearJavaGenerateEqualsAndHash() { _hasBits0 &= ~32; } @@ -4075,6 +5246,7 @@ namespace Google.Protobuf.Reflection { /// This option has no effect on when used with the lite runtime. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool JavaStringCheckUtf8 { get { if ((_hasBits0 & 128) != 0) { return javaStringCheckUtf8_; } else { return JavaStringCheckUtf8DefaultValue; } } set { @@ -4084,11 +5256,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "java_string_check_utf8" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasJavaStringCheckUtf8 { get { return (_hasBits0 & 128) != 0; } } /// Clears the value of the "java_string_check_utf8" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearJavaStringCheckUtf8() { _hasBits0 &= ~128; } @@ -4099,6 +5273,7 @@ namespace Google.Protobuf.Reflection { private global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode optimizeFor_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode OptimizeFor { get { if ((_hasBits0 & 1) != 0) { return optimizeFor_; } else { return OptimizeForDefaultValue; } } set { @@ -4108,11 +5283,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "optimize_for" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasOptimizeFor { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "optimize_for" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearOptimizeFor() { _hasBits0 &= ~1; } @@ -4130,6 +5307,7 @@ namespace Google.Protobuf.Reflection { /// - Otherwise, the basename of the .proto file, without extension. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string GoPackage { get { return goPackage_ ?? GoPackageDefaultValue; } set { @@ -4138,11 +5316,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "go_package" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasGoPackage { get { return goPackage_ != null; } } /// Clears the value of the "go_package" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearGoPackage() { goPackage_ = null; } @@ -4165,6 +5345,7 @@ namespace Google.Protobuf.Reflection { /// explicitly set them to true. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool CcGenericServices { get { if ((_hasBits0 & 4) != 0) { return ccGenericServices_; } else { return CcGenericServicesDefaultValue; } } set { @@ -4174,11 +5355,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "cc_generic_services" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCcGenericServices { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "cc_generic_services" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCcGenericServices() { _hasBits0 &= ~4; } @@ -4189,6 +5372,7 @@ namespace Google.Protobuf.Reflection { private bool javaGenericServices_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool JavaGenericServices { get { if ((_hasBits0 & 8) != 0) { return javaGenericServices_; } else { return JavaGenericServicesDefaultValue; } } set { @@ -4198,11 +5382,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "java_generic_services" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasJavaGenericServices { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "java_generic_services" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearJavaGenericServices() { _hasBits0 &= ~8; } @@ -4213,6 +5399,7 @@ namespace Google.Protobuf.Reflection { private bool pyGenericServices_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool PyGenericServices { get { if ((_hasBits0 & 16) != 0) { return pyGenericServices_; } else { return PyGenericServicesDefaultValue; } } set { @@ -4222,11 +5409,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "py_generic_services" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPyGenericServices { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "py_generic_services" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPyGenericServices() { _hasBits0 &= ~16; } @@ -4237,6 +5426,7 @@ namespace Google.Protobuf.Reflection { private bool phpGenericServices_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool PhpGenericServices { get { if ((_hasBits0 & 512) != 0) { return phpGenericServices_; } else { return PhpGenericServicesDefaultValue; } } set { @@ -4246,11 +5436,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "php_generic_services" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPhpGenericServices { get { return (_hasBits0 & 512) != 0; } } /// Clears the value of the "php_generic_services" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPhpGenericServices() { _hasBits0 &= ~512; } @@ -4267,6 +5459,7 @@ namespace Google.Protobuf.Reflection { /// least, this is a formalization for deprecating files. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Deprecated { get { if ((_hasBits0 & 64) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } set { @@ -4276,11 +5469,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "deprecated" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecated { get { return (_hasBits0 & 64) != 0; } } /// Clears the value of the "deprecated" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecated() { _hasBits0 &= ~64; } @@ -4295,6 +5490,7 @@ namespace Google.Protobuf.Reflection { /// only to generated classes for C++. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool CcEnableArenas { get { if ((_hasBits0 & 256) != 0) { return ccEnableArenas_; } else { return CcEnableArenasDefaultValue; } } set { @@ -4304,11 +5500,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "cc_enable_arenas" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCcEnableArenas { get { return (_hasBits0 & 256) != 0; } } /// Clears the value of the "cc_enable_arenas" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCcEnableArenas() { _hasBits0 &= ~256; } @@ -4323,6 +5521,7 @@ namespace Google.Protobuf.Reflection { /// generated classes from this .proto. There is no default. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string ObjcClassPrefix { get { return objcClassPrefix_ ?? ObjcClassPrefixDefaultValue; } set { @@ -4331,11 +5530,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "objc_class_prefix" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasObjcClassPrefix { get { return objcClassPrefix_ != null; } } /// Clears the value of the "objc_class_prefix" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearObjcClassPrefix() { objcClassPrefix_ = null; } @@ -4349,6 +5550,7 @@ namespace Google.Protobuf.Reflection { /// Namespace for generated classes; defaults to the package. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string CsharpNamespace { get { return csharpNamespace_ ?? CsharpNamespaceDefaultValue; } set { @@ -4357,11 +5559,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "csharp_namespace" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCsharpNamespace { get { return csharpNamespace_ != null; } } /// Clears the value of the "csharp_namespace" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCsharpNamespace() { csharpNamespace_ = null; } @@ -4378,6 +5582,7 @@ namespace Google.Protobuf.Reflection { /// to prefix the types/symbols defined. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string SwiftPrefix { get { return swiftPrefix_ ?? SwiftPrefixDefaultValue; } set { @@ -4386,11 +5591,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "swift_prefix" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSwiftPrefix { get { return swiftPrefix_ != null; } } /// Clears the value of the "swift_prefix" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSwiftPrefix() { swiftPrefix_ = null; } @@ -4405,6 +5612,7 @@ namespace Google.Protobuf.Reflection { /// from this .proto. Default is empty. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string PhpClassPrefix { get { return phpClassPrefix_ ?? PhpClassPrefixDefaultValue; } set { @@ -4413,11 +5621,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "php_class_prefix" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPhpClassPrefix { get { return phpClassPrefix_ != null; } } /// Clears the value of the "php_class_prefix" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPhpClassPrefix() { phpClassPrefix_ = null; } @@ -4433,6 +5643,7 @@ namespace Google.Protobuf.Reflection { /// determining the namespace. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string PhpNamespace { get { return phpNamespace_ ?? PhpNamespaceDefaultValue; } set { @@ -4441,11 +5652,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "php_namespace" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPhpNamespace { get { return phpNamespace_ != null; } } /// Clears the value of the "php_namespace" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPhpNamespace() { phpNamespace_ = null; } @@ -4461,6 +5674,7 @@ namespace Google.Protobuf.Reflection { /// used for determining the namespace. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string PhpMetadataNamespace { get { return phpMetadataNamespace_ ?? PhpMetadataNamespaceDefaultValue; } set { @@ -4469,11 +5683,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "php_metadata_namespace" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPhpMetadataNamespace { get { return phpMetadataNamespace_ != null; } } /// Clears the value of the "php_metadata_namespace" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPhpMetadataNamespace() { phpMetadataNamespace_ = null; } @@ -4489,6 +5705,7 @@ namespace Google.Protobuf.Reflection { /// determining the ruby package. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string RubyPackage { get { return rubyPackage_ ?? RubyPackageDefaultValue; } set { @@ -4497,11 +5714,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "ruby_package" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasRubyPackage { get { return rubyPackage_ != null; } } /// Clears the value of the "ruby_package" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearRubyPackage() { rubyPackage_ = null; } @@ -4516,16 +5735,19 @@ namespace Google.Protobuf.Reflection { /// See the documentation for the "Options" section above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FileOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FileOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -4561,6 +5783,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasJavaPackage) hash ^= JavaPackage.GetHashCode(); @@ -4594,12 +5817,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasJavaPackage) { output.WriteRawTag(10); output.WriteString(JavaPackage); @@ -4687,9 +5915,105 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasJavaPackage) { + output.WriteRawTag(10); + output.WriteString(JavaPackage); + } + if (HasJavaOuterClassname) { + output.WriteRawTag(66); + output.WriteString(JavaOuterClassname); + } + if (HasOptimizeFor) { + output.WriteRawTag(72); + output.WriteEnum((int) OptimizeFor); + } + if (HasJavaMultipleFiles) { + output.WriteRawTag(80); + output.WriteBool(JavaMultipleFiles); + } + if (HasGoPackage) { + output.WriteRawTag(90); + output.WriteString(GoPackage); + } + if (HasCcGenericServices) { + output.WriteRawTag(128, 1); + output.WriteBool(CcGenericServices); + } + if (HasJavaGenericServices) { + output.WriteRawTag(136, 1); + output.WriteBool(JavaGenericServices); + } + if (HasPyGenericServices) { + output.WriteRawTag(144, 1); + output.WriteBool(PyGenericServices); + } + if (HasJavaGenerateEqualsAndHash) { + output.WriteRawTag(160, 1); + output.WriteBool(JavaGenerateEqualsAndHash); + } + if (HasDeprecated) { + output.WriteRawTag(184, 1); + output.WriteBool(Deprecated); + } + if (HasJavaStringCheckUtf8) { + output.WriteRawTag(216, 1); + output.WriteBool(JavaStringCheckUtf8); + } + if (HasCcEnableArenas) { + output.WriteRawTag(248, 1); + output.WriteBool(CcEnableArenas); + } + if (HasObjcClassPrefix) { + output.WriteRawTag(162, 2); + output.WriteString(ObjcClassPrefix); + } + if (HasCsharpNamespace) { + output.WriteRawTag(170, 2); + output.WriteString(CsharpNamespace); + } + if (HasSwiftPrefix) { + output.WriteRawTag(186, 2); + output.WriteString(SwiftPrefix); + } + if (HasPhpClassPrefix) { + output.WriteRawTag(194, 2); + output.WriteString(PhpClassPrefix); + } + if (HasPhpNamespace) { + output.WriteRawTag(202, 2); + output.WriteString(PhpNamespace); + } + if (HasPhpGenericServices) { + output.WriteRawTag(208, 2); + output.WriteBool(PhpGenericServices); + } + if (HasPhpMetadataNamespace) { + output.WriteRawTag(226, 2); + output.WriteString(PhpMetadataNamespace); + } + if (HasRubyPackage) { + output.WriteRawTag(234, 2); + output.WriteString(RubyPackage); + } + uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasJavaPackage) { @@ -4763,6 +6087,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FileOptions other) { if (other == null) { return; @@ -4827,19 +6152,124 @@ namespace Google.Protobuf.Reflection { if (other.HasRubyPackage) { RubyPackage = other.RubyPackage; } - uninterpretedOption_.Add(other.uninterpretedOption_); - pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + uninterpretedOption_.Add(other.uninterpretedOption_); + pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + } + break; + case 10: { + JavaPackage = input.ReadString(); + break; + } + case 66: { + JavaOuterClassname = input.ReadString(); + break; + } + case 72: { + OptimizeFor = (global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode) input.ReadEnum(); + break; + } + case 80: { + JavaMultipleFiles = input.ReadBool(); + break; + } + case 90: { + GoPackage = input.ReadString(); + break; + } + case 128: { + CcGenericServices = input.ReadBool(); + break; + } + case 136: { + JavaGenericServices = input.ReadBool(); + break; + } + case 144: { + PyGenericServices = input.ReadBool(); + break; + } + case 160: { + JavaGenerateEqualsAndHash = input.ReadBool(); + break; + } + case 184: { + Deprecated = input.ReadBool(); + break; + } + case 216: { + JavaStringCheckUtf8 = input.ReadBool(); + break; + } + case 248: { + CcEnableArenas = input.ReadBool(); + break; + } + case 290: { + ObjcClassPrefix = input.ReadString(); + break; + } + case 298: { + CsharpNamespace = input.ReadString(); + break; + } + case 314: { + SwiftPrefix = input.ReadString(); + break; + } + case 322: { + PhpClassPrefix = input.ReadString(); + break; + } + case 330: { + PhpNamespace = input.ReadString(); + break; + } + case 336: { + PhpGenericServices = input.ReadBool(); + break; + } + case 354: { + PhpMetadataNamespace = input.ReadString(); + break; + } + case 362: { + RubyPackage = input.ReadString(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) { - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); } break; case 10: { @@ -4923,12 +6353,13 @@ namespace Google.Protobuf.Reflection { break; } case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); break; } } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -4955,6 +6386,7 @@ namespace Google.Protobuf.Reflection { #region Nested types /// Container for nested types declared in the FileOptions message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Generated classes can be optimized for speed or code size. @@ -4979,26 +6411,34 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class MessageOptions : pb::IExtendableMessage { + public sealed partial class MessageOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageOptions() { OnConstruction(); } @@ -5006,6 +6446,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageOptions(MessageOptions other) : this() { _hasBits0 = other._hasBits0; messageSetWireFormat_ = other.messageSetWireFormat_; @@ -5018,6 +6459,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MessageOptions Clone() { return new MessageOptions(this); } @@ -5048,6 +6490,7 @@ namespace Google.Protobuf.Reflection { /// the protocol compiler. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool MessageSetWireFormat { get { if ((_hasBits0 & 1) != 0) { return messageSetWireFormat_; } else { return MessageSetWireFormatDefaultValue; } } set { @@ -5057,11 +6500,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "message_set_wire_format" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMessageSetWireFormat { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "message_set_wire_format" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMessageSetWireFormat() { _hasBits0 &= ~1; } @@ -5077,6 +6522,7 @@ namespace Google.Protobuf.Reflection { /// from proto1 easier; new code should avoid fields named "descriptor". /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool NoStandardDescriptorAccessor { get { if ((_hasBits0 & 2) != 0) { return noStandardDescriptorAccessor_; } else { return NoStandardDescriptorAccessorDefaultValue; } } set { @@ -5086,11 +6532,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "no_standard_descriptor_accessor" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNoStandardDescriptorAccessor { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "no_standard_descriptor_accessor" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNoStandardDescriptorAccessor() { _hasBits0 &= ~2; } @@ -5107,6 +6555,7 @@ namespace Google.Protobuf.Reflection { /// this is a formalization for deprecating messages. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Deprecated { get { if ((_hasBits0 & 4) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } set { @@ -5116,11 +6565,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "deprecated" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecated { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "deprecated" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecated() { _hasBits0 &= ~4; } @@ -5154,6 +6605,7 @@ namespace Google.Protobuf.Reflection { /// parser. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool MapEntry { get { if ((_hasBits0 & 8) != 0) { return mapEntry_; } else { return MapEntryDefaultValue; } } set { @@ -5163,11 +6615,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "map_entry" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasMapEntry { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "map_entry" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearMapEntry() { _hasBits0 &= ~8; } @@ -5181,16 +6635,19 @@ namespace Google.Protobuf.Reflection { /// The parser stores options it doesn't recognize here. See above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MessageOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MessageOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -5210,6 +6667,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasMessageSetWireFormat) hash ^= MessageSetWireFormat.GetHashCode(); @@ -5227,12 +6685,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasMessageSetWireFormat) { output.WriteRawTag(8); output.WriteBool(MessageSetWireFormat); @@ -5256,9 +6719,41 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMessageSetWireFormat) { + output.WriteRawTag(8); + output.WriteBool(MessageSetWireFormat); + } + if (HasNoStandardDescriptorAccessor) { + output.WriteRawTag(16); + output.WriteBool(NoStandardDescriptorAccessor); + } + if (HasDeprecated) { + output.WriteRawTag(24); + output.WriteBool(Deprecated); + } + if (HasMapEntry) { + output.WriteRawTag(56); + output.WriteBool(MapEntry); + } + uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasMessageSetWireFormat) { @@ -5284,6 +6779,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MessageOptions other) { if (other == null) { return; @@ -5306,7 +6802,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5337,7 +6837,45 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + MessageSetWireFormat = input.ReadBool(); + break; + } + case 16: { + NoStandardDescriptorAccessor = input.ReadBool(); + break; + } + case 24: { + Deprecated = input.ReadBool(); + break; + } + case 56: { + MapEntry = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); + break; + } + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -5363,26 +6901,34 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class FieldOptions : pb::IExtendableMessage { + public sealed partial class FieldOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FieldOptions() { OnConstruction(); } @@ -5390,6 +6936,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FieldOptions(FieldOptions other) : this() { _hasBits0 = other._hasBits0; ctype_ = other.ctype_; @@ -5404,6 +6951,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FieldOptions Clone() { return new FieldOptions(this); } @@ -5420,6 +6968,7 @@ namespace Google.Protobuf.Reflection { /// release -- sorry, we'll try to include it in a future version! /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.FieldOptions.Types.CType Ctype { get { if ((_hasBits0 & 1) != 0) { return ctype_; } else { return CtypeDefaultValue; } } set { @@ -5429,11 +6978,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "ctype" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasCtype { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "ctype" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearCtype() { _hasBits0 &= ~1; } @@ -5451,6 +7002,7 @@ namespace Google.Protobuf.Reflection { /// false will avoid using packed encoding. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Packed { get { if ((_hasBits0 & 2) != 0) { return packed_; } else { return PackedDefaultValue; } } set { @@ -5460,11 +7012,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "packed" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPacked { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "packed" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPacked() { _hasBits0 &= ~2; } @@ -5488,6 +7042,7 @@ namespace Google.Protobuf.Reflection { /// goog.math.Integer. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.FieldOptions.Types.JSType Jstype { get { if ((_hasBits0 & 16) != 0) { return jstype_; } else { return JstypeDefaultValue; } } set { @@ -5497,11 +7052,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "jstype" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasJstype { get { return (_hasBits0 & 16) != 0; } } /// Clears the value of the "jstype" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearJstype() { _hasBits0 &= ~16; } @@ -5541,6 +7098,7 @@ namespace Google.Protobuf.Reflection { /// been parsed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Lazy { get { if ((_hasBits0 & 8) != 0) { return lazy_; } else { return LazyDefaultValue; } } set { @@ -5550,11 +7108,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "lazy" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasLazy { get { return (_hasBits0 & 8) != 0; } } /// Clears the value of the "lazy" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearLazy() { _hasBits0 &= ~8; } @@ -5571,6 +7131,7 @@ namespace Google.Protobuf.Reflection { /// is a formalization for deprecating fields. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Deprecated { get { if ((_hasBits0 & 4) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } set { @@ -5580,11 +7141,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "deprecated" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecated { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "deprecated" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecated() { _hasBits0 &= ~4; } @@ -5598,6 +7161,7 @@ namespace Google.Protobuf.Reflection { /// For Google-internal migration only. Do not use. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Weak { get { if ((_hasBits0 & 32) != 0) { return weak_; } else { return WeakDefaultValue; } } set { @@ -5607,11 +7171,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "weak" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasWeak { get { return (_hasBits0 & 32) != 0; } } /// Clears the value of the "weak" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearWeak() { _hasBits0 &= ~32; } @@ -5625,16 +7191,19 @@ namespace Google.Protobuf.Reflection { /// The parser stores options it doesn't recognize here. See above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FieldOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FieldOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -5656,6 +7225,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasCtype) hash ^= Ctype.GetHashCode(); @@ -5675,12 +7245,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasCtype) { output.WriteRawTag(8); output.WriteEnum((int) Ctype); @@ -5712,9 +7287,49 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasCtype) { + output.WriteRawTag(8); + output.WriteEnum((int) Ctype); + } + if (HasPacked) { + output.WriteRawTag(16); + output.WriteBool(Packed); + } + if (HasDeprecated) { + output.WriteRawTag(24); + output.WriteBool(Deprecated); + } + if (HasLazy) { + output.WriteRawTag(40); + output.WriteBool(Lazy); + } + if (HasJstype) { + output.WriteRawTag(48); + output.WriteEnum((int) Jstype); + } + if (HasWeak) { + output.WriteRawTag(80); + output.WriteBool(Weak); + } + uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasCtype) { @@ -5746,6 +7361,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FieldOptions other) { if (other == null) { return; @@ -5774,7 +7390,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -5813,7 +7433,53 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + Ctype = (global::Google.Protobuf.Reflection.FieldOptions.Types.CType) input.ReadEnum(); + break; + } + case 16: { + Packed = input.ReadBool(); + break; + } + case 24: { + Deprecated = input.ReadBool(); + break; + } + case 40: { + Lazy = input.ReadBool(); + break; + } + case 48: { + Jstype = (global::Google.Protobuf.Reflection.FieldOptions.Types.JSType) input.ReadEnum(); + break; + } + case 80: { + Weak = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); + break; + } + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -5840,6 +7506,7 @@ namespace Google.Protobuf.Reflection { #region Nested types /// Container for nested types declared in the FieldOptions message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum CType { /// @@ -5870,25 +7537,33 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class OneofOptions : pb::IExtendableMessage { + public sealed partial class OneofOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofOptions() { OnConstruction(); } @@ -5896,6 +7571,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofOptions(OneofOptions other) : this() { uninterpretedOption_ = other.uninterpretedOption_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); @@ -5903,6 +7579,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OneofOptions Clone() { return new OneofOptions(this); } @@ -5916,16 +7593,19 @@ namespace Google.Protobuf.Reflection { /// The parser stores options it doesn't recognize here. See above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OneofOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OneofOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -5941,6 +7621,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= uninterpretedOption_.GetHashCode(); @@ -5954,12 +7635,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else uninterpretedOption_.WriteTo(output, _repeated_uninterpretedOption_codec); if (_extensions != null) { _extensions.WriteTo(output); @@ -5967,9 +7653,25 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += uninterpretedOption_.CalculateSize(_repeated_uninterpretedOption_codec); @@ -5983,6 +7685,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OneofOptions other) { if (other == null) { return; @@ -5993,7 +7696,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6008,7 +7715,29 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 7994: { + uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); + break; + } + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6034,26 +7763,34 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class EnumOptions : pb::IExtendableMessage { + public sealed partial class EnumOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumOptions() { OnConstruction(); } @@ -6061,6 +7798,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumOptions(EnumOptions other) : this() { _hasBits0 = other._hasBits0; allowAlias_ = other.allowAlias_; @@ -6071,6 +7809,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumOptions Clone() { return new EnumOptions(this); } @@ -6085,6 +7824,7 @@ namespace Google.Protobuf.Reflection { /// value. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool AllowAlias { get { if ((_hasBits0 & 1) != 0) { return allowAlias_; } else { return AllowAliasDefaultValue; } } set { @@ -6094,11 +7834,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "allow_alias" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasAllowAlias { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "allow_alias" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearAllowAlias() { _hasBits0 &= ~1; } @@ -6115,6 +7857,7 @@ namespace Google.Protobuf.Reflection { /// is a formalization for deprecating enums. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Deprecated { get { if ((_hasBits0 & 2) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } set { @@ -6124,11 +7867,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "deprecated" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecated { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "deprecated" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecated() { _hasBits0 &= ~2; } @@ -6142,16 +7887,19 @@ namespace Google.Protobuf.Reflection { /// The parser stores options it doesn't recognize here. See above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as EnumOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(EnumOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -6169,6 +7917,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasAllowAlias) hash ^= AllowAlias.GetHashCode(); @@ -6184,12 +7933,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasAllowAlias) { output.WriteRawTag(16); output.WriteBool(AllowAlias); @@ -6205,9 +7959,33 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasAllowAlias) { + output.WriteRawTag(16); + output.WriteBool(AllowAlias); + } + if (HasDeprecated) { + output.WriteRawTag(24); + output.WriteBool(Deprecated); + } + uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasAllowAlias) { @@ -6227,6 +8005,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(EnumOptions other) { if (other == null) { return; @@ -6243,7 +8022,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6266,7 +8049,37 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 16: { + AllowAlias = input.ReadBool(); + break; + } + case 24: { + Deprecated = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); + break; + } + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6292,26 +8105,34 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class EnumValueOptions : pb::IExtendableMessage { + public sealed partial class EnumValueOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumValueOptions() { OnConstruction(); } @@ -6319,6 +8140,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumValueOptions(EnumValueOptions other) : this() { _hasBits0 = other._hasBits0; deprecated_ = other.deprecated_; @@ -6328,6 +8150,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumValueOptions Clone() { return new EnumValueOptions(this); } @@ -6344,6 +8167,7 @@ namespace Google.Protobuf.Reflection { /// this is a formalization for deprecating enum values. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Deprecated { get { if ((_hasBits0 & 1) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } set { @@ -6353,11 +8177,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "deprecated" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecated { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "deprecated" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecated() { _hasBits0 &= ~1; } @@ -6371,16 +8197,19 @@ namespace Google.Protobuf.Reflection { /// The parser stores options it doesn't recognize here. See above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as EnumValueOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(EnumValueOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -6397,6 +8226,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasDeprecated) hash ^= Deprecated.GetHashCode(); @@ -6411,12 +8241,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasDeprecated) { output.WriteRawTag(8); output.WriteBool(Deprecated); @@ -6428,9 +8263,29 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDeprecated) { + output.WriteRawTag(8); + output.WriteBool(Deprecated); + } + uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasDeprecated) { @@ -6447,6 +8302,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(EnumValueOptions other) { if (other == null) { return; @@ -6460,7 +8316,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6479,7 +8339,33 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 8: { + Deprecated = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); + break; + } + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6505,26 +8391,34 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class ServiceOptions : pb::IExtendableMessage { + public sealed partial class ServiceOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ServiceOptions() { OnConstruction(); } @@ -6532,6 +8426,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ServiceOptions(ServiceOptions other) : this() { _hasBits0 = other._hasBits0; deprecated_ = other.deprecated_; @@ -6541,6 +8436,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ServiceOptions Clone() { return new ServiceOptions(this); } @@ -6557,6 +8453,7 @@ namespace Google.Protobuf.Reflection { /// this is a formalization for deprecating services. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Deprecated { get { if ((_hasBits0 & 1) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } set { @@ -6566,11 +8463,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "deprecated" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecated { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "deprecated" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecated() { _hasBits0 &= ~1; } @@ -6584,16 +8483,19 @@ namespace Google.Protobuf.Reflection { /// The parser stores options it doesn't recognize here. See above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ServiceOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ServiceOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -6610,6 +8512,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasDeprecated) hash ^= Deprecated.GetHashCode(); @@ -6624,12 +8527,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasDeprecated) { output.WriteRawTag(136, 2); output.WriteBool(Deprecated); @@ -6641,9 +8549,29 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDeprecated) { + output.WriteRawTag(136, 2); + output.WriteBool(Deprecated); + } + uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasDeprecated) { @@ -6660,6 +8588,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ServiceOptions other) { if (other == null) { return; @@ -6673,7 +8602,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6687,12 +8620,38 @@ namespace Google.Protobuf.Reflection { break; } case 7994: { - uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 264: { + Deprecated = input.ReadBool(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); break; } } } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6718,26 +8677,34 @@ namespace Google.Protobuf.Reflection { } - public sealed partial class MethodOptions : pb::IExtendableMessage { + public sealed partial class MethodOptions : pb::IExtendableMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodOptions()); private pb::UnknownFieldSet _unknownFields; internal pb::ExtensionSet _extensions; private pb::ExtensionSet _Extensions { get { return _extensions; } } private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[17]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MethodOptions() { OnConstruction(); } @@ -6745,6 +8712,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MethodOptions(MethodOptions other) : this() { _hasBits0 = other._hasBits0; deprecated_ = other.deprecated_; @@ -6755,6 +8723,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public MethodOptions Clone() { return new MethodOptions(this); } @@ -6771,6 +8740,7 @@ namespace Google.Protobuf.Reflection { /// this is a formalization for deprecating methods. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Deprecated { get { if ((_hasBits0 & 1) != 0) { return deprecated_; } else { return DeprecatedDefaultValue; } } set { @@ -6780,11 +8750,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "deprecated" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDeprecated { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "deprecated" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDeprecated() { _hasBits0 &= ~1; } @@ -6795,6 +8767,7 @@ namespace Google.Protobuf.Reflection { private global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel idempotencyLevel_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel IdempotencyLevel { get { if ((_hasBits0 & 2) != 0) { return idempotencyLevel_; } else { return IdempotencyLevelDefaultValue; } } set { @@ -6804,11 +8777,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "idempotency_level" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasIdempotencyLevel { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "idempotency_level" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearIdempotencyLevel() { _hasBits0 &= ~2; } @@ -6822,16 +8797,19 @@ namespace Google.Protobuf.Reflection { /// The parser stores options it doesn't recognize here. See above. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as MethodOptions); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(MethodOptions other) { if (ReferenceEquals(other, null)) { return false; @@ -6849,6 +8827,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasDeprecated) hash ^= Deprecated.GetHashCode(); @@ -6864,12 +8843,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasDeprecated) { output.WriteRawTag(136, 2); output.WriteBool(Deprecated); @@ -6885,9 +8869,33 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasDeprecated) { + output.WriteRawTag(136, 2); + output.WriteBool(Deprecated); + } + if (HasIdempotencyLevel) { + output.WriteRawTag(144, 2); + output.WriteEnum((int) IdempotencyLevel); + } + uninterpretedOption_.WriteTo(ref output, _repeated_uninterpretedOption_codec); + if (_extensions != null) { + _extensions.WriteTo(ref output); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasDeprecated) { @@ -6907,6 +8915,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(MethodOptions other) { if (other == null) { return; @@ -6923,7 +8932,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -6946,7 +8959,37 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + } + break; + case 264: { + Deprecated = input.ReadBool(); + break; + } + case 272: { + IdempotencyLevel = (global::Google.Protobuf.Reflection.MethodOptions.Types.IdempotencyLevel) input.ReadEnum(); + break; + } + case 7994: { + uninterpretedOption_.AddEntriesFrom(ref input, _repeated_uninterpretedOption_codec); + break; + } + } + } } + #endif public TValue GetExtension(pb::Extension extension) { return pb::ExtensionSet.Get(ref _extensions, extension); @@ -6973,6 +9016,7 @@ namespace Google.Protobuf.Reflection { #region Nested types /// Container for nested types declared in the MethodOptions message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent, @@ -7004,24 +9048,32 @@ namespace Google.Protobuf.Reflection { /// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions /// in them. /// - public sealed partial class UninterpretedOption : pb::IMessage { + public sealed partial class UninterpretedOption : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UninterpretedOption()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public UninterpretedOption() { OnConstruction(); } @@ -7029,6 +9081,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public UninterpretedOption(UninterpretedOption other) : this() { _hasBits0 = other._hasBits0; name_ = other.name_.Clone(); @@ -7042,6 +9095,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public UninterpretedOption Clone() { return new UninterpretedOption(this); } @@ -7052,6 +9106,7 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart.Parser); private readonly pbc::RepeatedField name_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Name { get { return name_; } } @@ -7066,6 +9121,7 @@ namespace Google.Protobuf.Reflection { /// identified it as during parsing. Exactly one of these should be set. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string IdentifierValue { get { return identifierValue_ ?? IdentifierValueDefaultValue; } set { @@ -7074,11 +9130,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "identifier_value" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasIdentifierValue { get { return identifierValue_ != null; } } /// Clears the value of the "identifier_value" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearIdentifierValue() { identifierValue_ = null; } @@ -7089,6 +9147,7 @@ namespace Google.Protobuf.Reflection { private ulong positiveIntValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ulong PositiveIntValue { get { if ((_hasBits0 & 1) != 0) { return positiveIntValue_; } else { return PositiveIntValueDefaultValue; } } set { @@ -7098,11 +9157,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "positive_int_value" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasPositiveIntValue { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "positive_int_value" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearPositiveIntValue() { _hasBits0 &= ~1; } @@ -7113,6 +9174,7 @@ namespace Google.Protobuf.Reflection { private long negativeIntValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long NegativeIntValue { get { if ((_hasBits0 & 2) != 0) { return negativeIntValue_; } else { return NegativeIntValueDefaultValue; } } set { @@ -7122,11 +9184,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "negative_int_value" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNegativeIntValue { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "negative_int_value" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNegativeIntValue() { _hasBits0 &= ~2; } @@ -7137,6 +9201,7 @@ namespace Google.Protobuf.Reflection { private double doubleValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double DoubleValue { get { if ((_hasBits0 & 4) != 0) { return doubleValue_; } else { return DoubleValueDefaultValue; } } set { @@ -7146,11 +9211,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "double_value" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasDoubleValue { get { return (_hasBits0 & 4) != 0; } } /// Clears the value of the "double_value" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearDoubleValue() { _hasBits0 &= ~4; } @@ -7161,6 +9228,7 @@ namespace Google.Protobuf.Reflection { private pb::ByteString stringValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString StringValue { get { return stringValue_ ?? StringValueDefaultValue; } set { @@ -7169,11 +9237,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "string_value" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasStringValue { get { return stringValue_ != null; } } /// Clears the value of the "string_value" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearStringValue() { stringValue_ = null; } @@ -7184,6 +9254,7 @@ namespace Google.Protobuf.Reflection { private string aggregateValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string AggregateValue { get { return aggregateValue_ ?? AggregateValueDefaultValue; } set { @@ -7192,21 +9263,25 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "aggregate_value" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasAggregateValue { get { return aggregateValue_ != null; } } /// Clears the value of the "aggregate_value" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearAggregateValue() { aggregateValue_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as UninterpretedOption); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(UninterpretedOption other) { if (ReferenceEquals(other, null)) { return false; @@ -7225,6 +9300,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= name_.GetHashCode(); @@ -7241,12 +9317,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else name_.WriteTo(output, _repeated_name_codec); if (HasIdentifierValue) { output.WriteRawTag(26); @@ -7275,9 +9356,46 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + name_.WriteTo(ref output, _repeated_name_codec); + if (HasIdentifierValue) { + output.WriteRawTag(26); + output.WriteString(IdentifierValue); + } + if (HasPositiveIntValue) { + output.WriteRawTag(32); + output.WriteUInt64(PositiveIntValue); + } + if (HasNegativeIntValue) { + output.WriteRawTag(40); + output.WriteInt64(NegativeIntValue); + } + if (HasDoubleValue) { + output.WriteRawTag(49); + output.WriteDouble(DoubleValue); + } + if (HasStringValue) { + output.WriteRawTag(58); + output.WriteBytes(StringValue); + } + if (HasAggregateValue) { + output.WriteRawTag(66); + output.WriteString(AggregateValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += name_.CalculateSize(_repeated_name_codec); @@ -7306,6 +9424,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(UninterpretedOption other) { if (other == null) { return; @@ -7333,7 +9452,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7370,11 +9493,56 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 18: { + name_.AddEntriesFrom(ref input, _repeated_name_codec); + break; + } + case 26: { + IdentifierValue = input.ReadString(); + break; + } + case 32: { + PositiveIntValue = input.ReadUInt64(); + break; + } + case 40: { + NegativeIntValue = input.ReadInt64(); + break; + } + case 49: { + DoubleValue = input.ReadDouble(); + break; + } + case 58: { + StringValue = input.ReadBytes(); + break; + } + case 66: { + AggregateValue = input.ReadString(); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the UninterpretedOption message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// The name of the uninterpreted option. Each string represents a segment in @@ -7383,24 +9551,32 @@ namespace Google.Protobuf.Reflection { /// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents /// "foo.(bar.baz).qux". /// - public sealed partial class NamePart : pb::IMessage { + public sealed partial class NamePart : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NamePart()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.UninterpretedOption.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NamePart() { OnConstruction(); } @@ -7408,6 +9584,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NamePart(NamePart other) : this() { _hasBits0 = other._hasBits0; namePart_ = other.namePart_; @@ -7416,6 +9593,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NamePart Clone() { return new NamePart(this); } @@ -7426,6 +9604,7 @@ namespace Google.Protobuf.Reflection { private string namePart_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string NamePart_ { get { return namePart_ ?? NamePart_DefaultValue; } set { @@ -7434,11 +9613,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "name_part" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasNamePart_ { get { return namePart_ != null; } } /// Clears the value of the "name_part" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearNamePart_() { namePart_ = null; } @@ -7449,6 +9630,7 @@ namespace Google.Protobuf.Reflection { private bool isExtension_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool IsExtension { get { if ((_hasBits0 & 1) != 0) { return isExtension_; } else { return IsExtensionDefaultValue; } } set { @@ -7458,21 +9640,25 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "is_extension" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasIsExtension { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "is_extension" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearIsExtension() { _hasBits0 &= ~1; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NamePart); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NamePart other) { if (ReferenceEquals(other, null)) { return false; @@ -7486,6 +9672,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (HasNamePart_) hash ^= NamePart_.GetHashCode(); @@ -7497,12 +9684,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (HasNamePart_) { output.WriteRawTag(10); output.WriteString(NamePart_); @@ -7514,9 +9706,29 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasNamePart_) { + output.WriteRawTag(10); + output.WriteString(NamePart_); + } + if (HasIsExtension) { + output.WriteRawTag(16); + output.WriteBool(IsExtension); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (HasNamePart_) { @@ -7532,6 +9744,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NamePart other) { if (other == null) { return; @@ -7546,7 +9759,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7563,7 +9780,31 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + NamePart_ = input.ReadString(); + break; + } + case 16: { + IsExtension = input.ReadBool(); + break; + } + } + } } + #endif } @@ -7576,23 +9817,31 @@ namespace Google.Protobuf.Reflection { /// Encapsulates information about the original source file from which a /// FileDescriptorProto was generated. /// - public sealed partial class SourceCodeInfo : pb::IMessage { + public sealed partial class SourceCodeInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceCodeInfo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[19]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SourceCodeInfo() { OnConstruction(); } @@ -7600,12 +9849,14 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SourceCodeInfo(SourceCodeInfo other) : this() { location_ = other.location_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SourceCodeInfo Clone() { return new SourceCodeInfo(this); } @@ -7661,16 +9912,19 @@ namespace Google.Protobuf.Reflection { /// be recorded in the future. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Location { get { return location_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SourceCodeInfo); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SourceCodeInfo other) { if (ReferenceEquals(other, null)) { return false; @@ -7683,6 +9937,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= location_.GetHashCode(); @@ -7693,19 +9948,37 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else location_.WriteTo(output, _repeated_location_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + location_.WriteTo(ref output, _repeated_location_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += location_.CalculateSize(_repeated_location_codec); @@ -7716,6 +9989,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SourceCodeInfo other) { if (other == null) { return; @@ -7725,7 +9999,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -7738,29 +10016,58 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + location_.AddEntriesFrom(ref input, _repeated_location_codec); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the SourceCodeInfo message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class Location : pb::IMessage { + public sealed partial class Location : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Location()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.SourceCodeInfo.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Location() { OnConstruction(); } @@ -7768,6 +10075,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Location(Location other) : this() { path_ = other.path_.Clone(); span_ = other.span_.Clone(); @@ -7778,6 +10086,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Location Clone() { return new Location(this); } @@ -7813,6 +10122,7 @@ namespace Google.Protobuf.Reflection { /// of the label to the terminating semicolon). /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Path { get { return path_; } } @@ -7830,6 +10140,7 @@ namespace Google.Protobuf.Reflection { /// 1 to each before displaying to a user. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Span { get { return span_; } } @@ -7889,6 +10200,7 @@ namespace Google.Protobuf.Reflection { /// // ignored detached comments. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string LeadingComments { get { return leadingComments_ ?? LeadingCommentsDefaultValue; } set { @@ -7897,11 +10209,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "leading_comments" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasLeadingComments { get { return leadingComments_ != null; } } /// Clears the value of the "leading_comments" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearLeadingComments() { leadingComments_ = null; } @@ -7912,6 +10226,7 @@ namespace Google.Protobuf.Reflection { private string trailingComments_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string TrailingComments { get { return trailingComments_ ?? TrailingCommentsDefaultValue; } set { @@ -7920,11 +10235,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "trailing_comments" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasTrailingComments { get { return trailingComments_ != null; } } /// Clears the value of the "trailing_comments" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearTrailingComments() { trailingComments_ = null; } @@ -7935,16 +10252,19 @@ namespace Google.Protobuf.Reflection { = pb::FieldCodec.ForString(50); private readonly pbc::RepeatedField leadingDetachedComments_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField LeadingDetachedComments { get { return leadingDetachedComments_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Location); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Location other) { if (ReferenceEquals(other, null)) { return false; @@ -7961,6 +10281,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= path_.GetHashCode(); @@ -7975,12 +10296,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else path_.WriteTo(output, _repeated_path_codec); span_.WriteTo(output, _repeated_span_codec); if (HasLeadingComments) { @@ -7995,9 +10321,32 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + path_.WriteTo(ref output, _repeated_path_codec); + span_.WriteTo(ref output, _repeated_span_codec); + if (HasLeadingComments) { + output.WriteRawTag(26); + output.WriteString(LeadingComments); + } + if (HasTrailingComments) { + output.WriteRawTag(34); + output.WriteString(TrailingComments); + } + leadingDetachedComments_.WriteTo(ref output, _repeated_leadingDetachedComments_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += path_.CalculateSize(_repeated_path_codec); @@ -8016,6 +10365,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Location other) { if (other == null) { return; @@ -8033,7 +10383,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -8064,7 +10418,45 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 8: { + path_.AddEntriesFrom(ref input, _repeated_path_codec); + break; + } + case 18: + case 16: { + span_.AddEntriesFrom(ref input, _repeated_span_codec); + break; + } + case 26: { + LeadingComments = input.ReadString(); + break; + } + case 34: { + TrailingComments = input.ReadString(); + break; + } + case 50: { + leadingDetachedComments_.AddEntriesFrom(ref input, _repeated_leadingDetachedComments_codec); + break; + } + } + } } + #endif } @@ -8078,23 +10470,31 @@ namespace Google.Protobuf.Reflection { /// file. A GeneratedCodeInfo message is associated with only one generated /// source file, but may contain references to different source .proto files. /// - public sealed partial class GeneratedCodeInfo : pb::IMessage { + public sealed partial class GeneratedCodeInfo : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GeneratedCodeInfo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor.MessageTypes[20]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GeneratedCodeInfo() { OnConstruction(); } @@ -8102,12 +10502,14 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GeneratedCodeInfo(GeneratedCodeInfo other) : this() { annotation_ = other.annotation_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GeneratedCodeInfo Clone() { return new GeneratedCodeInfo(this); } @@ -8122,16 +10524,19 @@ namespace Google.Protobuf.Reflection { /// of its generating .proto file. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Annotation { get { return annotation_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as GeneratedCodeInfo); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(GeneratedCodeInfo other) { if (ReferenceEquals(other, null)) { return false; @@ -8144,6 +10549,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= annotation_.GetHashCode(); @@ -8154,19 +10560,37 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else annotation_.WriteTo(output, _repeated_annotation_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + annotation_.WriteTo(ref output, _repeated_annotation_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += annotation_.CalculateSize(_repeated_annotation_codec); @@ -8177,6 +10601,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(GeneratedCodeInfo other) { if (other == null) { return; @@ -8186,7 +10611,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -8199,30 +10628,59 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + annotation_.AddEntriesFrom(ref input, _repeated_annotation_codec); + break; + } + } + } } + #endif #region Nested types /// Container for nested types declared in the GeneratedCodeInfo message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { - public sealed partial class Annotation : pb::IMessage { + public sealed partial class Annotation : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Annotation()); private pb::UnknownFieldSet _unknownFields; private int _hasBits0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.GeneratedCodeInfo.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Annotation() { OnConstruction(); } @@ -8230,6 +10688,7 @@ namespace Google.Protobuf.Reflection { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Annotation(Annotation other) : this() { _hasBits0 = other._hasBits0; path_ = other.path_.Clone(); @@ -8240,6 +10699,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Annotation Clone() { return new Annotation(this); } @@ -8254,6 +10714,7 @@ namespace Google.Protobuf.Reflection { /// is formatted the same as SourceCodeInfo.Location.path. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Path { get { return path_; } } @@ -8267,6 +10728,7 @@ namespace Google.Protobuf.Reflection { /// Identifies the filesystem path to the original source .proto. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string SourceFile { get { return sourceFile_ ?? SourceFileDefaultValue; } set { @@ -8275,11 +10737,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "source_file" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasSourceFile { get { return sourceFile_ != null; } } /// Clears the value of the "source_file" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSourceFile() { sourceFile_ = null; } @@ -8294,6 +10758,7 @@ namespace Google.Protobuf.Reflection { /// that relates to the identified object. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Begin { get { if ((_hasBits0 & 1) != 0) { return begin_; } else { return BeginDefaultValue; } } set { @@ -8303,11 +10768,13 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "begin" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasBegin { get { return (_hasBits0 & 1) != 0; } } /// Clears the value of the "begin" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearBegin() { _hasBits0 &= ~1; } @@ -8323,6 +10790,7 @@ namespace Google.Protobuf.Reflection { /// the last relevant byte (so the length of the text = end - begin). /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int End { get { if ((_hasBits0 & 2) != 0) { return end_; } else { return EndDefaultValue; } } set { @@ -8332,21 +10800,25 @@ namespace Google.Protobuf.Reflection { } /// Gets whether the "end" field is set [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool HasEnd { get { return (_hasBits0 & 2) != 0; } } /// Clears the value of the "end" field [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearEnd() { _hasBits0 &= ~2; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Annotation); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Annotation other) { if (ReferenceEquals(other, null)) { return false; @@ -8362,6 +10834,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= path_.GetHashCode(); @@ -8375,12 +10848,17 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else path_.WriteTo(output, _repeated_path_codec); if (HasSourceFile) { output.WriteRawTag(18); @@ -8397,9 +10875,34 @@ namespace Google.Protobuf.Reflection { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + path_.WriteTo(ref output, _repeated_path_codec); + if (HasSourceFile) { + output.WriteRawTag(18); + output.WriteString(SourceFile); + } + if (HasBegin) { + output.WriteRawTag(24); + output.WriteInt32(Begin); + } + if (HasEnd) { + output.WriteRawTag(32); + output.WriteInt32(End); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += path_.CalculateSize(_repeated_path_codec); @@ -8419,6 +10922,7 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Annotation other) { if (other == null) { return; @@ -8437,7 +10941,11 @@ namespace Google.Protobuf.Reflection { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -8463,7 +10971,40 @@ namespace Google.Protobuf.Reflection { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: + case 8: { + path_.AddEntriesFrom(ref input, _repeated_path_codec); + break; + } + case 18: { + SourceFile = input.ReadString(); + break; + } + case 24: { + Begin = input.ReadInt32(); + break; + } + case 32: { + End = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs index 264a88a063..f7e8b5b5f2 100644 --- a/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs @@ -128,12 +128,21 @@ namespace Google.Protobuf.Reflection /// /// The (possibly empty) set of custom options for this enum. /// - [Obsolete("CustomOptions are obsolete. Use GetOption")] + [Obsolete("CustomOptions are obsolete. Use the GetOptions() method.")] public CustomOptions CustomOptions => new CustomOptions(Proto.Options?._extensions?.ValuesByNumber); + /// + /// The EnumOptions, defined in descriptor.proto. + /// If the options message is not present (i.e. there are no options), null is returned. + /// Custom options can be retrieved as extensions of the returned message. + /// NOTE: A defensive copy is created each time this property is retrieved. + /// + public EnumOptions GetOptions() => Proto.Options?.Clone(); + /// /// Gets a single value enum option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public T GetOption(Extension extension) { var value = Proto.Options.GetExtension(extension); @@ -143,6 +152,7 @@ namespace Google.Protobuf.Reflection /// /// Gets a repeated value enum option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public RepeatedField GetOption(RepeatedExtension extension) { return Proto.Options.GetExtension(extension).Clone(); diff --git a/csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs index 3933820105..05097bd1da 100644 --- a/csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs @@ -73,12 +73,21 @@ namespace Google.Protobuf.Reflection /// /// The (possibly empty) set of custom options for this enum value. /// - [Obsolete("CustomOptions are obsolete. Use GetOption")] + [Obsolete("CustomOptions are obsolete. Use the GetOptions() method.")] public CustomOptions CustomOptions => new CustomOptions(Proto.Options?._extensions?.ValuesByNumber); + /// + /// The EnumValueOptions, defined in descriptor.proto. + /// If the options message is not present (i.e. there are no options), null is returned. + /// Custom options can be retrieved as extensions of the returned message. + /// NOTE: A defensive copy is created each time this property is retrieved. + /// + public EnumValueOptions GetOptions() => Proto.Options?.Clone(); + /// /// Gets a single value enum value option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public T GetOption(Extension extension) { var value = Proto.Options.GetExtension(extension); @@ -88,6 +97,7 @@ namespace Google.Protobuf.Reflection /// /// Gets a repeated value enum value option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public RepeatedField GetOption(RepeatedExtension extension) { return Proto.Options.GetExtension(extension).Clone(); diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs index ddd671aadb..7324e3dfc6 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs @@ -58,12 +58,33 @@ namespace Google.Protobuf.Reflection /// public OneofDescriptor ContainingOneof { get; } + /// + /// Returns the oneof containing this field if it's a "real" oneof, or null if either this + /// field is not part of a oneof, or the oneof is synthetic. + /// + public OneofDescriptor RealContainingOneof => ContainingOneof?.IsSynthetic == false ? ContainingOneof : null; + /// /// The effective JSON name for this field. This is usually the lower-camel-cased form of the field name, /// but can be overridden using the json_name option in the .proto file. /// public string JsonName { get; } + /// + /// Indicates whether this field supports presence, either implicitly (e.g. due to it being a message + /// type field) or explicitly via Has/Clear members. If this returns true, it is safe to call + /// and + /// on this field's accessor with a suitable message. + /// + public bool HasPresence => + Extension != null ? !Extension.IsRepeated + : IsRepeated ? false + : IsMap ? false + : FieldType == FieldType.Message ? true + // This covers "real oneof members" and "proto3 optional fields" + : ContainingOneof != null ? true + : File.Syntax == Syntax.Proto2; + internal FieldDescriptorProto Proto { get; } /// @@ -298,12 +319,21 @@ namespace Google.Protobuf.Reflection /// /// The (possibly empty) set of custom options for this field. /// - [Obsolete("CustomOptions are obsolete. Use GetOption")] + [Obsolete("CustomOptions are obsolete. Use the GetOptions() method.")] public CustomOptions CustomOptions => new CustomOptions(Proto.Options?._extensions?.ValuesByNumber); + /// + /// The FieldOptions, defined in descriptor.proto. + /// If the options message is not present (i.e. there are no options), null is returned. + /// Custom options can be retrieved as extensions of the returned message. + /// NOTE: A defensive copy is created each time this property is retrieved. + /// + public FieldOptions GetOptions() => Proto.Options?.Clone(); + /// /// Gets a single value field option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public T GetOption(Extension extension) { var value = Proto.Options.GetExtension(extension); @@ -313,6 +343,7 @@ namespace Google.Protobuf.Reflection /// /// Gets a repeated value field option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public RepeatedField GetOption(RepeatedExtension extension) { return Proto.Options.GetExtension(extension).Clone(); @@ -388,7 +419,7 @@ namespace Google.Protobuf.Reflection File.DescriptorPool.AddFieldByNumber(this); - if (ContainingType != null && ContainingType.Proto.HasOptions && ContainingType.Proto.Options.MessageSetWireFormat) + if (ContainingType != null && ContainingType.Proto.Options != null && ContainingType.Proto.Options.MessageSetWireFormat) { throw new DescriptorValidationException(this, "MessageSet format is not supported."); } diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs index 56c0caacfd..724bb3a04d 100644 --- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs @@ -481,18 +481,21 @@ namespace Google.Protobuf.Reflection /// dependencies must come before the descriptor which depends on them. (If A depends on B, and B /// depends on C, then the descriptors must be presented in the order C, B, A.) This is compatible /// with the order in which protoc provides descriptors to plugins. + /// The extension registry to use when parsing, or null if no extensions are required. /// The file descriptors corresponding to . - public static IReadOnlyList BuildFromByteStrings(IEnumerable descriptorData) + public static IReadOnlyList BuildFromByteStrings(IEnumerable descriptorData, ExtensionRegistry registry) { ProtoPreconditions.CheckNotNull(descriptorData, nameof(descriptorData)); + var parser = FileDescriptorProto.Parser.WithExtensionRegistry(registry); + // TODO: See if we can build a single DescriptorPool instead of building lots of them. // This will all behave correctly, but it's less efficient than we'd like. var descriptors = new List(); var descriptorsByName = new Dictionary(); foreach (var data in descriptorData) { - var proto = FileDescriptorProto.Parser.ParseFrom(data); + var proto = parser.ParseFrom(data); var dependencies = new List(); foreach (var dependencyName in proto.Dependency) { @@ -518,6 +521,18 @@ namespace Google.Protobuf.Reflection return new ReadOnlyCollection(descriptors); } + /// + /// Converts the given descriptor binary data into FileDescriptor objects. + /// Note: reflection using the returned FileDescriptors is not currently supported. + /// + /// The binary file descriptor proto data. Must not be null, and any + /// dependencies must come before the descriptor which depends on them. (If A depends on B, and B + /// depends on C, then the descriptors must be presented in the order C, B, A.) This is compatible + /// with the order in which protoc provides descriptors to plugins. + /// The file descriptors corresponding to . + public static IReadOnlyList BuildFromByteStrings(IEnumerable descriptorData) => + BuildFromByteStrings(descriptorData, null); + /// /// Returns a that represents this instance. /// @@ -547,12 +562,21 @@ namespace Google.Protobuf.Reflection /// /// The (possibly empty) set of custom options for this file. /// - [Obsolete("CustomOptions are obsolete. Use GetOption")] + [Obsolete("CustomOptions are obsolete. Use the GetOptions() method.")] public CustomOptions CustomOptions => new CustomOptions(Proto.Options?._extensions?.ValuesByNumber); + /// + /// The FileOptions, defined in descriptor.proto. + /// If the options message is not present (i.e. there are no options), null is returned. + /// Custom options can be retrieved as extensions of the returned message. + /// NOTE: A defensive copy is created each time this property is retrieved. + /// + public FileOptions GetOptions() => Proto.Options?.Clone(); + /// /// Gets a single value file option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public T GetOption(Extension extension) { var value = Proto.Options.GetExtension(extension); @@ -562,6 +586,7 @@ namespace Google.Protobuf.Reflection /// /// Gets a repeated value file option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public RepeatedField GetOption(RepeatedExtension extension) { return Proto.Options.GetExtension(extension).Clone(); diff --git a/csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs index b48c4f9df5..d73427b73b 100644 --- a/csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs @@ -59,7 +59,8 @@ namespace Google.Protobuf.Reflection object GetValue(IMessage message); /// - /// Indicates whether the field in the specified message is set. For proto3 fields, this throws an + /// Indicates whether the field in the specified message is set. + /// For proto3 fields that aren't explicitly optional, this throws an /// bool HasValue(IMessage message); diff --git a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs index eda1965c54..7b5ab2fb48 100644 --- a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs @@ -80,6 +80,20 @@ namespace Google.Protobuf.Reflection (oneof, index) => new OneofDescriptor(oneof, file, this, index, generatedCodeInfo?.OneofNames[index])); + int syntheticOneofCount = 0; + foreach (var oneof in Oneofs) + { + if (oneof.IsSynthetic) + { + syntheticOneofCount++; + } + else if (syntheticOneofCount != 0) + { + throw new ArgumentException("All synthetic oneofs should come after real oneofs"); + } + } + RealOneofCount = Oneofs.Count - syntheticOneofCount; + NestedTypes = DescriptorUtil.ConvertAndMakeReadOnly( proto.NestedType, (type, index) => @@ -234,9 +248,19 @@ namespace Google.Protobuf.Reflection /// /// An unmodifiable list of the "oneof" field collections in this message type. + /// All "real" oneofs (where returns false) + /// come before synthetic ones. /// public IList Oneofs { get; } + /// + /// The number of real "oneof" descriptors in this message type. Every element in + /// with an index less than this will have a property value + /// of false; every element with an index greater than or equal to this will have a + /// property value of true. + /// + public int RealOneofCount { get; } + /// /// Finds a field by field name. /// @@ -263,12 +287,21 @@ namespace Google.Protobuf.Reflection /// /// The (possibly empty) set of custom options for this message. /// - [Obsolete("CustomOptions are obsolete. Use GetOption")] + [Obsolete("CustomOptions are obsolete. Use the GetOptions() method.")] public CustomOptions CustomOptions => new CustomOptions(Proto.Options?._extensions?.ValuesByNumber); + /// + /// The MessageOptions, defined in descriptor.proto. + /// If the options message is not present (i.e. there are no options), null is returned. + /// Custom options can be retrieved as extensions of the returned message. + /// NOTE: A defensive copy is created each time this property is retrieved. + /// + public MessageOptions GetOptions() => Proto.Options?.Clone(); + /// /// Gets a single value message option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public T GetOption(Extension extension) { var value = Proto.Options.GetExtension(extension); @@ -278,6 +311,7 @@ namespace Google.Protobuf.Reflection /// /// Gets a repeated value message option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public Collections.RepeatedField GetOption(RepeatedExtension extension) { return Proto.Options.GetExtension(extension).Clone(); diff --git a/csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs index 92250ba662..8e1503767b 100644 --- a/csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs @@ -73,12 +73,21 @@ namespace Google.Protobuf.Reflection /// /// The (possibly empty) set of custom options for this method. /// - [Obsolete("CustomOptions are obsolete. Use GetOption")] + [Obsolete("CustomOptions are obsolete. Use the GetOptions() method.")] public CustomOptions CustomOptions => new CustomOptions(Proto.Options?._extensions?.ValuesByNumber); + /// + /// The MethodOptions, defined in descriptor.proto. + /// If the options message is not present (i.e. there are no options), null is returned. + /// Custom options can be retrieved as extensions of the returned message. + /// NOTE: A defensive copy is created each time this property is retrieved. + /// + public MethodOptions GetOptions() => Proto.Options?.Clone(); + /// /// Gets a single value method option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public T GetOption(Extension extension) { var value = Proto.Options.GetExtension(extension); @@ -88,6 +97,7 @@ namespace Google.Protobuf.Reflection /// /// Gets a repeated value method option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public RepeatedField GetOption(RepeatedExtension extension) { return Proto.Options.GetExtension(extension).Clone(); diff --git a/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs b/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs index f4bf628a6f..7523426dc5 100644 --- a/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs @@ -43,19 +43,31 @@ namespace Google.Protobuf.Reflection { private readonly Func caseDelegate; private readonly Action clearDelegate; - private OneofDescriptor descriptor; - internal OneofAccessor(PropertyInfo caseProperty, MethodInfo clearMethod, OneofDescriptor descriptor) + private OneofAccessor(OneofDescriptor descriptor, Func caseDelegate, Action clearDelegate) { - if (!caseProperty.CanRead) - { - throw new ArgumentException("Cannot read from property"); - } - this.descriptor = descriptor; - caseDelegate = ReflectionUtil.CreateFuncIMessageInt32(caseProperty.GetGetMethod()); + Descriptor = descriptor; + this.caseDelegate = caseDelegate; + this.clearDelegate = clearDelegate; + } + + internal static OneofAccessor ForRegularOneof( + OneofDescriptor descriptor, + PropertyInfo caseProperty, + MethodInfo clearMethod) => + new OneofAccessor( + descriptor, + ReflectionUtil.CreateFuncIMessageInt32(caseProperty.GetGetMethod()), + ReflectionUtil.CreateActionIMessage(clearMethod)); - this.descriptor = descriptor; - clearDelegate = ReflectionUtil.CreateActionIMessage(clearMethod); + internal static OneofAccessor ForSyntheticOneof(OneofDescriptor descriptor) + { + // Note: descriptor.Fields will be null when this method is called, because we haven't + // cross-linked yet. But by the time the delegates are called by user code, all will be + // well. (That's why we capture the descriptor itself rather than a field.) + return new OneofAccessor(descriptor, + message => descriptor.Fields[0].Accessor.HasValue(message) ? descriptor.Fields[0].FieldNumber : 0, + message => descriptor.Fields[0].Accessor.Clear(message)); } /// @@ -64,15 +76,12 @@ namespace Google.Protobuf.Reflection /// /// The descriptor of the oneof. /// - public OneofDescriptor Descriptor { get { return descriptor; } } + public OneofDescriptor Descriptor { get; } /// /// Clears the oneof in the specified message. /// - public void Clear(IMessage message) - { - clearDelegate(message); - } + public void Clear(IMessage message) => clearDelegate(message); /// /// Indicates which field in the oneof is set for specified message @@ -80,11 +89,9 @@ namespace Google.Protobuf.Reflection public FieldDescriptor GetCaseFieldDescriptor(IMessage message) { int fieldNumber = caseDelegate(message); - if (fieldNumber > 0) - { - return descriptor.ContainingType.FindFieldByNumber(fieldNumber); - } - return null; + return fieldNumber > 0 + ? Descriptor.ContainingType.FindFieldByNumber(fieldNumber) + : null; } } } diff --git a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs index 1e30b92ed6..b41d520515 100644 --- a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs @@ -33,6 +33,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Linq; using Google.Protobuf.Collections; using Google.Protobuf.Compatibility; @@ -54,8 +55,13 @@ namespace Google.Protobuf.Reflection { this.proto = proto; containingType = parent; - file.DescriptorPool.AddSymbol(this); + + // It's useful to determine whether or not this is a synthetic oneof before cross-linking. That means + // diving into the proto directly rather than using FieldDescriptor, but that's okay. + var firstFieldInOneof = parent.Proto.Field.FirstOrDefault(fieldProto => fieldProto.HasOneofIndex && fieldProto.OneofIndex == index); + IsSynthetic = firstFieldInOneof?.Proto3Optional ?? false; + accessor = CreateAccessor(clrName); } @@ -83,6 +89,12 @@ namespace Google.Protobuf.Reflection /// public IList Fields { get { return fields; } } + /// + /// Returns true if this oneof is a synthetic oneof containing a proto3 optional field; + /// false otherwise. + /// + public bool IsSynthetic { get; } + /// /// Gets an accessor for reflective access to the values associated with the oneof /// in a particular message. @@ -105,12 +117,21 @@ namespace Google.Protobuf.Reflection /// /// The (possibly empty) set of custom options for this oneof. /// - [Obsolete("CustomOptions are obsolete. Use GetOption")] + [Obsolete("CustomOptions are obsolete. Use the GetOptions method.")] public CustomOptions CustomOptions => new CustomOptions(proto.Options?._extensions?.ValuesByNumber); + /// + /// The OneofOptions, defined in descriptor.proto. + /// If the options message is not present (i.e. there are no options), null is returned. + /// Custom options can be retrieved as extensions of the returned message. + /// NOTE: A defensive copy is created each time this property is retrieved. + /// + public OneofOptions GetOptions() => proto.Options?.Clone(); + /// /// Gets a single value oneof option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public T GetOption(Extension extension) { var value = proto.Options.GetExtension(extension); @@ -120,6 +141,7 @@ namespace Google.Protobuf.Reflection /// /// Gets a repeated value oneof option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public RepeatedField GetOption(RepeatedExtension extension) { return proto.Options.GetExtension(extension).Clone(); @@ -146,18 +168,28 @@ namespace Google.Protobuf.Reflection { return null; } - var caseProperty = containingType.ClrType.GetProperty(clrName + "Case"); - if (caseProperty == null) + if (IsSynthetic) { - throw new DescriptorValidationException(this, $"Property {clrName}Case not found in {containingType.ClrType}"); + return OneofAccessor.ForSyntheticOneof(this); } - var clearMethod = containingType.ClrType.GetMethod("Clear" + clrName); - if (clearMethod == null) + else { - throw new DescriptorValidationException(this, $"Method Clear{clrName} not found in {containingType.ClrType}"); + var caseProperty = containingType.ClrType.GetProperty(clrName + "Case"); + if (caseProperty == null) + { + throw new DescriptorValidationException(this, $"Property {clrName}Case not found in {containingType.ClrType}"); + } + if (!caseProperty.CanRead) + { + throw new ArgumentException($"Cannot read from property {clrName}Case in {containingType.ClrType}"); + } + var clearMethod = containingType.ClrType.GetMethod("Clear" + clrName); + if (clearMethod == null) + { + throw new DescriptorValidationException(this, $"Method Clear{clrName} not found in {containingType.ClrType}"); + } + return OneofAccessor.ForRegularOneof(this, caseProperty, clearMethod); } - - return new OneofAccessor(caseProperty, clearMethod, this); } } } diff --git a/csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs index 21417ec641..dab348b6f8 100644 --- a/csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs @@ -94,12 +94,21 @@ namespace Google.Protobuf.Reflection /// /// The (possibly empty) set of custom options for this service. /// - [Obsolete("CustomOptions are obsolete. Use GetOption")] + [Obsolete("CustomOptions are obsolete. Use the GetOptions() method.")] public CustomOptions CustomOptions => new CustomOptions(Proto.Options?._extensions?.ValuesByNumber); + /// + /// The ServiceOptions, defined in descriptor.proto. + /// If the options message is not present (i.e. there are no options), null is returned. + /// Custom options can be retrieved as extensions of the returned message. + /// NOTE: A defensive copy is created each time this property is retrieved. + /// + public ServiceOptions GetOptions() => Proto.Options?.Clone(); + /// /// Gets a single value service option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public T GetOption(Extension extension) { var value = Proto.Options.GetExtension(extension); @@ -109,6 +118,7 @@ namespace Google.Protobuf.Reflection /// /// Gets a repeated value service option for this descriptor /// + [Obsolete("GetOption is obsolete. Use the GetOptions() method.")] public RepeatedField GetOption(RepeatedExtension extension) { return Proto.Options.GetExtension(extension).Clone(); diff --git a/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs index de10226511..07d84d7fb9 100644 --- a/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs @@ -57,49 +57,68 @@ namespace Google.Protobuf.Reflection throw new ArgumentException("Not all required properties/methods available"); } setValueDelegate = ReflectionUtil.CreateActionIMessageObject(property.GetSetMethod()); - if (descriptor.File.Syntax == Syntax.Proto3) + + // Note: this looks worrying in that we access the containing oneof, which isn't valid until cross-linking + // is complete... but field accessors aren't created until after cross-linking. + // The oneof itself won't be cross-linked yet, but that's okay: the oneof accessor is created + // earlier. + + // Message fields always support presence, via null checks. + if (descriptor.FieldType == FieldType.Message) + { + hasDelegate = message => GetValue(message) != null; + clearDelegate = message => SetValue(message, null); + } + // Oneof fields always support presence, via case checks. + // Note that clearing the field is a no-op unless that specific field is the current "case". + else if (descriptor.RealContainingOneof != null) { - hasDelegate = message => { - throw new InvalidOperationException("HasValue is not implemented for proto3 fields"); + var oneofAccessor = descriptor.RealContainingOneof.Accessor; + hasDelegate = message => oneofAccessor.GetCaseFieldDescriptor(message) == descriptor; + clearDelegate = message => + { + // Clear on a field only affects the oneof itself if the current case is the field we're accessing. + if (oneofAccessor.GetCaseFieldDescriptor(message) == descriptor) + { + oneofAccessor.Clear(message); + } }; - var clrType = property.PropertyType; - - // TODO: Validate that this is a reasonable single field? (Should be a value type, a message type, or string/ByteString.) - object defaultValue = - descriptor.FieldType == FieldType.Message ? null - : clrType == typeof(string) ? "" - : clrType == typeof(ByteString) ? ByteString.Empty - : Activator.CreateInstance(clrType); - clearDelegate = message => SetValue(message, defaultValue); } - else + // Primitive fields always support presence in proto2, and support presence in proto3 for optional fields. + else if (descriptor.File.Syntax == Syntax.Proto2 || descriptor.Proto.Proto3Optional) { MethodInfo hasMethod = property.DeclaringType.GetRuntimeProperty("Has" + property.Name).GetMethod; - if (hasMethod == null) { - throw new ArgumentException("Not all required properties/methods are available"); + if (hasMethod == null) + { + throw new ArgumentException("Not all required properties/methods are available"); } hasDelegate = ReflectionUtil.CreateFuncIMessageBool(hasMethod); MethodInfo clearMethod = property.DeclaringType.GetRuntimeMethod("Clear" + property.Name, ReflectionUtil.EmptyTypes); - if (clearMethod == null) { - throw new ArgumentException("Not all required properties/methods are available"); + if (clearMethod == null) + { + throw new ArgumentException("Not all required properties/methods are available"); } clearDelegate = ReflectionUtil.CreateActionIMessage(clearMethod); } - } + // What's left? + // Primitive proto3 fields without the optional keyword, which aren't in oneofs. + else + { + hasDelegate = message => { throw new InvalidOperationException("Presence is not implemented for this field"); }; - public override void Clear(IMessage message) - { - clearDelegate(message); - } + // While presence isn't supported, clearing still is; it's just setting to a default value. + var clrType = property.PropertyType; - public override bool HasValue(IMessage message) - { - return hasDelegate(message); + object defaultValue = + clrType == typeof(string) ? "" + : clrType == typeof(ByteString) ? ByteString.Empty + : Activator.CreateInstance(clrType); + clearDelegate = message => SetValue(message, defaultValue); + } } - public override void SetValue(IMessage message, object value) - { - setValueDelegate(message, value); - } + public override void Clear(IMessage message) => clearDelegate(message); + public override bool HasValue(IMessage message) => hasDelegate(message); + public override void SetValue(IMessage message, object value) => setValueDelegate(message, value); } } diff --git a/csharp/src/Google.Protobuf/SegmentedBufferHelper.cs b/csharp/src/Google.Protobuf/SegmentedBufferHelper.cs new file mode 100644 index 0000000000..b5441d3421 --- /dev/null +++ b/csharp/src/Google.Protobuf/SegmentedBufferHelper.cs @@ -0,0 +1,296 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Buffers; +using System.IO; +using System.Runtime.CompilerServices; +using System.Security; + +namespace Google.Protobuf +{ + /// + /// Abstraction for reading from a stream / read only sequence. + /// Parsing from the buffer is a loop of reading from current buffer / refreshing the buffer once done. + /// + [SecuritySafeCritical] + internal struct SegmentedBufferHelper + { + private int? totalLength; + private ReadOnlySequence.Enumerator readOnlySequenceEnumerator; + private CodedInputStream codedInputStream; + + /// + /// Initialize an instance with a coded input stream. + /// This approach is faster than using a constructor because the instance to initialize is passed by reference + /// and we can write directly into it without copying. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Initialize(CodedInputStream codedInputStream, out SegmentedBufferHelper instance) + { + instance.totalLength = codedInputStream.InternalInputStream == null ? (int?)codedInputStream.InternalBuffer.Length : null; + instance.readOnlySequenceEnumerator = default; + instance.codedInputStream = codedInputStream; + } + + /// + /// Initialize an instance with a read only sequence. + /// This approach is faster than using a constructor because the instance to initialize is passed by reference + /// and we can write directly into it without copying. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Initialize(ReadOnlySequence sequence, out SegmentedBufferHelper instance, out ReadOnlySpan firstSpan) + { + instance.codedInputStream = null; + if (sequence.IsSingleSegment) + { + firstSpan = sequence.First.Span; + instance.totalLength = firstSpan.Length; + instance.readOnlySequenceEnumerator = default; + } + else + { + instance.readOnlySequenceEnumerator = sequence.GetEnumerator(); + instance.totalLength = (int) sequence.Length; + + // set firstSpan to the first segment + instance.readOnlySequenceEnumerator.MoveNext(); + firstSpan = instance.readOnlySequenceEnumerator.Current.Span; + } + } + + public bool RefillBuffer(ref ReadOnlySpan buffer, ref ParserInternalState state, bool mustSucceed) + { + if (codedInputStream != null) + { + return RefillFromCodedInputStream(ref buffer, ref state, mustSucceed); + } + else + { + return RefillFromReadOnlySequence(ref buffer, ref state, mustSucceed); + } + } + + public int? TotalLength => totalLength; + + public CodedInputStream CodedInputStream => codedInputStream; + + /// + /// Sets currentLimit to (current position) + byteLimit. This is called + /// when descending into a length-delimited embedded message. The previous + /// limit is returned. + /// + /// The old limit. + public static int PushLimit(ref ParserInternalState state, int byteLimit) + { + if (byteLimit < 0) + { + throw InvalidProtocolBufferException.NegativeSize(); + } + byteLimit += state.totalBytesRetired + state.bufferPos; + int oldLimit = state.currentLimit; + if (byteLimit > oldLimit) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + state.currentLimit = byteLimit; + + RecomputeBufferSizeAfterLimit(ref state); + + return oldLimit; + } + + /// + /// Discards the current limit, returning the previous limit. + /// + public static void PopLimit(ref ParserInternalState state, int oldLimit) + { + state.currentLimit = oldLimit; + RecomputeBufferSizeAfterLimit(ref state); + } + + /// + /// Returns whether or not all the data before the limit has been read. + /// + /// + public static bool IsReachedLimit(ref ParserInternalState state) + { + if (state.currentLimit == int.MaxValue) + { + return false; + } + int currentAbsolutePosition = state.totalBytesRetired + state.bufferPos; + return currentAbsolutePosition >= state.currentLimit; + } + + /// + /// Returns true if the stream has reached the end of the input. This is the + /// case if either the end of the underlying input source has been reached or + /// the stream has reached a limit created using PushLimit. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsAtEnd(ref ReadOnlySpan buffer, ref ParserInternalState state) + { + return state.bufferPos == state.bufferSize && !state.segmentedBufferHelper.RefillBuffer(ref buffer, ref state, false); + } + + private bool RefillFromReadOnlySequence(ref ReadOnlySpan buffer, ref ParserInternalState state, bool mustSucceed) + { + CheckCurrentBufferIsEmpty(ref state); + + if (state.totalBytesRetired + state.bufferSize == state.currentLimit) + { + // Oops, we hit a limit. + if (mustSucceed) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + else + { + return false; + } + } + + state.totalBytesRetired += state.bufferSize; + + state.bufferPos = 0; + state.bufferSize = 0; + while (readOnlySequenceEnumerator.MoveNext()) + { + buffer = readOnlySequenceEnumerator.Current.Span; + state.bufferSize = buffer.Length; + if (buffer.Length != 0) + { + break; + } + } + + if (state.bufferSize == 0) + { + if (mustSucceed) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + else + { + return false; + } + } + else + { + RecomputeBufferSizeAfterLimit(ref state); + int totalBytesRead = + state.totalBytesRetired + state.bufferSize + state.bufferSizeAfterLimit; + if (totalBytesRead < 0 || totalBytesRead > state.sizeLimit) + { + throw InvalidProtocolBufferException.SizeLimitExceeded(); + } + return true; + } + } + + private bool RefillFromCodedInputStream(ref ReadOnlySpan buffer, ref ParserInternalState state, bool mustSucceed) + { + CheckCurrentBufferIsEmpty(ref state); + + if (state.totalBytesRetired + state.bufferSize == state.currentLimit) + { + // Oops, we hit a limit. + if (mustSucceed) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + else + { + return false; + } + } + + Stream input = codedInputStream.InternalInputStream; + + state.totalBytesRetired += state.bufferSize; + + state.bufferPos = 0; + state.bufferSize = (input == null) ? 0 : input.Read(codedInputStream.InternalBuffer, 0, buffer.Length); + if (state.bufferSize < 0) + { + throw new InvalidOperationException("Stream.Read returned a negative count"); + } + if (state.bufferSize == 0) + { + if (mustSucceed) + { + throw InvalidProtocolBufferException.TruncatedMessage(); + } + else + { + return false; + } + } + else + { + RecomputeBufferSizeAfterLimit(ref state); + int totalBytesRead = + state.totalBytesRetired + state.bufferSize + state.bufferSizeAfterLimit; + if (totalBytesRead < 0 || totalBytesRead > state.sizeLimit) + { + throw InvalidProtocolBufferException.SizeLimitExceeded(); + } + return true; + } + } + + private static void RecomputeBufferSizeAfterLimit(ref ParserInternalState state) + { + state.bufferSize += state.bufferSizeAfterLimit; + int bufferEnd = state.totalBytesRetired + state.bufferSize; + if (bufferEnd > state.currentLimit) + { + // Limit is in current buffer. + state.bufferSizeAfterLimit = bufferEnd - state.currentLimit; + state.bufferSize -= state.bufferSizeAfterLimit; + } + else + { + state.bufferSizeAfterLimit = 0; + } + } + + private static void CheckCurrentBufferIsEmpty(ref ParserInternalState state) + { + if (state.bufferPos < state.bufferSize) + { + throw new InvalidOperationException("RefillBuffer() called when buffer wasn't empty."); + } + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/UnknownField.cs b/csharp/src/Google.Protobuf/UnknownField.cs index e3ce0e86ef..4793a6419d 100644 --- a/csharp/src/Google.Protobuf/UnknownField.cs +++ b/csharp/src/Google.Protobuf/UnknownField.cs @@ -101,8 +101,8 @@ namespace Google.Protobuf /// /// /// The unknown field number. - /// The CodedOutputStream to write to. - internal void WriteTo(int fieldNumber, CodedOutputStream output) + /// The write context to write to. + internal void WriteTo(int fieldNumber, ref WriteContext output) { if (varintList != null) { @@ -141,7 +141,7 @@ namespace Google.Protobuf foreach (UnknownFieldSet value in groupList) { output.WriteTag(fieldNumber, WireFormat.WireType.StartGroup); - value.WriteTo(output); + value.WriteTo(ref output); output.WriteTag(fieldNumber, WireFormat.WireType.EndGroup); } } @@ -209,13 +209,13 @@ namespace Google.Protobuf /// /// Returns a new list containing all of the given specified values from /// both the and lists. - /// If is null and is empty, + /// If is null and is null or empty, /// null is returned. Otherwise, either a new list is created (if /// is null) or the elements of are added to . /// private static List AddAll(List current, IList extras) { - if (extras.Count == 0) + if (extras == null || extras.Count == 0) { return current; } diff --git a/csharp/src/Google.Protobuf/UnknownFieldSet.cs b/csharp/src/Google.Protobuf/UnknownFieldSet.cs index 7a2b6a00d2..9888dd1c3d 100644 --- a/csharp/src/Google.Protobuf/UnknownFieldSet.cs +++ b/csharp/src/Google.Protobuf/UnknownFieldSet.cs @@ -33,6 +33,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Security; using Google.Protobuf.Reflection; namespace Google.Protobuf @@ -70,10 +71,27 @@ namespace Google.Protobuf /// Serializes the set and writes it to . /// public void WriteTo(CodedOutputStream output) + { + WriteContext.Initialize(output, out WriteContext ctx); + try + { + WriteTo(ref ctx); + } + finally + { + ctx.CopyStateTo(output); + } + } + + /// + /// Serializes the set and writes it to . + /// + [SecuritySafeCritical] + public void WriteTo(ref WriteContext ctx) { foreach (KeyValuePair entry in fields) { - entry.Value.WriteTo(entry.Key, output); + entry.Value.WriteTo(entry.Key, ref ctx); } } @@ -176,47 +194,47 @@ namespace Google.Protobuf fields[number] = field; return this; } - + /// - /// Parse a single field from and merge it + /// Parse a single field from and merge it /// into this set. /// - /// The coded input stream containing the field + /// The parse context from which to read the field /// false if the tag is an "end group" tag, true otherwise - private bool MergeFieldFrom(CodedInputStream input) + private bool MergeFieldFrom(ref ParseContext ctx) { - uint tag = input.LastTag; + uint tag = ctx.LastTag; int number = WireFormat.GetTagFieldNumber(tag); switch (WireFormat.GetTagWireType(tag)) { case WireFormat.WireType.Varint: { - ulong uint64 = input.ReadUInt64(); + ulong uint64 = ctx.ReadUInt64(); GetOrAddField(number).AddVarint(uint64); return true; } case WireFormat.WireType.Fixed32: { - uint uint32 = input.ReadFixed32(); + uint uint32 = ctx.ReadFixed32(); GetOrAddField(number).AddFixed32(uint32); return true; } case WireFormat.WireType.Fixed64: { - ulong uint64 = input.ReadFixed64(); + ulong uint64 = ctx.ReadFixed64(); GetOrAddField(number).AddFixed64(uint64); return true; } case WireFormat.WireType.LengthDelimited: { - ByteString bytes = input.ReadBytes(); + ByteString bytes = ctx.ReadBytes(); GetOrAddField(number).AddLengthDelimited(bytes); return true; } case WireFormat.WireType.StartGroup: { UnknownFieldSet set = new UnknownFieldSet(); - input.ReadGroup(number, set); + ParsingPrimitivesMessages.ReadGroup(ref ctx, number, set); GetOrAddField(number).AddGroup(set); return true; } @@ -229,16 +247,16 @@ namespace Google.Protobuf } } - internal void MergeGroupFrom(CodedInputStream input) + internal void MergeGroupFrom(ref ParseContext ctx) { while (true) { - uint tag = input.ReadTag(); + uint tag = ctx.ReadTag(); if (tag == 0) { break; } - if (!MergeFieldFrom(input)) + if (!MergeFieldFrom(ref ctx)) { break; } @@ -257,21 +275,45 @@ namespace Google.Protobuf public static UnknownFieldSet MergeFieldFrom(UnknownFieldSet unknownFields, CodedInputStream input) { - if (input.DiscardUnknownFields) + ParseContext.Initialize(input, out ParseContext ctx); + try + { + return MergeFieldFrom(unknownFields, ref ctx); + } + finally + { + ctx.CopyStateTo(input); + } + } + + /// + /// Create a new UnknownFieldSet if unknownFields is null. + /// Parse a single field from and merge it + /// into unknownFields. If is configured to discard unknown fields, + /// will be returned as-is and the field will be skipped. + /// + /// The UnknownFieldSet which need to be merged + /// The parse context from which to read the field + /// The merged UnknownFieldSet + [SecuritySafeCritical] + public static UnknownFieldSet MergeFieldFrom(UnknownFieldSet unknownFields, + ref ParseContext ctx) + { + if (ctx.DiscardUnknownFields) { - input.SkipLastField(); + ParsingPrimitivesMessages.SkipLastField(ref ctx.buffer, ref ctx.state); return unknownFields; } if (unknownFields == null) { unknownFields = new UnknownFieldSet(); } - if (!unknownFields.MergeFieldFrom(input)) - { - throw new InvalidProtocolBufferException("Merge an unknown field of end-group tag, indicating that the corresponding start-group was missing."); // match the old code-gen + if (!unknownFields.MergeFieldFrom(ref ctx)) + { + throw new InvalidProtocolBufferException("Merge an unknown field of end-group tag, indicating that the corresponding start-group was missing."); // match the old code-gen } return unknownFields; - } + } /// /// Merges the fields from into this set. diff --git a/csharp/src/Google.Protobuf/UnsafeByteOperations.cs b/csharp/src/Google.Protobuf/UnsafeByteOperations.cs new file mode 100644 index 0000000000..865ea067b8 --- /dev/null +++ b/csharp/src/Google.Protobuf/UnsafeByteOperations.cs @@ -0,0 +1,81 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using System; +using System.Security; + +namespace Google.Protobuf +{ + /// + /// Provides a number of unsafe byte operations to be used by advanced applications with high performance + /// requirements. These methods are referred to as "unsafe" due to the fact that they potentially expose + /// the backing buffer of a to the application. + /// + /// + /// + /// The methods in this class should only be called if it is guaranteed that the buffer backing the + /// will never change! Mutation of a can lead to unexpected + /// and undesirable consequences in your application, and will likely be difficult to debug. Proceed with caution! + /// + /// + /// This can have a number of significant side affects that have spooky-action-at-a-distance-like behavior. In + /// particular, if the bytes value changes out from under a Protocol Buffer: + /// + /// + /// + /// serialization may throw + /// + /// + /// serialization may succeed but the wrong bytes may be written out + /// + /// + /// objects that are normally immutable (such as ByteString) are no longer immutable + /// + /// + /// hashCode may be incorrect + /// + /// + /// + [SecuritySafeCritical] + public static class UnsafeByteOperations + { + /// + /// Constructs a new from the given bytes. The bytes are not copied, + /// and must not be modified while the is in use. + /// This API is experimental and subject to change. + /// + public static ByteString UnsafeWrap(ReadOnlyMemory bytes) + { + return ByteString.AttachBytes(bytes); + } + } +} diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs index 09e0e29f0d..7b5019a8ac 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs @@ -25,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi", - "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQm8KE2Nv", - "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaJWdpdGh1Yi5jb20vZ29s", - "YW5nL3Byb3RvYnVmL3B0eXBlcy9hbnmiAgNHUEKqAh5Hb29nbGUuUHJvdG9i", - "dWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); + "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2Nv", + "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcu", + "b3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xl", + "LlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -78,10 +78,13 @@ namespace Google.Protobuf.WellKnownTypes { /// Example 4: Pack and unpack a message in Go /// /// foo := &pb.Foo{...} - /// any, err := ptypes.MarshalAny(foo) + /// any, err := anypb.New(foo) + /// if err != nil { + /// ... + /// } /// ... /// foo := &pb.Foo{} - /// if err := ptypes.UnmarshalAny(any, foo); err != nil { + /// if err := any.UnmarshalTo(foo); err != nil { /// ... /// } /// @@ -119,23 +122,31 @@ namespace Google.Protobuf.WellKnownTypes { /// "value": "1.212s" /// } /// - public sealed partial class Any : pb::IMessage { + public sealed partial class Any : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Any()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Any() { OnConstruction(); } @@ -143,6 +154,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Any(Any other) : this() { typeUrl_ = other.typeUrl_; value_ = other.value_; @@ -150,6 +162,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Any Clone() { return new Any(this); } @@ -187,6 +200,7 @@ namespace Google.Protobuf.WellKnownTypes { /// used with implementation specific semantics. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string TypeUrl { get { return typeUrl_; } set { @@ -201,6 +215,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Must be a valid serialized protocol buffer of the above specified type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString Value { get { return value_; } set { @@ -209,11 +224,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Any); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Any other) { if (ReferenceEquals(other, null)) { return false; @@ -227,6 +244,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode(); @@ -238,12 +256,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (TypeUrl.Length != 0) { output.WriteRawTag(10); output.WriteString(TypeUrl); @@ -255,9 +278,29 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TypeUrl.Length != 0) { + output.WriteRawTag(10); + output.WriteString(TypeUrl); + } + if (Value.Length != 0) { + output.WriteRawTag(18); + output.WriteBytes(Value); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (TypeUrl.Length != 0) { @@ -273,6 +316,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Any other) { if (other == null) { return; @@ -287,7 +331,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -304,7 +352,31 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + TypeUrl = input.ReadString(); + break; + } + case 18: { + Value = input.ReadBytes(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs index 06a9905919..58a658e077 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs @@ -37,10 +37,10 @@ namespace Google.Protobuf.WellKnownTypes { "ChFyZXNwb25zZV90eXBlX3VybBgEIAEoCRIaChJyZXNwb25zZV9zdHJlYW1p", "bmcYBSABKAgSKAoHb3B0aW9ucxgGIAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5P", "cHRpb24SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRh", - "eCIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCdQoTY29t", - "Lmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAVorZ29vZ2xlLmdvbGFuZy5v", - "cmcvZ2VucHJvdG8vcHJvdG9idWYvYXBpO2FwaaICA0dQQqoCHkdvb2dsZS5Q", - "cm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z")); + "eCIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCdgoTY29t", + "Lmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAVosZ29vZ2xlLmdvbGFuZy5v", + "cmcvcHJvdG9idWYvdHlwZXMva25vd24vYXBpcGKiAgNHUEKqAh5Hb29nbGUu", + "UHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -64,23 +64,31 @@ namespace Google.Protobuf.WellKnownTypes { /// this message itself. See https://cloud.google.com/apis/design/glossary for /// detailed terminology. /// - public sealed partial class Api : pb::IMessage { + public sealed partial class Api : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Api()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.ApiReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Api() { OnConstruction(); } @@ -88,6 +96,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Api(Api other) : this() { name_ = other.name_; methods_ = other.methods_.Clone(); @@ -100,6 +109,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Api Clone() { return new Api(this); } @@ -112,6 +122,7 @@ namespace Google.Protobuf.WellKnownTypes { /// followed by the interface's simple name. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -128,6 +139,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The methods of this interface, in unspecified order. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Methods { get { return methods_; } } @@ -141,6 +153,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Any metadata attached to the interface. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Options { get { return options_; } } @@ -170,6 +183,7 @@ namespace Google.Protobuf.WellKnownTypes { /// experimental, non-GA interfaces. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Version { get { return version_; } set { @@ -185,6 +199,7 @@ namespace Google.Protobuf.WellKnownTypes { /// message. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -201,6 +216,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Included interfaces. See [Mixin][]. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Mixins { get { return mixins_; } } @@ -212,6 +228,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The source syntax of the service. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { get { return syntax_; } set { @@ -220,11 +237,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Api); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Api other) { if (ReferenceEquals(other, null)) { return false; @@ -243,6 +262,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -259,12 +279,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); @@ -287,9 +312,40 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + methods_.WriteTo(ref output, _repeated_methods_codec); + options_.WriteTo(ref output, _repeated_options_codec); + if (Version.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Version); + } + if (sourceContext_ != null) { + output.WriteRawTag(42); + output.WriteMessage(SourceContext); + } + mixins_.WriteTo(ref output, _repeated_mixins_codec); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { + output.WriteRawTag(56); + output.WriteEnum((int) Syntax); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -314,6 +370,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Api other) { if (other == null) { return; @@ -340,7 +397,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -380,30 +441,85 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + methods_.AddEntriesFrom(ref input, _repeated_methods_codec); + break; + } + case 26: { + options_.AddEntriesFrom(ref input, _repeated_options_codec); + break; + } + case 34: { + Version = input.ReadString(); + break; + } + case 42: { + if (sourceContext_ == null) { + SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + } + input.ReadMessage(SourceContext); + break; + } + case 50: { + mixins_.AddEntriesFrom(ref input, _repeated_mixins_codec); + break; + } + case 56: { + Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } + } + } } + #endif } /// /// Method represents a method of an API interface. /// - public sealed partial class Method : pb::IMessage { + public sealed partial class Method : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Method()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.ApiReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Method() { OnConstruction(); } @@ -411,6 +527,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Method(Method other) : this() { name_ = other.name_; requestTypeUrl_ = other.requestTypeUrl_; @@ -423,6 +540,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Method Clone() { return new Method(this); } @@ -434,6 +552,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The simple name of this method. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -448,6 +567,7 @@ namespace Google.Protobuf.WellKnownTypes { /// A URL of the input message type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string RequestTypeUrl { get { return requestTypeUrl_; } set { @@ -462,6 +582,7 @@ namespace Google.Protobuf.WellKnownTypes { /// If true, the request is streamed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool RequestStreaming { get { return requestStreaming_; } set { @@ -476,6 +597,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The URL of the output message type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string ResponseTypeUrl { get { return responseTypeUrl_; } set { @@ -490,6 +612,7 @@ namespace Google.Protobuf.WellKnownTypes { /// If true, the response is streamed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool ResponseStreaming { get { return responseStreaming_; } set { @@ -506,6 +629,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Any metadata attached to the method. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Options { get { return options_; } } @@ -517,6 +641,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The source syntax of this method. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { get { return syntax_; } set { @@ -525,11 +650,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Method); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Method other) { if (ReferenceEquals(other, null)) { return false; @@ -548,6 +675,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -564,12 +692,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); @@ -598,9 +731,46 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (RequestTypeUrl.Length != 0) { + output.WriteRawTag(18); + output.WriteString(RequestTypeUrl); + } + if (RequestStreaming != false) { + output.WriteRawTag(24); + output.WriteBool(RequestStreaming); + } + if (ResponseTypeUrl.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ResponseTypeUrl); + } + if (ResponseStreaming != false) { + output.WriteRawTag(40); + output.WriteBool(ResponseStreaming); + } + options_.WriteTo(ref output, _repeated_options_codec); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { + output.WriteRawTag(56); + output.WriteEnum((int) Syntax); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -629,6 +799,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Method other) { if (other == null) { return; @@ -656,7 +827,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -693,7 +868,51 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + RequestTypeUrl = input.ReadString(); + break; + } + case 24: { + RequestStreaming = input.ReadBool(); + break; + } + case 34: { + ResponseTypeUrl = input.ReadString(); + break; + } + case 40: { + ResponseStreaming = input.ReadBool(); + break; + } + case 50: { + options_.AddEntriesFrom(ref input, _repeated_options_codec); + break; + } + case 56: { + Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } + } + } } + #endif } @@ -745,7 +964,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The mixin construct implies that all methods in `AccessControl` are /// also declared with same name and request/response types in /// `Storage`. A documentation generator or annotation processor will - /// see the effective `Storage.GetAcl` method after inherting + /// see the effective `Storage.GetAcl` method after inheriting /// documentation and annotations as follows: /// /// service Storage { @@ -777,23 +996,31 @@ namespace Google.Protobuf.WellKnownTypes { /// ... /// } /// - public sealed partial class Mixin : pb::IMessage { + public sealed partial class Mixin : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mixin()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.ApiReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Mixin() { OnConstruction(); } @@ -801,6 +1028,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Mixin(Mixin other) : this() { name_ = other.name_; root_ = other.root_; @@ -808,6 +1036,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Mixin Clone() { return new Mixin(this); } @@ -819,6 +1048,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The fully qualified name of the interface which is included. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -834,6 +1064,7 @@ namespace Google.Protobuf.WellKnownTypes { /// are rooted. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Root { get { return root_; } set { @@ -842,11 +1073,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Mixin); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Mixin other) { if (ReferenceEquals(other, null)) { return false; @@ -860,6 +1093,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -871,12 +1105,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); @@ -888,9 +1127,29 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Root.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Root); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -906,6 +1165,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Mixin other) { if (other == null) { return; @@ -920,7 +1180,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -937,7 +1201,31 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Root = input.ReadString(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs index f0078c4dd4..b46f4d2936 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs @@ -26,10 +26,10 @@ namespace Google.Protobuf.WellKnownTypes { string.Concat( "Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90", "b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIg", - "ASgFQnwKE2NvbS5nb29nbGUucHJvdG9idWZCDUR1cmF0aW9uUHJvdG9QAVoq", - "Z2l0aHViLmNvbS9nb2xhbmcvcHJvdG9idWYvcHR5cGVzL2R1cmF0aW9u+AEB", - "ogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90", - "bzM=")); + "ASgFQoMBChNjb20uZ29vZ2xlLnByb3RvYnVmQg1EdXJhdGlvblByb3RvUAFa", + "MWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2R1cmF0", + "aW9ucGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlw", + "ZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -100,23 +100,31 @@ namespace Google.Protobuf.WellKnownTypes { /// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 /// microsecond should be expressed in JSON format as "3.000001s". /// - public sealed partial class Duration : pb::IMessage { + public sealed partial class Duration : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Duration()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Duration() { OnConstruction(); } @@ -124,6 +132,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Duration(Duration other) : this() { seconds_ = other.seconds_; nanos_ = other.nanos_; @@ -131,6 +140,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Duration Clone() { return new Duration(this); } @@ -144,6 +154,7 @@ namespace Google.Protobuf.WellKnownTypes { /// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Seconds { get { return seconds_; } set { @@ -163,6 +174,7 @@ namespace Google.Protobuf.WellKnownTypes { /// to +999,999,999 inclusive. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Nanos { get { return nanos_; } set { @@ -171,11 +183,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Duration); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Duration other) { if (ReferenceEquals(other, null)) { return false; @@ -189,6 +203,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Seconds != 0L) hash ^= Seconds.GetHashCode(); @@ -200,12 +215,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Seconds != 0L) { output.WriteRawTag(8); output.WriteInt64(Seconds); @@ -217,9 +237,29 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Seconds != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Seconds); + } + if (Nanos != 0) { + output.WriteRawTag(16); + output.WriteInt32(Nanos); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Seconds != 0L) { @@ -235,6 +275,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Duration other) { if (other == null) { return; @@ -249,7 +290,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -266,7 +311,31 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Seconds = input.ReadInt64(); + break; + } + case 16: { + Nanos = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs index fa435cd23e..073b59eb0d 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs @@ -25,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1", - "ZiIHCgVFbXB0eUJ2ChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv", - "UAFaJ2dpdGh1Yi5jb20vZ29sYW5nL3Byb3RvYnVmL3B0eXBlcy9lbXB0efgB", - "AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv", - "dG8z")); + "ZiIHCgVFbXB0eUJ9ChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv", + "UAFaLmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2Vt", + "cHR5cGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlw", + "ZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -50,23 +50,31 @@ namespace Google.Protobuf.WellKnownTypes { /// /// The JSON representation for `Empty` is empty JSON object `{}`. /// - public sealed partial class Empty : pb::IMessage { + public sealed partial class Empty : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Empty() { OnConstruction(); } @@ -74,21 +82,25 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Empty(Empty other) : this() { _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Empty Clone() { return new Empty(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Empty); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Empty other) { if (ReferenceEquals(other, null)) { return false; @@ -100,6 +112,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (_unknownFields != null) { @@ -109,18 +122,35 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (_unknownFields != null) { @@ -130,6 +160,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Empty other) { if (other == null) { return; @@ -138,7 +169,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -147,7 +182,23 @@ namespace Google.Protobuf.WellKnownTypes { break; } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs index 00e1e9faa4..e90c3d571d 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs @@ -25,11 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy", - "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKMAQoTY29tLmdv", - "b2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVo5Z29vZ2xlLmdvbGFu", - "Zy5vcmcvZ2VucHJvdG8vcHJvdG9idWYvZmllbGRfbWFzaztmaWVsZF9tYXNr", - "+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZw", - "cm90bzM=")); + "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUKFAQoTY29tLmdv", + "b2dsZS5wcm90b2J1ZkIORmllbGRNYXNrUHJvdG9QAVoyZ29vZ2xlLmdvbGFu", + "Zy5vcmcvcHJvdG9idWYvdHlwZXMva25vd24vZmllbGRtYXNrcGL4AQGiAgNH", + "UEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -240,23 +239,31 @@ namespace Google.Protobuf.WellKnownTypes { /// request should verify the included field paths, and return an /// `INVALID_ARGUMENT` error if any path is unmappable. /// - public sealed partial class FieldMask : pb::IMessage { + public sealed partial class FieldMask : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldMask()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FieldMask() { OnConstruction(); } @@ -264,12 +271,14 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FieldMask(FieldMask other) : this() { paths_ = other.paths_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FieldMask Clone() { return new FieldMask(this); } @@ -283,16 +292,19 @@ namespace Google.Protobuf.WellKnownTypes { /// The set of field mask paths. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Paths { get { return paths_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FieldMask); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FieldMask other) { if (ReferenceEquals(other, null)) { return false; @@ -305,6 +317,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= paths_.GetHashCode(); @@ -315,19 +328,37 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else paths_.WriteTo(output, _repeated_paths_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + paths_.WriteTo(ref output, _repeated_paths_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += paths_.CalculateSize(_repeated_paths_codec); @@ -338,6 +369,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FieldMask other) { if (other == null) { return; @@ -347,7 +379,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -360,7 +396,27 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + paths_.AddEntriesFrom(ref input, _repeated_paths_codec); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs index d7076196e0..58c23cea1d 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs @@ -26,10 +26,10 @@ namespace Google.Protobuf.WellKnownTypes { string.Concat( "CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2ds", "ZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEo", - "CUKVAQoTY29tLmdvb2dsZS5wcm90b2J1ZkISU291cmNlQ29udGV4dFByb3Rv", - "UAFaQWdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL3Byb3RvYnVmL3NvdXJj", - "ZV9jb250ZXh0O3NvdXJjZV9jb250ZXh0ogIDR1BCqgIeR29vZ2xlLlByb3Rv", - "YnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); + "CUKKAQoTY29tLmdvb2dsZS5wcm90b2J1ZkISU291cmNlQ29udGV4dFByb3Rv", + "UAFaNmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3Nv", + "dXJjZWNvbnRleHRwYqICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25v", + "d25UeXBlc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -44,23 +44,31 @@ namespace Google.Protobuf.WellKnownTypes { /// `SourceContext` represents information about the source of a /// protobuf element, like the file in which it is defined. /// - public sealed partial class SourceContext : pb::IMessage { + public sealed partial class SourceContext : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceContext()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SourceContext() { OnConstruction(); } @@ -68,12 +76,14 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SourceContext(SourceContext other) : this() { fileName_ = other.fileName_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SourceContext Clone() { return new SourceContext(this); } @@ -86,6 +96,7 @@ namespace Google.Protobuf.WellKnownTypes { /// protobuf element. For example: `"google/protobuf/source_context.proto"`. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string FileName { get { return fileName_; } set { @@ -94,11 +105,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SourceContext); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SourceContext other) { if (ReferenceEquals(other, null)) { return false; @@ -111,6 +124,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (FileName.Length != 0) hash ^= FileName.GetHashCode(); @@ -121,12 +135,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (FileName.Length != 0) { output.WriteRawTag(10); output.WriteString(FileName); @@ -134,9 +153,25 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (FileName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(FileName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (FileName.Length != 0) { @@ -149,6 +184,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SourceContext other) { if (other == null) { return; @@ -160,7 +196,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -173,7 +213,27 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + FileName = input.ReadString(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs index b1dbe239cc..b32b76c0a5 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs @@ -35,10 +35,10 @@ namespace Google.Protobuf.WellKnownTypes { "ABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RW", "YWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIW", "Lmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9W", - "QUxVRRAAQoEBChNjb20uZ29vZ2xlLnByb3RvYnVmQgtTdHJ1Y3RQcm90b1AB", - "WjFnaXRodWIuY29tL2dvbGFuZy9wcm90b2J1Zi9wdHlwZXMvc3RydWN0O3N0", - "cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5", - "cGVzYgZwcm90bzM=")); + "QUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFa", + "L2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVj", + "dHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVz", + "YgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.NullValue), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -77,23 +77,31 @@ namespace Google.Protobuf.WellKnownTypes { /// /// The JSON representation for `Struct` is JSON object. /// - public sealed partial class Struct : pb::IMessage { + public sealed partial class Struct : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Struct()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Struct() { OnConstruction(); } @@ -101,12 +109,14 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Struct(Struct other) : this() { fields_ = other.fields_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Struct Clone() { return new Struct(this); } @@ -120,16 +130,19 @@ namespace Google.Protobuf.WellKnownTypes { /// Unordered map of dynamically typed values. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField Fields { get { return fields_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Struct); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Struct other) { if (ReferenceEquals(other, null)) { return false; @@ -142,6 +155,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= Fields.GetHashCode(); @@ -152,19 +166,37 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else fields_.WriteTo(output, _map_fields_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + fields_.WriteTo(ref output, _map_fields_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += fields_.CalculateSize(_map_fields_codec); @@ -175,6 +207,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Struct other) { if (other == null) { return; @@ -184,7 +217,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -197,7 +234,27 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + fields_.AddEntriesFrom(ref input, _map_fields_codec); + break; + } + } + } } + #endif } @@ -209,23 +266,31 @@ namespace Google.Protobuf.WellKnownTypes { /// /// The JSON representation for `Value` is JSON value. /// - public sealed partial class Value : pb::IMessage { + public sealed partial class Value : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Value()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Value() { OnConstruction(); } @@ -233,6 +298,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Value(Value other) : this() { switch (other.KindCase) { case KindOneofCase.NullValue: @@ -259,6 +325,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Value Clone() { return new Value(this); } @@ -269,6 +336,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Represents a null value. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { get { return kindCase_ == KindOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) kind_ : global::Google.Protobuf.WellKnownTypes.NullValue.NullValue; } set { @@ -283,6 +351,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Represents a double value. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public double NumberValue { get { return kindCase_ == KindOneofCase.NumberValue ? (double) kind_ : 0D; } set { @@ -297,6 +366,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Represents a string value. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string StringValue { get { return kindCase_ == KindOneofCase.StringValue ? (string) kind_ : ""; } set { @@ -311,6 +381,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Represents a boolean value. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool BoolValue { get { return kindCase_ == KindOneofCase.BoolValue ? (bool) kind_ : false; } set { @@ -325,6 +396,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Represents a structured value. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Struct StructValue { get { return kindCase_ == KindOneofCase.StructValue ? (global::Google.Protobuf.WellKnownTypes.Struct) kind_ : null; } set { @@ -339,6 +411,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Represents a repeated `Value`. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.ListValue ListValue { get { return kindCase_ == KindOneofCase.ListValue ? (global::Google.Protobuf.WellKnownTypes.ListValue) kind_ : null; } set { @@ -360,22 +433,26 @@ namespace Google.Protobuf.WellKnownTypes { } private KindOneofCase kindCase_ = KindOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public KindOneofCase KindCase { get { return kindCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearKind() { kindCase_ = KindOneofCase.None; kind_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Value); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Value other) { if (ReferenceEquals(other, null)) { return false; @@ -394,6 +471,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (kindCase_ == KindOneofCase.NullValue) hash ^= NullValue.GetHashCode(); @@ -410,12 +488,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (kindCase_ == KindOneofCase.NullValue) { output.WriteRawTag(8); output.WriteEnum((int) NullValue); @@ -443,9 +526,45 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (kindCase_ == KindOneofCase.NullValue) { + output.WriteRawTag(8); + output.WriteEnum((int) NullValue); + } + if (kindCase_ == KindOneofCase.NumberValue) { + output.WriteRawTag(17); + output.WriteDouble(NumberValue); + } + if (kindCase_ == KindOneofCase.StringValue) { + output.WriteRawTag(26); + output.WriteString(StringValue); + } + if (kindCase_ == KindOneofCase.BoolValue) { + output.WriteRawTag(32); + output.WriteBool(BoolValue); + } + if (kindCase_ == KindOneofCase.StructValue) { + output.WriteRawTag(42); + output.WriteMessage(StructValue); + } + if (kindCase_ == KindOneofCase.ListValue) { + output.WriteRawTag(50); + output.WriteMessage(ListValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (kindCase_ == KindOneofCase.NullValue) { @@ -473,6 +592,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Value other) { if (other == null) { return; @@ -508,7 +628,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -552,7 +676,58 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + kind_ = input.ReadEnum(); + kindCase_ = KindOneofCase.NullValue; + break; + } + case 17: { + NumberValue = input.ReadDouble(); + break; + } + case 26: { + StringValue = input.ReadString(); + break; + } + case 32: { + BoolValue = input.ReadBool(); + break; + } + case 42: { + global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); + if (kindCase_ == KindOneofCase.StructValue) { + subBuilder.MergeFrom(StructValue); + } + input.ReadMessage(subBuilder); + StructValue = subBuilder; + break; + } + case 50: { + global::Google.Protobuf.WellKnownTypes.ListValue subBuilder = new global::Google.Protobuf.WellKnownTypes.ListValue(); + if (kindCase_ == KindOneofCase.ListValue) { + subBuilder.MergeFrom(ListValue); + } + input.ReadMessage(subBuilder); + ListValue = subBuilder; + break; + } + } + } } + #endif } @@ -561,23 +736,31 @@ namespace Google.Protobuf.WellKnownTypes { /// /// The JSON representation for `ListValue` is JSON array. /// - public sealed partial class ListValue : pb::IMessage { + public sealed partial class ListValue : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListValue()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ListValue() { OnConstruction(); } @@ -585,12 +768,14 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ListValue(ListValue other) : this() { values_ = other.values_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ListValue Clone() { return new ListValue(this); } @@ -604,16 +789,19 @@ namespace Google.Protobuf.WellKnownTypes { /// Repeated field of dynamically typed values. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Values { get { return values_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ListValue); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ListValue other) { if (ReferenceEquals(other, null)) { return false; @@ -626,6 +814,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= values_.GetHashCode(); @@ -636,19 +825,37 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else values_.WriteTo(output, _repeated_values_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + values_.WriteTo(ref output, _repeated_values_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += values_.CalculateSize(_repeated_values_codec); @@ -659,6 +866,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ListValue other) { if (other == null) { return; @@ -668,7 +876,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -681,7 +893,27 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + values_.AddEntriesFrom(ref input, _repeated_values_codec); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs index 12f4812af3..e981dc2a01 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs @@ -26,10 +26,10 @@ namespace Google.Protobuf.WellKnownTypes { string.Concat( "Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv", "dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY", - "AiABKAVCfgoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q", - "AVorZ2l0aHViLmNvbS9nb2xhbmcvcHJvdG9idWYvcHR5cGVzL3RpbWVzdGFt", - "cPgBAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", - "cHJvdG8z")); + "AiABKAVChQEKE2NvbS5nb29nbGUucHJvdG9idWZCDlRpbWVzdGFtcFByb3Rv", + "UAFaMmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3Rp", + "bWVzdGFtcHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93", + "blR5cGVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -91,7 +91,15 @@ namespace Google.Protobuf.WellKnownTypes { /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) /// .setNanos((int) ((millis % 1000) * 1000000)).build(); /// - /// Example 5: Compute Timestamp from current time in Python. + /// Example 5: Compute Timestamp from Java `Instant.now()`. + /// + /// Instant now = Instant.now(); + /// + /// Timestamp timestamp = + /// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + /// .setNanos(now.getNano()).build(); + /// + /// Example 6: Compute Timestamp from current time in Python. /// /// timestamp = Timestamp() /// timestamp.GetCurrentTime() @@ -123,23 +131,31 @@ namespace Google.Protobuf.WellKnownTypes { /// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D /// ) to obtain a formatter capable of generating timestamps in this format. /// - public sealed partial class Timestamp : pb::IMessage { + public sealed partial class Timestamp : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Timestamp()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Timestamp() { OnConstruction(); } @@ -147,6 +163,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Timestamp(Timestamp other) : this() { seconds_ = other.seconds_; nanos_ = other.nanos_; @@ -154,6 +171,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Timestamp Clone() { return new Timestamp(this); } @@ -167,6 +185,7 @@ namespace Google.Protobuf.WellKnownTypes { /// 9999-12-31T23:59:59Z inclusive. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Seconds { get { return seconds_; } set { @@ -184,6 +203,7 @@ namespace Google.Protobuf.WellKnownTypes { /// inclusive. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Nanos { get { return nanos_; } set { @@ -192,11 +212,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Timestamp); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Timestamp other) { if (ReferenceEquals(other, null)) { return false; @@ -210,6 +232,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Seconds != 0L) hash ^= Seconds.GetHashCode(); @@ -221,12 +244,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Seconds != 0L) { output.WriteRawTag(8); output.WriteInt64(Seconds); @@ -238,9 +266,29 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Seconds != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Seconds); + } + if (Nanos != 0) { + output.WriteRawTag(16); + output.WriteInt32(Nanos); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Seconds != 0L) { @@ -256,6 +304,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Timestamp other) { if (other == null) { return; @@ -270,7 +319,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -287,7 +340,31 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Seconds = input.ReadInt64(); + break; + } + case 16: { + Nanos = input.ReadInt32(); + break; + } + } + } } + #endif } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs index bfd4b8ec82..120f31a90a 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs @@ -56,10 +56,10 @@ namespace Google.Protobuf.WellKnownTypes { "ASgFEigKB29wdGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9u", "IjsKBk9wdGlvbhIMCgRuYW1lGAEgASgJEiMKBXZhbHVlGAIgASgLMhQuZ29v", "Z2xlLnByb3RvYnVmLkFueSouCgZTeW50YXgSEQoNU1lOVEFYX1BST1RPMhAA", - "EhEKDVNZTlRBWF9QUk9UTzMQAUJ9ChNjb20uZ29vZ2xlLnByb3RvYnVmQglU", - "eXBlUHJvdG9QAVovZ29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vcHJvdG9i", - "dWYvcHR5cGU7cHR5cGX4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2Vs", - "bEtub3duVHlwZXNiBnByb3RvMw==")); + "EhEKDVNZTlRBWF9QUk9UTzMQAUJ7ChNjb20uZ29vZ2xlLnByb3RvYnVmQglU", + "eXBlUHJvdG9QAVotZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMv", + "a25vd24vdHlwZXBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxL", + "bm93blR5cGVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.Syntax), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -94,23 +94,31 @@ namespace Google.Protobuf.WellKnownTypes { /// /// A protocol buffer message type. /// - public sealed partial class Type : pb::IMessage { + public sealed partial class Type : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Type()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Type() { OnConstruction(); } @@ -118,6 +126,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Type(Type other) : this() { name_ = other.name_; fields_ = other.fields_.Clone(); @@ -129,6 +138,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Type Clone() { return new Type(this); } @@ -140,6 +150,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The fully qualified message name. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -156,6 +167,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The list of fields. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Fields { get { return fields_; } } @@ -169,6 +181,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The list of types appearing in `oneof` definitions in this type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Oneofs { get { return oneofs_; } } @@ -182,6 +195,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The protocol buffer options. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Options { get { return options_; } } @@ -193,6 +207,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The source context. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -207,6 +222,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The source syntax. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { get { return syntax_; } set { @@ -215,11 +231,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Type); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Type other) { if (ReferenceEquals(other, null)) { return false; @@ -237,6 +255,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -252,12 +271,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); @@ -276,9 +300,36 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + fields_.WriteTo(ref output, _repeated_fields_codec); + oneofs_.WriteTo(ref output, _repeated_oneofs_codec); + options_.WriteTo(ref output, _repeated_options_codec); + if (sourceContext_ != null) { + output.WriteRawTag(42); + output.WriteMessage(SourceContext); + } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { + output.WriteRawTag(48); + output.WriteEnum((int) Syntax); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -300,6 +351,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Type other) { if (other == null) { return; @@ -323,7 +375,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -359,30 +415,81 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + fields_.AddEntriesFrom(ref input, _repeated_fields_codec); + break; + } + case 26: { + oneofs_.AddEntriesFrom(ref input, _repeated_oneofs_codec); + break; + } + case 34: { + options_.AddEntriesFrom(ref input, _repeated_options_codec); + break; + } + case 42: { + if (sourceContext_ == null) { + SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + } + input.ReadMessage(SourceContext); + break; + } + case 48: { + Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } + } + } + } + #endif + } /// /// A single field of a message type. /// - public sealed partial class Field : pb::IMessage { + public sealed partial class Field : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Field()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Field() { OnConstruction(); } @@ -390,6 +497,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Field(Field other) : this() { kind_ = other.kind_; cardinality_ = other.cardinality_; @@ -405,6 +513,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Field Clone() { return new Field(this); } @@ -416,6 +525,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The field type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind { get { return kind_; } set { @@ -430,6 +540,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The field cardinality. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality { get { return cardinality_; } set { @@ -444,6 +555,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The field number. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Number { get { return number_; } set { @@ -458,6 +570,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The field name. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -473,6 +586,7 @@ namespace Google.Protobuf.WellKnownTypes { /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string TypeUrl { get { return typeUrl_; } set { @@ -488,6 +602,7 @@ namespace Google.Protobuf.WellKnownTypes { /// types. The first type has index 1; zero means the type is not in the list. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int OneofIndex { get { return oneofIndex_; } set { @@ -502,6 +617,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Whether to use alternative packed wire representation. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Packed { get { return packed_; } set { @@ -518,6 +634,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The protocol buffer options. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Options { get { return options_; } } @@ -529,6 +646,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The field JSON name. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string JsonName { get { return jsonName_; } set { @@ -543,6 +661,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The string value of the default value of this field. Proto2 syntax only. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DefaultValue { get { return defaultValue_; } set { @@ -551,11 +670,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Field); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Field other) { if (ReferenceEquals(other, null)) { return false; @@ -577,6 +698,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown) hash ^= Kind.GetHashCode(); @@ -596,12 +718,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown) { output.WriteRawTag(8); output.WriteEnum((int) Kind); @@ -642,9 +769,58 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown) { + output.WriteRawTag(8); + output.WriteEnum((int) Kind); + } + if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.Unknown) { + output.WriteRawTag(16); + output.WriteEnum((int) Cardinality); + } + if (Number != 0) { + output.WriteRawTag(24); + output.WriteInt32(Number); + } + if (Name.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Name); + } + if (TypeUrl.Length != 0) { + output.WriteRawTag(50); + output.WriteString(TypeUrl); + } + if (OneofIndex != 0) { + output.WriteRawTag(56); + output.WriteInt32(OneofIndex); + } + if (Packed != false) { + output.WriteRawTag(64); + output.WriteBool(Packed); + } + options_.WriteTo(ref output, _repeated_options_codec); + if (JsonName.Length != 0) { + output.WriteRawTag(82); + output.WriteString(JsonName); + } + if (DefaultValue.Length != 0) { + output.WriteRawTag(90); + output.WriteString(DefaultValue); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TypeUnknown) { @@ -682,6 +858,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Field other) { if (other == null) { return; @@ -718,7 +895,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -767,11 +948,68 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif } + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Kind = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum(); + break; + } + case 16: { + Cardinality = (global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) input.ReadEnum(); + break; + } + case 24: { + Number = input.ReadInt32(); + break; + } + case 34: { + Name = input.ReadString(); + break; + } + case 50: { + TypeUrl = input.ReadString(); + break; + } + case 56: { + OneofIndex = input.ReadInt32(); + break; + } + case 64: { + Packed = input.ReadBool(); + break; + } + case 74: { + options_.AddEntriesFrom(ref input, _repeated_options_codec); + break; + } + case 82: { + JsonName = input.ReadString(); + break; + } + case 90: { + DefaultValue = input.ReadString(); + break; + } + } + } + } + #endif + #region Nested types /// Container for nested types declared in the Field message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Basic field types. @@ -885,23 +1123,31 @@ namespace Google.Protobuf.WellKnownTypes { /// /// Enum type definition. /// - public sealed partial class Enum : pb::IMessage { + public sealed partial class Enum : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Enum()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Enum() { OnConstruction(); } @@ -909,6 +1155,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Enum(Enum other) : this() { name_ = other.name_; enumvalue_ = other.enumvalue_.Clone(); @@ -919,6 +1166,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Enum Clone() { return new Enum(this); } @@ -930,6 +1178,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Enum type name. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -946,6 +1195,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Enum value definitions. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Enumvalue { get { return enumvalue_; } } @@ -959,6 +1209,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Protocol buffer options. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Options { get { return options_; } } @@ -970,6 +1221,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The source context. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -984,6 +1236,7 @@ namespace Google.Protobuf.WellKnownTypes { /// The source syntax. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { get { return syntax_; } set { @@ -992,11 +1245,13 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Enum); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Enum other) { if (ReferenceEquals(other, null)) { return false; @@ -1013,6 +1268,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -1027,12 +1283,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); @@ -1050,9 +1311,35 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + enumvalue_.WriteTo(ref output, _repeated_enumvalue_codec); + options_.WriteTo(ref output, _repeated_options_codec); + if (sourceContext_ != null) { + output.WriteRawTag(34); + output.WriteMessage(SourceContext); + } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.Proto2) { + output.WriteRawTag(40); + output.WriteEnum((int) Syntax); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -1073,6 +1360,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Enum other) { if (other == null) { return; @@ -1095,7 +1383,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1127,30 +1419,77 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + enumvalue_.AddEntriesFrom(ref input, _repeated_enumvalue_codec); + break; + } + case 26: { + options_.AddEntriesFrom(ref input, _repeated_options_codec); + break; + } + case 34: { + if (sourceContext_ == null) { + SourceContext = new global::Google.Protobuf.WellKnownTypes.SourceContext(); + } + input.ReadMessage(SourceContext); + break; + } + case 40: { + Syntax = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } + } + } } + #endif } /// /// Enum value definition. /// - public sealed partial class EnumValue : pb::IMessage { + public sealed partial class EnumValue : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValue()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumValue() { OnConstruction(); } @@ -1158,6 +1497,7 @@ namespace Google.Protobuf.WellKnownTypes { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumValue(EnumValue other) : this() { name_ = other.name_; number_ = other.number_; @@ -1166,6 +1506,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EnumValue Clone() { return new EnumValue(this); } @@ -1177,6 +1518,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Enum value name. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -1191,6 +1533,7 @@ namespace Google.Protobuf.WellKnownTypes { /// Enum value number. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int Number { get { return number_; } set { @@ -1207,16 +1550,19 @@ namespace Google.Protobuf.WellKnownTypes { /// Protocol buffer options. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Options { get { return options_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as EnumValue); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(EnumValue other) { if (ReferenceEquals(other, null)) { return false; @@ -1231,6 +1577,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -1243,12 +1590,17 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); @@ -1261,9 +1613,30 @@ namespace Google.Protobuf.WellKnownTypes { if (_unknownFields != null) { _unknownFields.WriteTo(output); } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Number != 0) { + output.WriteRawTag(16); + output.WriteInt32(Number); + } + options_.WriteTo(ref output, _repeated_options_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } } + #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -1280,6 +1653,7 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(EnumValue other) { if (other == null) { return; @@ -1295,7 +1669,11 @@ namespace Google.Protobuf.WellKnownTypes { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { @@ -1316,7 +1694,35 @@ namespace Google.Protobuf.WellKnownTypes { } } } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + Number = input.ReadInt32(); + break; + } + case 26: { + options_.AddEntriesFrom(ref input, _repeated_options_codec); + break; + } + } + } } + #endif } @@ -1324,23 +1730,31 @@ namespace Google.Protobuf.WellKnownTypes { /// A protocol buffer option, which can be attached to a message, field, /// enumeration, etc. /// - public sealed partial class Option : pb::IMessage