diff --git a/BUILD.bazel b/BUILD.bazel index 637882c49e..a5fa012e12 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -103,6 +103,12 @@ alias( # Built-in runtime protos: these are part of protobuf's internal # implementation, but are not Well-Known Types. +alias( + name = "cpp_features_proto", + actual = "//src/google/protobuf:cpp_features_proto", # proto_library + visibility = ["//visibility:public"], +) + alias( name = "descriptor_proto", actual = "//src/google/protobuf:descriptor_proto", # proto_library diff --git a/cmake/install.cmake b/cmake/install.cmake index e7eb2103be..c52f692dfe 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -65,6 +65,7 @@ set(protobuf_HEADERS ${libprotobuf_hdrs} ${libprotoc_hdrs} ${wkt_protos_files} + ${cpp_features_proto_proto_srcs} ${descriptor_proto_proto_srcs} ${plugin_proto_proto_srcs} ) diff --git a/cmake/tests.cmake b/cmake/tests.cmake index bf8ceaa94f..e2559e910e 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -172,6 +172,7 @@ file(GLOB_RECURSE _local_hdrs # Exclude the bootstrapping that are directly used by tests. set(_exclude_hdrs + "${protobuf_SOURCE_DIR}/src/google/protobuf/cpp_features.pb.h" "${protobuf_SOURCE_DIR}/src/google/protobuf/descriptor.pb.h" "${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.pb.h") diff --git a/generate_descriptor_proto.sh b/generate_descriptor_proto.sh index 43a060b532..0eb158146f 100755 --- a/generate_descriptor_proto.sh +++ b/generate_descriptor_proto.sh @@ -23,6 +23,7 @@ cd src declare -a RUNTIME_PROTO_FILES=(\ google/protobuf/any.proto \ google/protobuf/api.proto \ + google/protobuf/cpp_features.proto \ google/protobuf/descriptor.proto \ google/protobuf/duration.proto \ google/protobuf/empty.proto \ diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index c174b98748..18206b849d 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -894,22 +894,24 @@ const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[3] = { +static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[4] = { {.submsg = &google_protobuf_ExtensionRangeOptions_Declaration_msg_init}, + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, {.subenum = &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init}, }; -static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[3] = { +static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[4] = { {2, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = { &google_protobuf_ExtensionRangeOptions_submsgs[0], &google_protobuf_ExtensionRangeOptions__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -929,12 +931,12 @@ const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0010000002010392, &upb_psm_2bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x001000003f013eba, &upb_prm_2bt_max128b}, + {0x001800003f023eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1004,7 +1006,7 @@ const upb_MiniTable google_protobuf_FieldDescriptorProto_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0038000006000032, &upb_pss_1bt}, {0x004800000700003a, &upb_pss_1bt}, - {0x0058000008000042, &upb_psm_1bt_max64b}, + {0x0058000008000042, &upb_psm_1bt_max128b}, {0x0010000009000048, &upb_psv4_1bt}, {0x006000000a000052, &upb_pss_1bt}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1173,17 +1175,18 @@ const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[2] = { +static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[3] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, {.subenum = &google_protobuf_FileOptions_OptimizeMode_enum_init}, }; -static const upb_MiniTableField google_protobuf_FileOptions__fields[21] = { - {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FileOptions__fields[22] = { + {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, {10, 8, 4, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, {16, 9, 6, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {17, 10, 7, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {18, 11, 8, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, @@ -1191,21 +1194,22 @@ static const upb_MiniTableField google_protobuf_FileOptions__fields[21] = { {23, 13, 10, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {27, 14, 11, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {31, 15, 12, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, {42, 16, 18, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_FileOptions_msg_init = { &google_protobuf_FileOptions_submsgs[0], &google_protobuf_FileOptions__fields[0], - UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(112, 200), 22, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x001800000100000a, &upb_pss_1bt}, @@ -1242,23 +1246,25 @@ const upb_MiniTable google_protobuf_FileOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[1] = { +static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_MessageOptions__fields[6] = { +static const upb_MiniTableField google_protobuf_MessageOptions__fields[7] = { {1, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {2, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {3, 3, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {7, 4, 4, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {11, 5, 5, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_MessageOptions_msg_init = { &google_protobuf_MessageOptions_submsgs[0], &google_protobuf_MessageOptions__fields[0], - 16, 6, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 7, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0001000001000008, &upb_psb1_1bt}, @@ -1272,6 +1278,7 @@ const upb_MiniTable google_protobuf_MessageOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0005000005000058, &upb_psb1_1bt}, + {0x0008000006000062, &upb_psm_1bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1282,8 +1289,7 @@ const upb_MiniTable google_protobuf_MessageOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1295,7 +1301,9 @@ const upb_MiniTable google_protobuf_MessageOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[6] = { +static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[8] = { + {.submsg = &google_protobuf_FieldOptions_EditionDefault_msg_init}, + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, {.subenum = &google_protobuf_FieldOptions_CType_enum_init}, {.subenum = &google_protobuf_FieldOptions_JSType_enum_init}, @@ -1304,25 +1312,27 @@ static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[6] = { {.subenum = &google_protobuf_FieldOptions_OptionTargetType_enum_init}, }; -static const upb_MiniTableField google_protobuf_FieldOptions__fields[12] = { - {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FieldOptions__fields[14] = { + {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, {2, 8, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {3, 9, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {5, 10, 4, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, {10, 16, 6, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {15, 17, 7, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {16, 18, 8, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_FieldOptions_msg_init = { &google_protobuf_FieldOptions_submsgs[0], &google_protobuf_FieldOptions__fields[0], - UPB_SIZE(40, 48), 12, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(48, 64), 14, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1344,10 +1354,10 @@ const upb_MiniTable google_protobuf_FieldOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002800003f0001a2, &upb_prm_2bt_max64b}, + {0x003000000b0101aa, &upb_psm_2bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x002800003f003eba, &upb_prm_2bt_max128b}, + {0x003800003f023eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1359,20 +1369,40 @@ const upb_MiniTable google_protobuf_FieldOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[1] = { +static const upb_MiniTableField google_protobuf_FieldOptions_EditionDefault__fields[2] = { + {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_FieldOptions_EditionDefault_msg_init = { + NULL, + &google_protobuf_FieldOptions_EditionDefault__fields[0], + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pss_1bt}, + {0x0018000002000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_OneofOptions__fields[1] = { - {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_OneofOptions__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_OneofOptions_msg_init = { &google_protobuf_OneofOptions_submsgs[0], &google_protobuf_OneofOptions__fields[0], - 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1394,8 +1424,7 @@ const upb_MiniTable google_protobuf_OneofOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000000003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1407,21 +1436,23 @@ const upb_MiniTable google_protobuf_OneofOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[1] = { +static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_EnumOptions__fields[4] = { +static const upb_MiniTableField google_protobuf_EnumOptions__fields[5] = { {2, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {6, 3, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_EnumOptions_msg_init = { &google_protobuf_EnumOptions_submsgs[0], &google_protobuf_EnumOptions__fields[0], - UPB_SIZE(8, 16), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 5, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1430,6 +1461,7 @@ const upb_MiniTable google_protobuf_EnumOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0003000003000030, &upb_psb1_1bt}, + {0x000800000400003a, &upb_psm_1bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1445,8 +1477,7 @@ const upb_MiniTable google_protobuf_EnumOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1458,25 +1489,27 @@ const upb_MiniTable google_protobuf_EnumOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[1] = { +static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[3] = { +static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[4] = { {1, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { &google_protobuf_EnumValueOptions_submsgs[0], &google_protobuf_EnumValueOptions__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0001000001000008, &upb_psb1_1bt}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0002000002000018, &upb_psb1_1bt}, + {0x0008000002000012, &upb_psm_1bt_max64b}, + {0x0002000003000018, &upb_psb1_1bt}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1496,7 +1529,7 @@ const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1508,19 +1541,21 @@ const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[1] = { +static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_ServiceOptions__fields[2] = { +static const upb_MiniTableField google_protobuf_ServiceOptions__fields[3] = { {33, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { &google_protobuf_ServiceOptions_submsgs[0], &google_protobuf_ServiceOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1540,12 +1575,12 @@ const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0001000001000288, &upb_psb1_2bt}, + {0x0008000002000292, &upb_psm_2bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1557,21 +1592,23 @@ const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[2] = { +static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[3] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, {.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init}, }; -static const upb_MiniTableField google_protobuf_MethodOptions__fields[3] = { +static const upb_MiniTableField google_protobuf_MethodOptions__fields[4] = { {33, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_MethodOptions_msg_init = { &google_protobuf_MethodOptions_submsgs[0], &google_protobuf_MethodOptions__fields[0], - 16, 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1592,11 +1629,11 @@ const upb_MiniTable google_protobuf_MethodOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0001000001000288, &upb_psb1_2bt}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000300029a, &upb_psm_2bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1663,6 +1700,30 @@ const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init = { }) }; +static const upb_MiniTableSub google_protobuf_FeatureSet_submsgs[6] = { + {.subenum = &google_protobuf_FeatureSet_FieldPresence_enum_init}, + {.subenum = &google_protobuf_FeatureSet_EnumType_enum_init}, + {.subenum = &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init}, + {.subenum = &google_protobuf_FeatureSet_StringFieldValidation_enum_init}, + {.subenum = &google_protobuf_FeatureSet_MessageEncoding_enum_init}, + {.subenum = &google_protobuf_FeatureSet_JsonFormat_enum_init}, +}; + +static const upb_MiniTableField google_protobuf_FeatureSet__fields[6] = { + {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_FeatureSet_msg_init = { + &google_protobuf_FeatureSet_submsgs[0], + &google_protobuf_FeatureSet__fields[0], + 32, 6, kUpb_ExtMode_Extendable, 6, UPB_FASTTABLE_MASK(255), 0, +}; + static const upb_MiniTableSub google_protobuf_SourceCodeInfo_submsgs[1] = { {.submsg = &google_protobuf_SourceCodeInfo_Location_msg_init}, }; @@ -1751,7 +1812,7 @@ const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init = { }) }; -static const upb_MiniTable *messages_layout[28] = { +static const upb_MiniTable *messages_layout[30] = { &google_protobuf_FileDescriptorSet_msg_init, &google_protobuf_FileDescriptorProto_msg_init, &google_protobuf_DescriptorProto_msg_init, @@ -1769,6 +1830,7 @@ static const upb_MiniTable *messages_layout[28] = { &google_protobuf_FileOptions_msg_init, &google_protobuf_MessageOptions_msg_init, &google_protobuf_FieldOptions_msg_init, + &google_protobuf_FieldOptions_EditionDefault_msg_init, &google_protobuf_OneofOptions_msg_init, &google_protobuf_EnumOptions_msg_init, &google_protobuf_EnumValueOptions_msg_init, @@ -1776,6 +1838,7 @@ static const upb_MiniTable *messages_layout[28] = { &google_protobuf_MethodOptions_msg_init, &google_protobuf_UninterpretedOption_msg_init, &google_protobuf_UninterpretedOption_NamePart_msg_init, + &google_protobuf_FeatureSet_msg_init, &google_protobuf_SourceCodeInfo_msg_init, &google_protobuf_SourceCodeInfo_Location_msg_init, &google_protobuf_GeneratedCodeInfo_msg_init, @@ -1791,6 +1854,60 @@ const upb_MiniTableEnum google_protobuf_ExtensionRangeOptions_VerificationState_ }, }; +const upb_MiniTableEnum google_protobuf_FeatureSet_EnumType_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_FieldPresence_enum_init = { + 64, + 0, + { + 0xf, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_JsonFormat_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_MessageEncoding_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_StringFieldValidation_enum_init = { + 64, + 0, + { + 0xf, + 0x0, + }, +}; + const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init = { 64, 0, @@ -1872,8 +1989,14 @@ const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init }, }; -static const upb_MiniTableEnum *enums_layout[10] = { +static const upb_MiniTableEnum *enums_layout[16] = { &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init, + &google_protobuf_FeatureSet_EnumType_enum_init, + &google_protobuf_FeatureSet_FieldPresence_enum_init, + &google_protobuf_FeatureSet_JsonFormat_enum_init, + &google_protobuf_FeatureSet_MessageEncoding_enum_init, + &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init, + &google_protobuf_FeatureSet_StringFieldValidation_enum_init, &google_protobuf_FieldDescriptorProto_Label_enum_init, &google_protobuf_FieldDescriptorProto_Type_enum_init, &google_protobuf_FieldOptions_CType_enum_init, @@ -1889,8 +2012,8 @@ const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout = { messages_layout, enums_layout, NULL, - 28, - 10, + 30, + 16, 0, }; @@ -1904,7 +2027,7 @@ const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout = { * regenerated. */ -static const char descriptor[9135] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', +static const char descriptor[11046] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', 'M', '\n', '\021', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'S', 'e', 't', '\022', '8', '\n', '\004', 'f', 'i', 'l', 'e', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', @@ -1968,7 +2091,7 @@ static const char descriptor[9135] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', ' 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\032', '7', '\n', '\r', 'R', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', 's', 't', 'a', 'r', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\005', 's', 't', 'a', 'r', 't', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\"', -'\255', '\004', '\n', '\025', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', +'\346', '\004', '\n', '\025', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', @@ -1976,300 +2099,376 @@ static const char descriptor[9135] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', ' 'a', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\003', '(', '\013', '2', '2', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'D', 'e', 'c', 'l', 'a', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\003', '\210', '\001', '\002', 'R', '\013', 'd', 'e', 'c', 'l', 'a', -'r', 'a', 't', 'i', 'o', 'n', '\022', 'h', '\n', '\014', 'v', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\003', ' ', -'\001', '(', '\016', '2', '8', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'x', 't', -'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'V', 'e', 'r', 'i', 'f', 'i', -'c', 'a', 't', 'i', 'o', 'n', 'S', 't', 'a', 't', 'e', ':', '\n', 'U', 'N', 'V', 'E', 'R', 'I', 'F', 'I', 'E', 'D', 'R', '\014', -'v', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\263', '\001', '\n', '\013', 'D', 'e', 'c', 'l', 'a', 'r', 'a', 't', -'i', 'o', 'n', '\022', '\026', '\n', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\006', 'n', 'u', 'm', 'b', -'e', 'r', '\022', '\033', '\n', '\t', 'f', 'u', 'l', 'l', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\010', 'f', 'u', -'l', 'l', 'N', 'a', 'm', 'e', '\022', '\022', '\n', '\004', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\004', 't', 'y', 'p', -'e', '\022', '#', '\n', '\013', 'i', 's', '_', 'r', 'e', 'p', 'e', 'a', 't', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\010', 'B', '\002', '\030', -'\001', 'R', '\n', 'i', 's', 'R', 'e', 'p', 'e', 'a', 't', 'e', 'd', '\022', '\032', '\n', '\010', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', -'\030', '\005', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '\022', '\032', '\n', '\010', 'r', 'e', 'p', 'e', 'a', -'t', 'e', 'd', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'p', 'e', 'a', 't', 'e', 'd', '\"', '4', '\n', '\021', 'V', 'e', -'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'S', 't', 'a', 't', 'e', '\022', '\017', '\n', '\013', 'D', 'E', 'C', 'L', 'A', 'R', -'A', 'T', 'I', 'O', 'N', '\020', '\000', '\022', '\016', '\n', '\n', 'U', 'N', 'V', 'E', 'R', 'I', 'F', 'I', 'E', 'D', '\020', '\001', '*', '\t', -'\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\301', '\006', '\n', '\024', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', -'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', -'n', 'a', 'm', 'e', '\022', '\026', '\n', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\006', 'n', 'u', 'm', -'b', 'e', 'r', '\022', 'A', '\n', '\005', 'l', 'a', 'b', 'e', 'l', '\030', '\004', ' ', '\001', '(', '\016', '2', '+', '.', 'g', 'o', 'o', 'g', -'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', -'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'L', 'a', 'b', 'e', 'l', 'R', '\005', 'l', 'a', 'b', 'e', 'l', '\022', '>', '\n', '\004', 't', -'y', 'p', 'e', '\030', '\005', ' ', '\001', '(', '\016', '2', '*', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', -'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'T', -'y', 'p', 'e', 'R', '\004', 't', 'y', 'p', 'e', '\022', '\033', '\n', '\t', 't', 'y', 'p', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\006', ' ', -'\001', '(', '\t', 'R', '\010', 't', 'y', 'p', 'e', 'N', 'a', 'm', 'e', '\022', '\032', '\n', '\010', 'e', 'x', 't', 'e', 'n', 'd', 'e', 'e', -'\030', '\002', ' ', '\001', '(', '\t', 'R', '\010', 'e', 'x', 't', 'e', 'n', 'd', 'e', 'e', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', -'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', -'l', 'u', 'e', '\022', '\037', '\n', '\013', 'o', 'n', 'e', 'o', 'f', '_', 'i', 'n', 'd', 'e', 'x', '\030', '\t', ' ', '\001', '(', '\005', 'R', -'\n', 'o', 'n', 'e', 'o', 'f', 'I', 'n', 'd', 'e', 'x', '\022', '\033', '\n', '\t', 'j', 's', 'o', 'n', '_', 'n', 'a', 'm', 'e', '\030', -'\n', ' ', '\001', '(', '\t', 'R', '\010', 'j', 's', 'o', 'n', 'N', 'a', 'm', 'e', '\022', '7', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', -'s', '\030', '\010', ' ', '\001', '(', '\013', '2', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', -'.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', '\'', '\n', -'\017', 'p', 'r', 'o', 't', 'o', '3', '_', 'o', 'p', 't', 'i', 'o', 'n', 'a', 'l', '\030', '\021', ' ', '\001', '(', '\010', 'R', '\016', 'p', -'r', 'o', 't', 'o', '3', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l', '\"', '\266', '\002', '\n', '\004', 'T', 'y', 'p', 'e', '\022', '\017', '\n', -'\013', 'T', 'Y', 'P', 'E', '_', 'D', 'O', 'U', 'B', 'L', 'E', '\020', '\001', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'F', 'L', -'O', 'A', 'T', '\020', '\002', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'I', 'N', 'T', '6', '4', '\020', '\003', '\022', '\017', '\n', '\013', -'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', 'T', '6', '4', '\020', '\004', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'I', 'N', 'T', -'3', '2', '\020', '\005', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'X', 'E', 'D', '6', '4', '\020', '\006', '\022', '\020', '\n', -'\014', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'X', 'E', 'D', '3', '2', '\020', '\007', '\022', '\r', '\n', '\t', 'T', 'Y', 'P', 'E', '_', 'B', -'O', 'O', 'L', '\020', '\010', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\t', '\022', '\016', '\n', -'\n', 'T', 'Y', 'P', 'E', '_', 'G', 'R', 'O', 'U', 'P', '\020', '\n', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'M', 'E', 'S', -'S', 'A', 'G', 'E', '\020', '\013', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'B', 'Y', 'T', 'E', 'S', '\020', '\014', '\022', '\017', '\n', -'\013', 'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', 'T', '3', '2', '\020', '\r', '\022', '\r', '\n', '\t', 'T', 'Y', 'P', 'E', '_', 'E', 'N', -'U', 'M', '\020', '\016', '\022', '\021', '\n', '\r', 'T', 'Y', 'P', 'E', '_', 'S', 'F', 'I', 'X', 'E', 'D', '3', '2', '\020', '\017', '\022', '\021', -'\n', '\r', 'T', 'Y', 'P', 'E', '_', 'S', 'F', 'I', 'X', 'E', 'D', '6', '4', '\020', '\020', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', -'_', 'S', 'I', 'N', 'T', '3', '2', '\020', '\021', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'S', 'I', 'N', 'T', '6', '4', '\020', -'\022', '\"', 'C', '\n', '\005', 'L', 'a', 'b', 'e', 'l', '\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', 'L', '_', 'O', 'P', 'T', 'I', 'O', -'N', 'A', 'L', '\020', '\001', '\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', 'L', '_', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D', '\020', '\002', -'\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', 'L', '_', 'R', 'E', 'P', 'E', 'A', 'T', 'E', 'D', '\020', '\003', '\"', 'c', '\n', '\024', 'O', -'n', 'e', 'o', 'f', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', -'m', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '7', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', -'\030', '\002', ' ', '\001', '(', '\013', '2', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', -'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\343', '\002', '\n', -'\023', 'E', 'n', 'u', 'm', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', -'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '?', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', -'\002', ' ', '\003', '(', '\013', '2', ')', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', -'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\005', -'v', 'a', 'l', 'u', 'e', '\022', '6', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', -'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', -'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', ']', '\n', '\016', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '_', 'r', -'a', 'n', 'g', 'e', '\030', '\004', ' ', '\003', '(', '\013', '2', '6', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', -'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'E', -'n', 'u', 'm', 'R', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', 'R', '\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', -'d', 'R', 'a', 'n', 'g', 'e', '\022', '#', '\n', '\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '_', 'n', 'a', 'm', 'e', '\030', '\005', -' ', '\003', '(', '\t', 'R', '\014', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'N', 'a', 'm', 'e', '\032', ';', '\n', '\021', 'E', 'n', 'u', -'m', 'R', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', 's', 't', 'a', 'r', 't', '\030', '\001', -' ', '\001', '(', '\005', 'R', '\005', 's', 't', 'a', 'r', 't', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\005', 'R', -'\003', 'e', 'n', 'd', '\"', '\203', '\001', '\n', '\030', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', -'t', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', -'a', 'm', 'e', '\022', '\026', '\n', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\006', 'n', 'u', 'm', 'b', -'e', 'r', '\022', ';', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '!', '.', 'g', 'o', 'o', -'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', -'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\247', '\001', '\n', '\026', 'S', 'e', 'r', 'v', 'i', 'c', 'e', +'r', 'a', 't', 'i', 'o', 'n', '\022', '7', '\n', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\030', '2', ' ', '\001', '(', '\013', '2', +'\033', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', +'S', 'e', 't', 'R', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\022', 'h', '\n', '\014', 'v', 'e', 'r', 'i', 'f', 'i', 'c', 'a', +'t', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\016', '2', '8', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', 'a', 'n', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', +'.', 'V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'S', 't', 'a', 't', 'e', ':', '\n', 'U', 'N', 'V', 'E', 'R', +'I', 'F', 'I', 'E', 'D', 'R', '\014', 'v', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\263', '\001', '\n', '\013', 'D', +'e', 'c', 'l', 'a', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\030', '\001', ' ', '\001', '(', +'\005', 'R', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\022', '\033', '\n', '\t', 'f', 'u', 'l', 'l', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', +'\001', '(', '\t', 'R', '\010', 'f', 'u', 'l', 'l', 'N', 'a', 'm', 'e', '\022', '\022', '\n', '\004', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\001', +'(', '\t', 'R', '\004', 't', 'y', 'p', 'e', '\022', '#', '\n', '\013', 'i', 's', '_', 'r', 'e', 'p', 'e', 'a', 't', 'e', 'd', '\030', '\004', +' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\n', 'i', 's', 'R', 'e', 'p', 'e', 'a', 't', 'e', 'd', '\022', '\032', '\n', '\010', 'r', +'e', 's', 'e', 'r', 'v', 'e', 'd', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', '\022', '\032', +'\n', '\010', 'r', 'e', 'p', 'e', 'a', 't', 'e', 'd', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'p', 'e', 'a', 't', 'e', +'d', '\"', '4', '\n', '\021', 'V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'S', 't', 'a', 't', 'e', '\022', '\017', '\n', +'\013', 'D', 'E', 'C', 'L', 'A', 'R', 'A', 'T', 'I', 'O', 'N', '\020', '\000', '\022', '\016', '\n', '\n', 'U', 'N', 'V', 'E', 'R', 'I', 'F', +'I', 'E', 'D', '\020', '\001', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\301', '\006', '\n', '\024', 'F', 'i', 'e', 'l', +'d', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', +'\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\026', '\n', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\030', '\003', ' ', '\001', +'(', '\005', 'R', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\022', 'A', '\n', '\005', 'l', 'a', 'b', 'e', 'l', '\030', '\004', ' ', '\001', '(', '\016', +'2', '+', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', +'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '.', 'L', 'a', 'b', 'e', 'l', 'R', '\005', 'l', 'a', 'b', +'e', 'l', '\022', '>', '\n', '\004', 't', 'y', 'p', 'e', '\030', '\005', ' ', '\001', '(', '\016', '2', '*', '.', 'g', 'o', 'o', 'g', 'l', 'e', +'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', +'P', 'r', 'o', 't', 'o', '.', 'T', 'y', 'p', 'e', 'R', '\004', 't', 'y', 'p', 'e', '\022', '\033', '\n', '\t', 't', 'y', 'p', 'e', '_', +'n', 'a', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\010', 't', 'y', 'p', 'e', 'N', 'a', 'm', 'e', '\022', '\032', '\n', '\010', 'e', +'x', 't', 'e', 'n', 'd', 'e', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\010', 'e', 'x', 't', 'e', 'n', 'd', 'e', 'e', '\022', '#', +'\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', +'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '\037', '\n', '\013', 'o', 'n', 'e', 'o', 'f', '_', 'i', 'n', 'd', 'e', 'x', +'\030', '\t', ' ', '\001', '(', '\005', 'R', '\n', 'o', 'n', 'e', 'o', 'f', 'I', 'n', 'd', 'e', 'x', '\022', '\033', '\n', '\t', 'j', 's', 'o', +'n', '_', 'n', 'a', 'm', 'e', '\030', '\n', ' ', '\001', '(', '\t', 'R', '\010', 'j', 's', 'o', 'n', 'N', 'a', 'm', 'e', '\022', '7', '\n', +'\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\010', ' ', '\001', '(', '\013', '2', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', +'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', +'i', 'o', 'n', 's', '\022', '\'', '\n', '\017', 'p', 'r', 'o', 't', 'o', '3', '_', 'o', 'p', 't', 'i', 'o', 'n', 'a', 'l', '\030', '\021', +' ', '\001', '(', '\010', 'R', '\016', 'p', 'r', 'o', 't', 'o', '3', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l', '\"', '\266', '\002', '\n', '\004', +'T', 'y', 'p', 'e', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'D', 'O', 'U', 'B', 'L', 'E', '\020', '\001', '\022', '\016', '\n', '\n', +'T', 'Y', 'P', 'E', '_', 'F', 'L', 'O', 'A', 'T', '\020', '\002', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'I', 'N', 'T', '6', +'4', '\020', '\003', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', 'T', '6', '4', '\020', '\004', '\022', '\016', '\n', '\n', 'T', +'Y', 'P', 'E', '_', 'I', 'N', 'T', '3', '2', '\020', '\005', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'X', 'E', 'D', +'6', '4', '\020', '\006', '\022', '\020', '\n', '\014', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'X', 'E', 'D', '3', '2', '\020', '\007', '\022', '\r', '\n', +'\t', 'T', 'Y', 'P', 'E', '_', 'B', 'O', 'O', 'L', '\020', '\010', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'S', 'T', 'R', 'I', +'N', 'G', '\020', '\t', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'G', 'R', 'O', 'U', 'P', '\020', '\n', '\022', '\020', '\n', '\014', 'T', +'Y', 'P', 'E', '_', 'M', 'E', 'S', 'S', 'A', 'G', 'E', '\020', '\013', '\022', '\016', '\n', '\n', 'T', 'Y', 'P', 'E', '_', 'B', 'Y', 'T', +'E', 'S', '\020', '\014', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'U', 'I', 'N', 'T', '3', '2', '\020', '\r', '\022', '\r', '\n', '\t', +'T', 'Y', 'P', 'E', '_', 'E', 'N', 'U', 'M', '\020', '\016', '\022', '\021', '\n', '\r', 'T', 'Y', 'P', 'E', '_', 'S', 'F', 'I', 'X', 'E', +'D', '3', '2', '\020', '\017', '\022', '\021', '\n', '\r', 'T', 'Y', 'P', 'E', '_', 'S', 'F', 'I', 'X', 'E', 'D', '6', '4', '\020', '\020', '\022', +'\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', 'S', 'I', 'N', 'T', '3', '2', '\020', '\021', '\022', '\017', '\n', '\013', 'T', 'Y', 'P', 'E', '_', +'S', 'I', 'N', 'T', '6', '4', '\020', '\022', '\"', 'C', '\n', '\005', 'L', 'a', 'b', 'e', 'l', '\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', +'L', '_', 'O', 'P', 'T', 'I', 'O', 'N', 'A', 'L', '\020', '\001', '\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', 'L', '_', 'R', 'E', 'Q', +'U', 'I', 'R', 'E', 'D', '\020', '\002', '\022', '\022', '\n', '\016', 'L', 'A', 'B', 'E', 'L', '_', 'R', 'E', 'P', 'E', 'A', 'T', 'E', 'D', +'\020', '\003', '\"', 'c', '\n', '\024', 'O', 'n', 'e', 'o', 'f', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', +'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '7', '\n', '\007', +'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', +'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', +'o', 'n', 's', '\"', '\343', '\002', '\n', '\023', 'E', 'n', 'u', 'm', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', +'t', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '?', '\n', +'\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', ')', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', +'t', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', +'P', 'r', 'o', 't', 'o', 'R', '\005', 'v', 'a', 'l', 'u', 'e', '\022', '6', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', +' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', +'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', ']', '\n', '\016', 'r', 'e', 's', +'e', 'r', 'v', 'e', 'd', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\004', ' ', '\003', '(', '\013', '2', '6', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', +'P', 'r', 'o', 't', 'o', '.', 'E', 'n', 'u', 'm', 'R', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', 'R', '\r', +'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', '\022', '#', '\n', '\r', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', +'_', 'n', 'a', 'm', 'e', '\030', '\005', ' ', '\003', '(', '\t', 'R', '\014', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'N', 'a', 'm', 'e', +'\032', ';', '\n', '\021', 'E', 'n', 'u', 'm', 'R', 'e', 's', 'e', 'r', 'v', 'e', 'd', 'R', 'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', +'s', 't', 'a', 'r', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\005', 's', 't', 'a', 'r', 't', '\022', '\020', '\n', '\003', 'e', 'n', 'd', +'\030', '\002', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\"', '\203', '\001', '\n', '\030', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', -' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '>', '\n', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\030', '\002', ' ', '\003', '(', -'\013', '2', '&', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', -'d', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\022', -'9', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', -'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', -'\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\211', '\002', '\n', '\025', 'M', 'e', 't', 'h', 'o', 'd', 'D', 'e', 's', 'c', 'r', 'i', -'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', -'n', 'a', 'm', 'e', '\022', '\035', '\n', '\n', 'i', 'n', 'p', 'u', 't', '_', 't', 'y', 'p', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', -'\t', 'i', 'n', 'p', 'u', 't', 'T', 'y', 'p', 'e', '\022', '\037', '\n', '\013', 'o', 'u', 't', 'p', 'u', 't', '_', 't', 'y', 'p', 'e', -'\030', '\003', ' ', '\001', '(', '\t', 'R', '\n', 'o', 'u', 't', 'p', 'u', 't', 'T', 'y', 'p', 'e', '\022', '8', '\n', '\007', 'o', 'p', 't', -'i', 'o', 'n', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', -'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', -'s', '\022', '0', '\n', '\020', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\030', '\005', ' ', '\001', -'(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\017', 'c', 'l', 'i', 'e', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', -'g', '\022', '0', '\n', '\020', 's', 'e', 'r', 'v', 'e', 'r', '_', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\030', '\006', ' ', '\001', -'(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\017', 's', 'e', 'r', 'v', 'e', 'r', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', -'g', '\"', '\221', '\t', '\n', '\013', 'F', 'i', 'l', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '!', '\n', '\014', 'j', 'a', 'v', 'a', -'_', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 'j', 'a', 'v', 'a', 'P', 'a', 'c', 'k', 'a', -'g', 'e', '\022', '0', '\n', '\024', 'j', 'a', 'v', 'a', '_', 'o', 'u', 't', 'e', 'r', '_', 'c', 'l', 'a', 's', 's', 'n', 'a', 'm', -'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\022', 'j', 'a', 'v', 'a', 'O', 'u', 't', 'e', 'r', 'C', 'l', 'a', 's', 's', 'n', 'a', -'m', 'e', '\022', '5', '\n', '\023', 'j', 'a', 'v', 'a', '_', 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', '_', 'f', 'i', 'l', 'e', 's', -'\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\021', 'j', 'a', 'v', 'a', 'M', 'u', 'l', 't', 'i', 'p', -'l', 'e', 'F', 'i', 'l', 'e', 's', '\022', 'D', '\n', '\035', 'j', 'a', 'v', 'a', '_', 'g', 'e', 'n', 'e', 'r', 'a', 't', 'e', '_', -'e', 'q', 'u', 'a', 'l', 's', '_', 'a', 'n', 'd', '_', 'h', 'a', 's', 'h', '\030', '\024', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', -'R', '\031', 'j', 'a', 'v', 'a', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'E', 'q', 'u', 'a', 'l', 's', 'A', 'n', 'd', 'H', 'a', -'s', 'h', '\022', ':', '\n', '\026', 'j', 'a', 'v', 'a', '_', 's', 't', 'r', 'i', 'n', 'g', '_', 'c', 'h', 'e', 'c', 'k', '_', 'u', -'t', 'f', '8', '\030', '\033', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\023', 'j', 'a', 'v', 'a', 'S', 't', 'r', -'i', 'n', 'g', 'C', 'h', 'e', 'c', 'k', 'U', 't', 'f', '8', '\022', 'S', '\n', '\014', 'o', 'p', 't', 'i', 'm', 'i', 'z', 'e', '_', -'f', 'o', 'r', '\030', '\t', ' ', '\001', '(', '\016', '2', ')', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', -'u', 'f', '.', 'F', 'i', 'l', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', 'o', -'d', 'e', ':', '\005', 'S', 'P', 'E', 'E', 'D', 'R', '\013', 'o', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'F', 'o', 'r', '\022', '\035', '\n', -'\n', 'g', 'o', '_', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', '\013', ' ', '\001', '(', '\t', 'R', '\t', 'g', 'o', 'P', 'a', 'c', 'k', -'a', 'g', 'e', '\022', '5', '\n', '\023', 'c', 'c', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', -'s', '\030', '\020', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\021', 'c', 'c', 'G', 'e', 'n', 'e', 'r', 'i', 'c', -'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '9', '\n', '\025', 'j', 'a', 'v', 'a', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', -'s', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '\021', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\023', 'j', 'a', -'v', 'a', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '5', '\n', '\023', 'p', 'y', '_', 'g', -'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '\022', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', -'l', 's', 'e', 'R', '\021', 'p', 'y', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '7', '\n', -'\024', 'p', 'h', 'p', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '*', ' ', '\001', -'(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\022', 'p', 'h', 'p', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', -'i', 'c', 'e', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\027', ' ', '\001', '(', '\010', ':', -'\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '.', '\n', '\020', 'c', 'c', '_', -'e', 'n', 'a', 'b', 'l', 'e', '_', 'a', 'r', 'e', 'n', 'a', 's', '\030', '\037', ' ', '\001', '(', '\010', ':', '\004', 't', 'r', 'u', 'e', -'R', '\016', 'c', 'c', 'E', 'n', 'a', 'b', 'l', 'e', 'A', 'r', 'e', 'n', 'a', 's', '\022', '*', '\n', '\021', 'o', 'b', 'j', 'c', '_', -'c', 'l', 'a', 's', 's', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '$', ' ', '\001', '(', '\t', 'R', '\017', 'o', 'b', 'j', 'c', 'C', -'l', 'a', 's', 's', 'P', 'r', 'e', 'f', 'i', 'x', '\022', ')', '\n', '\020', 'c', 's', 'h', 'a', 'r', 'p', '_', 'n', 'a', 'm', 'e', -'s', 'p', 'a', 'c', 'e', '\030', '%', ' ', '\001', '(', '\t', 'R', '\017', 'c', 's', 'h', 'a', 'r', 'p', 'N', 'a', 'm', 'e', 's', 'p', -'a', 'c', 'e', '\022', '!', '\n', '\014', 's', 'w', 'i', 'f', 't', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\'', ' ', '\001', '(', '\t', -'R', '\013', 's', 'w', 'i', 'f', 't', 'P', 'r', 'e', 'f', 'i', 'x', '\022', '(', '\n', '\020', 'p', 'h', 'p', '_', 'c', 'l', 'a', 's', -'s', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '(', ' ', '\001', '(', '\t', 'R', '\016', 'p', 'h', 'p', 'C', 'l', 'a', 's', 's', 'P', -'r', 'e', 'f', 'i', 'x', '\022', '#', '\n', '\r', 'p', 'h', 'p', '_', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\030', ')', ' ', -'\001', '(', '\t', 'R', '\014', 'p', 'h', 'p', 'N', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\022', '4', '\n', '\026', 'p', 'h', 'p', '_', -'m', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\030', ',', ' ', '\001', '(', '\t', 'R', -'\024', 'p', 'h', 'p', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'N', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\022', '!', '\n', '\014', -'r', 'u', 'b', 'y', '_', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', '-', ' ', '\001', '(', '\t', 'R', '\013', 'r', 'u', 'b', 'y', 'P', -'a', 'c', 'k', 'a', 'g', 'e', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', -'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', -'t', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', -'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', ':', '\n', '\014', -'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', 'o', 'd', 'e', '\022', '\t', '\n', '\005', 'S', 'P', 'E', 'E', 'D', '\020', '\001', '\022', '\r', -'\n', '\t', 'C', 'O', 'D', 'E', '_', 'S', 'I', 'Z', 'E', '\020', '\002', '\022', '\020', '\n', '\014', 'L', 'I', 'T', 'E', '_', 'R', 'U', 'N', -'T', 'I', 'M', 'E', '\020', '\003', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\273', -'\003', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\027', 'm', 'e', 's', 's', -'a', 'g', 'e', '_', 's', 'e', 't', '_', 'w', 'i', 'r', 'e', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\001', ' ', '\001', '(', '\010', -':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\024', 'm', 'e', 's', 's', 'a', 'g', 'e', 'S', 'e', 't', 'W', 'i', 'r', 'e', 'F', 'o', -'r', 'm', 'a', 't', '\022', 'L', '\n', '\037', 'n', 'o', '_', 's', 't', 'a', 'n', 'd', 'a', 'r', 'd', '_', 'd', 'e', 's', 'c', 'r', -'i', 'p', 't', 'o', 'r', '_', 'a', 'c', 'c', 'e', 's', 's', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', -'s', 'e', 'R', '\034', 'n', 'o', 'S', 't', 'a', 'n', 'd', 'a', 'r', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'A', -'c', 'c', 'e', 's', 's', 'o', 'r', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', -'(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\033', '\n', '\t', -'m', 'a', 'p', '_', 'e', 'n', 't', 'r', 'y', '\030', '\007', ' ', '\001', '(', '\010', 'R', '\010', 'm', 'a', 'p', 'E', 'n', 't', 'r', 'y', -'\022', 'V', '\n', '&', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'j', 's', 'o', -'n', '_', 'f', 'i', 'e', 'l', 'd', '_', 'c', 'o', 'n', 'f', 'l', 'i', 'c', 't', 's', '\030', '\013', ' ', '\001', '(', '\010', 'B', '\002', -'\030', '\001', 'R', '\"', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'L', 'e', 'g', 'a', 'c', 'y', 'J', 's', 'o', 'n', 'F', -'i', 'e', 'l', 'd', 'C', 'o', 'n', 'f', 'l', 'i', 'c', 't', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', -'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', -'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', -'d', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', -'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\005', '\020', -'\006', 'J', '\004', '\010', '\006', '\020', '\007', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004', '\010', '\t', '\020', '\n', '\"', '\251', '\t', '\n', '\014', 'F', -'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'A', '\n', '\005', 'c', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', -'\016', '2', '#', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', -'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'C', 'T', 'y', 'p', 'e', ':', '\006', 'S', 'T', 'R', 'I', 'N', 'G', 'R', '\005', 'c', 't', -'y', 'p', 'e', '\022', '\026', '\n', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\006', 'p', 'a', 'c', 'k', -'e', 'd', '\022', 'G', '\n', '\006', 'j', 's', 't', 'y', 'p', 'e', '\030', '\006', ' ', '\001', '(', '\016', '2', '$', '.', 'g', 'o', 'o', 'g', -'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', -'J', 'S', 'T', 'y', 'p', 'e', ':', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', 'R', '\006', 'j', 's', 't', 'y', 'p', 'e', -'\022', '\031', '\n', '\004', 'l', 'a', 'z', 'y', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'l', 'a', -'z', 'y', '\022', '.', '\n', '\017', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', '_', 'l', 'a', 'z', 'y', '\030', '\017', ' ', '\001', -'(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\016', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', 'L', 'a', 'z', 'y', -'\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', -'s', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\031', '\n', '\004', 'w', 'e', 'a', 'k', '\030', '\n', ' ', -'\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'w', 'e', 'a', 'k', '\022', '(', '\n', '\014', 'd', 'e', 'b', 'u', 'g', -'_', 'r', 'e', 'd', 'a', 'c', 't', '\030', '\020', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\013', 'd', 'e', 'b', -'u', 'g', 'R', 'e', 'd', 'a', 'c', 't', '\022', 'K', '\n', '\t', 'r', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', '\030', '\021', ' ', '\001', -'(', '\016', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', -'d', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'O', 'p', 't', 'i', 'o', 'n', 'R', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', 'R', -'\t', 'r', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', '\022', 'H', '\n', '\007', 't', 'a', 'r', 'g', 'e', 't', 's', '\030', '\023', ' ', '\003', -'(', '\016', '2', '.', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', -'d', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'O', 'p', 't', 'i', 'o', 'n', 'T', 'a', 'r', 'g', 'e', 't', 'T', 'y', 'p', 'e', -'R', '\007', 't', 'a', 'r', 'g', 'e', 't', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', +' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\026', '\n', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\030', '\002', ' ', '\001', '(', +'\005', 'R', '\006', 'n', 'u', 'm', 'b', 'e', 'r', '\022', ';', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', +'\013', '2', '!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'V', +'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\247', '\001', '\n', '\026', +'S', 'e', 'r', 'v', 'i', 'c', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', +'\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '>', '\n', '\006', 'm', 'e', 't', 'h', +'o', 'd', '\030', '\002', ' ', '\003', '(', '\013', '2', '&', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', +'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'R', '\006', +'m', 'e', 't', 'h', 'o', 'd', '\022', '9', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '\037', +'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', +'p', 't', 'i', 'o', 'n', 's', 'R', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\211', '\002', '\n', '\025', 'M', 'e', 't', 'h', 'o', +'d', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', +'\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\035', '\n', '\n', 'i', 'n', 'p', 'u', 't', '_', 't', 'y', 'p', 'e', +'\030', '\002', ' ', '\001', '(', '\t', 'R', '\t', 'i', 'n', 'p', 'u', 't', 'T', 'y', 'p', 'e', '\022', '\037', '\n', '\013', 'o', 'u', 't', 'p', +'u', 't', '_', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\n', 'o', 'u', 't', 'p', 'u', 't', 'T', 'y', 'p', 'e', +'\022', '8', '\n', '\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', +'\007', 'o', 'p', 't', 'i', 'o', 'n', 's', '\022', '0', '\n', '\020', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'r', 'e', 'a', 'm', +'i', 'n', 'g', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\017', 'c', 'l', 'i', 'e', 'n', 't', 'S', +'t', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\022', '0', '\n', '\020', 's', 'e', 'r', 'v', 'e', 'r', '_', 's', 't', 'r', 'e', 'a', 'm', +'i', 'n', 'g', '\030', '\006', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\017', 's', 'e', 'r', 'v', 'e', 'r', 'S', +'t', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\"', '\312', '\t', '\n', '\013', 'F', 'i', 'l', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', +'!', '\n', '\014', 'j', 'a', 'v', 'a', '_', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 'j', 'a', +'v', 'a', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\022', '0', '\n', '\024', 'j', 'a', 'v', 'a', '_', 'o', 'u', 't', 'e', 'r', '_', 'c', +'l', 'a', 's', 's', 'n', 'a', 'm', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\022', 'j', 'a', 'v', 'a', 'O', 'u', 't', 'e', 'r', +'C', 'l', 'a', 's', 's', 'n', 'a', 'm', 'e', '\022', '5', '\n', '\023', 'j', 'a', 'v', 'a', '_', 'm', 'u', 'l', 't', 'i', 'p', 'l', +'e', '_', 'f', 'i', 'l', 'e', 's', '\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\021', 'j', 'a', 'v', +'a', 'M', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'F', 'i', 'l', 'e', 's', '\022', 'D', '\n', '\035', 'j', 'a', 'v', 'a', '_', 'g', 'e', +'n', 'e', 'r', 'a', 't', 'e', '_', 'e', 'q', 'u', 'a', 'l', 's', '_', 'a', 'n', 'd', '_', 'h', 'a', 's', 'h', '\030', '\024', ' ', +'\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\031', 'j', 'a', 'v', 'a', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'E', 'q', 'u', 'a', +'l', 's', 'A', 'n', 'd', 'H', 'a', 's', 'h', '\022', ':', '\n', '\026', 'j', 'a', 'v', 'a', '_', 's', 't', 'r', 'i', 'n', 'g', '_', +'c', 'h', 'e', 'c', 'k', '_', 'u', 't', 'f', '8', '\030', '\033', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\023', +'j', 'a', 'v', 'a', 'S', 't', 'r', 'i', 'n', 'g', 'C', 'h', 'e', 'c', 'k', 'U', 't', 'f', '8', '\022', 'S', '\n', '\014', 'o', 'p', +'t', 'i', 'm', 'i', 'z', 'e', '_', 'f', 'o', 'r', '\030', '\t', ' ', '\001', '(', '\016', '2', ')', '.', 'g', 'o', 'o', 'g', 'l', 'e', +'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'l', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'O', 'p', 't', +'i', 'm', 'i', 'z', 'e', 'M', 'o', 'd', 'e', ':', '\005', 'S', 'P', 'E', 'E', 'D', 'R', '\013', 'o', 'p', 't', 'i', 'm', 'i', 'z', +'e', 'F', 'o', 'r', '\022', '\035', '\n', '\n', 'g', 'o', '_', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', '\013', ' ', '\001', '(', '\t', 'R', +'\t', 'g', 'o', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\022', '5', '\n', '\023', 'c', 'c', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', +'s', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '\020', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\021', 'c', 'c', +'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '9', '\n', '\025', 'j', 'a', 'v', 'a', '_', 'g', +'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '\021', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', +'l', 's', 'e', 'R', '\023', 'j', 'a', 'v', 'a', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', +'5', '\n', '\023', 'p', 'y', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '\022', ' ', +'\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\021', 'p', 'y', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'r', 'v', +'i', 'c', 'e', 's', '\022', '7', '\n', '\024', 'p', 'h', 'p', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 's', 'e', 'r', 'v', 'i', +'c', 'e', 's', '\030', '*', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\022', 'p', 'h', 'p', 'G', 'e', 'n', 'e', +'r', 'i', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', +'\030', '\027', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', +'\022', '.', '\n', '\020', 'c', 'c', '_', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'a', 'r', 'e', 'n', 'a', 's', '\030', '\037', ' ', '\001', '(', +'\010', ':', '\004', 't', 'r', 'u', 'e', 'R', '\016', 'c', 'c', 'E', 'n', 'a', 'b', 'l', 'e', 'A', 'r', 'e', 'n', 'a', 's', '\022', '*', +'\n', '\021', 'o', 'b', 'j', 'c', '_', 'c', 'l', 'a', 's', 's', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '$', ' ', '\001', '(', '\t', +'R', '\017', 'o', 'b', 'j', 'c', 'C', 'l', 'a', 's', 's', 'P', 'r', 'e', 'f', 'i', 'x', '\022', ')', '\n', '\020', 'c', 's', 'h', 'a', +'r', 'p', '_', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\030', '%', ' ', '\001', '(', '\t', 'R', '\017', 'c', 's', 'h', 'a', 'r', +'p', 'N', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\022', '!', '\n', '\014', 's', 'w', 'i', 'f', 't', '_', 'p', 'r', 'e', 'f', 'i', +'x', '\030', '\'', ' ', '\001', '(', '\t', 'R', '\013', 's', 'w', 'i', 'f', 't', 'P', 'r', 'e', 'f', 'i', 'x', '\022', '(', '\n', '\020', 'p', +'h', 'p', '_', 'c', 'l', 'a', 's', 's', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '(', ' ', '\001', '(', '\t', 'R', '\016', 'p', 'h', +'p', 'C', 'l', 'a', 's', 's', 'P', 'r', 'e', 'f', 'i', 'x', '\022', '#', '\n', '\r', 'p', 'h', 'p', '_', 'n', 'a', 'm', 'e', 's', +'p', 'a', 'c', 'e', '\030', ')', ' ', '\001', '(', '\t', 'R', '\014', 'p', 'h', 'p', 'N', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\022', +'4', '\n', '\026', 'p', 'h', 'p', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', +'\030', ',', ' ', '\001', '(', '\t', 'R', '\024', 'p', 'h', 'p', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'N', 'a', 'm', 'e', 's', 'p', +'a', 'c', 'e', '\022', '!', '\n', '\014', 'r', 'u', 'b', 'y', '_', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', '-', ' ', '\001', '(', '\t', +'R', '\013', 'r', 'u', 'b', 'y', 'P', 'a', 'c', 'k', 'a', 'g', 'e', '\022', '7', '\n', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', +'\030', '2', ' ', '\001', '(', '\013', '2', '\033', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', +'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', 'R', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\022', 'X', '\n', '\024', 'u', +'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', +'\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', +'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', +'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', ':', '\n', '\014', 'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', 'o', 'd', +'e', '\022', '\t', '\n', '\005', 'S', 'P', 'E', 'E', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'C', 'O', 'D', 'E', '_', 'S', 'I', 'Z', 'E', +'\020', '\002', '\022', '\020', '\n', '\014', 'L', 'I', 'T', 'E', '_', 'R', 'U', 'N', 'T', 'I', 'M', 'E', '\020', '\003', '*', '\t', '\010', '\350', '\007', +'\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\364', '\003', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', +'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\027', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 's', 'e', 't', '_', 'w', 'i', 'r', +'e', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\024', 'm', 'e', +'s', 's', 'a', 'g', 'e', 'S', 'e', 't', 'W', 'i', 'r', 'e', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'L', '\n', '\037', 'n', 'o', '_', +'s', 't', 'a', 'n', 'd', 'a', 'r', 'd', '_', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'a', 'c', 'c', 'e', 's', +'s', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\034', 'n', 'o', 'S', 't', 'a', 'n', 'd', +'a', 'r', 'd', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'A', 'c', 'c', 'e', 's', 's', 'o', 'r', '\022', '%', '\n', '\n', +'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', +'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\033', '\n', '\t', 'm', 'a', 'p', '_', 'e', 'n', 't', 'r', 'y', '\030', '\007', +' ', '\001', '(', '\010', 'R', '\010', 'm', 'a', 'p', 'E', 'n', 't', 'r', 'y', '\022', 'V', '\n', '&', 'd', 'e', 'p', 'r', 'e', 'c', 'a', +'t', 'e', 'd', '_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'j', 's', 'o', 'n', '_', 'f', 'i', 'e', 'l', 'd', '_', 'c', 'o', 'n', +'f', 'l', 'i', 'c', 't', 's', '\030', '\013', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\"', 'd', 'e', 'p', 'r', 'e', 'c', 'a', +'t', 'e', 'd', 'L', 'e', 'g', 'a', 'c', 'y', 'J', 's', 'o', 'n', 'F', 'i', 'e', 'l', 'd', 'C', 'o', 'n', 'f', 'l', 'i', 'c', +'t', 's', '\022', '7', '\n', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\030', '\014', ' ', '\001', '(', '\013', '2', '\033', '.', 'g', 'o', +'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', 'R', +'\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', -'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022', -'n', '\n', '\032', 't', 'a', 'r', 'g', 'e', 't', '_', 'o', 'b', 's', 'o', 'l', 'e', 't', 'e', '_', 'd', 'o', '_', 'n', 'o', 't', -'_', 'u', 's', 'e', '\030', '\022', ' ', '\001', '(', '\016', '2', '.', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', -'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'O', 'p', 't', 'i', 'o', 'n', 'T', 'a', -'r', 'g', 'e', 't', 'T', 'y', 'p', 'e', 'B', '\002', '\030', '\001', 'R', '\026', 't', 'a', 'r', 'g', 'e', 't', 'O', 'b', 's', 'o', 'l', -'e', 't', 'e', 'D', 'o', 'N', 'o', 't', 'U', 's', 'e', '\"', '/', '\n', '\005', 'C', 'T', 'y', 'p', 'e', '\022', '\n', '\n', '\006', 'S', -'T', 'R', 'I', 'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', '\022', '\020', '\n', '\014', 'S', 'T', 'R', 'I', -'N', 'G', '_', 'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', 'y', 'p', 'e', '\022', '\r', '\n', '\t', 'J', -'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\001', -'\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '\"', 'U', '\n', '\017', 'O', 'p', 't', 'i', 'o', 'n', -'R', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', '\022', '\025', '\n', '\021', 'R', 'E', 'T', 'E', 'N', 'T', 'I', 'O', 'N', '_', 'U', 'N', -'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\025', '\n', '\021', 'R', 'E', 'T', 'E', 'N', 'T', 'I', 'O', 'N', '_', 'R', 'U', 'N', 'T', -'I', 'M', 'E', '\020', '\001', '\022', '\024', '\n', '\020', 'R', 'E', 'T', 'E', 'N', 'T', 'I', 'O', 'N', '_', 'S', 'O', 'U', 'R', 'C', 'E', -'\020', '\002', '\"', '\214', '\002', '\n', '\020', 'O', 'p', 't', 'i', 'o', 'n', 'T', 'a', 'r', 'g', 'e', 't', 'T', 'y', 'p', 'e', '\022', '\027', -'\n', '\023', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\024', -'\n', '\020', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'L', 'E', '\020', '\001', '\022', '\037', '\n', '\033', 'T', -'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'E', 'X', 'T', 'E', 'N', 'S', 'I', 'O', 'N', '_', 'R', 'A', 'N', 'G', -'E', '\020', '\002', '\022', '\027', '\n', '\023', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'M', 'E', 'S', 'S', 'A', 'G', -'E', '\020', '\003', '\022', '\025', '\n', '\021', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'E', 'L', 'D', '\020', -'\004', '\022', '\025', '\n', '\021', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'O', 'N', 'E', 'O', 'F', '\020', '\005', '\022', -'\024', '\n', '\020', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'E', 'N', 'U', 'M', '\020', '\006', '\022', '\032', '\n', '\026', -'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'E', 'N', 'U', 'M', '_', 'E', 'N', 'T', 'R', 'Y', '\020', '\007', '\022', -'\027', '\n', '\023', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'S', 'E', 'R', 'V', 'I', 'C', 'E', '\020', '\010', '\022', -'\026', '\n', '\022', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'M', 'E', 'T', 'H', 'O', 'D', '\020', '\t', '*', '\t', -'\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', '\"', 's', '\n', '\014', 'O', 'n', 'e', 'o', 'f', 'O', -'p', 't', 'i', 'o', 'n', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', +'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', +'\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\005', '\020', '\006', 'J', '\004', '\010', +'\006', '\020', '\007', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004', '\010', '\t', '\020', '\n', '\"', '\375', '\n', '\n', '\014', 'F', 'i', 'e', 'l', 'd', +'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'A', '\n', '\005', 'c', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '#', '.', +'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', +'o', 'n', 's', '.', 'C', 'T', 'y', 'p', 'e', ':', '\006', 'S', 'T', 'R', 'I', 'N', 'G', 'R', '\005', 'c', 't', 'y', 'p', 'e', '\022', +'\026', '\n', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\022', 'G', +'\n', '\006', 'j', 's', 't', 'y', 'p', 'e', '\030', '\006', ' ', '\001', '(', '\016', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', +'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'J', 'S', 'T', 'y', +'p', 'e', ':', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', 'R', '\006', 'j', 's', 't', 'y', 'p', 'e', '\022', '\031', '\n', '\004', +'l', 'a', 'z', 'y', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'l', 'a', 'z', 'y', '\022', '.', +'\n', '\017', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', '_', 'l', 'a', 'z', 'y', '\030', '\017', ' ', '\001', '(', '\010', ':', '\005', +'f', 'a', 'l', 's', 'e', 'R', '\016', 'u', 'n', 'v', 'e', 'r', 'i', 'f', 'i', 'e', 'd', 'L', 'a', 'z', 'y', '\022', '%', '\n', '\n', +'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', +'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\031', '\n', '\004', 'w', 'e', 'a', 'k', '\030', '\n', ' ', '\001', '(', '\010', ':', +'\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'w', 'e', 'a', 'k', '\022', '(', '\n', '\014', 'd', 'e', 'b', 'u', 'g', '_', 'r', 'e', 'd', +'a', 'c', 't', '\030', '\020', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\013', 'd', 'e', 'b', 'u', 'g', 'R', 'e', +'d', 'a', 'c', 't', '\022', 'K', '\n', '\t', 'r', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', '\030', '\021', ' ', '\001', '(', '\016', '2', '-', +'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', +'i', 'o', 'n', 's', '.', 'O', 'p', 't', 'i', 'o', 'n', 'R', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', 'R', '\t', 'r', 'e', 't', +'e', 'n', 't', 'i', 'o', 'n', '\022', 'H', '\n', '\007', 't', 'a', 'r', 'g', 'e', 't', 's', '\030', '\023', ' ', '\003', '(', '\016', '2', '.', +'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', +'i', 'o', 'n', 's', '.', 'O', 'p', 't', 'i', 'o', 'n', 'T', 'a', 'r', 'g', 'e', 't', 'T', 'y', 'p', 'e', 'R', '\007', 't', 'a', +'r', 'g', 'e', 't', 's', '\022', 'W', '\n', '\020', 'e', 'd', 'i', 't', 'i', 'o', 'n', '_', 'd', 'e', 'f', 'a', 'u', 'l', 't', 's', +'\030', '\024', ' ', '\003', '(', '\013', '2', ',', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', +'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'E', 'd', 'i', 't', 'i', 'o', 'n', 'D', 'e', 'f', 'a', 'u', +'l', 't', 'R', '\017', 'e', 'd', 'i', 't', 'i', 'o', 'n', 'D', 'e', 'f', 'a', 'u', 'l', 't', 's', '\022', '7', '\n', '\010', 'f', 'e', +'a', 't', 'u', 'r', 'e', 's', '\030', '\025', ' ', '\001', '(', '\013', '2', '\033', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', +'t', 'o', 'b', 'u', 'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', 'R', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', +'s', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', +'\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', +'.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', +'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'n', '\n', '\032', 't', 'a', 'r', 'g', 'e', +'t', '_', 'o', 'b', 's', 'o', 'l', 'e', 't', 'e', '_', 'd', 'o', '_', 'n', 'o', 't', '_', 'u', 's', 'e', '\030', '\022', ' ', '\001', +'(', '\016', '2', '.', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', +'d', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'O', 'p', 't', 'i', 'o', 'n', 'T', 'a', 'r', 'g', 'e', 't', 'T', 'y', 'p', 'e', +'B', '\002', '\030', '\001', 'R', '\026', 't', 'a', 'r', 'g', 'e', 't', 'O', 'b', 's', 'o', 'l', 'e', 't', 'e', 'D', 'o', 'N', 'o', 't', +'U', 's', 'e', '\032', '@', '\n', '\016', 'E', 'd', 'i', 't', 'i', 'o', 'n', 'D', 'e', 'f', 'a', 'u', 'l', 't', '\022', '\030', '\n', '\007', +'e', 'd', 'i', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 'e', 'd', 'i', 't', 'i', 'o', 'n', '\022', '\024', '\n', +'\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\005', 'v', 'a', 'l', 'u', 'e', '\"', '/', '\n', '\005', 'C', 'T', +'y', 'p', 'e', '\022', '\n', '\n', '\006', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', +'\022', '\020', '\n', '\014', 'S', 'T', 'R', 'I', 'N', 'G', '_', 'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', +'y', 'p', 'e', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', +'S', 'T', 'R', 'I', 'N', 'G', '\020', '\001', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '\"', 'U', +'\n', '\017', 'O', 'p', 't', 'i', 'o', 'n', 'R', 'e', 't', 'e', 'n', 't', 'i', 'o', 'n', '\022', '\025', '\n', '\021', 'R', 'E', 'T', 'E', +'N', 'T', 'I', 'O', 'N', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\025', '\n', '\021', 'R', 'E', 'T', 'E', 'N', 'T', +'I', 'O', 'N', '_', 'R', 'U', 'N', 'T', 'I', 'M', 'E', '\020', '\001', '\022', '\024', '\n', '\020', 'R', 'E', 'T', 'E', 'N', 'T', 'I', 'O', +'N', '_', 'S', 'O', 'U', 'R', 'C', 'E', '\020', '\002', '\"', '\214', '\002', '\n', '\020', 'O', 'p', 't', 'i', 'o', 'n', 'T', 'a', 'r', 'g', +'e', 't', 'T', 'y', 'p', 'e', '\022', '\027', '\n', '\023', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'U', 'N', 'K', +'N', 'O', 'W', 'N', '\020', '\000', '\022', '\024', '\n', '\020', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'F', 'I', 'L', +'E', '\020', '\001', '\022', '\037', '\n', '\033', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'E', 'X', 'T', 'E', 'N', 'S', +'I', 'O', 'N', '_', 'R', 'A', 'N', 'G', 'E', '\020', '\002', '\022', '\027', '\n', '\023', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', +'E', '_', 'M', 'E', 'S', 'S', 'A', 'G', 'E', '\020', '\003', '\022', '\025', '\n', '\021', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', +'E', '_', 'F', 'I', 'E', 'L', 'D', '\020', '\004', '\022', '\025', '\n', '\021', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', +'O', 'N', 'E', 'O', 'F', '\020', '\005', '\022', '\024', '\n', '\020', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'E', 'N', +'U', 'M', '\020', '\006', '\022', '\032', '\n', '\026', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'E', 'N', 'U', 'M', '_', +'E', 'N', 'T', 'R', 'Y', '\020', '\007', '\022', '\027', '\n', '\023', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'S', 'E', +'R', 'V', 'I', 'C', 'E', '\020', '\010', '\022', '\026', '\n', '\022', 'T', 'A', 'R', 'G', 'E', 'T', '_', 'T', 'Y', 'P', 'E', '_', 'M', 'E', +'T', 'H', 'O', 'D', '\020', '\t', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', '\"', '\254', +'\001', '\n', '\014', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '7', '\n', '\010', 'f', 'e', 'a', 't', 'u', 'r', +'e', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\033', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', +'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', 'R', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\022', 'X', '\n', +'\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', +'\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', +'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', +'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\321', +'\002', '\n', '\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\037', '\n', '\013', 'a', 'l', 'l', 'o', 'w', '_', 'a', +'l', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', 'l', 'o', 'w', 'A', 'l', 'i', 'a', 's', '\022', '%', '\n', +'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', +'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'V', '\n', '&', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', +'_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'j', 's', 'o', 'n', '_', 'f', 'i', 'e', 'l', 'd', '_', 'c', 'o', 'n', 'f', 'l', 'i', +'c', 't', 's', '\030', '\006', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\"', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', +'L', 'e', 'g', 'a', 'c', 'y', 'J', 's', 'o', 'n', 'F', 'i', 'e', 'l', 'd', 'C', 'o', 'n', 'f', 'l', 'i', 'c', 't', 's', '\022', +'7', '\n', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\030', '\007', ' ', '\001', '(', '\013', '2', '\033', '.', 'g', 'o', 'o', 'g', 'l', +'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', 'R', '\010', 'f', 'e', +'a', 't', 'u', 'r', 'e', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', -'\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\230', '\002', '\n', '\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\037', -'\n', '\013', 'a', 'l', 'l', 'o', 'w', '_', 'a', 'l', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', 'l', 'o', -'w', 'A', 'l', 'i', 'a', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', -'\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'V', '\n', '&', 'd', -'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'l', 'e', 'g', 'a', 'c', 'y', '_', 'j', 's', 'o', 'n', '_', 'f', 'i', 'e', -'l', 'd', '_', 'c', 'o', 'n', 'f', 'l', 'i', 'c', 't', 's', '\030', '\006', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\"', 'd', -'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'L', 'e', 'g', 'a', 'c', 'y', 'J', 's', 'o', 'n', 'F', 'i', 'e', 'l', 'd', 'C', -'o', 'n', 'f', 'l', 'i', 'c', 't', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', -'_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', +'\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006', '\"', '\201', '\002', '\n', '\020', 'E', 'n', 'u', 'm', 'V', 'a', 'l', +'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\001', +' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '7', +'\n', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\033', '.', 'g', 'o', 'o', 'g', 'l', 'e', +'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', 'R', '\010', 'f', 'e', 'a', +'t', 'u', 'r', 'e', 's', '\022', '(', '\n', '\014', 'd', 'e', 'b', 'u', 'g', '_', 'r', 'e', 'd', 'a', 'c', 't', '\030', '\003', ' ', '\001', +'(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\013', 'd', 'e', 'b', 'u', 'g', 'R', 'e', 'd', 'a', 'c', 't', '\022', 'X', '\n', +'\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', +'\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', +'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', +'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\325', +'\001', '\n', '\016', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '7', '\n', '\010', 'f', 'e', 'a', 't', +'u', 'r', 'e', 's', '\030', '\"', ' ', '\001', '(', '\013', '2', '\033', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', 'R', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\022', +'%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', +'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', +'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', +'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', +'d', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', +'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\231', '\003', '\n', '\r', 'M', 'e', 't', 'h', 'o', 'd', +'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', +'(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'q', '\n', '\021', +'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\"', ' ', '\001', '(', '\016', '2', '/', +'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', +'t', 'i', 'o', 'n', 's', '.', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', ':', '\023', 'I', +'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', 'R', '\020', 'i', 'd', 'e', 'm', 'p', +'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '7', '\n', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\030', '#', +' ', '\001', '(', '\013', '2', '\033', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'e', +'a', 't', 'u', 'r', 'e', 'S', 'e', 't', 'R', '\010', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', +'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', +'$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', +'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', +'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', 'P', '\n', '\020', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', +'v', 'e', 'l', '\022', '\027', '\n', '\023', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', +'N', '\020', '\000', '\022', '\023', '\n', '\017', 'N', 'O', '_', 'S', 'I', 'D', 'E', '_', 'E', 'F', 'F', 'E', 'C', 'T', 'S', '\020', '\001', '\022', +'\016', '\n', '\n', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'T', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', +'\002', '\"', '\232', '\003', '\n', '\023', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', +'\022', 'A', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', -'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', -'\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006', '\"', '\310', '\001', '\n', '\020', 'E', 'n', 'u', 'm', 'V', -'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', -'\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', -'\022', '(', '\n', '\014', 'd', 'e', 'b', 'u', 'g', '_', 'r', 'e', 'd', 'a', 'c', 't', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', -'a', 'l', 's', 'e', 'R', '\013', 'd', 'e', 'b', 'u', 'g', 'R', 'e', 'd', 'a', 'c', 't', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', -'t', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', -'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', -'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', -'d', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\234', '\001', '\n', '\016', 'S', 'e', -'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', -'d', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', -'d', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', -'\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', -'.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', -'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', -'\200', '\002', '\"', '\340', '\002', '\n', '\r', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', -'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', -'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'q', '\n', '\021', 'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', '_', -'l', 'e', 'v', 'e', 'l', '\030', '\"', ' ', '\001', '(', '\016', '2', '/', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', -'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'I', 'd', 'e', 'm', 'p', 'o', -'t', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', ':', '\023', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', -'N', 'K', 'N', 'O', 'W', 'N', 'R', '\020', 'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', -'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', -'\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', -'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', -'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', 'P', '\n', '\020', 'I', 'd', 'e', 'm', 'p', 'o', 't', -'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '\027', '\n', '\023', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', -'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\023', '\n', '\017', 'N', 'O', '_', 'S', 'I', 'D', 'E', '_', 'E', 'F', 'F', 'E', -'C', 'T', 'S', '\020', '\001', '\022', '\016', '\n', '\n', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'T', '\020', '\002', '*', '\t', '\010', '\350', -'\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\232', '\003', '\n', '\023', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', -'O', 'p', 't', 'i', 'o', 'n', '\022', 'A', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', -'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', -'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '.', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ')', -'\n', '\020', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', -'\017', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'p', 'o', 's', 'i', 't', -'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\020', 'p', 'o', 's', 'i', -'t', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', '_', -'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\020', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', -'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 'd', 'o', 'u', 'b', 'l', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', -'\006', ' ', '\001', '(', '\001', 'R', '\013', 'd', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 's', 't', 'r', -'i', 'n', 'g', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', ' ', '\001', '(', '\014', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'V', 'a', -'l', 'u', 'e', '\022', '\'', '\n', '\017', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\010', ' ', -'\001', '(', '\t', 'R', '\016', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'V', 'a', 'l', 'u', 'e', '\032', 'J', '\n', '\010', 'N', 'a', -'m', 'e', 'P', 'a', 'r', 't', '\022', '\033', '\n', '\t', 'n', 'a', 'm', 'e', '_', 'p', 'a', 'r', 't', '\030', '\001', ' ', '\002', '(', '\t', -'R', '\010', 'n', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '!', '\n', '\014', 'i', 's', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', -'n', '\030', '\002', ' ', '\002', '(', '\010', 'R', '\013', 'i', 's', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\"', '\247', '\002', '\n', '\016', -'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', 'D', '\n', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', -'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '(', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', -'.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', 'R', -'\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\316', '\001', '\n', '\010', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', -'\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\026', '\n', '\004', -'s', 'p', 'a', 'n', '\030', '\002', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 's', 'p', 'a', 'n', '\022', ')', '\n', '\020', 'l', -'e', 'a', 'd', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'l', 'e', -'a', 'd', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', '+', '\n', '\021', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', -'_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\020', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', -'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', ':', '\n', '\031', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'd', 'e', 't', 'a', 'c', -'h', 'e', 'd', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\006', ' ', '\003', '(', '\t', 'R', '\027', 'l', 'e', 'a', 'd', 'i', -'n', 'g', 'D', 'e', 't', 'a', 'c', 'h', 'e', 'd', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\"', '\320', '\002', '\n', '\021', 'G', 'e', -'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', 'M', '\n', '\n', 'a', 'n', 'n', 'o', 't', 'a', -'t', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'o', 'n', '.', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'i', 'd', 'e', 'n', +'t', 'i', 'f', 'i', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'i', 'd', 'e', 'n', 't', +'i', 'f', 'i', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', '_', 'i', 'n', +'t', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\020', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', 'I', 'n', +'t', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', +'l', 'u', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\020', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', +'u', 'e', '\022', '!', '\n', '\014', 'd', 'o', 'u', 'b', 'l', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\006', ' ', '\001', '(', '\001', 'R', +'\013', 'd', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'v', 'a', +'l', 'u', 'e', '\030', '\007', ' ', '\001', '(', '\014', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'V', 'a', 'l', 'u', 'e', '\022', '\'', '\n', +'\017', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\016', 'a', +'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'V', 'a', 'l', 'u', 'e', '\032', 'J', '\n', '\010', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', +'\022', '\033', '\n', '\t', 'n', 'a', 'm', 'e', '_', 'p', 'a', 'r', 't', '\030', '\001', ' ', '\002', '(', '\t', 'R', '\010', 'n', 'a', 'm', 'e', +'P', 'a', 'r', 't', '\022', '!', '\n', '\014', 'i', 's', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\002', '(', +'\010', 'R', '\013', 'i', 's', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\"', '\327', '\t', '\n', '\n', 'F', 'e', 'a', 't', 'u', 'r', +'e', 'S', 'e', 't', '\022', 'n', '\n', '\016', 'f', 'i', 'e', 'l', 'd', '_', 'p', 'r', 'e', 's', 'e', 'n', 'c', 'e', '\030', '\001', ' ', +'\001', '(', '\016', '2', ')', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'e', 'a', +'t', 'u', 'r', 'e', 'S', 'e', 't', '.', 'F', 'i', 'e', 'l', 'd', 'P', 'r', 'e', 's', 'e', 'n', 'c', 'e', 'B', '\034', '\210', '\001', +'\001', '\230', '\001', '\004', '\230', '\001', '\001', '\242', '\001', '\020', '\n', '\004', '2', '0', '2', '3', '\022', '\010', 'E', 'X', 'P', 'L', 'I', 'C', 'I', +'T', 'R', '\r', 'f', 'i', 'e', 'l', 'd', 'P', 'r', 'e', 's', 'e', 'n', 'c', 'e', '\022', '[', '\n', '\t', 'e', 'n', 'u', 'm', '_', +'t', 'y', 'p', 'e', '\030', '\002', ' ', '\001', '(', '\016', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', '.', 'E', 'n', 'u', 'm', 'T', 'y', 'p', 'e', 'B', '\030', +'\210', '\001', '\001', '\230', '\001', '\006', '\230', '\001', '\001', '\242', '\001', '\014', '\n', '\004', '2', '0', '2', '3', '\022', '\004', 'O', 'P', 'E', 'N', 'R', +'\010', 'e', 'n', 'u', 'm', 'T', 'y', 'p', 'e', '\022', '\205', '\001', '\n', '\027', 'r', 'e', 'p', 'e', 'a', 't', 'e', 'd', '_', 'f', 'i', +'e', 'l', 'd', '_', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\016', '2', '1', '.', 'g', 'o', 'o', 'g', +'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', '.', 'R', 'e', +'p', 'e', 'a', 't', 'e', 'd', 'F', 'i', 'e', 'l', 'd', 'E', 'n', 'c', 'o', 'd', 'i', 'n', 'g', 'B', '\032', '\210', '\001', '\001', '\230', +'\001', '\004', '\230', '\001', '\001', '\242', '\001', '\016', '\n', '\004', '2', '0', '2', '3', '\022', '\006', 'P', 'A', 'C', 'K', 'E', 'D', 'R', '\025', 'r', +'e', 'p', 'e', 'a', 't', 'e', 'd', 'F', 'i', 'e', 'l', 'd', 'E', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '\022', '\210', '\001', '\n', '\027', +'s', 't', 'r', 'i', 'n', 'g', '_', 'f', 'i', 'e', 'l', 'd', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '\030', '\004', +' ', '\001', '(', '\016', '2', '1', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'e', +'a', 't', 'u', 'r', 'e', 'S', 'e', 't', '.', 'S', 't', 'r', 'i', 'n', 'g', 'F', 'i', 'e', 'l', 'd', 'V', 'a', 'l', 'i', 'd', +'a', 't', 'i', 'o', 'n', 'B', '\035', '\210', '\001', '\001', '\230', '\001', '\004', '\230', '\001', '\001', '\242', '\001', '\021', '\n', '\004', '2', '0', '2', '3', +'\022', '\t', 'M', 'A', 'N', 'D', 'A', 'T', 'O', 'R', 'Y', 'R', '\025', 's', 't', 'r', 'i', 'n', 'g', 'F', 'i', 'e', 'l', 'd', 'V', +'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '\022', '{', '\n', '\020', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 'e', 'n', 'c', 'o', +'d', 'i', 'n', 'g', '\030', '\005', ' ', '\001', '(', '\016', '2', '+', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', +'b', 'u', 'f', '.', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'E', 'n', 'c', +'o', 'd', 'i', 'n', 'g', 'B', '#', '\210', '\001', '\001', '\230', '\001', '\004', '\230', '\001', '\001', '\242', '\001', '\027', '\n', '\004', '2', '0', '2', '3', +'\022', '\017', 'L', 'E', 'N', 'G', 'T', 'H', '_', 'P', 'R', 'E', 'F', 'I', 'X', 'E', 'D', 'R', '\017', 'm', 'e', 's', 's', 'a', 'g', +'e', 'E', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '\022', 'e', '\n', '\013', 'j', 's', 'o', 'n', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', +'\006', ' ', '\001', '(', '\016', '2', '&', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', +'e', 'a', 't', 'u', 'r', 'e', 'S', 'e', 't', '.', 'J', 's', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'B', '\034', '\210', '\001', '\001', +'\230', '\001', '\003', '\230', '\001', '\006', '\230', '\001', '\001', '\242', '\001', '\r', '\n', '\004', '2', '0', '2', '3', '\022', '\005', 'A', 'L', 'L', 'O', 'W', +'R', '\n', 'j', 's', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', '\"', '\\', '\n', '\r', 'F', 'i', 'e', 'l', 'd', 'P', 'r', 'e', 's', +'e', 'n', 'c', 'e', '\022', '\032', '\n', '\026', 'F', 'I', 'E', 'L', 'D', '_', 'P', 'R', 'E', 'S', 'E', 'N', 'C', 'E', '_', 'U', 'N', +'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\014', '\n', '\010', 'E', 'X', 'P', 'L', 'I', 'C', 'I', 'T', '\020', '\001', '\022', '\014', '\n', '\010', +'I', 'M', 'P', 'L', 'I', 'C', 'I', 'T', '\020', '\002', '\022', '\023', '\n', '\017', 'L', 'E', 'G', 'A', 'C', 'Y', '_', 'R', 'E', 'Q', 'U', +'I', 'R', 'E', 'D', '\020', '\003', '\"', '7', '\n', '\010', 'E', 'n', 'u', 'm', 'T', 'y', 'p', 'e', '\022', '\025', '\n', '\021', 'E', 'N', 'U', +'M', '_', 'T', 'Y', 'P', 'E', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\010', '\n', '\004', 'O', 'P', 'E', 'N', '\020', +'\001', '\022', '\n', '\n', '\006', 'C', 'L', 'O', 'S', 'E', 'D', '\020', '\002', '\"', 'V', '\n', '\025', 'R', 'e', 'p', 'e', 'a', 't', 'e', 'd', +'F', 'i', 'e', 'l', 'd', 'E', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '\022', '#', '\n', '\037', 'R', 'E', 'P', 'E', 'A', 'T', 'E', 'D', +'_', 'F', 'I', 'E', 'L', 'D', '_', 'E', 'N', 'C', 'O', 'D', 'I', 'N', 'G', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', +'\022', '\n', '\n', '\006', 'P', 'A', 'C', 'K', 'E', 'D', '\020', '\001', '\022', '\014', '\n', '\010', 'E', 'X', 'P', 'A', 'N', 'D', 'E', 'D', '\020', +'\002', '\"', '_', '\n', '\025', 'S', 't', 'r', 'i', 'n', 'g', 'F', 'i', 'e', 'l', 'd', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', +'n', '\022', '#', '\n', '\037', 'S', 'T', 'R', 'I', 'N', 'G', '_', 'F', 'I', 'E', 'L', 'D', '_', 'V', 'A', 'L', 'I', 'D', 'A', 'T', +'I', 'O', 'N', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\r', '\n', '\t', 'M', 'A', 'N', 'D', 'A', 'T', 'O', 'R', +'Y', '\020', '\001', '\022', '\010', '\n', '\004', 'H', 'I', 'N', 'T', '\020', '\002', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\003', '\"', 'S', +'\n', '\017', 'M', 'e', 's', 's', 'a', 'g', 'e', 'E', 'n', 'c', 'o', 'd', 'i', 'n', 'g', '\022', '\034', '\n', '\030', 'M', 'E', 'S', 'S', +'A', 'G', 'E', '_', 'E', 'N', 'C', 'O', 'D', 'I', 'N', 'G', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\023', '\n', +'\017', 'L', 'E', 'N', 'G', 'T', 'H', '_', 'P', 'R', 'E', 'F', 'I', 'X', 'E', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'D', 'E', 'L', +'I', 'M', 'I', 'T', 'E', 'D', '\020', '\002', '\"', 'H', '\n', '\n', 'J', 's', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', '\022', '\027', '\n', +'\023', 'J', 'S', 'O', 'N', '_', 'F', 'O', 'R', 'M', 'A', 'T', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\t', '\n', +'\005', 'A', 'L', 'L', 'O', 'W', '\020', '\001', '\022', '\026', '\n', '\022', 'L', 'E', 'G', 'A', 'C', 'Y', '_', 'B', 'E', 'S', 'T', '_', 'E', +'F', 'F', 'O', 'R', 'T', '\020', '\002', '*', '\006', '\010', '\350', '\007', '\020', '\351', '\007', '*', '\006', '\010', '\351', '\007', '\020', '\352', '\007', '*', '\006', +'\010', '\213', 'N', '\020', '\220', 'N', '\"', '\247', '\002', '\n', '\016', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', +'\022', 'D', '\n', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '(', '.', 'g', 'o', 'o', 'g', +'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', +'o', '.', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\316', '\001', '\n', '\010', +'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', +'\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\026', '\n', '\004', 's', 'p', 'a', 'n', '\030', '\002', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', +'R', '\004', 's', 'p', 'a', 'n', '\022', ')', '\n', '\020', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', +'s', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', +'+', '\n', '\021', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\004', ' ', '\001', '(', +'\t', 'R', '\020', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', ':', '\n', '\031', 'l', 'e', +'a', 'd', 'i', 'n', 'g', '_', 'd', 'e', 't', 'a', 'c', 'h', 'e', 'd', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\006', +' ', '\003', '(', '\t', 'R', '\027', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'D', 'e', 't', 'a', 'c', 'h', 'e', 'd', 'C', 'o', 'm', 'm', +'e', 'n', 't', 's', '\"', '\320', '\002', '\n', '\021', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', +'o', '\022', 'M', '\n', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '-', '.', 'g', +'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', +'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'a', 'n', 'n', 'o', 't', +'a', 't', 'i', 'o', 'n', '\032', '\353', '\001', '\n', '\n', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', +'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', +'u', 'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'F', 'i', +'l', 'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005', 'b', 'e', 'g', 'i', 'n', '\022', +'\020', '\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', '\022', 'R', '\n', '\010', 's', 'e', 'm', 'a', +'n', 't', 'i', 'c', '\030', '\005', ' ', '\001', '(', '\016', '2', '6', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', -'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\032', '\353', '\001', '\n', '\n', 'A', -'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', -'\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', 'u', 'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', -' ', '\001', '(', '\t', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'F', 'i', 'l', 'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', -'\030', '\003', ' ', '\001', '(', '\005', 'R', '\005', 'b', 'e', 'g', 'i', 'n', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', -'\005', 'R', '\003', 'e', 'n', 'd', '\022', 'R', '\n', '\010', 's', 'e', 'm', 'a', 'n', 't', 'i', 'c', '\030', '\005', ' ', '\001', '(', '\016', '2', -'6', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', -'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '.', 'S', 'e', 'm', -'a', 'n', 't', 'i', 'c', 'R', '\010', 's', 'e', 'm', 'a', 'n', 't', 'i', 'c', '\"', '(', '\n', '\010', 'S', 'e', 'm', 'a', 'n', 't', -'i', 'c', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\000', '\022', '\007', '\n', '\003', 'S', 'E', 'T', '\020', '\001', '\022', '\t', '\n', '\005', -'A', 'L', 'I', 'A', 'S', '\020', '\002', 'B', '~', '\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', -'t', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', -'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', -'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', -'\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', -'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n', +'o', 't', 'a', 't', 'i', 'o', 'n', '.', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'R', '\010', 's', 'e', 'm', 'a', 'n', 't', 'i', +'c', '\"', '(', '\n', '\010', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\000', '\022', '\007', +'\n', '\003', 'S', 'E', 'T', '\020', '\001', '\022', '\t', '\n', '\005', 'A', 'L', 'I', 'A', 'S', '\020', '\002', 'B', '~', '\n', '\023', 'c', 'o', 'm', +'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e', 's', 'c', 'r', 'i', 'p', +'t', 'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', +'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'd', 'e', 's', 'c', +'r', 'i', 'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', +'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n', }; static _upb_DefPool_Init *deps[1] = { @@ -2280,7 +2479,7 @@ _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit = { deps, &google_protobuf_descriptor_proto_upb_file_layout, "google/protobuf/descriptor.proto", - UPB_STRINGVIEW_INIT(descriptor, 9135) + UPB_STRINGVIEW_INIT(descriptor, 11046) }; diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index 9b72ef1901..ff116f6216 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -3451,6 +3451,7 @@ typedef struct google_protobuf_MethodDescriptorProto google_protobuf_MethodDescr typedef struct google_protobuf_FileOptions google_protobuf_FileOptions; typedef struct google_protobuf_MessageOptions google_protobuf_MessageOptions; typedef struct google_protobuf_FieldOptions google_protobuf_FieldOptions; +typedef struct google_protobuf_FieldOptions_EditionDefault google_protobuf_FieldOptions_EditionDefault; typedef struct google_protobuf_OneofOptions google_protobuf_OneofOptions; typedef struct google_protobuf_EnumOptions google_protobuf_EnumOptions; typedef struct google_protobuf_EnumValueOptions google_protobuf_EnumValueOptions; @@ -3458,6 +3459,7 @@ typedef struct google_protobuf_ServiceOptions google_protobuf_ServiceOptions; typedef struct google_protobuf_MethodOptions google_protobuf_MethodOptions; typedef struct google_protobuf_UninterpretedOption google_protobuf_UninterpretedOption; typedef struct google_protobuf_UninterpretedOption_NamePart google_protobuf_UninterpretedOption_NamePart; +typedef struct google_protobuf_FeatureSet google_protobuf_FeatureSet; typedef struct google_protobuf_SourceCodeInfo google_protobuf_SourceCodeInfo; typedef struct google_protobuf_SourceCodeInfo_Location google_protobuf_SourceCodeInfo_Location; typedef struct google_protobuf_GeneratedCodeInfo google_protobuf_GeneratedCodeInfo; @@ -3479,6 +3481,7 @@ extern const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init; extern const upb_MiniTable google_protobuf_FileOptions_msg_init; extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_EditionDefault_msg_init; extern const upb_MiniTable google_protobuf_OneofOptions_msg_init; extern const upb_MiniTable google_protobuf_EnumOptions_msg_init; extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; @@ -3486,6 +3489,7 @@ extern const upb_MiniTable google_protobuf_ServiceOptions_msg_init; extern const upb_MiniTable google_protobuf_MethodOptions_msg_init; extern const upb_MiniTable google_protobuf_UninterpretedOption_msg_init; extern const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init; +extern const upb_MiniTable google_protobuf_FeatureSet_msg_init; extern const upb_MiniTable google_protobuf_SourceCodeInfo_msg_init; extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init; extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init; @@ -3496,6 +3500,44 @@ typedef enum { google_protobuf_ExtensionRangeOptions_UNVERIFIED = 1 } google_protobuf_ExtensionRangeOptions_VerificationState; +typedef enum { + google_protobuf_FeatureSet_ENUM_TYPE_UNKNOWN = 0, + google_protobuf_FeatureSet_OPEN = 1, + google_protobuf_FeatureSet_CLOSED = 2 +} google_protobuf_FeatureSet_EnumType; + +typedef enum { + google_protobuf_FeatureSet_FIELD_PRESENCE_UNKNOWN = 0, + google_protobuf_FeatureSet_EXPLICIT = 1, + google_protobuf_FeatureSet_IMPLICIT = 2, + google_protobuf_FeatureSet_LEGACY_REQUIRED = 3 +} google_protobuf_FeatureSet_FieldPresence; + +typedef enum { + google_protobuf_FeatureSet_JSON_FORMAT_UNKNOWN = 0, + google_protobuf_FeatureSet_ALLOW = 1, + google_protobuf_FeatureSet_LEGACY_BEST_EFFORT = 2 +} google_protobuf_FeatureSet_JsonFormat; + +typedef enum { + google_protobuf_FeatureSet_MESSAGE_ENCODING_UNKNOWN = 0, + google_protobuf_FeatureSet_LENGTH_PREFIXED = 1, + google_protobuf_FeatureSet_DELIMITED = 2 +} google_protobuf_FeatureSet_MessageEncoding; + +typedef enum { + google_protobuf_FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN = 0, + google_protobuf_FeatureSet_PACKED = 1, + google_protobuf_FeatureSet_EXPANDED = 2 +} google_protobuf_FeatureSet_RepeatedFieldEncoding; + +typedef enum { + google_protobuf_FeatureSet_STRING_FIELD_VALIDATION_UNKNOWN = 0, + google_protobuf_FeatureSet_MANDATORY = 1, + google_protobuf_FeatureSet_HINT = 2, + google_protobuf_FeatureSet_NONE = 3 +} google_protobuf_FeatureSet_StringFieldValidation; + typedef enum { google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1, google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2, @@ -3574,6 +3616,12 @@ typedef enum { extern const upb_MiniTableEnum google_protobuf_ExtensionRangeOptions_VerificationState_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_EnumType_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_FieldPresence_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_JsonFormat_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_MessageEncoding_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_StringFieldValidation_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init; @@ -5121,26 +5169,41 @@ UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_declaration(const goog return size != 0; } UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_verification(google_protobuf_ExtensionRangeOptions* msg) { - const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_ExtensionRangeOptions_verification(const google_protobuf_ExtensionRangeOptions* msg) { int32_t default_val = 1; int32_t ret; - const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_verification(const google_protobuf_ExtensionRangeOptions* msg) { - const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_features(google_protobuf_ExtensionRangeOptions* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_features(const google_protobuf_ExtensionRangeOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_features(const google_protobuf_ExtensionRangeOptions* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -5151,7 +5214,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Ext } } UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -5159,7 +5222,7 @@ UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted return arr; } UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -5200,11 +5263,23 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_prot return sub; } UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) { - const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_features(google_protobuf_ExtensionRangeOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_mutable_features(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ExtensionRangeOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_ExtensionRangeOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -5215,11 +5290,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeO } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -6506,48 +6581,48 @@ UPB_INLINE char* google_protobuf_FileOptions_serialize_ex(const google_protobuf_ return ptr; } UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) { int32_t default_val = 1; int32_t ret; - const upb_MiniTableField field = {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) { @@ -6566,18 +6641,18 @@ UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) { @@ -6686,78 +6761,78 @@ UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_pr return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(google_protobuf_FileOptions* msg) { @@ -6776,41 +6851,56 @@ UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const googl return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_features(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FileOptions_features(const google_protobuf_FileOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_features(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -6821,7 +6911,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Fil } } UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_upb_array(const google_protobuf_FileOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -6829,7 +6919,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_up return arr; } UPB_INLINE upb_Array* _google_protobuf_FileOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_FileOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -6844,15 +6934,15 @@ UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const googl } UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { - const upb_MiniTableField field = {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { @@ -6860,7 +6950,7 @@ UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_proto _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { @@ -6892,23 +6982,23 @@ UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { @@ -6916,15 +7006,27 @@ UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_prot _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_FileOptions_set_features(google_protobuf_FileOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FileOptions_mutable_features(google_protobuf_FileOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FileOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_FileOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -6935,11 +7037,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mut } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7060,12 +7162,27 @@ UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_ const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_MessageOptions_clear_features(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MessageOptions_features(const google_protobuf_MessageOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_features(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7076,7 +7193,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Mes } } UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_upb_array(const google_protobuf_MessageOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7084,7 +7201,7 @@ UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option return arr; } UPB_INLINE upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_MessageOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7118,8 +7235,20 @@ UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_ const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_MessageOptions_set_features(google_protobuf_MessageOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MessageOptions_mutable_features(google_protobuf_MessageOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MessageOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_MessageOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7130,11 +7259,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_ } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7181,18 +7310,18 @@ UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf return ptr; } UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) { @@ -7241,18 +7370,18 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_Fiel return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) { @@ -7301,41 +7430,41 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_proto return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_target_obsolete_do_not_use(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_target_obsolete_do_not_use(const google_protobuf_FieldOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FieldOptions_has_target_obsolete_do_not_use(const google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_targets(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_protobuf_FieldOptions* msg, size_t* size) { - const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7346,7 +7475,7 @@ UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_prot } } UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) { - const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7354,7 +7483,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(cons return arr; } UPB_INLINE upb_Array* _google_protobuf_FieldOptions_targets_mutable_upb_array(const google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7367,12 +7496,64 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_targets(const google_protobuf_F google_protobuf_FieldOptions_targets(msg, &size); return size != 0; } +UPB_INLINE void google_protobuf_FieldOptions_clear_edition_defaults(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldOptions_EditionDefault* const* google_protobuf_FieldOptions_edition_defaults(const google_protobuf_FieldOptions* msg, size_t* size) { + const upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldOptions_EditionDefault* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_edition_defaults_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) { + const upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (size) { + *size = arr ? arr->size : 0; + } + return arr; +} +UPB_INLINE upb_Array* _google_protobuf_FieldOptions_edition_defaults_mutable_upb_array(const google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { + const upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray( + (upb_Message*)msg, &field, arena); + if (size) { + *size = arr ? arr->size : 0; + } + return arr; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_edition_defaults(const google_protobuf_FieldOptions* msg) { + size_t size; + google_protobuf_FieldOptions_edition_defaults(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FieldOptions_clear_features(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FieldOptions_features(const google_protobuf_FieldOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_features(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7383,7 +7564,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Fie } } UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7391,7 +7572,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_u return arr; } UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7406,7 +7587,7 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const goog } UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) { - const upb_MiniTableField field = {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { @@ -7422,7 +7603,7 @@ UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptio _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { - const upb_MiniTableField field = {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { @@ -7438,15 +7619,15 @@ UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_Fi _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions *msg, int32_t value) { - const upb_MiniTableField field = {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_target_obsolete_do_not_use(google_protobuf_FieldOptions *msg, int32_t value) { - const upb_MiniTableField field = {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf_FieldOptions* msg, size_t* size) { - upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7457,11 +7638,11 @@ UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf } } UPB_INLINE int32_t* google_protobuf_FieldOptions_resize_targets(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (int32_t*)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions* msg, int32_t val, upb_Arena* arena) { - upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return false; @@ -7469,8 +7650,46 @@ UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOp _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); return true; } +UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) { + upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldOptions_EditionDefault**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_resize_edition_defaults(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FieldOptions_EditionDefault**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_add_edition_defaults(google_protobuf_FieldOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google_protobuf_FieldOptions_EditionDefault_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FieldOptions_mutable_features(google_protobuf_FieldOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FieldOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_FieldOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7481,11 +7700,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mu } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7496,6 +7715,81 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOpti return sub; } +/* google.protobuf.FieldOptions.EditionDefault */ + +UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_new(upb_Arena* arena) { + return (google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google_protobuf_FieldOptions_EditionDefault_msg_init, arena); +} +UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_EditionDefault_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_EditionDefault_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize(const google_protobuf_FieldOptions_EditionDefault* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldOptions_EditionDefault_msg_init, 0, arena, &ptr, len); + return ptr; +} +UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize_ex(const google_protobuf_FieldOptions_EditionDefault* msg, int options, + upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldOptions_EditionDefault_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_edition(google_protobuf_FieldOptions_EditionDefault* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldOptions_EditionDefault_edition(const google_protobuf_FieldOptions_EditionDefault* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_edition(const google_protobuf_FieldOptions_EditionDefault* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_value(google_protobuf_FieldOptions_EditionDefault* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldOptions_EditionDefault_value(const google_protobuf_FieldOptions_EditionDefault* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_value(const google_protobuf_FieldOptions_EditionDefault* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_edition(google_protobuf_FieldOptions_EditionDefault *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_value(google_protobuf_FieldOptions_EditionDefault *msg, upb_StringView value) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + /* google.protobuf.OneofOptions */ UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) { @@ -7531,12 +7825,27 @@ UPB_INLINE char* google_protobuf_OneofOptions_serialize_ex(const google_protobuf (void)upb_Encode(msg, &google_protobuf_OneofOptions_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_protobuf_OneofOptions_clear_features(google_protobuf_OneofOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_OneofOptions_features(const google_protobuf_OneofOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_OneofOptions_has_features(const google_protobuf_OneofOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) { - const upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7547,7 +7856,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_One } } UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_upb_array(const google_protobuf_OneofOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7555,7 +7864,7 @@ UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_u return arr; } UPB_INLINE upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_OneofOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7569,8 +7878,20 @@ UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const goog return size != 0; } +UPB_INLINE void google_protobuf_OneofOptions_set_features(google_protobuf_OneofOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_OneofOptions_mutable_features(google_protobuf_OneofOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_OneofOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_OneofOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* size) { - upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7581,11 +7902,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mu } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7676,12 +7997,27 @@ UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_con const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_EnumOptions_clear_features(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumOptions_features(const google_protobuf_EnumOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_features(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7692,7 +8028,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Enu } } UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_upb_array(const google_protobuf_EnumOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7700,7 +8036,7 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_up return arr; } UPB_INLINE upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_EnumOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7726,8 +8062,20 @@ UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_con const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_EnumOptions_set_features(google_protobuf_EnumOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumOptions_mutable_features(google_protobuf_EnumOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_EnumOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7738,11 +8086,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mut } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7803,27 +8151,42 @@ UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_pro const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_EnumValueOptions_clear_features(google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_features(const google_protobuf_EnumValueOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueOptions_has_features(const google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_EnumValueOptions_clear_debug_redact(google_protobuf_EnumValueOptions* msg) { - const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_EnumValueOptions_debug_redact(const google_protobuf_EnumValueOptions* msg) { bool default_val = false; bool ret; - const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_EnumValueOptions_has_debug_redact(const google_protobuf_EnumValueOptions* msg) { - const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7834,7 +8197,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Enu } } UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_upb_array(const google_protobuf_EnumValueOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7842,7 +8205,7 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_opti return arr; } UPB_INLINE upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_EnumValueOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7860,12 +8223,24 @@ UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_EnumValueOptions_set_features(google_protobuf_EnumValueOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_mutable_features(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumValueOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_EnumValueOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE void google_protobuf_EnumValueOptions_set_debug_redact(google_protobuf_EnumValueOptions *msg, bool value) { - const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7876,11 +8251,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOption } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7941,12 +8316,27 @@ UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_proto const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_ServiceOptions_clear_features(google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ServiceOptions_features(const google_protobuf_ServiceOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceOptions_has_features(const google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7957,7 +8347,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Ser } } UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_upb_array(const google_protobuf_ServiceOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7965,7 +8355,7 @@ UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option return arr; } UPB_INLINE upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_ServiceOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7983,8 +8373,20 @@ UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_Se const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_ServiceOptions_set_features(google_protobuf_ServiceOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ServiceOptions_mutable_features(google_protobuf_ServiceOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ServiceOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_ServiceOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7995,11 +8397,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_ } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -8061,26 +8463,41 @@ UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protob return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) { - const upb_MiniTableField field = {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) { - const upb_MiniTableField field = {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodOptions_clear_features(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MethodOptions_features(const google_protobuf_MethodOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodOptions_has_features(const google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -8091,7 +8508,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Met } } UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_upb_array(const google_protobuf_MethodOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -8099,7 +8516,7 @@ UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_ return arr; } UPB_INLINE upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_MethodOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -8118,11 +8535,23 @@ UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_Met _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { - const upb_MiniTableField field = {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_MethodOptions_set_features(google_protobuf_MethodOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MethodOptions_mutable_features(google_protobuf_MethodOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MethodOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_MethodOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -8133,11 +8562,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_m } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -8437,6 +8866,157 @@ UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(go _upb_Message_SetNonExtensionField(msg, &field, &value); } +/* google.protobuf.FeatureSet */ + +UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_new(upb_Arena* arena) { + return (google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); +} +UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FeatureSet_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FeatureSet_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FeatureSet_serialize(const google_protobuf_FeatureSet* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FeatureSet_msg_init, 0, arena, &ptr, len); + return ptr; +} +UPB_INLINE char* google_protobuf_FeatureSet_serialize_ex(const google_protobuf_FeatureSet* msg, int options, + upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FeatureSet_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FeatureSet_clear_field_presence(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_field_presence(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_field_presence(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_enum_type(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_enum_type(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_enum_type(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_repeated_field_encoding(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_repeated_field_encoding(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_repeated_field_encoding(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_string_field_validation(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_string_field_validation(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_string_field_validation(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_message_encoding(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_message_encoding(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_message_encoding(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_json_format(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_json_format(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_json_format(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_FeatureSet_set_field_presence(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_enum_type(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_repeated_field_encoding(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_string_field_validation(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_message_encoding(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_json_format(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + /* google.protobuf.SourceCodeInfo */ UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) { @@ -9073,7 +9653,7 @@ extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout; /* Max size 32 is google.protobuf.FileOptions */ /* Max size 64 is google.protobuf.FileOptions */ -#define _UPB_MAXOPT_SIZE UPB_SIZE(104, 192) +#define _UPB_MAXOPT_SIZE UPB_SIZE(112, 200) #ifdef __cplusplus } /* extern "C" */ @@ -10009,6 +10589,11 @@ UPB_INLINE const upb_MessageDef *google_protobuf_FieldOptions_getmsgdef(upb_DefP return upb_DefPool_FindMessageByName(s, "google.protobuf.FieldOptions"); } +UPB_INLINE const upb_MessageDef *google_protobuf_FieldOptions_EditionDefault_getmsgdef(upb_DefPool *s) { + _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit); + return upb_DefPool_FindMessageByName(s, "google.protobuf.FieldOptions.EditionDefault"); +} + UPB_INLINE const upb_MessageDef *google_protobuf_OneofOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "google.protobuf.OneofOptions"); @@ -10044,6 +10629,11 @@ UPB_INLINE const upb_MessageDef *google_protobuf_UninterpretedOption_NamePart_ge return upb_DefPool_FindMessageByName(s, "google.protobuf.UninterpretedOption.NamePart"); } +UPB_INLINE const upb_MessageDef *google_protobuf_FeatureSet_getmsgdef(upb_DefPool *s) { + _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit); + return upb_DefPool_FindMessageByName(s, "google.protobuf.FeatureSet"); +} + UPB_INLINE const upb_MessageDef *google_protobuf_SourceCodeInfo_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "google.protobuf.SourceCodeInfo"); diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index 69afd75050..bd9df1b33f 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -110,6 +110,7 @@ gen_file_lists( ":protoc": "libprotoc", # Protos: "//src/google/protobuf:well_known_type_protos": "wkt_protos", + "//src/google/protobuf:cpp_features_proto": "cpp_features_proto", "//src/google/protobuf:descriptor_proto": "descriptor_proto", "//src/google/protobuf/compiler:plugin_proto": "plugin_proto", # Test libraries: diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c index cb0dc8be91..3e286066ac 100644 --- a/ruby/ext/google/protobuf_c/ruby-upb.c +++ b/ruby/ext/google/protobuf_c/ruby-upb.c @@ -894,22 +894,24 @@ const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[3] = { +static const upb_MiniTableSub google_protobuf_ExtensionRangeOptions_submsgs[4] = { {.submsg = &google_protobuf_ExtensionRangeOptions_Declaration_msg_init}, + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, {.subenum = &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init}, }; -static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[3] = { +static const upb_MiniTableField google_protobuf_ExtensionRangeOptions__fields[4] = { {2, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, - {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = { &google_protobuf_ExtensionRangeOptions_submsgs[0], &google_protobuf_ExtensionRangeOptions__fields[0], - UPB_SIZE(16, 24), 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -929,12 +931,12 @@ const upb_MiniTable google_protobuf_ExtensionRangeOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x0010000002010392, &upb_psm_2bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x001000003f013eba, &upb_prm_2bt_max128b}, + {0x001800003f023eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1004,7 +1006,7 @@ const upb_MiniTable google_protobuf_FieldDescriptorProto_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0038000006000032, &upb_pss_1bt}, {0x004800000700003a, &upb_pss_1bt}, - {0x0058000008000042, &upb_psm_1bt_max64b}, + {0x0058000008000042, &upb_psm_1bt_max128b}, {0x0010000009000048, &upb_psv4_1bt}, {0x006000000a000052, &upb_pss_1bt}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1173,17 +1175,18 @@ const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[2] = { +static const upb_MiniTableSub google_protobuf_FileOptions_submsgs[3] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, {.subenum = &google_protobuf_FileOptions_OptimizeMode_enum_init}, }; -static const upb_MiniTableField google_protobuf_FileOptions__fields[21] = { - {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FileOptions__fields[22] = { + {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, {10, 8, 4, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, {16, 9, 6, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {17, 10, 7, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {18, 11, 8, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, @@ -1191,21 +1194,22 @@ static const upb_MiniTableField google_protobuf_FileOptions__fields[21] = { {23, 13, 10, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {27, 14, 11, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {31, 15, 12, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, {42, 16, 18, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_FileOptions_msg_init = { &google_protobuf_FileOptions_submsgs[0], &google_protobuf_FileOptions__fields[0], - UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(112, 200), 22, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x001800000100000a, &upb_pss_1bt}, @@ -1242,23 +1246,25 @@ const upb_MiniTable google_protobuf_FileOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[1] = { +static const upb_MiniTableSub google_protobuf_MessageOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_MessageOptions__fields[6] = { +static const upb_MiniTableField google_protobuf_MessageOptions__fields[7] = { {1, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {2, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {3, 3, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {7, 4, 4, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {11, 5, 5, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_MessageOptions_msg_init = { &google_protobuf_MessageOptions_submsgs[0], &google_protobuf_MessageOptions__fields[0], - 16, 6, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 7, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0001000001000008, &upb_psb1_1bt}, @@ -1272,6 +1278,7 @@ const upb_MiniTable google_protobuf_MessageOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0005000005000058, &upb_psb1_1bt}, + {0x0008000006000062, &upb_psm_1bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1282,8 +1289,7 @@ const upb_MiniTable google_protobuf_MessageOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1295,7 +1301,9 @@ const upb_MiniTable google_protobuf_MessageOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[6] = { +static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[8] = { + {.submsg = &google_protobuf_FieldOptions_EditionDefault_msg_init}, + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, {.subenum = &google_protobuf_FieldOptions_CType_enum_init}, {.subenum = &google_protobuf_FieldOptions_JSType_enum_init}, @@ -1304,25 +1312,27 @@ static const upb_MiniTableSub google_protobuf_FieldOptions_submsgs[6] = { {.subenum = &google_protobuf_FieldOptions_OptionTargetType_enum_init}, }; -static const upb_MiniTableField google_protobuf_FieldOptions__fields[12] = { - {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_FieldOptions__fields[14] = { + {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, {2, 8, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {3, 9, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {5, 10, 4, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, {10, 16, 6, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {15, 17, 7, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {16, 18, 8, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_FieldOptions_msg_init = { &google_protobuf_FieldOptions_submsgs[0], &google_protobuf_FieldOptions__fields[0], - UPB_SIZE(40, 48), 12, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(48, 64), 14, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1344,10 +1354,10 @@ const upb_MiniTable google_protobuf_FieldOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x002800003f0001a2, &upb_prm_2bt_max64b}, + {0x003000000b0101aa, &upb_psm_2bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x002800003f003eba, &upb_prm_2bt_max128b}, + {0x003800003f023eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1359,20 +1369,40 @@ const upb_MiniTable google_protobuf_FieldOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[1] = { +static const upb_MiniTableField google_protobuf_FieldOptions_EditionDefault__fields[2] = { + {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_FieldOptions_EditionDefault_msg_init = { + NULL, + &google_protobuf_FieldOptions_EditionDefault__fields[0], + UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0, + UPB_FASTTABLE_INIT({ + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_pss_1bt}, + {0x0018000002000012, &upb_pss_1bt}, + {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + }) +}; + +static const upb_MiniTableSub google_protobuf_OneofOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_OneofOptions__fields[1] = { - {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, +static const upb_MiniTableField google_protobuf_OneofOptions__fields[2] = { + {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_OneofOptions_msg_init = { &google_protobuf_OneofOptions_submsgs[0], &google_protobuf_OneofOptions__fields[0], - 8, 1, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000100000a, &upb_psm_1bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1394,8 +1424,7 @@ const upb_MiniTable google_protobuf_OneofOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000000003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1407,21 +1436,23 @@ const upb_MiniTable google_protobuf_OneofOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[1] = { +static const upb_MiniTableSub google_protobuf_EnumOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_EnumOptions__fields[4] = { +static const upb_MiniTableField google_protobuf_EnumOptions__fields[5] = { {2, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, {6, 3, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_EnumOptions_msg_init = { &google_protobuf_EnumOptions_submsgs[0], &google_protobuf_EnumOptions__fields[0], - UPB_SIZE(8, 16), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 5, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1430,6 +1461,7 @@ const upb_MiniTable google_protobuf_EnumOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0003000003000030, &upb_psb1_1bt}, + {0x000800000400003a, &upb_psm_1bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1445,8 +1477,7 @@ const upb_MiniTable google_protobuf_EnumOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1458,25 +1489,27 @@ const upb_MiniTable google_protobuf_EnumOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[1] = { +static const upb_MiniTableSub google_protobuf_EnumValueOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[3] = { +static const upb_MiniTableField google_protobuf_EnumValueOptions__fields[4] = { {1, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { &google_protobuf_EnumValueOptions_submsgs[0], &google_protobuf_EnumValueOptions__fields[0], - UPB_SIZE(8, 16), 3, kUpb_ExtMode_Extendable, 1, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_Extendable, 3, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0001000001000008, &upb_psb1_1bt}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0002000002000018, &upb_psb1_1bt}, + {0x0008000002000012, &upb_psm_1bt_max64b}, + {0x0002000003000018, &upb_psb1_1bt}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1496,7 +1529,7 @@ const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1508,19 +1541,21 @@ const upb_MiniTable google_protobuf_EnumValueOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[1] = { +static const upb_MiniTableSub google_protobuf_ServiceOptions_submsgs[2] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, }; -static const upb_MiniTableField google_protobuf_ServiceOptions__fields[2] = { +static const upb_MiniTableField google_protobuf_ServiceOptions__fields[3] = { {33, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { &google_protobuf_ServiceOptions_submsgs[0], &google_protobuf_ServiceOptions__fields[0], - UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1540,12 +1575,12 @@ const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0001000001000288, &upb_psb1_2bt}, + {0x0008000002000292, &upb_psm_2bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1557,21 +1592,23 @@ const upb_MiniTable google_protobuf_ServiceOptions_msg_init = { }) }; -static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[2] = { +static const upb_MiniTableSub google_protobuf_MethodOptions_submsgs[3] = { + {.submsg = &google_protobuf_FeatureSet_msg_init}, {.submsg = &google_protobuf_UninterpretedOption_msg_init}, {.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enum_init}, }; -static const upb_MiniTableField google_protobuf_MethodOptions__fields[3] = { +static const upb_MiniTableField google_protobuf_MethodOptions__fields[4] = { {33, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}, - {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, - {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, + {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}, }; const upb_MiniTable google_protobuf_MethodOptions_msg_init = { &google_protobuf_MethodOptions_submsgs[0], &google_protobuf_MethodOptions__fields[0], - 16, 3, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_Extendable, 0, UPB_FASTTABLE_MASK(248), 0, UPB_FASTTABLE_INIT({ {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1592,11 +1629,11 @@ const upb_MiniTable google_protobuf_MethodOptions_msg_init = { {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0001000001000288, &upb_psb1_2bt}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, + {0x000800000300029a, &upb_psm_2bt_max64b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, - {0x000800003f003eba, &upb_prm_2bt_max128b}, + {0x001000003f013eba, &upb_prm_2bt_max128b}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, {0x0000000000000000, &_upb_FastDecoder_DecodeGeneric}, @@ -1663,6 +1700,30 @@ const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init = { }) }; +static const upb_MiniTableSub google_protobuf_FeatureSet_submsgs[6] = { + {.subenum = &google_protobuf_FeatureSet_FieldPresence_enum_init}, + {.subenum = &google_protobuf_FeatureSet_EnumType_enum_init}, + {.subenum = &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init}, + {.subenum = &google_protobuf_FeatureSet_StringFieldValidation_enum_init}, + {.subenum = &google_protobuf_FeatureSet_MessageEncoding_enum_init}, + {.subenum = &google_protobuf_FeatureSet_JsonFormat_enum_init}, +}; + +static const upb_MiniTableField google_protobuf_FeatureSet__fields[6] = { + {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, + {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}, +}; + +const upb_MiniTable google_protobuf_FeatureSet_msg_init = { + &google_protobuf_FeatureSet_submsgs[0], + &google_protobuf_FeatureSet__fields[0], + 32, 6, kUpb_ExtMode_Extendable, 6, UPB_FASTTABLE_MASK(255), 0, +}; + static const upb_MiniTableSub google_protobuf_SourceCodeInfo_submsgs[1] = { {.submsg = &google_protobuf_SourceCodeInfo_Location_msg_init}, }; @@ -1751,7 +1812,7 @@ const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msg_init = { }) }; -static const upb_MiniTable *messages_layout[28] = { +static const upb_MiniTable *messages_layout[30] = { &google_protobuf_FileDescriptorSet_msg_init, &google_protobuf_FileDescriptorProto_msg_init, &google_protobuf_DescriptorProto_msg_init, @@ -1769,6 +1830,7 @@ static const upb_MiniTable *messages_layout[28] = { &google_protobuf_FileOptions_msg_init, &google_protobuf_MessageOptions_msg_init, &google_protobuf_FieldOptions_msg_init, + &google_protobuf_FieldOptions_EditionDefault_msg_init, &google_protobuf_OneofOptions_msg_init, &google_protobuf_EnumOptions_msg_init, &google_protobuf_EnumValueOptions_msg_init, @@ -1776,6 +1838,7 @@ static const upb_MiniTable *messages_layout[28] = { &google_protobuf_MethodOptions_msg_init, &google_protobuf_UninterpretedOption_msg_init, &google_protobuf_UninterpretedOption_NamePart_msg_init, + &google_protobuf_FeatureSet_msg_init, &google_protobuf_SourceCodeInfo_msg_init, &google_protobuf_SourceCodeInfo_Location_msg_init, &google_protobuf_GeneratedCodeInfo_msg_init, @@ -1791,6 +1854,60 @@ const upb_MiniTableEnum google_protobuf_ExtensionRangeOptions_VerificationState_ }, }; +const upb_MiniTableEnum google_protobuf_FeatureSet_EnumType_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_FieldPresence_enum_init = { + 64, + 0, + { + 0xf, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_JsonFormat_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_MessageEncoding_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init = { + 64, + 0, + { + 0x7, + 0x0, + }, +}; + +const upb_MiniTableEnum google_protobuf_FeatureSet_StringFieldValidation_enum_init = { + 64, + 0, + { + 0xf, + 0x0, + }, +}; + const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init = { 64, 0, @@ -1872,8 +1989,14 @@ const upb_MiniTableEnum google_protobuf_MethodOptions_IdempotencyLevel_enum_init }, }; -static const upb_MiniTableEnum *enums_layout[10] = { +static const upb_MiniTableEnum *enums_layout[16] = { &google_protobuf_ExtensionRangeOptions_VerificationState_enum_init, + &google_protobuf_FeatureSet_EnumType_enum_init, + &google_protobuf_FeatureSet_FieldPresence_enum_init, + &google_protobuf_FeatureSet_JsonFormat_enum_init, + &google_protobuf_FeatureSet_MessageEncoding_enum_init, + &google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init, + &google_protobuf_FeatureSet_StringFieldValidation_enum_init, &google_protobuf_FieldDescriptorProto_Label_enum_init, &google_protobuf_FieldDescriptorProto_Type_enum_init, &google_protobuf_FieldOptions_CType_enum_init, @@ -1889,8 +2012,8 @@ const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout = { messages_layout, enums_layout, NULL, - 28, - 10, + 30, + 16, 0, }; diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h index 473bc19c7a..7afc703a9c 100755 --- a/ruby/ext/google/protobuf_c/ruby-upb.h +++ b/ruby/ext/google/protobuf_c/ruby-upb.h @@ -3453,6 +3453,7 @@ typedef struct google_protobuf_MethodDescriptorProto google_protobuf_MethodDescr typedef struct google_protobuf_FileOptions google_protobuf_FileOptions; typedef struct google_protobuf_MessageOptions google_protobuf_MessageOptions; typedef struct google_protobuf_FieldOptions google_protobuf_FieldOptions; +typedef struct google_protobuf_FieldOptions_EditionDefault google_protobuf_FieldOptions_EditionDefault; typedef struct google_protobuf_OneofOptions google_protobuf_OneofOptions; typedef struct google_protobuf_EnumOptions google_protobuf_EnumOptions; typedef struct google_protobuf_EnumValueOptions google_protobuf_EnumValueOptions; @@ -3460,6 +3461,7 @@ typedef struct google_protobuf_ServiceOptions google_protobuf_ServiceOptions; typedef struct google_protobuf_MethodOptions google_protobuf_MethodOptions; typedef struct google_protobuf_UninterpretedOption google_protobuf_UninterpretedOption; typedef struct google_protobuf_UninterpretedOption_NamePart google_protobuf_UninterpretedOption_NamePart; +typedef struct google_protobuf_FeatureSet google_protobuf_FeatureSet; typedef struct google_protobuf_SourceCodeInfo google_protobuf_SourceCodeInfo; typedef struct google_protobuf_SourceCodeInfo_Location google_protobuf_SourceCodeInfo_Location; typedef struct google_protobuf_GeneratedCodeInfo google_protobuf_GeneratedCodeInfo; @@ -3481,6 +3483,7 @@ extern const upb_MiniTable google_protobuf_MethodDescriptorProto_msg_init; extern const upb_MiniTable google_protobuf_FileOptions_msg_init; extern const upb_MiniTable google_protobuf_MessageOptions_msg_init; extern const upb_MiniTable google_protobuf_FieldOptions_msg_init; +extern const upb_MiniTable google_protobuf_FieldOptions_EditionDefault_msg_init; extern const upb_MiniTable google_protobuf_OneofOptions_msg_init; extern const upb_MiniTable google_protobuf_EnumOptions_msg_init; extern const upb_MiniTable google_protobuf_EnumValueOptions_msg_init; @@ -3488,6 +3491,7 @@ extern const upb_MiniTable google_protobuf_ServiceOptions_msg_init; extern const upb_MiniTable google_protobuf_MethodOptions_msg_init; extern const upb_MiniTable google_protobuf_UninterpretedOption_msg_init; extern const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msg_init; +extern const upb_MiniTable google_protobuf_FeatureSet_msg_init; extern const upb_MiniTable google_protobuf_SourceCodeInfo_msg_init; extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msg_init; extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msg_init; @@ -3498,6 +3502,44 @@ typedef enum { google_protobuf_ExtensionRangeOptions_UNVERIFIED = 1 } google_protobuf_ExtensionRangeOptions_VerificationState; +typedef enum { + google_protobuf_FeatureSet_ENUM_TYPE_UNKNOWN = 0, + google_protobuf_FeatureSet_OPEN = 1, + google_protobuf_FeatureSet_CLOSED = 2 +} google_protobuf_FeatureSet_EnumType; + +typedef enum { + google_protobuf_FeatureSet_FIELD_PRESENCE_UNKNOWN = 0, + google_protobuf_FeatureSet_EXPLICIT = 1, + google_protobuf_FeatureSet_IMPLICIT = 2, + google_protobuf_FeatureSet_LEGACY_REQUIRED = 3 +} google_protobuf_FeatureSet_FieldPresence; + +typedef enum { + google_protobuf_FeatureSet_JSON_FORMAT_UNKNOWN = 0, + google_protobuf_FeatureSet_ALLOW = 1, + google_protobuf_FeatureSet_LEGACY_BEST_EFFORT = 2 +} google_protobuf_FeatureSet_JsonFormat; + +typedef enum { + google_protobuf_FeatureSet_MESSAGE_ENCODING_UNKNOWN = 0, + google_protobuf_FeatureSet_LENGTH_PREFIXED = 1, + google_protobuf_FeatureSet_DELIMITED = 2 +} google_protobuf_FeatureSet_MessageEncoding; + +typedef enum { + google_protobuf_FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN = 0, + google_protobuf_FeatureSet_PACKED = 1, + google_protobuf_FeatureSet_EXPANDED = 2 +} google_protobuf_FeatureSet_RepeatedFieldEncoding; + +typedef enum { + google_protobuf_FeatureSet_STRING_FIELD_VALIDATION_UNKNOWN = 0, + google_protobuf_FeatureSet_MANDATORY = 1, + google_protobuf_FeatureSet_HINT = 2, + google_protobuf_FeatureSet_NONE = 3 +} google_protobuf_FeatureSet_StringFieldValidation; + typedef enum { google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1, google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2, @@ -3576,6 +3618,12 @@ typedef enum { extern const upb_MiniTableEnum google_protobuf_ExtensionRangeOptions_VerificationState_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_EnumType_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_FieldPresence_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_JsonFormat_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_MessageEncoding_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_RepeatedFieldEncoding_enum_init; +extern const upb_MiniTableEnum google_protobuf_FeatureSet_StringFieldValidation_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Label_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldDescriptorProto_Type_enum_init; extern const upb_MiniTableEnum google_protobuf_FieldOptions_CType_enum_init; @@ -5123,26 +5171,41 @@ UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_declaration(const goog return size != 0; } UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_verification(google_protobuf_ExtensionRangeOptions* msg) { - const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_ExtensionRangeOptions_verification(const google_protobuf_ExtensionRangeOptions* msg) { int32_t default_val = 1; int32_t ret; - const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_verification(const google_protobuf_ExtensionRangeOptions* msg) { - const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_features(google_protobuf_ExtensionRangeOptions* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_features(const google_protobuf_ExtensionRangeOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_features(const google_protobuf_ExtensionRangeOptions* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -5153,7 +5216,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Ext } } UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -5161,7 +5224,7 @@ UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted return arr; } UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_ExtensionRangeOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -5202,11 +5265,23 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_prot return sub; } UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) { - const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 4), 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_features(google_protobuf_ExtensionRangeOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {50, UPB_SIZE(12, 16), 2, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_mutable_features(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ExtensionRangeOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_ExtensionRangeOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -5217,11 +5292,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeO } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(16, 24), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -6508,48 +6583,48 @@ UPB_INLINE char* google_protobuf_FileOptions_serialize_ex(const google_protobuf_ return ptr; } UPB_INLINE void google_protobuf_FileOptions_clear_java_package(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) { int32_t default_val = 1; int32_t ret; - const upb_MiniTableField field = {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(google_protobuf_FileOptions* msg) { @@ -6568,18 +6643,18 @@ UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_go_package(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(google_protobuf_FileOptions* msg) { @@ -6688,78 +6763,78 @@ UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_pr return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(google_protobuf_FileOptions* msg) { @@ -6778,41 +6853,56 @@ UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const googl return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) { upb_StringView default_val = upb_StringView_FromString(""); upb_StringView ret; - const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FileOptions_clear_features(google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FileOptions_features(const google_protobuf_FileOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FileOptions_has_features(const google_protobuf_FileOptions* msg) { + const upb_MiniTableField field = {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(google_protobuf_FileOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -6823,7 +6913,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Fil } } UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_upb_array(const google_protobuf_FileOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -6831,7 +6921,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_up return arr; } UPB_INLINE upb_Array* _google_protobuf_FileOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_FileOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -6846,15 +6936,15 @@ UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const googl } UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {1, 24, 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, UPB_SIZE(28, 24), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {8, UPB_SIZE(32, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {8, UPB_SIZE(36, 40), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) { - const upb_MiniTableField field = {9, 4, 3, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {9, 4, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) { @@ -6862,7 +6952,7 @@ UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_proto _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {11, UPB_SIZE(40, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {11, UPB_SIZE(44, 56), 5, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) { @@ -6894,23 +6984,23 @@ UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {36, UPB_SIZE(48, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {36, UPB_SIZE(52, 72), 13, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {37, UPB_SIZE(56, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {37, UPB_SIZE(60, 88), 14, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {39, UPB_SIZE(64, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {39, UPB_SIZE(68, 104), 15, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {40, UPB_SIZE(72, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {40, UPB_SIZE(76, 120), 16, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {41, UPB_SIZE(80, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {41, UPB_SIZE(84, 136), 17, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) { @@ -6918,15 +7008,27 @@ UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_prot _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {44, UPB_SIZE(88, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {44, UPB_SIZE(92, 152), 19, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) { - const upb_MiniTableField field = {45, UPB_SIZE(96, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {45, UPB_SIZE(100, 168), 20, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_FileOptions_set_features(google_protobuf_FileOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {50, UPB_SIZE(20, 184), 21, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FileOptions_mutable_features(google_protobuf_FileOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FileOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_FileOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -6937,11 +7039,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mut } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(20, 184), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(24, 192), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7062,12 +7164,27 @@ UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated_legacy_json_field_ const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_MessageOptions_clear_features(google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MessageOptions_features(const google_protobuf_MessageOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MessageOptions_has_features(const google_protobuf_MessageOptions* msg) { + const upb_MiniTableField field = {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(google_protobuf_MessageOptions* msg) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7078,7 +7195,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Mes } } UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_upb_array(const google_protobuf_MessageOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7086,7 +7203,7 @@ UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option return arr; } UPB_INLINE upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_MessageOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7120,8 +7237,20 @@ UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_ const upb_MiniTableField field = {11, 5, 5, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_MessageOptions_set_features(google_protobuf_MessageOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {12, 8, 6, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MessageOptions_mutable_features(google_protobuf_MessageOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MessageOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_MessageOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* size) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7132,11 +7261,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_ } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7183,18 +7312,18 @@ UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf return ptr; } UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) { @@ -7243,18 +7372,18 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_Fiel return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) { @@ -7303,41 +7432,41 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_proto return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_target_obsolete_do_not_use(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_FieldOptions_target_obsolete_do_not_use(const google_protobuf_FieldOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_FieldOptions_has_target_obsolete_do_not_use(const google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_FieldOptions_clear_targets(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_protobuf_FieldOptions* msg, size_t* size) { - const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7348,7 +7477,7 @@ UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_prot } } UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) { - const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7356,7 +7485,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(cons return arr; } UPB_INLINE upb_Array* _google_protobuf_FieldOptions_targets_mutable_upb_array(const google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7369,12 +7498,64 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_targets(const google_protobuf_F google_protobuf_FieldOptions_targets(msg, &size); return size != 0; } +UPB_INLINE void google_protobuf_FieldOptions_clear_edition_defaults(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FieldOptions_EditionDefault* const* google_protobuf_FieldOptions_edition_defaults(const google_protobuf_FieldOptions* msg, size_t* size) { + const upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (const google_protobuf_FieldOptions_EditionDefault* const*)_upb_array_constptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_edition_defaults_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) { + const upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_Array* arr = upb_Message_GetArray(msg, &field); + if (size) { + *size = arr ? arr->size : 0; + } + return arr; +} +UPB_INLINE upb_Array* _google_protobuf_FieldOptions_edition_defaults_mutable_upb_array(const google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { + const upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray( + (upb_Message*)msg, &field, arena); + if (size) { + *size = arr ? arr->size : 0; + } + return arr; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_edition_defaults(const google_protobuf_FieldOptions* msg) { + size_t size; + google_protobuf_FieldOptions_edition_defaults(msg, &size); + return size != 0; +} +UPB_INLINE void google_protobuf_FieldOptions_clear_features(google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FieldOptions_features(const google_protobuf_FieldOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_has_features(const google_protobuf_FieldOptions* msg) { + const upb_MiniTableField field = {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7385,7 +7566,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Fie } } UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7393,7 +7574,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_u return arr; } UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7408,7 +7589,7 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const goog } UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) { - const upb_MiniTableField field = {1, 4, 1, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {1, 4, 1, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) { @@ -7424,7 +7605,7 @@ UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptio _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) { - const upb_MiniTableField field = {6, 12, 5, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {6, 12, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) { @@ -7440,15 +7621,15 @@ UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_Fi _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions *msg, int32_t value) { - const upb_MiniTableField field = {17, 20, 9, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {17, 20, 9, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_FieldOptions_set_target_obsolete_do_not_use(google_protobuf_FieldOptions *msg, int32_t value) { - const upb_MiniTableField field = {18, 24, 10, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {18, 24, 10, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf_FieldOptions* msg, size_t* size) { - upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7459,11 +7640,11 @@ UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf } } UPB_INLINE int32_t* google_protobuf_FieldOptions_resize_targets(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (int32_t*)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions* msg, int32_t val, upb_Arena* arena) { - upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 5, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {19, UPB_SIZE(28, 32), 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return false; @@ -7471,8 +7652,46 @@ UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOp _upb_Array_Set(arr, arr->size - 1, &val, sizeof(val)); return true; } +UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) { + upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetMutableArray(msg, &field); + if (arr) { + if (size) *size = arr->size; + return (google_protobuf_FieldOptions_EditionDefault**)_upb_array_ptr(arr); + } else { + if (size) *size = 0; + return NULL; + } +} +UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_resize_edition_defaults(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { + upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return (google_protobuf_FieldOptions_EditionDefault**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); +} +UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_add_edition_defaults(google_protobuf_FieldOptions* msg, upb_Arena* arena) { + upb_MiniTableField field = {20, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); + if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + return NULL; + } + struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google_protobuf_FieldOptions_EditionDefault_msg_init, arena); + if (!arr || !sub) return NULL; + _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub)); + return sub; +} +UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {21, UPB_SIZE(36, 48), 11, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FieldOptions_mutable_features(google_protobuf_FieldOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FieldOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_FieldOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7483,11 +7702,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mu } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(32, 40), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(40, 56), 0, 2, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7498,6 +7717,81 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOpti return sub; } +/* google.protobuf.FieldOptions.EditionDefault */ + +UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_new(upb_Arena* arena) { + return (google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(&google_protobuf_FieldOptions_EditionDefault_msg_init, arena); +} +UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_EditionDefault_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_EditionDefault_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FieldOptions_EditionDefault* ret = google_protobuf_FieldOptions_EditionDefault_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_EditionDefault_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize(const google_protobuf_FieldOptions_EditionDefault* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldOptions_EditionDefault_msg_init, 0, arena, &ptr, len); + return ptr; +} +UPB_INLINE char* google_protobuf_FieldOptions_EditionDefault_serialize_ex(const google_protobuf_FieldOptions_EditionDefault* msg, int options, + upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldOptions_EditionDefault_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_edition(google_protobuf_FieldOptions_EditionDefault* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldOptions_EditionDefault_edition(const google_protobuf_FieldOptions_EditionDefault* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_edition(const google_protobuf_FieldOptions_EditionDefault* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_clear_value(google_protobuf_FieldOptions_EditionDefault* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE upb_StringView google_protobuf_FieldOptions_EditionDefault_value(const google_protobuf_FieldOptions_EditionDefault* msg) { + upb_StringView default_val = upb_StringView_FromString(""); + upb_StringView ret; + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_value(const google_protobuf_FieldOptions_EditionDefault* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_edition(google_protobuf_FieldOptions_EditionDefault *msg, upb_StringView value) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_value(google_protobuf_FieldOptions_EditionDefault *msg, upb_StringView value) { + const upb_MiniTableField field = {2, UPB_SIZE(12, 24), 2, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + /* google.protobuf.OneofOptions */ UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) { @@ -7533,12 +7827,27 @@ UPB_INLINE char* google_protobuf_OneofOptions_serialize_ex(const google_protobuf (void)upb_Encode(msg, &google_protobuf_OneofOptions_msg_init, options, arena, &ptr, len); return ptr; } +UPB_INLINE void google_protobuf_OneofOptions_clear_features(google_protobuf_OneofOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_OneofOptions_features(const google_protobuf_OneofOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_OneofOptions_has_features(const google_protobuf_OneofOptions* msg) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(google_protobuf_OneofOptions* msg) { - const upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7549,7 +7858,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_One } } UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_upb_array(const google_protobuf_OneofOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7557,7 +7866,7 @@ UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_u return arr; } UPB_INLINE upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_OneofOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7571,8 +7880,20 @@ UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const goog return size != 0; } +UPB_INLINE void google_protobuf_OneofOptions_set_features(google_protobuf_OneofOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_OneofOptions_mutable_features(google_protobuf_OneofOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_OneofOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_OneofOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* size) { - upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7583,11 +7904,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mu } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, 0, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7678,12 +7999,27 @@ UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated_legacy_json_field_con const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_EnumOptions_clear_features(google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumOptions_features(const google_protobuf_EnumOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumOptions_has_features(const google_protobuf_EnumOptions* msg) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(google_protobuf_EnumOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7694,7 +8030,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Enu } } UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_upb_array(const google_protobuf_EnumOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7702,7 +8038,7 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_up return arr; } UPB_INLINE upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_EnumOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7728,8 +8064,20 @@ UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_con const upb_MiniTableField field = {6, 3, 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_EnumOptions_set_features(google_protobuf_EnumOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {7, UPB_SIZE(4, 8), 4, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumOptions_mutable_features(google_protobuf_EnumOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_EnumOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7740,11 +8088,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mut } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7805,27 +8153,42 @@ UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_pro const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_EnumValueOptions_clear_features(google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_features(const google_protobuf_EnumValueOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_EnumValueOptions_has_features(const google_protobuf_EnumValueOptions* msg) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_EnumValueOptions_clear_debug_redact(google_protobuf_EnumValueOptions* msg) { - const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE bool google_protobuf_EnumValueOptions_debug_redact(const google_protobuf_EnumValueOptions* msg) { bool default_val = false; bool ret; - const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_EnumValueOptions_has_debug_redact(const google_protobuf_EnumValueOptions* msg) { - const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(google_protobuf_EnumValueOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7836,7 +8199,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Enu } } UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_upb_array(const google_protobuf_EnumValueOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7844,7 +8207,7 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_opti return arr; } UPB_INLINE upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_EnumValueOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7862,12 +8225,24 @@ UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_ const upb_MiniTableField field = {1, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_EnumValueOptions_set_features(google_protobuf_EnumValueOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {2, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_mutable_features(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumValueOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_EnumValueOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE void google_protobuf_EnumValueOptions_set_debug_redact(google_protobuf_EnumValueOptions *msg, bool value) { - const upb_MiniTableField field = {3, 2, 2, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {3, UPB_SIZE(8, 2), 3, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7878,11 +8253,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOption } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -7943,12 +8318,27 @@ UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_proto const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } +UPB_INLINE void google_protobuf_ServiceOptions_clear_features(google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_ServiceOptions_features(const google_protobuf_ServiceOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_ServiceOptions_has_features(const google_protobuf_ServiceOptions* msg) { + const upb_MiniTableField field = {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(google_protobuf_ServiceOptions* msg) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7959,7 +8349,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Ser } } UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_upb_array(const google_protobuf_ServiceOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -7967,7 +8357,7 @@ UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option return arr; } UPB_INLINE upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_ServiceOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -7985,8 +8375,20 @@ UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_Se const upb_MiniTableField field = {33, 1, 1, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_ServiceOptions_set_features(google_protobuf_ServiceOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {34, UPB_SIZE(4, 8), 2, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ServiceOptions_mutable_features(google_protobuf_ServiceOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ServiceOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_ServiceOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* size) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -7997,11 +8399,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_ } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, UPB_SIZE(4, 8), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(8, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -8063,26 +8465,41 @@ UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protob return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(google_protobuf_MethodOptions* msg) { - const upb_MiniTableField field = {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) { int32_t default_val = 0; int32_t ret; - const upb_MiniTableField field = {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); return ret; } UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) { - const upb_MiniTableField field = {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_MethodOptions_clear_features(google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_MethodOptions_features(const google_protobuf_MethodOptions* msg) { + const google_protobuf_FeatureSet* default_val = NULL; + const google_protobuf_FeatureSet* ret; + const upb_MiniTableField field = {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_MethodOptions_has_features(const google_protobuf_MethodOptions* msg) { + const upb_MiniTableField field = {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return _upb_Message_HasNonExtensionField(msg, &field); } UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(google_protobuf_MethodOptions* msg) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; _upb_Message_ClearNonExtensionField(msg, &field); } UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -8093,7 +8510,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Met } } UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_upb_array(const google_protobuf_MethodOptions* msg, size_t* size) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { *size = arr ? arr->size : 0; @@ -8101,7 +8518,7 @@ UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_ return arr; } UPB_INLINE upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_mutable_upb_array(const google_protobuf_MethodOptions* msg, size_t* size, upb_Arena* arena) { - const upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { @@ -8120,11 +8537,23 @@ UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_Met _upb_Message_SetNonExtensionField(msg, &field, &value); } UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) { - const upb_MiniTableField field = {34, 4, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + const upb_MiniTableField field = {34, 4, 2, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; _upb_Message_SetNonExtensionField(msg, &field, &value); } +UPB_INLINE void google_protobuf_MethodOptions_set_features(google_protobuf_MethodOptions *msg, google_protobuf_FeatureSet* value) { + const upb_MiniTableField field = {35, 8, 3, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MethodOptions_mutable_features(google_protobuf_MethodOptions* msg, upb_Arena* arena) { + struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MethodOptions_features(msg); + if (sub == NULL) { + sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); + if (sub) google_protobuf_MethodOptions_set_features(msg, sub); + } + return sub; +} UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* size) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { if (size) *size = arr->size; @@ -8135,11 +8564,11 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_m } } UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t size, upb_Arena* arena) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(msg, &field, size, arena); } UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) { - upb_MiniTableField field = {999, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; + upb_MiniTableField field = {999, UPB_SIZE(12, 16), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)}; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { return NULL; @@ -8439,6 +8868,157 @@ UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(go _upb_Message_SetNonExtensionField(msg, &field, &value); } +/* google.protobuf.FeatureSet */ + +UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_new(upb_Arena* arena) { + return (google_protobuf_FeatureSet*)_upb_Message_New(&google_protobuf_FeatureSet_msg_init, arena); +} +UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse(const char* buf, size_t size, upb_Arena* arena) { + google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FeatureSet_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE google_protobuf_FeatureSet* google_protobuf_FeatureSet_parse_ex(const char* buf, size_t size, + const upb_ExtensionRegistry* extreg, + int options, upb_Arena* arena) { + google_protobuf_FeatureSet* ret = google_protobuf_FeatureSet_new(arena); + if (!ret) return NULL; + if (upb_Decode(buf, size, ret, &google_protobuf_FeatureSet_msg_init, extreg, options, arena) != + kUpb_DecodeStatus_Ok) { + return NULL; + } + return ret; +} +UPB_INLINE char* google_protobuf_FeatureSet_serialize(const google_protobuf_FeatureSet* msg, upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FeatureSet_msg_init, 0, arena, &ptr, len); + return ptr; +} +UPB_INLINE char* google_protobuf_FeatureSet_serialize_ex(const google_protobuf_FeatureSet* msg, int options, + upb_Arena* arena, size_t* len) { + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FeatureSet_msg_init, options, arena, &ptr, len); + return ptr; +} +UPB_INLINE void google_protobuf_FeatureSet_clear_field_presence(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_field_presence(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_field_presence(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_enum_type(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_enum_type(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_enum_type(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_repeated_field_encoding(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_repeated_field_encoding(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_repeated_field_encoding(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_string_field_validation(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_string_field_validation(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_string_field_validation(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_message_encoding(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_message_encoding(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_message_encoding(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} +UPB_INLINE void google_protobuf_FeatureSet_clear_json_format(google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_ClearNonExtensionField(msg, &field); +} +UPB_INLINE int32_t google_protobuf_FeatureSet_json_format(const google_protobuf_FeatureSet* msg) { + int32_t default_val = 0; + int32_t ret; + const upb_MiniTableField field = {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret); + return ret; +} +UPB_INLINE bool google_protobuf_FeatureSet_has_json_format(const google_protobuf_FeatureSet* msg) { + const upb_MiniTableField field = {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + return _upb_Message_HasNonExtensionField(msg, &field); +} + +UPB_INLINE void google_protobuf_FeatureSet_set_field_presence(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {1, 4, 1, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_enum_type(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {2, 8, 2, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_repeated_field_encoding(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {3, 12, 3, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_string_field_validation(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {4, 16, 4, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_message_encoding(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {5, 20, 5, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} +UPB_INLINE void google_protobuf_FeatureSet_set_json_format(google_protobuf_FeatureSet *msg, int32_t value) { + const upb_MiniTableField field = {6, 24, 6, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)}; + _upb_Message_SetNonExtensionField(msg, &field, &value); +} + /* google.protobuf.SourceCodeInfo */ UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) { @@ -9075,7 +9655,7 @@ extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout; /* Max size 32 is google.protobuf.FileOptions */ /* Max size 64 is google.protobuf.FileOptions */ -#define _UPB_MAXOPT_SIZE UPB_SIZE(104, 192) +#define _UPB_MAXOPT_SIZE UPB_SIZE(112, 200) #ifdef __cplusplus } /* extern "C" */ diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel index 8e8f71b2a1..9d340ecb1d 100644 --- a/src/google/protobuf/BUILD.bazel +++ b/src/google/protobuf/BUILD.bazel @@ -109,6 +109,7 @@ WELL_KNOWN_TYPES = [ proto_library( name = "wkt_proto", + strip_import_prefix = "/src", visibility = ["//visibility:private"], deps = [wkt + "_proto" for wkt in WELL_KNOWN_TYPES], ) @@ -177,6 +178,14 @@ proto_library( ], ) +proto_library( + name = "cpp_features_proto", + srcs = ["cpp_features.proto"], + strip_import_prefix = "/src", + visibility = ["//:__subpackages__"], + deps = [":descriptor_proto"], +) + ################################################################################ # C++ Runtime Library ################################################################################ @@ -419,11 +428,13 @@ cc_library( name = "protobuf_nowkt", srcs = [ "any.cc", + "cpp_features.pb.cc", "descriptor.cc", "descriptor.pb.cc", "descriptor_database.cc", "dynamic_message.cc", "extension_set_heavy.cc", + "feature_resolver.cc", "generated_message_bases.cc", "generated_message_reflection.cc", "generated_message_tctable_full.cc", @@ -439,12 +450,14 @@ cc_library( "wire_format.cc", ], hdrs = [ + "cpp_features.pb.h", "descriptor.h", "descriptor.pb.h", "descriptor_database.h", "descriptor_legacy.h", "descriptor_visitor.h", "dynamic_message.h", + "feature_resolver.h", "field_access_listener.h", "generated_enum_reflection.h", "generated_message_bases.h", @@ -574,6 +587,12 @@ filegroup( visibility = ["//:__subpackages__"], ) +filegroup( + name = "cpp_features_proto_srcs", + srcs = ["cpp_features.proto"], + visibility = ["//src/google/protobuf/compiler/cpp:__pkg__"], +) + filegroup( name = "testdata", srcs = glob(["testdata/**/*"]) + [ @@ -630,8 +649,10 @@ filegroup( "unittest_embed_optimize_for.proto", "unittest_empty.proto", "unittest_enormous_descriptor.proto", + "unittest_features.proto", "unittest_import.proto", "unittest_import_public.proto", + "unittest_invalid_features.proto", "unittest_lazy_dependencies.proto", "unittest_lazy_dependencies_custom_option.proto", "unittest_lazy_dependencies_enum.proto", @@ -793,6 +814,16 @@ filegroup( visibility = ["//src/google/protobuf/compiler/cpp:__pkg__"], ) +filegroup( + name = "cpp_features_cc_srcs", + testonly = 1, + data = [ + "cpp_features.pb.cc", + "cpp_features.pb.h", + ], + visibility = ["//src/google/protobuf/compiler/cpp:__pkg__"], +) + cc_library( name = "lite_test_util", testonly = 1, @@ -981,7 +1012,10 @@ cc_library( testonly = True, hdrs = ["test_textproto.h"], strip_include_prefix = "/src", - visibility = ["//pkg:__pkg__"], + visibility = [ + "//pkg:__pkg__", + "//src/google/protobuf:__subpackages__", + ], deps = [ ":protobuf", "@com_google_absl//absl/log:absl_check", @@ -1044,6 +1078,23 @@ cc_test( ], ) +cc_test( + name = "feature_resolver_test", + srcs = ["feature_resolver_test.cc"], + copts = COPTS, + deps = [ + ":cc_test_protos", + ":protobuf", + ":test_textproto", + ":test_util", + "//src/google/protobuf/compiler:importer", + "//src/google/protobuf/stubs", + "//src/google/protobuf/testing", + "@com_google_googletest//:gtest", + "@com_google_googletest//:gtest_main", + ], +) + cc_test( name = "generated_message_reflection_unittest", srcs = ["generated_message_reflection_unittest.cc"], diff --git a/src/google/protobuf/bridge/BUILD.bazel b/src/google/protobuf/bridge/BUILD.bazel index b76bbae8f6..c219b3814c 100644 --- a/src/google/protobuf/bridge/BUILD.bazel +++ b/src/google/protobuf/bridge/BUILD.bazel @@ -8,4 +8,4 @@ proto_library( name = "message_set_proto", srcs = ["message_set.proto"], strip_import_prefix = "/src", -) \ No newline at end of file +) diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel index 488c238e1e..5898938000 100644 --- a/src/google/protobuf/compiler/BUILD.bazel +++ b/src/google/protobuf/compiler/BUILD.bazel @@ -294,8 +294,8 @@ cc_library( copts = COPTS, strip_include_prefix = "/src", visibility = [ - "//pkg:__pkg__", - "//src/google/protobuf/compiler:__subpackages__", + "//pkg:__pkg__", + "//src/google/protobuf/compiler:__subpackages__", ], deps = [ ":code_generator", diff --git a/src/google/protobuf/compiler/allowlists/editions.cc b/src/google/protobuf/compiler/allowlists/editions.cc index 7c08bbbdab..39bac65676 100644 --- a/src/google/protobuf/compiler/allowlists/editions.cc +++ b/src/google/protobuf/compiler/allowlists/editions.cc @@ -39,9 +39,12 @@ namespace compiler { // NOTE: These files have early default access to go/editions. The protoc flag // `--experimental_editions` can also be used to enable editions. -static constexpr auto kEarlyEditionsFile = internal::MakeAllowlist({ +static constexpr auto kEarlyEditionsFile = internal::MakeAllowlist( + { // Intentionally left blank. -}); + "google/protobuf/editions/", + }, + internal::AllowlistFlags::kMatchPrefix); bool IsEarlyEditionsFile(absl::string_view file) { return kEarlyEditionsFile.Allows(file); diff --git a/src/google/protobuf/compiler/code_generator.h b/src/google/protobuf/compiler/code_generator.h index 20a6f44278..cff469753b 100644 --- a/src/google/protobuf/compiler/code_generator.h +++ b/src/google/protobuf/compiler/code_generator.h @@ -126,6 +126,24 @@ class PROTOC_EXPORT CodeGenerator { // method can be removed. virtual bool HasGenerateAll() const { return true; } +#ifdef PROTOBUF_FUTURE_EDITIONS + + protected: + // Retrieves the resolved source features for a given descriptor. These + // should be used to make any feature-based decisions during code generation. + template + static const FeatureSet& GetSourceFeatures(const DescriptorT& desc) { + return ::google::protobuf::internal::InternalFeatureHelper::GetFeatures(desc); + } + + // Retrieves the raw source features for a given descriptor. These should be + // used to validate the original .proto file and make any decisions about it + // during code generation. + template + static const FeatureSet& GetSourceRawFeatures(const DescriptorT& desc) { + return ::google::protobuf::internal::InternalFeatureHelper::GetRawFeatures(desc); + } +#endif // PROTOBUF_FUTURE_EDITIONS }; // CodeGenerators generate one or more files in a given directory. This diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index 7d5cb6a34a..0890e6354f 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -1551,6 +1551,21 @@ bool CommandLineInterface::ParseInputFiles( } parsed_files->push_back(parsed_file); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (!experimental_editions_ && !IsEarlyEditionsFile(parsed_file->name())) { + if (FileDescriptorLegacy(parsed_file).syntax() == + FileDescriptorLegacy::Syntax::SYNTAX_EDITIONS) { + std::cerr + << parsed_file->name() + << ": This file uses editions, but --experimental_editions has not " + "been enabled. This syntax is experimental and should be " + "avoided." + << std::endl; + result = false; + break; + } + } +#endif // PROTOBUF_FUTURE_EDITIONS // Enforce --disallow_services. if (disallow_services_ && parsed_file->service_count() > 0) { @@ -1601,6 +1616,9 @@ void CommandLineInterface::Clear() { descriptor_set_out_name_.clear(); dependency_out_name_.clear(); +#ifdef PROTOBUF_FUTURE_EDITIONS + experimental_editions_ = false; +#endif // PROTOBUF_FUTURE_EDITIONS mode_ = MODE_COMPILE; print_mode_ = PRINT_NONE; @@ -1919,6 +1937,9 @@ bool CommandLineInterface::ParseArgument(const char* arg, std::string* name, *name == "--include_imports" || *name == "--include_source_info" || *name == "--retain_options" || *name == "--version" || *name == "--decode_raw" || +#ifdef PROTOBUF_FUTURE_EDITIONS + *name == "--experimental_editions" || +#endif // PROTOBUF_FUTURE_EDITIONS *name == "--print_free_field_numbers" || *name == "--experimental_allow_proto3_optional" || *name == "--deterministic_output" || *name == "--fatal_warnings") { @@ -2245,6 +2266,14 @@ CommandLineInterface::InterpretArgument(const std::string& name, #else ::setenv(io::Printer::kProtocCodegenTrace.data(), "yes", 0); #endif +#ifdef PROTOBUF_FUTURE_EDITIONS + } else if (name == "--experimental_editions") { + // If you're reading this, you're probably wondering what + // --experimental_editions is for and thinking of turning it on. This is an + // experimental, undocumented, unsupported flag. Enable it at your own risk + // (or, just don't!). + experimental_editions_ = true; +#endif // PROTOBUF_FUTURE_EDITIONS } else { // Some other flag. Look it up in the generators list. const GeneratorInfo* generator_info = FindGeneratorByFlag(name); diff --git a/src/google/protobuf/compiler/command_line_interface.h b/src/google/protobuf/compiler/command_line_interface.h index c042983710..51e2312fc9 100644 --- a/src/google/protobuf/compiler/command_line_interface.h +++ b/src/google/protobuf/compiler/command_line_interface.h @@ -428,6 +428,9 @@ class PROTOC_EXPORT CommandLineInterface { // dependency file will be written. Otherwise, empty. std::string dependency_out_name_; +#ifdef PROTOBUF_FUTURE_EDITIONS + bool experimental_editions_ = false; +#endif // PROTOBUF_FUTURE_EDITIONS // True if --include_imports was given, meaning that we should // write all transitive dependencies to the DescriptorSet. Otherwise, only diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc index 4515ac199a..07cd76d8e0 100644 --- a/src/google/protobuf/compiler/command_line_interface_unittest.cc +++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc @@ -1344,6 +1344,145 @@ TEST_F(CommandLineInterfaceTest, AllowServicesHasService) { ExpectGenerated("test_generator", "", "foo.proto", "Foo"); } +#ifdef PROTOBUF_FUTURE_EDITIONS + +TEST_F(CommandLineInterfaceTest, EditionsAreNotAllowed) { + CreateTempFile("foo.proto", + "edition = \"very-cool\";\n" + "message FooRequest {}\n"); + + Run("protocol_compiler --proto_path=$tmpdir --test_out=$tmpdir foo.proto"); + + ExpectErrorSubstring( + "This file uses editions, but --experimental_editions has not been " + "enabled."); +} + +TEST_F(CommandLineInterfaceTest, EditionsFlagExplicitTrue) { + CreateTempFile("foo.proto", + "edition = \"very-cool\";\n" + "message FooRequest {}\n"); + + Run("protocol_compiler --proto_path=$tmpdir --test_out=$tmpdir " + "--experimental_editions foo.proto"); + ExpectNoErrors(); +} + +TEST_F(CommandLineInterfaceTest, FeaturesEditionZero) { + CreateTempFile("foo.proto", + R"schema( + edition = "2023"; + option features.field_presence = IMPLICIT; + message Foo { + int32 bar = 1 [default = 5, features.field_presence = EXPLICIT]; + int32 baz = 2; + })schema"); + + Run("protocol_compiler --proto_path=$tmpdir --test_out=$tmpdir " + "--experimental_editions foo.proto"); + ExpectNoErrors(); +} + +TEST_F(CommandLineInterfaceTest, FeatureExtensions) { + CreateTempFile("net/proto2/proto/descriptor.proto", + google::protobuf::DescriptorProto::descriptor()->file()->DebugString()); + CreateTempFile("features.proto", + R"schema( + syntax = "proto2"; + package pb; + import "net/proto2/proto/descriptor.proto"; + extend google.protobuf.FeatureSet { + optional TestFeatures test = 9999; + } + message TestFeatures { + optional int32 int_feature = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "3" } + ]; + })schema"); + CreateTempFile("foo.proto", + R"schema( + edition = "2023"; + import "features.proto"; + message Foo { + int32 bar = 1; + int32 baz = 2 [features.(pb.test).int_feature = 5]; + })schema"); + + Run("protocol_compiler --proto_path=$tmpdir --test_out=$tmpdir " + "--experimental_editions foo.proto"); + ExpectNoErrors(); +} + +TEST_F(CommandLineInterfaceTest, FeatureValidationError) { + CreateTempFile("foo.proto", + R"schema( + edition = "2023"; + option features.field_presence = IMPLICIT; + message Foo { + int32 bar = 1 [default = 5, features.field_presence = FIELD_PRESENCE_UNKNOWN]; + int32 baz = 2; + })schema"); + + Run("protocol_compiler --proto_path=$tmpdir --test_out=$tmpdir " + "--experimental_editions foo.proto"); + ExpectErrorSubstring( + "FeatureSet.field_presence must resolve to a known value, found " + "FIELD_PRESENCE_UNKNOWN"); +} + +TEST_F(CommandLineInterfaceTest, FeatureTargetError) { + CreateTempFile("foo.proto", + R"schema( + edition = "2023"; + message Foo { + option features.field_presence = IMPLICIT; + int32 bar = 1 [default = 5, features.field_presence = EXPLICIT]; + int32 baz = 2; + })schema"); + + Run("protocol_compiler --proto_path=$tmpdir --test_out=$tmpdir " + "--experimental_editions foo.proto"); + ExpectErrorSubstring( + "FeatureSet.field_presence cannot be set on an entity of type `message`"); +} + +TEST_F(CommandLineInterfaceTest, FeatureExtensionError) { + CreateTempFile("net/proto2/proto/descriptor.proto", + google::protobuf::DescriptorProto::descriptor()->file()->DebugString()); + CreateTempFile("features.proto", + R"schema( + syntax = "proto2"; + package pb; + import "net/proto2/proto/descriptor.proto"; + extend google.protobuf.FeatureSet { + optional TestFeatures test = 9999; + } + message TestFeatures { + repeated int32 repeated_feature = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "3" } + ]; + })schema"); + CreateTempFile("foo.proto", + R"schema( + edition = "2023"; + import "features.proto"; + message Foo { + int32 bar = 1; + int32 baz = 2 [features.(pb.test).int_feature = 5]; + })schema"); + + Run("protocol_compiler --proto_path=$tmpdir --test_out=$tmpdir " + "--experimental_editions foo.proto"); + ExpectErrorSubstring( + "Feature field pb.TestFeatures.repeated_feature is an unsupported " + "repeated field"); +} + +#endif // PROTOBUF_FUTURE_EDITIONS TEST_F(CommandLineInterfaceTest, DirectDependencies_Missing_EmptyList) { diff --git a/src/google/protobuf/compiler/cpp/BUILD.bazel b/src/google/protobuf/compiler/cpp/BUILD.bazel index 674f2fb0c6..aa9777c99d 100644 --- a/src/google/protobuf/compiler/cpp/BUILD.bazel +++ b/src/google/protobuf/compiler/cpp/BUILD.bazel @@ -166,6 +166,8 @@ cc_test( srcs = ["bootstrap_unittest.cc"], data = [ "//:well_known_type_protos", + "//src/google/protobuf:cpp_features_cc_srcs", + "//src/google/protobuf:cpp_features_proto_srcs", "//src/google/protobuf:descriptor_cc_srcs", "//src/google/protobuf:descriptor_proto_srcs", "//src/google/protobuf:testdata", diff --git a/src/google/protobuf/compiler/cpp/bootstrap_unittest.cc b/src/google/protobuf/compiler/cpp/bootstrap_unittest.cc index 5223d19f19..856a06c689 100644 --- a/src/google/protobuf/compiler/cpp/bootstrap_unittest.cc +++ b/src/google/protobuf/compiler/cpp/bootstrap_unittest.cc @@ -129,11 +129,13 @@ class MockGeneratorContext : public GeneratorContext { }; const char kDescriptorParameter[] = "dllexport_decl=PROTOBUF_EXPORT"; +const char kCppFeaturesParameter[] = "dllexport_decl=PROTOBUF_EXPORT"; const char kPluginParameter[] = "dllexport_decl=PROTOC_EXPORT"; const char* test_protos[][2] = { {"google/protobuf/descriptor", kDescriptorParameter}, + {"google/protobuf/cpp_features", kCppFeaturesParameter}, {"google/protobuf/compiler/plugin", kPluginParameter}, }; diff --git a/src/google/protobuf/compiler/cpp/generator.cc b/src/google/protobuf/compiler/cpp/generator.cc index c42e708bc4..73224ac0fd 100644 --- a/src/google/protobuf/compiler/cpp/generator.cc +++ b/src/google/protobuf/compiler/cpp/generator.cc @@ -49,6 +49,9 @@ #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/descriptor_visitor.h" +#ifdef PROTOBUF_FUTURE_EDITIONS +#include "google/protobuf/cpp_features.pb.h" +#endif // PROTOBUF_FUTURE_EDITIONS namespace google { namespace protobuf { @@ -364,6 +367,25 @@ bool CppGenerator::Generate(const FileDescriptor* file, absl::Status CppGenerator::ValidateFeatures(const FileDescriptor* file) const { absl::Status status = absl::OkStatus(); +#ifdef PROTOBUF_FUTURE_EDITIONS + google::protobuf::internal::VisitDescriptors(*file, [&](const FieldDescriptor& field) { + const FeatureSet& source_features = GetSourceFeatures(field); + const FeatureSet& raw_features = GetSourceRawFeatures(field); + if (raw_features.GetExtension(::pb::cpp).has_legacy_closed_enum() && + field.cpp_type() != FieldDescriptor::CPPTYPE_ENUM) { + status = absl::FailedPreconditionError(absl::StrCat( + "Field ", field.full_name(), + " specifies the legacy_closed_enum feature but has non-enum type.")); + } + if (field.enum_type() != nullptr && + source_features.GetExtension(::pb::cpp).legacy_closed_enum() && + source_features.field_presence() == FeatureSet::IMPLICIT) { + status = absl::FailedPreconditionError( + absl::StrCat("Field ", field.full_name(), + " has a closed enum type with implicit presence.")); + } + }); +#endif // PROTOBUF_FUTURE_EDITIONS return status; } diff --git a/src/google/protobuf/compiler/cpp/generator_unittest.cc b/src/google/protobuf/compiler/cpp/generator_unittest.cc index 90e17bc400..af3148899d 100644 --- a/src/google/protobuf/compiler/cpp/generator_unittest.cc +++ b/src/google/protobuf/compiler/cpp/generator_unittest.cc @@ -35,6 +35,9 @@ #include "google/protobuf/descriptor.pb.h" #include #include "google/protobuf/compiler/command_line_interface_tester.h" +#ifdef PROTOBUF_FUTURE_EDITIONS +#include "google/protobuf/cpp_features.pb.h" +#endif // PROTOBUF_FUTURE_EDITIONS namespace google { namespace protobuf { @@ -52,6 +55,10 @@ class CppGeneratorTest : public CommandLineInterfaceTester { CreateTempFile( "google/protobuf/descriptor.proto", google::protobuf::DescriptorProto::descriptor()->file()->DebugString()); +#ifdef PROTOBUF_FUTURE_EDITIONS + CreateTempFile("third_party/protobuf/cpp_features.proto", + pb::CppFeatures::descriptor()->file()->DebugString()); +#endif // PROTOBUF_FUTURE_EDITIONS } }; @@ -84,6 +91,92 @@ TEST_F(CppGeneratorTest, BasicError) { "foo.proto:4:7: Expected \"required\", \"optional\", or \"repeated\""); } +#ifdef PROTOBUF_FUTURE_EDITIONS + +TEST_F(CppGeneratorTest, LegacyClosedEnumOnNonEnumField) { + CreateTempFile("foo.proto", + R"schema( + edition = "2023"; + import "third_party/protobuf/cpp_features.proto"; + + message Foo { + int32 bar = 1 [features.(pb.cpp).legacy_closed_enum = true]; + })schema"); + + RunProtoc( + "protocol_compiler --proto_path=$tmpdir --cpp_out=$tmpdir " + "--experimental_editions foo.proto"); + + ExpectErrorSubstring( + "Field Foo.bar specifies the legacy_closed_enum feature but has non-enum " + "type."); +} + +TEST_F(CppGeneratorTest, LegacyClosedEnum) { + CreateTempFile("foo.proto", + R"schema( + edition = "2023"; + import "third_party/protobuf/cpp_features.proto"; + + enum TestEnum { + TEST_ENUM_UNKNOWN = 0; + } + message Foo { + TestEnum bar = 1 [features.(pb.cpp).legacy_closed_enum = true]; + })schema"); + + RunProtoc( + "protocol_compiler --proto_path=$tmpdir --cpp_out=$tmpdir " + "--experimental_editions foo.proto"); + + ExpectNoErrors(); +} + +TEST_F(CppGeneratorTest, LegacyClosedEnumInherited) { + CreateTempFile("foo.proto", + R"schema( + edition = "2023"; + import "third_party/protobuf/cpp_features.proto"; + option features.(pb.cpp).legacy_closed_enum = true; + + enum TestEnum { + TEST_ENUM_UNKNOWN = 0; + } + message Foo { + TestEnum bar = 1; + int32 baz = 2; + })schema"); + + RunProtoc( + "protocol_compiler --proto_path=$tmpdir --cpp_out=$tmpdir " + "--experimental_editions foo.proto"); + + ExpectNoErrors(); +} + +TEST_F(CppGeneratorTest, LegacyClosedEnumImplicit) { + CreateTempFile("foo.proto", + R"schema( + edition = "2023"; + import "third_party/protobuf/cpp_features.proto"; + option features.(pb.cpp).legacy_closed_enum = true; + + enum TestEnum { + TEST_ENUM_UNKNOWN = 0; + } + message Foo { + TestEnum bar = 1 [features.field_presence = IMPLICIT]; + int32 baz = 2; + })schema"); + + RunProtoc( + "protocol_compiler --proto_path=$tmpdir --cpp_out=$tmpdir " + "--experimental_editions foo.proto"); + + ExpectErrorSubstring( + "Field Foo.bar has a closed enum type with implicit presence."); +} +#endif // PROTOBUF_FUTURE_EDITIONS } // namespace } // namespace cpp diff --git a/src/google/protobuf/compiler/cpp/helpers.cc b/src/google/protobuf/compiler/cpp/helpers.cc index a850fcceaf..e57f35e004 100644 --- a/src/google/protobuf/compiler/cpp/helpers.cc +++ b/src/google/protobuf/compiler/cpp/helpers.cc @@ -1400,6 +1400,10 @@ bool GetBootstrapBasename(const Options& options, absl::string_view basename, new absl::flat_hash_map{ {"net/proto2/proto/descriptor", "third_party/protobuf/descriptor"}, +#ifdef PROTOBUF_FUTURE_EDITIONS + {"third_party/protobuf/cpp_features", + "third_party/protobuf/cpp_features"}, +#endif // PROTOBUF_FUTURE_EDITIONS {"third_party/protobuf/compiler/plugin", "third_party/protobuf/compiler/plugin"}, {"net/proto2/compiler/proto/profile", diff --git a/src/google/protobuf/compiler/objectivec/file.cc b/src/google/protobuf/compiler/objectivec/file.cc index a798dda434..e0b76069e2 100644 --- a/src/google/protobuf/compiler/objectivec/file.cc +++ b/src/google/protobuf/compiler/objectivec/file.cc @@ -700,6 +700,11 @@ void FileGenerator::EmitFileDescription(io::Printer* p) const { case FileDescriptorLegacy::Syntax::SYNTAX_PROTO3: syntax = "GPBFileSyntaxProto3"; break; +#ifdef PROTOBUF_FUTURE_EDITIONS + case FileDescriptorLegacy::Syntax::SYNTAX_EDITIONS: + syntax = "GPBFileSyntaxProtoEditions"; + break; +#endif // PROTOBUF_FUTURE_EDITIONS } p->Emit({{"file_description_name", file_description_name_}, diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc index 5526c47ce7..5bff5a94cd 100644 --- a/src/google/protobuf/compiler/parser.cc +++ b/src/google/protobuf/compiler/parser.cc @@ -662,6 +662,9 @@ bool Parser::Parse(io::Tokenizer* input, FileDescriptorProto* file) { DescriptorPool::ErrorCollector::OTHER); if (require_syntax_identifier_ || LookingAt("syntax") +#ifdef PROTOBUF_FUTURE_EDITIONS + || LookingAt("edition") +#endif // PROTOBUF_FUTURE_EDITIONS ) { if (!ParseSyntaxIdentifier(file, root_location)) { // Don't attempt to parse the file if we didn't recognize the syntax @@ -671,6 +674,11 @@ bool Parser::Parse(io::Tokenizer* input, FileDescriptorProto* file) { // Store the syntax into the file. if (file != nullptr) { file->set_syntax(syntax_identifier_); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (syntax_identifier_ == "editions") { + file->set_edition(edition_); + } +#endif // PROTOBUF_FUTURE_EDITIONS } } else if (!stop_after_syntax_identifier_) { ABSL_LOG(WARNING) << "No syntax specified for the proto file: " @@ -710,9 +718,20 @@ bool Parser::ParseSyntaxIdentifier(const FileDescriptorProto* file, const LocationRecorder& parent) { LocationRecorder syntax_location(parent, FileDescriptorProto::kSyntaxFieldNumber); +#ifdef PROTOBUF_FUTURE_EDITIONS + syntax_location.RecordLegacyLocation( + file, DescriptorPool::ErrorCollector::EDITIONS); + bool has_edition = false; + if (TryConsume("edition")) { + has_edition = true; + } else { +#endif // PROTOBUF_FUTURE_EDITIONS DO(Consume("syntax", "File must begin with a syntax statement, e.g. 'syntax = " "\"proto2\";'.")); +#ifdef PROTOBUF_FUTURE_EDITIONS + } +#endif // PROTOBUF_FUTURE_EDITIONS DO(Consume("=")); io::Tokenizer::Token syntax_token = input_->current(); @@ -720,6 +739,19 @@ bool Parser::ParseSyntaxIdentifier(const FileDescriptorProto* file, DO(ConsumeString(&syntax, "Expected syntax identifier.")); DO(ConsumeEndOfDeclaration(";", &syntax_location)); +#ifdef PROTOBUF_FUTURE_EDITIONS + (has_edition ? edition_ : syntax_identifier_) = syntax; + if (has_edition) { + if (syntax.empty()) { + RecordError(syntax_token.line, syntax_token.column, + "A file's edition must be a nonempty string."); + return false; + } + edition_ = syntax; + syntax_identifier_ = "editions"; + return true; + } +#endif // PROTOBUF_FUTURE_EDITIONS syntax_identifier_ = syntax; if (syntax != "proto2" && syntax != "proto3" && !stop_after_syntax_identifier_) { @@ -2307,6 +2339,18 @@ bool Parser::ParseLabel(FieldDescriptorProto::Label* label, !LookingAt("required")) { return false; } +#ifdef PROTOBUF_FUTURE_EDITIONS + if (LookingAt("optional") && syntax_identifier_ == "editions") { + RecordError( + "Label \"optional\" is not supported in editions. By default, all " + "singular fields have presence unless features.field_presence is set."); + } + if (LookingAt("required") && syntax_identifier_ == "editions") { + RecordError( + "Label \"required\" is not supported in editions, use " + "features.field_presence = LEGACY_REQUIRED."); + } +#endif // PROTOBUF_FUTURE_EDITIONS LocationRecorder location(field_location, FieldDescriptorProto::kLabelFieldNumber); @@ -2326,6 +2370,15 @@ bool Parser::ParseType(FieldDescriptorProto::Type* type, const auto& type_names_table = GetTypeNameTable(); auto iter = type_names_table.find(input_->current().text); if (iter != type_names_table.end()) { +#ifdef PROTOBUF_FUTURE_EDITIONS + if (syntax_identifier_ == "editions" && + iter->second == FieldDescriptorProto::TYPE_GROUP) { + RecordError( + "Group syntax is no longer supported in editions. To get group " + "behavior you can specify features.message_encoding = DELIMITED on a " + "message field."); + } +#endif // PROTOBUF_FUTURE_EDITIONS *type = iter->second; input_->Next(); } else { diff --git a/src/google/protobuf/compiler/parser.h b/src/google/protobuf/compiler/parser.h index 357d02cb89..8f8866267f 100644 --- a/src/google/protobuf/compiler/parser.h +++ b/src/google/protobuf/compiler/parser.h @@ -530,6 +530,9 @@ class PROTOBUF_EXPORT Parser { // Whether fields without label default to optional fields. bool DefaultToOptionalFields() const { +#ifdef PROTOBUF_FUTURE_EDITIONS + if (syntax_identifier_ == "editions") return true; +#endif // PROTOBUF_FUTURE_EDITIONS return syntax_identifier_ == "proto3"; } @@ -545,6 +548,9 @@ class PROTOBUF_EXPORT Parser { bool require_syntax_identifier_; bool stop_after_syntax_identifier_; std::string syntax_identifier_; +#ifdef PROTOBUF_FUTURE_EDITIONS + std::string edition_; +#endif // PROTOBUF_FUTURE_EDITIONS // Leading doc comments for the next declaration. These are not complete // yet; use ConsumeEndOfDeclaration() to get the complete comments. diff --git a/src/google/protobuf/compiler/parser_unittest.cc b/src/google/protobuf/compiler/parser_unittest.cc index 3bb4e53159..24e478bc6d 100644 --- a/src/google/protobuf/compiler/parser_unittest.cc +++ b/src/google/protobuf/compiler/parser_unittest.cc @@ -3915,6 +3915,177 @@ TEST_F(SourceInfoTest, DocCommentsOneof) { // =================================================================== +#ifdef PROTOBUF_FUTURE_EDITIONS +typedef ParserTest ParseEditionsTest; + +TEST_F(ParseEditionsTest, Editions) { + ExpectParsesTo( + R"schema( + edition = "super-cool"; + message A { + int32 b = 1; + })schema", + "message_type \t {" + " name: \"A\"" + " field {" + " name: \"b\"" + " number: 1" + " label: LABEL_OPTIONAL" + " type: TYPE_INT32" + " }" + "}" + "syntax: \"editions\"" + "edition: \"super-cool\"\n"); +} + +TEST_F(ParseEditionsTest, ExtensionsParse) { + ExpectParsesTo( + R"schema( + edition = '2023'; + message Foo { + extensions 100 to 199; + } + extend Foo { string foo = 101; })schema", + "message_type \t {" + " name: \"Foo\"" + " extension_range {" + " start: 100" + " end: 200" + " }" + "}" + "extension {" + " name: \"foo\"" + " extendee: \"Foo\"" + " number: 101" + " label: LABEL_OPTIONAL" + " type: TYPE_STRING" + "}" + "syntax: \"editions\"" + "edition: \"2023\"\n"); +} + +TEST_F(ParseEditionsTest, EmptyEdition) { + ExpectHasEarlyExitErrors( + R"schema( + edition = ""; + message A { + optional int32 b = 1; + })schema", + "1:18: A file's edition must be a nonempty string.\n"); +} + +TEST_F(ParseEditionsTest, SyntaxEditions) { + ExpectHasEarlyExitErrors( + R"schema( + syntax = "editions"; + message A { + optional int32 b = 1; + })schema", + "1:17: Unrecognized syntax identifier \"editions\". This parser only " + "recognizes \"proto2\" and \"proto3\".\n"); +} + +TEST_F(ParseEditionsTest, MixedSyntaxAndEdition) { + ExpectHasErrors( + R"schema( + syntax = "proto2"; + edition = "super-cool"; + message A { + optional int32 b = 1; + })schema", + "2:8: Expected top-level statement (e.g. \"message\").\n"); +} + +TEST_F(ParseEditionsTest, MixedEditionAndSyntax) { + ExpectHasErrors( + R"schema( + edition = "super-cool"; + syntax = "proto2"; + message A { + int32 b = 1; + })schema", + "2:8: Expected top-level statement (e.g. \"message\").\n"); +} + +TEST_F(ParseEditionsTest, OptionalKeywordBanned) { + ExpectHasErrors( + R"schema( + edition = "2023"; + message A { + optional int32 b = 1; + })schema", + "3:10: Label \"optional\" is not supported in editions. By default, all " + "singular fields have presence unless features.field_presence is set.\n"); +} + +TEST_F(ParseEditionsTest, RequiredKeywordBanned) { + ExpectHasErrors( + R"schema( + edition = "2023"; + message A { + required int32 b = 1; + })schema", + "3:10: Label \"required\" is not supported in editions, use " + "features.field_presence = LEGACY_REQUIRED.\n"); +} + +TEST_F(ParseEditionsTest, GroupsBanned) { + ExpectHasErrors( + R"schema( + edition = "2023"; + message TestMessage { + group TestGroup = 1 {}; + })schema", + "3:10: Group syntax is no longer supported in editions. To get group " + "behavior you can specify features.message_encoding = DELIMITED on a " + "message field.\n"); +} + +TEST_F(ParseEditionsTest, ValidationError) { + ExpectHasValidationErrors( + R"schema( + edition = "2023"; + option features.field_presence = IMPLICIT; + option java_package = "blah"; + message TestMessage { + string foo = 1 [default = "hello"]; + })schema", + "5:17: Implicit presence fields can't specify defaults.\n"); +} + +TEST_F(ParseEditionsTest, InvalidMerge) { + ExpectHasValidationErrors( + R"schema( + edition = "2023"; + option features.field_presence = IMPLICIT; + option java_package = "blah"; + message TestMessage { + string foo = 1 [ + default = "hello", + features.field_presence = FIELD_PRESENCE_UNKNOWN, + features.string_field_validation = STRING_FIELD_VALIDATION_UNKNOWN + ]; + })schema", + "5:17: Feature field google.protobuf.FeatureSet.field_presence must resolve to a " + "known value, found FIELD_PRESENCE_UNKNOWN\n"); +} + +TEST_F(ParseEditionsTest, FeaturesWithoutEditions) { + ExpectHasValidationErrors( + R"schema( + syntax = "proto3"; + option features.field_presence = IMPLICIT; + message TestMessage { + string foo = 1 [ + default = "hello", + features.field_presence = EXPLICIT + ]; + })schema", + "1:8: Features are only valid under editions.\n" + "4:17: Features are only valid under editions.\n"); +} + +#endif // PROTOBUF_FUTURE_EDITIONS } // anonymous namespace diff --git a/src/google/protobuf/cpp_features.pb.cc b/src/google/protobuf/cpp_features.pb.cc new file mode 100644 index 0000000000..0bc05b172a --- /dev/null +++ b/src/google/protobuf/cpp_features.pb.cc @@ -0,0 +1,306 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/cpp_features.proto + +#include "google/protobuf/cpp_features.pb.h" + +#include +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/extension_set.h" +#include "google/protobuf/wire_format_lite.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/reflection_ops.h" +#include "google/protobuf/wire_format.h" +#include "google/protobuf/generated_message_tctable_impl.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" +PROTOBUF_PRAGMA_INIT_SEG +namespace _pb = ::google::protobuf; +namespace _pbi = ::google::protobuf::internal; +namespace _fl = ::google::protobuf::internal::field_layout; +namespace pb { + template +PROTOBUF_CONSTEXPR CppFeatures::CppFeatures(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.legacy_closed_enum_)*/ false, + } {} +struct CppFeaturesDefaultTypeInternal { + PROTOBUF_CONSTEXPR CppFeaturesDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~CppFeaturesDefaultTypeInternal() {} + union { + CppFeatures _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_EXPORT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CppFeaturesDefaultTypeInternal _CppFeatures_default_instance_; +} // namespace pb +static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fcpp_5ffeatures_2eproto[1]; +static constexpr const ::_pb::EnumDescriptor** + file_level_enum_descriptors_google_2fprotobuf_2fcpp_5ffeatures_2eproto = nullptr; +static constexpr const ::_pb::ServiceDescriptor** + file_level_service_descriptors_google_2fprotobuf_2fcpp_5ffeatures_2eproto = nullptr; +const ::uint32_t TableStruct_google_2fprotobuf_2fcpp_5ffeatures_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( + protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::pb::CppFeatures, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::pb::CppFeatures, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::pb::CppFeatures, _impl_.legacy_closed_enum_), + 0, +}; + +static const ::_pbi::MigrationSchema + schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + {0, 9, -1, sizeof(::pb::CppFeatures)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::pb::_CppFeatures_default_instance_._instance, +}; +const char descriptor_table_protodef_google_2fprotobuf_2fcpp_5ffeatures_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + "\n\"google/protobuf/cpp_features.proto\022\002pb" + "\032 google/protobuf/descriptor.proto\"D\n\013Cp" + "pFeatures\0225\n\022legacy_closed_enum\030\001 \001(\010B\031\210" + "\001\001\230\001\004\230\001\001\242\001\r\n\0042023\022\005false::\n\003cpp\022\033.google" + ".protobuf.FeatureSet\030\350\007 \001(\0132\017.pb.CppFeat" + "ures" +}; +static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_deps[1] = + { + &::descriptor_table_google_2fprotobuf_2fdescriptor_2eproto, +}; +static ::absl::once_flag descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto = { + false, + false, + 204, + descriptor_table_protodef_google_2fprotobuf_2fcpp_5ffeatures_2eproto, + "google/protobuf/cpp_features.proto", + &descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_once, + descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_deps, + 1, + 1, + schemas, + file_default_instances, + TableStruct_google_2fprotobuf_2fcpp_5ffeatures_2eproto::offsets, + file_level_metadata_google_2fprotobuf_2fcpp_5ffeatures_2eproto, + file_level_enum_descriptors_google_2fprotobuf_2fcpp_5ffeatures_2eproto, + file_level_service_descriptors_google_2fprotobuf_2fcpp_5ffeatures_2eproto, +}; + +// This function exists to be marked as weak. +// It can significantly speed up compilation by breaking up LLVM's SCC +// in the .pb.cc translation units. Large translation units see a +// reduction of more than 35% of walltime for optimized builds. Without +// the weak attribute all the messages in the file, including all the +// vtables and everything they use become part of the same SCC through +// a cycle like: +// GetMetadata -> descriptor table -> default instances -> +// vtables -> GetMetadata +// By adding a weak function here we break the connection from the +// individual vtables back into the descriptor table. +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_getter() { + return &descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto; +} +namespace pb { +// =================================================================== + +class CppFeatures::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(CppFeatures, _impl_._has_bits_); + static void set_has_legacy_closed_enum(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +CppFeatures::CppFeatures(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:pb.CppFeatures) +} +CppFeatures::CppFeatures(const CppFeatures& from) + : ::google::protobuf::Message(), _impl_(from._impl_) { + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:pb.CppFeatures) +} +inline void CppFeatures::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.legacy_closed_enum_){false}, + }; +} +CppFeatures::~CppFeatures() { + // @@protoc_insertion_point(destructor:pb.CppFeatures) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void CppFeatures::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); +} +void CppFeatures::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void CppFeatures::Clear() { +// @@protoc_insertion_point(message_clear_start:pb.CppFeatures) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.legacy_closed_enum_ = false; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* CppFeatures::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 1, 0, 0, 2> CppFeatures::_table_ = { + { + PROTOBUF_FIELD_OFFSET(CppFeatures, _impl_._has_bits_), + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967294, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_CppFeatures_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {::_pbi::TcParser::SingularVarintNoZag1(), + {8, 0, 0, PROTOBUF_FIELD_OFFSET(CppFeatures, _impl_.legacy_closed_enum_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {PROTOBUF_FIELD_OFFSET(CppFeatures, _impl_.legacy_closed_enum_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + }}, + // no aux_entries + {{ + }}, +}; + +::uint8_t* CppFeatures::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:pb.CppFeatures) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000001u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 1, this->_internal_legacy_closed_enum(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:pb.CppFeatures) + return target; +} + +::size_t CppFeatures::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:pb.CppFeatures) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 2; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData CppFeatures::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + CppFeatures::MergeImpl +}; +const ::google::protobuf::Message::ClassData*CppFeatures::GetClassData() const { return &_class_data_; } + + +void CppFeatures::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:pb.CppFeatures) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_set_legacy_closed_enum(from._internal_legacy_closed_enum()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void CppFeatures::CopyFrom(const CppFeatures& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:pb.CppFeatures) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool CppFeatures::IsInitialized() const { + return true; +} + +void CppFeatures::InternalSwap(CppFeatures* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + swap(_impl_.legacy_closed_enum_, other->_impl_.legacy_closed_enum_); +} + +::google::protobuf::Metadata CppFeatures::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_getter, &descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_once, + file_level_metadata_google_2fprotobuf_2fcpp_5ffeatures_2eproto[0]); +} +PROTOBUF_CONSTINIT PROTOBUF_EXPORT PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 +::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FeatureSet, + ::google::protobuf::internal::MessageTypeTraits< ::pb::CppFeatures >, 11, false> + cpp(kCppFieldNumber); +// @@protoc_insertion_point(namespace_scope) +} // namespace pb +namespace google { +namespace protobuf { +template<> PROTOBUF_NOINLINE ::pb::CppFeatures* +Arena::CreateMaybeMessage< ::pb::CppFeatures >(Arena* arena) { + return Arena::CreateMessageInternal< ::pb::CppFeatures >(arena); +} +} // namespace protobuf +} // namespace google +// @@protoc_insertion_point(global_scope) +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/cpp_features.pb.h b/src/google/protobuf/cpp_features.pb.h new file mode 100644 index 0000000000..37b61e6c14 --- /dev/null +++ b/src/google/protobuf/cpp_features.pb.h @@ -0,0 +1,295 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/cpp_features.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh +#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh + +#include +#include +#include + +#include "google/protobuf/port_def.inc" +#if PROTOBUF_VERSION < 4023000 +#error "This file was generated by a newer version of protoc which is" +#error "incompatible with your Protocol Buffer headers. Please update" +#error "your headers." +#endif // PROTOBUF_VERSION + +#if 4023000 < PROTOBUF_MIN_PROTOC_VERSION +#error "This file was generated by an older version of protoc which is" +#error "incompatible with your Protocol Buffer headers. Please" +#error "regenerate this file with a newer version of protoc." +#endif // PROTOBUF_MIN_PROTOC_VERSION +#include "google/protobuf/port_undef.inc" +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/arena.h" +#include "google/protobuf/arenastring.h" +#include "google/protobuf/generated_message_tctable_decl.h" +#include "google/protobuf/generated_message_util.h" +#include "google/protobuf/metadata_lite.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/message.h" +#include "google/protobuf/repeated_field.h" // IWYU pragma: export +#include "google/protobuf/extension_set.h" // IWYU pragma: export +#include "google/protobuf/unknown_field_set.h" +#include "google/protobuf/descriptor.pb.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" + +#define PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fcpp_5ffeatures_2eproto PROTOBUF_EXPORT + +namespace google { +namespace protobuf { +namespace internal { +class AnyMetadata; +} // namespace internal +} // namespace protobuf +} // namespace google + +// Internal implementation detail -- do not use these members. +struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fcpp_5ffeatures_2eproto { + static const ::uint32_t offsets[]; +}; +PROTOBUF_EXPORT extern const ::google::protobuf::internal::DescriptorTable + descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto; +namespace pb { +class CppFeatures; +struct CppFeaturesDefaultTypeInternal; +PROTOBUF_EXPORT extern CppFeaturesDefaultTypeInternal _CppFeatures_default_instance_; +} // namespace pb +namespace google { +namespace protobuf { +template <> +PROTOBUF_EXPORT ::pb::CppFeatures* Arena::CreateMaybeMessage<::pb::CppFeatures>(Arena*); +} // namespace protobuf +} // namespace google + +namespace pb { + +// =================================================================== + + +// ------------------------------------------------------------------- + +class PROTOBUF_EXPORT CppFeatures final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.CppFeatures) */ { + public: + inline CppFeatures() : CppFeatures(nullptr) {} + ~CppFeatures() override; + template + explicit PROTOBUF_CONSTEXPR CppFeatures(::google::protobuf::internal::ConstantInitialized); + + CppFeatures(const CppFeatures& from); + CppFeatures(CppFeatures&& from) noexcept + : CppFeatures() { + *this = ::std::move(from); + } + + inline CppFeatures& operator=(const CppFeatures& from) { + CopyFrom(from); + return *this; + } + inline CppFeatures& operator=(CppFeatures&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const CppFeatures& default_instance() { + return *internal_default_instance(); + } + static inline const CppFeatures* internal_default_instance() { + return reinterpret_cast( + &_CppFeatures_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(CppFeatures& a, CppFeatures& b) { + a.Swap(&b); + } + inline void Swap(CppFeatures* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(CppFeatures* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + CppFeatures* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const CppFeatures& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const CppFeatures& from) { + CppFeatures::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CppFeatures* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "pb.CppFeatures"; + } + protected: + explicit CppFeatures(::google::protobuf::Arena* arena); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kLegacyClosedEnumFieldNumber = 1, + }; + // optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + bool has_legacy_closed_enum() const; + void clear_legacy_closed_enum() ; + bool legacy_closed_enum() const; + void set_legacy_closed_enum(bool value); + + private: + bool _internal_legacy_closed_enum() const; + void _internal_set_legacy_closed_enum(bool value); + + public: + // @@protoc_insertion_point(class_scope:pb.CppFeatures) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, 0, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + bool legacy_closed_enum_; + PROTOBUF_TSAN_DECLARE_MEMBER; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_google_2fprotobuf_2fcpp_5ffeatures_2eproto; +}; + +// =================================================================== + + + +static const int kCppFieldNumber = 1000; +PROTOBUF_EXPORT extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FeatureSet, + ::google::protobuf::internal::MessageTypeTraits< ::pb::CppFeatures >, 11, false > + cpp; + +// =================================================================== + + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// CppFeatures + +// optional bool legacy_closed_enum = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { +inline bool CppFeatures::has_legacy_closed_enum() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void CppFeatures::clear_legacy_closed_enum() { + _impl_.legacy_closed_enum_ = false; + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline bool CppFeatures::legacy_closed_enum() const { + // @@protoc_insertion_point(field_get:pb.CppFeatures.legacy_closed_enum) + return _internal_legacy_closed_enum(); +} +inline void CppFeatures::set_legacy_closed_enum(bool value) { + _internal_set_legacy_closed_enum(value); + // @@protoc_insertion_point(field_set:pb.CppFeatures.legacy_closed_enum) +} +inline bool CppFeatures::_internal_legacy_closed_enum() const { + PROTOBUF_TSAN_READ_PRIMITIVE(&_impl_._tsan_detect_race); + return _impl_.legacy_closed_enum_; +} +inline void CppFeatures::_internal_set_legacy_closed_enum(bool value) { + PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.legacy_closed_enum_ = value; +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) +} // namespace pb + + +// @@protoc_insertion_point(global_scope) + +#include "google/protobuf/port_undef.inc" + +#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh diff --git a/src/google/protobuf/cpp_features.proto b/src/google/protobuf/cpp_features.proto new file mode 100644 index 0000000000..ee0977b842 --- /dev/null +++ b/src/google/protobuf/cpp_features.proto @@ -0,0 +1,52 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 pb; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.FeatureSet { + optional CppFeatures cpp = 1000; +} + +message CppFeatures { + // Whether or not to treat an enum field as closed. This option is only + // applicable to enum fields, and will be removed in the future. It is + // consistent with the legacy behavior of using proto3 enum types for proto2 + // fields. + optional bool legacy_closed_enum = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: "2023", value: "false" } + ]; +} diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 641ef31201..a5d9faedde 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -76,6 +76,10 @@ #include "google/protobuf/descriptor_legacy.h" #include "google/protobuf/descriptor_visitor.h" #include "google/protobuf/dynamic_message.h" +#ifdef PROTOBUF_FUTURE_EDITIONS +#include "google/protobuf/cpp_features.pb.h" +#include "google/protobuf/feature_resolver.h" +#endif // PROTOBUF_FUTURE_EDITIONS #include "google/protobuf/generated_message_util.h" #include "google/protobuf/io/strtod.h" #include "google/protobuf/io/tokenizer.h" @@ -834,6 +838,10 @@ const char* FileDescriptor::SyntaxName(FileDescriptor::Syntax syntax) { return "proto2"; case SYNTAX_PROTO3: return "proto3"; +#ifdef PROTOBUF_FUTURE_EDITIONS + case SYNTAX_EDITIONS: + return "editions"; +#endif // !PROTOBUF_FUTURE_EDITIONS case SYNTAX_UNKNOWN: return "unknown"; } @@ -1106,6 +1114,140 @@ bool AllowedExtendeeInProto3(const std::string& name) { allowed_proto3_extendees->end(); } +#ifdef PROTOBUF_FUTURE_EDITIONS + +// Create global defaults for proto2/proto3 compatibility. +FeatureSet* CreateProto2DefaultFeatures() { + FeatureSet* features = new FeatureSet(); + features->set_field_presence(FeatureSet::EXPLICIT); + features->set_enum_type(FeatureSet::CLOSED); + features->set_repeated_field_encoding(FeatureSet::EXPANDED); + features->set_string_field_validation(FeatureSet::HINT); + features->set_message_encoding(FeatureSet::LENGTH_PREFIXED); + features->set_json_format(FeatureSet::LEGACY_BEST_EFFORT); + features->MutableExtension(pb::cpp)->set_legacy_closed_enum(true); + + return features; +} + +const FeatureSet& GetProto2Features() { + static const FeatureSet* kProto2Features = CreateProto2DefaultFeatures(); + return *kProto2Features; +} + +const FeatureSet& GetProto2GroupFeatures() { + static const FeatureSet* kProto2GroupFeatures = [] { + FeatureSet* features = CreateProto2DefaultFeatures(); + features->set_message_encoding(FeatureSet::DELIMITED); + return features; + }(); + return *kProto2GroupFeatures; +} + +const FeatureSet& GetProto3Features() { + static const FeatureSet* kProto3Features = [] { + FeatureSet* features = new FeatureSet(); + features->set_field_presence(FeatureSet::IMPLICIT); + features->set_enum_type(FeatureSet::OPEN); + features->set_repeated_field_encoding(FeatureSet::PACKED); + features->set_string_field_validation(FeatureSet::MANDATORY); + features->set_message_encoding(FeatureSet::LENGTH_PREFIXED); + features->set_json_format(FeatureSet::ALLOW); + return features; + }(); + return *kProto3Features; +} + +bool IsLegacyFeatureSet(const FeatureSet& features) { + return &features == &GetProto2Features() || + &features == &GetProto2GroupFeatures() || + &features == &GetProto3Features(); +} + +template +void RestoreFeaturesToOptions(const FeatureSet* features, ProtoT* proto) { + if (features != &FeatureSet::default_instance()) { + *proto->mutable_options()->mutable_features() = *features; + } +} + +template +bool HasFeatures(const OptionsT& options) { + if (options.has_features()) return true; + + for (const auto& opt : options.uninterpreted_option()) { + if (opt.name_size() > 0 && opt.name(0).name_part() == "features" && + !opt.name(0).is_extension()) { + return true; + } + } + return false; +} + +const FeatureSet& GetParentFeatures(const FileDescriptor* file) { + if (FileDescriptorLegacy(file).syntax() == + FileDescriptorLegacy::SYNTAX_PROTO3) { + return GetProto3Features(); + } + if (FileDescriptorLegacy(file).syntax() == + FileDescriptorLegacy::SYNTAX_PROTO2) { + return GetProto2Features(); + } + return FeatureSet::default_instance(); +} + +const FeatureSet& GetParentFeatures(const Descriptor* message) { + if (message->containing_type() == nullptr) { + return internal::InternalFeatureHelper::GetFeatures(*message->file()); + } + return internal::InternalFeatureHelper::GetFeatures( + *message->containing_type()); +} + +const FeatureSet& GetParentFeatures(const OneofDescriptor* oneof) { + return internal::InternalFeatureHelper::GetFeatures( + *oneof->containing_type()); +} + +const FeatureSet& GetParentFeatures(const Descriptor::ExtensionRange* range) { + return internal::InternalFeatureHelper::GetFeatures( + *range->containing_type()); +} + +const FeatureSet& GetParentFeatures(const FieldDescriptor* field) { + if (field->containing_oneof() != nullptr) { + return internal::InternalFeatureHelper::GetFeatures( + *field->containing_oneof()); + } else if (field->is_extension()) { + if (field->extension_scope() == nullptr) { + return internal::InternalFeatureHelper::GetFeatures(*field->file()); + } + return internal::InternalFeatureHelper::GetFeatures( + *field->extension_scope()); + } + return internal::InternalFeatureHelper::GetFeatures( + *field->containing_type()); +} + +const FeatureSet& GetParentFeatures(const EnumDescriptor* enm) { + if (enm->containing_type() == nullptr) { + return internal::InternalFeatureHelper::GetFeatures(*enm->file()); + } + return internal::InternalFeatureHelper::GetFeatures(*enm->containing_type()); +} + +const FeatureSet& GetParentFeatures(const EnumValueDescriptor* value) { + return internal::InternalFeatureHelper::GetFeatures(*value->type()); +} + +const FeatureSet& GetParentFeatures(const ServiceDescriptor* service) { + return internal::InternalFeatureHelper::GetFeatures(*service->file()); +} + +const FeatureSet& GetParentFeatures(const MethodDescriptor* method) { + return internal::InternalFeatureHelper::GetFeatures(*method->service()); +} +#endif // PROTOBUF_FUTURE_EDITIONS } // anonymous namespace // Contains tables specific to a particular file. These tables are not @@ -1222,6 +1364,9 @@ class FlatAllocator : public decltype(ApplyTypeList( SortByAlignmentmutable_options() = *options_; } +#ifdef PROTOBUF_FUTURE_EDITIONS + RestoreFeaturesToOptions(proto_features_, proto); +#endif // PROTOBUF_FUTURE_EDITIONS } const Descriptor::ExtensionRange* @@ -2642,13 +2797,24 @@ void FileDescriptor::CopyHeadingTo(FileDescriptorProto* proto) const { // TODO(liujisi): Also populate when syntax="proto2". FileDescriptorLegacy::Syntax syntax = FileDescriptorLegacy(this).syntax(); if (syntax == FileDescriptorLegacy::Syntax::SYNTAX_PROTO3 +#ifdef PROTOBUF_FUTURE_EDITIONS + || syntax == FileDescriptorLegacy::Syntax::SYNTAX_EDITIONS +#endif // !PROTOBUF_FUTURE_EDITIONS ) { proto->set_syntax(FileDescriptorLegacy::SyntaxName(syntax)); } +#ifdef PROTOBUF_FUTURE_EDITIONS + if (syntax == FileDescriptorLegacy::Syntax::SYNTAX_EDITIONS) { + proto->set_edition(edition()); + } +#endif // !PROTOBUF_FUTURE_EDITIONS if (&options() != &FileOptions::default_instance()) { *proto->mutable_options() = options(); } +#ifdef PROTOBUF_FUTURE_EDITIONS + RestoreFeaturesToOptions(proto_features_, proto); +#endif // PROTOBUF_FUTURE_EDITIONS } void FileDescriptor::CopyJsonNameTo(FileDescriptorProto* proto) const { @@ -2706,6 +2872,9 @@ void Descriptor::CopyTo(DescriptorProto* proto) const { proto->mutable_options()->CopyFrom(options()); } +#ifdef PROTOBUF_FUTURE_EDITIONS + RestoreFeaturesToOptions(proto_features_, proto); +#endif // PROTOBUF_FUTURE_EDITIONS } void Descriptor::CopyJsonNameTo(DescriptorProto* proto) const { @@ -2737,10 +2906,34 @@ void FieldDescriptor::CopyTo(FieldDescriptorProto* proto) const { } // Some compilers do not allow static_cast directly between two enum types, // so we must cast to int first. +#ifdef PROTOBUF_FUTURE_EDITIONS + if (is_required() && FileDescriptorLegacy(file()).syntax() == + FileDescriptorLegacy::Syntax::SYNTAX_EDITIONS) { + // Editions files have no required keyword, and we only set this label + // during descriptor build. + proto->set_label(static_cast( + absl::implicit_cast(LABEL_OPTIONAL))); + } else { + proto->set_label(static_cast( + absl::implicit_cast(label()))); + } + if (type() == TYPE_GROUP && + FileDescriptorLegacy(file()).syntax() == + FileDescriptorLegacy::Syntax::SYNTAX_EDITIONS) { + // Editions files have no group keyword, and we only set this label + // during descriptor build. + proto->set_type(static_cast( + absl::implicit_cast(TYPE_MESSAGE))); + } else { + proto->set_type(static_cast( + absl::implicit_cast(type()))); + } +#else // PROTOBUF_FUTURE_EDITIONS proto->set_label(static_cast( absl::implicit_cast(label()))); proto->set_type(static_cast( absl::implicit_cast(type()))); +#endif // PROTOBUF_FUTURE_EDITIONS if (is_extension()) { if (!containing_type()->is_unqualified_placeholder_) { @@ -2779,6 +2972,9 @@ void FieldDescriptor::CopyTo(FieldDescriptorProto* proto) const { proto->mutable_options()->CopyFrom(options()); } +#ifdef PROTOBUF_FUTURE_EDITIONS + RestoreFeaturesToOptions(proto_features_, proto); +#endif // PROTOBUF_FUTURE_EDITIONS } void FieldDescriptor::CopyJsonNameTo(FieldDescriptorProto* proto) const { @@ -2790,6 +2986,9 @@ void OneofDescriptor::CopyTo(OneofDescriptorProto* proto) const { if (&options() != &OneofOptions::default_instance()) { proto->mutable_options()->CopyFrom(options()); } +#ifdef PROTOBUF_FUTURE_EDITIONS + RestoreFeaturesToOptions(proto_features_, proto); +#endif // PROTOBUF_FUTURE_EDITIONS } void EnumDescriptor::CopyTo(EnumDescriptorProto* proto) const { @@ -2810,6 +3009,9 @@ void EnumDescriptor::CopyTo(EnumDescriptorProto* proto) const { if (&options() != &EnumOptions::default_instance()) { proto->mutable_options()->CopyFrom(options()); } +#ifdef PROTOBUF_FUTURE_EDITIONS + RestoreFeaturesToOptions(proto_features_, proto); +#endif // PROTOBUF_FUTURE_EDITIONS } void EnumValueDescriptor::CopyTo(EnumValueDescriptorProto* proto) const { @@ -2819,6 +3021,9 @@ void EnumValueDescriptor::CopyTo(EnumValueDescriptorProto* proto) const { if (&options() != &EnumValueOptions::default_instance()) { proto->mutable_options()->CopyFrom(options()); } +#ifdef PROTOBUF_FUTURE_EDITIONS + RestoreFeaturesToOptions(proto_features_, proto); +#endif // PROTOBUF_FUTURE_EDITIONS } void ServiceDescriptor::CopyTo(ServiceDescriptorProto* proto) const { @@ -2831,6 +3036,9 @@ void ServiceDescriptor::CopyTo(ServiceDescriptorProto* proto) const { if (&options() != &ServiceOptions::default_instance()) { proto->mutable_options()->CopyFrom(options()); } +#ifdef PROTOBUF_FUTURE_EDITIONS + RestoreFeaturesToOptions(proto_features_, proto); +#endif // PROTOBUF_FUTURE_EDITIONS } void MethodDescriptor::CopyTo(MethodDescriptorProto* proto) const { @@ -2856,6 +3064,9 @@ void MethodDescriptor::CopyTo(MethodDescriptorProto* proto) const { if (server_streaming_) { proto->set_server_streaming(true); } +#ifdef PROTOBUF_FUTURE_EDITIONS + RestoreFeaturesToOptions(proto_features_, proto); +#endif // PROTOBUF_FUTURE_EDITIONS } // DebugString methods =============================================== @@ -2863,9 +3074,23 @@ void MethodDescriptor::CopyTo(MethodDescriptorProto* proto) const { namespace { bool IsGroupSyntax(const FieldDescriptor* desc) { +#ifdef PROTOBUF_FUTURE_EDITIONS + if (FileDescriptorLegacy(desc->file()).syntax() == + FileDescriptorLegacy::SYNTAX_EDITIONS) { + return false; + } +#endif // PROTOBUF_FUTURE_EDITIONS return desc->type() == FieldDescriptor::TYPE_GROUP; } +#ifdef PROTOBUF_FUTURE_EDITIONS +template +void CopyFeaturesToOptions(const FeatureSet* features, OptionsT* options) { + if (features != &FeatureSet::default_instance()) { + *options->mutable_features() = *features; + } +} +#endif // PROTOBUF_FUTURE_EDITIONS bool RetrieveOptionsAssumingRightPool( int depth, const Message& options, @@ -3047,6 +3272,12 @@ std::string FileDescriptor::DebugStringWithOptions( SourceLocationCommentPrinter syntax_comment(this, path, "", debug_string_options); syntax_comment.AddPreComment(&contents); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (FileDescriptorLegacy(this).syntax() == + FileDescriptorLegacy::SYNTAX_EDITIONS) { + absl::SubstituteAndAppend(&contents, "edition = \"$0\";\n\n", edition()); + } else // NOLINT(readability/braces) +#endif // PROTOBUF_FUTURE_EDITIONS { absl::SubstituteAndAppend(&contents, "syntax = \"$0\";\n\n", FileDescriptorLegacy::SyntaxName( @@ -3087,6 +3318,9 @@ std::string FileDescriptor::DebugStringWithOptions( } FileOptions full_options = options(); +#ifdef PROTOBUF_FUTURE_EDITIONS + CopyFeaturesToOptions(proto_features_, &full_options); +#endif // PROTOBUF_FUTURE_EDITIONS if (FormatLineOptions(0, full_options, pool(), &contents)) { contents.append("\n"); // add some space if we had options } @@ -3167,6 +3401,9 @@ void Descriptor::DebugString(int depth, std::string* contents, contents->append(" {\n"); MessageOptions full_options = options(); +#ifdef PROTOBUF_FUTURE_EDITIONS + CopyFeaturesToOptions(proto_features_, &full_options); +#endif // PROTOBUF_FUTURE_EDITIONS FormatLineOptions(depth, full_options, file()->pool(), contents); // Find all the 'group' types for fields and extensions; we will not output @@ -3212,6 +3449,9 @@ void Descriptor::DebugString(int depth, std::string* contents, extension_range(i)->end_number() - 1); } ExtensionRangeOptions range_options = extension_range(i)->options(); +#ifdef PROTOBUF_FUTURE_EDITIONS + CopyFeaturesToOptions(extension_range(i)->proto_features_, &range_options); +#endif // PROTOBUF_FUTURE_EDITIONS std::string formatted_options; if (FormatBracketedOptions(depth, range_options, file()->pool(), &formatted_options)) { @@ -3323,6 +3563,14 @@ void FieldDescriptor::DebugString( (is_optional() && !FieldDescriptorLegacy(this).has_optional_keyword())) { label.clear(); } +#ifdef PROTOBUF_FUTURE_EDITIONS + // Label is omitted for optional and required fields under editions. + if ((is_optional() || is_required()) && + FileDescriptorLegacy(file()).syntax() == + FileDescriptorLegacy::SYNTAX_EDITIONS) { + label.clear(); + } +#endif // PROTOBUF_FUTURE_EDITIONS SourceLocationCommentPrinter comment_printer(this, prefix, debug_string_options); @@ -3351,6 +3599,9 @@ void FieldDescriptor::DebugString( } FieldOptions full_options = options(); +#ifdef PROTOBUF_FUTURE_EDITIONS + CopyFeaturesToOptions(proto_features_, &full_options); +#endif // PROTOBUF_FUTURE_EDITIONS std::string formatted_options; if (FormatBracketedOptions(depth, full_options, file()->pool(), &formatted_options)) { @@ -3400,6 +3651,9 @@ void OneofDescriptor::DebugString( absl::SubstituteAndAppend(contents, "$0oneof $1 {", prefix, name()); OneofOptions full_options = options(); +#ifdef PROTOBUF_FUTURE_EDITIONS + CopyFeaturesToOptions(proto_features_, &full_options); +#endif // PROTOBUF_FUTURE_EDITIONS FormatLineOptions(depth, full_options, containing_type()->file()->pool(), contents); @@ -3440,6 +3694,9 @@ void EnumDescriptor::DebugString( absl::SubstituteAndAppend(contents, "$0enum $1 {\n", prefix, name()); EnumOptions full_options = options(); +#ifdef PROTOBUF_FUTURE_EDITIONS + CopyFeaturesToOptions(proto_features_, &full_options); +#endif // PROTOBUF_FUTURE_EDITIONS FormatLineOptions(depth, full_options, file()->pool(), contents); for (int i = 0; i < value_count(); i++) { @@ -3500,6 +3757,9 @@ void EnumValueDescriptor::DebugString( absl::SubstituteAndAppend(contents, "$0$1 = $2", prefix, name(), number()); EnumValueOptions full_options = options(); +#ifdef PROTOBUF_FUTURE_EDITIONS + CopyFeaturesToOptions(proto_features_, &full_options); +#endif // PROTOBUF_FUTURE_EDITIONS std::string formatted_options; if (FormatBracketedOptions(depth, full_options, type()->file()->pool(), &formatted_options)) { @@ -3532,6 +3792,9 @@ void ServiceDescriptor::DebugString( absl::SubstituteAndAppend(contents, "service $0 {\n", name()); ServiceOptions full_options = options(); +#ifdef PROTOBUF_FUTURE_EDITIONS + CopyFeaturesToOptions(proto_features_, &full_options); +#endif // PROTOBUF_FUTURE_EDITIONS FormatLineOptions(1, full_options, file()->pool(), contents); for (int i = 0; i < method_count(); i++) { @@ -3571,6 +3834,9 @@ void MethodDescriptor::DebugString( client_streaming() ? "stream " : "", server_streaming() ? "stream " : ""); MethodOptions full_options = options(); +#ifdef PROTOBUF_FUTURE_EDITIONS + CopyFeaturesToOptions(proto_features_, &full_options); +#endif // PROTOBUF_FUTURE_EDITIONS std::string formatted_options; if (FormatLineOptions(depth, full_options, service()->file()->pool(), &formatted_options)) { @@ -3586,15 +3852,23 @@ void MethodDescriptor::DebugString( // Feature methods =============================================== bool EnumDescriptor::is_closed() const { +#ifdef PROTOBUF_FUTURE_EDITIONS + return features().enum_type() == FeatureSet::CLOSED; +#else // PROTOBUF_FUTURE_EDITIONS PROTOBUF_IGNORE_DEPRECATION_START return file()->syntax() != FileDescriptor::SYNTAX_PROTO3; PROTOBUF_IGNORE_DEPRECATION_STOP +#endif // PROTOBUF_FUTURE_EDITIONS } bool FieldDescriptor::is_packed() const { if (!is_packable()) return false; +#ifdef PROTOBUF_FUTURE_EDITIONS + if (features().repeated_field_encoding() != FeatureSet::PACKED) { +#else // PROTOBUF_FUTURE_EDITIONS if (FileDescriptorLegacy(file_).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO2) { +#endif // PROTOBUF_FUTURE_EDITIONS return (options_ != nullptr) && options_->packed(); } else { return options_ == nullptr || !options_->has_packed() || options_->packed(); @@ -3603,8 +3877,13 @@ bool FieldDescriptor::is_packed() const { static bool FieldEnforceUtf8(const FieldDescriptor* field) { return +#ifdef PROTOBUF_FUTURE_EDITIONS + internal::InternalFeatureHelper::GetFeatures(*field) + .string_field_validation() == FeatureSet::MANDATORY; +#else // PROTOBUF_FUTURE_EDITIONS FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO3; +#endif // PROTOBUF_FUTURE_EDITIONS } bool FieldDescriptor::requires_utf8_validation() const { @@ -3614,15 +3893,25 @@ bool FieldDescriptor::requires_utf8_validation() const { bool FieldDescriptor::has_presence() const { if (is_repeated()) return false; return cpp_type() == CPPTYPE_MESSAGE || containing_oneof() || +#ifdef PROTOBUF_FUTURE_EDITIONS + features().field_presence() != FeatureSet::IMPLICIT; +#else // PROTOBUF_FUTURE_EDITIONS FileDescriptorLegacy(file_).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO2; +#endif // PROTOBUF_FUTURE_EDITIONS } bool FieldDescriptor::legacy_enum_field_treated_as_closed() const { +#ifdef PROTOBUF_FUTURE_EDITIONS + return type() == TYPE_ENUM && + (features().GetExtension(pb::cpp).legacy_closed_enum() || + enum_type()->is_closed()); +#else // PROTOBUF_FUTURE_EDITIONS return type() == TYPE_ENUM && (FileDescriptorLegacy(file_).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO2 || enum_type()->is_closed()); +#endif // PROTOBUF_FUTURE_EDITIONS } // Location methods =============================================== @@ -3823,6 +4112,9 @@ class DescriptorBuilder { DescriptorPool::Tables* tables_; // for convenience DescriptorPool::ErrorCollector* error_collector_; +#ifdef PROTOBUF_FUTURE_EDITIONS + absl::optional feature_resolver_ = absl::nullopt; +#endif // PROTOBUF_FUTURE_EDITIONS // As we build descriptors we store copies of the options messages in // them. We put pointers to those copies in this vector, as we build, so we @@ -4017,6 +4309,37 @@ class DescriptorBuilder { absl::Span options_path, absl::string_view option_name, internal::FlatAllocator& alloc); +#ifdef PROTOBUF_FUTURE_EDITIONS + // Allocates and resolves any feature sets that need to be owned by a given + // descriptor. This also strips features out of the mutable options message to + // prevent leaking of unresolved features. + // Note: This must be used during a pre-order traversal of the + // descriptor tree, so that each descriptor's parent has a fully resolved + // feature set already. + template + void ResolveFeatures(const typename DescriptorT::Proto& proto, + DescriptorT* descriptor, + typename DescriptorT::OptionsType* options, + internal::FlatAllocator& alloc); + void ResolveFeatures(const FileDescriptorProto& proto, + FileDescriptor* descriptor, FileOptions* options, + internal::FlatAllocator& alloc); + template + void ResolveFeaturesImpl( + const typename DescriptorT::Proto& proto, DescriptorT* descriptor, + typename DescriptorT::OptionsType* options, + internal::FlatAllocator& alloc, + DescriptorPool::ErrorCollector::ErrorLocation error_location, + bool force_merge = false); + + // Performs descriptor-specific overrides of proto2/proto3 defaults for + // descriptors outside editions. + template + const FeatureSet* GetLegacyFeatureOverride(const FeatureSet* parent_features, + const DescriptorT* descriptor); + + void PostProcessFieldFeatures(FieldDescriptor& field); +#endif // PROTOBUF_FUTURE_EDITIONS // Allocates an array of two strings, the first one is a copy of // `proto_name`, and the second one is the full name. Full proto name is @@ -4124,6 +4447,13 @@ class DescriptorBuilder { // Otherwise returns true. bool InterpretOptions(OptionsToInterpret* options_to_interpret); +#ifdef PROTOBUF_FUTURE_EDITIONS + // Interprets the uninterpreted feature options in the specified Options + // message. On error, calls AddError() on the underlying builder and returns + // false. Otherwise returns true. + bool InterpretFeatures(OptionsToInterpret* options_to_interpret); + +#endif // PROTOBUF_FUTURE_EDITIONS // Updates the given source code info by re-writing uninterpreted option // locations to refer to the corresponding interpreted option. void UpdateSourceCodeInfo(SourceCodeInfo* info); @@ -4369,6 +4699,14 @@ DescriptorBuilder::DescriptorBuilder( had_errors_(false), possible_undeclared_dependency_(nullptr), undefine_resolved_name_("") { +#ifdef PROTOBUF_FUTURE_EDITIONS + // Ensure that any lazily loaded static initializers from the generated pool + // (e.g. from bootstrapped protos) are run before building any descriptors. We + // have to avoid registering these pre-main, because we need to ensure that + // the linker --gc-sections step can strip out the full runtime if it is + // unused. + pb::cpp.LazyRegister(); +#endif // PROTOBUF_FUTURE_EDITIONS } DescriptorBuilder::~DescriptorBuilder() {} @@ -4720,6 +5058,10 @@ Symbol DescriptorPool::NewPlaceholderWithMutexHeld( alloc.AllocateStrings(placeholder_name, placeholder_full_name); placeholder_enum->file_ = placeholder_file; placeholder_enum->options_ = &EnumOptions::default_instance(); +#ifdef PROTOBUF_FUTURE_EDITIONS + placeholder_enum->proto_features_ = &FeatureSet::default_instance(); + placeholder_enum->merged_features_ = &FeatureSet::default_instance(); +#endif // PROTOBUF_FUTURE_EDITIONS placeholder_enum->is_placeholder_ = true; placeholder_enum->is_unqualified_placeholder_ = (name[0] != '.'); @@ -4757,6 +5099,10 @@ Symbol DescriptorPool::NewPlaceholderWithMutexHeld( alloc.AllocateStrings(placeholder_name, placeholder_full_name); placeholder_message->file_ = placeholder_file; placeholder_message->options_ = &MessageOptions::default_instance(); +#ifdef PROTOBUF_FUTURE_EDITIONS + placeholder_message->proto_features_ = &FeatureSet::default_instance(); + placeholder_message->merged_features_ = &FeatureSet::default_instance(); +#endif // PROTOBUF_FUTURE_EDITIONS placeholder_message->is_placeholder_ = true; placeholder_message->is_unqualified_placeholder_ = (name[0] != '.'); @@ -4769,6 +5115,12 @@ Symbol DescriptorPool::NewPlaceholderWithMutexHeld( placeholder_message->extension_ranges_[0].end_ = FieldDescriptor::kMaxNumber + 1; placeholder_message->extension_ranges_[0].options_ = nullptr; +#ifdef PROTOBUF_FUTURE_EDITIONS + placeholder_message->extension_ranges_[0].proto_features_ = + &FeatureSet::default_instance(); + placeholder_message->extension_ranges_[0].merged_features_ = + &FeatureSet::default_instance(); +#endif // PROTOBUF_FUTURE_EDITIONS } return Symbol(placeholder_message); @@ -4798,6 +5150,10 @@ FileDescriptor* DescriptorPool::NewPlaceholderFileWithMutexHeld( placeholder->package_ = &internal::GetEmptyString(); placeholder->pool_ = this; placeholder->options_ = &FileOptions::default_instance(); +#ifdef PROTOBUF_FUTURE_EDITIONS + placeholder->proto_features_ = &FeatureSet::default_instance(); + placeholder->merged_features_ = &FeatureSet::default_instance(); +#endif // PROTOBUF_FUTURE_EDITIONS placeholder->tables_ = &FileDescriptorTables::GetEmptyInstance(); placeholder->source_code_info_ = &SourceCodeInfo::default_instance(); placeholder->is_placeholder_ = true; @@ -4944,6 +5300,10 @@ void DescriptorBuilder::AllocateOptions( descriptor->full_name(), descriptor->full_name(), proto, options_path, option_name, alloc); descriptor->options_ = options; +#ifdef PROTOBUF_FUTURE_EDITIONS + descriptor->proto_features_ = &FeatureSet::default_instance(); + descriptor->merged_features_ = &FeatureSet::default_instance(); +#endif // PROTOBUF_FUTURE_EDITIONS } // We specialize for FileDescriptor. @@ -4957,6 +5317,10 @@ void DescriptorBuilder::AllocateOptions(const FileDescriptorProto& proto, absl::StrCat(descriptor->package(), ".dummy"), descriptor->name(), proto, options_path, "google.protobuf.FileOptions", alloc); descriptor->options_ = options; +#ifdef PROTOBUF_FUTURE_EDITIONS + descriptor->proto_features_ = &FeatureSet::default_instance(); + descriptor->merged_features_ = &FeatureSet::default_instance(); +#endif // PROTOBUF_FUTURE_EDITIONS } template @@ -5019,6 +5383,105 @@ typename DescriptorT::OptionsType* DescriptorBuilder::AllocateOptionsImpl( return options; } +#ifdef PROTOBUF_FUTURE_EDITIONS +template +void DescriptorBuilder::ResolveFeaturesImpl( + const typename DescriptorT::Proto& proto, DescriptorT* descriptor, + typename DescriptorT::OptionsType* options, internal::FlatAllocator& alloc, + DescriptorPool::ErrorCollector::ErrorLocation error_location, + bool force_merge) { + const FeatureSet& parent_features = GetParentFeatures(descriptor); + + descriptor->merged_features_ = + GetLegacyFeatureOverride(&parent_features, descriptor); + descriptor->proto_features_ = &FeatureSet::default_instance(); + if (!feature_resolver_.has_value()) { + if (options != nullptr && options->has_features()) { + AddError(descriptor->name(), proto, error_location, + "Features are only valid under editions."); + } + return; + } + + if (options != nullptr && options->has_features()) { + // Remove the features from the child's options proto to avoid leaking + // internal details. + FeatureSet* mutable_features = alloc.AllocateArray(1); + descriptor->proto_features_ = mutable_features; + options->mutable_features()->Swap(mutable_features); + options->clear_features(); + } else if (!force_merge) { + // Nothing to merge, and we aren't forcing it. + return; + } + FeatureSet* merged_features = alloc.AllocateArray(1); + + // Calculate the merged features for this target. + absl::StatusOr merged = feature_resolver_->MergeFeatures( + parent_features, *descriptor->proto_features_); + if (!merged.ok()) { + AddError(descriptor->name(), proto, error_location, + [&] { return std::string(merged.status().message()); }); + return; + } + + merged_features->Swap(&merged.value()); + descriptor->merged_features_ = merged_features; +} + +template +void DescriptorBuilder::ResolveFeatures( + const typename DescriptorT::Proto& proto, DescriptorT* descriptor, + typename DescriptorT::OptionsType* options, + internal::FlatAllocator& alloc) { + ResolveFeaturesImpl(proto, descriptor, options, alloc, + DescriptorPool::ErrorCollector::NAME); +} + +void DescriptorBuilder::ResolveFeatures(const FileDescriptorProto& proto, + FileDescriptor* descriptor, + FileOptions* options, + internal::FlatAllocator& alloc) { + // File descriptors always need their own merged feature set, even without + // any explicit features. + ResolveFeaturesImpl(proto, descriptor, options, alloc, + DescriptorPool::ErrorCollector::EDITIONS, + /*force_merge=*/true); +} + +template +const FeatureSet* DescriptorBuilder::GetLegacyFeatureOverride( + const FeatureSet* parent_features, const DescriptorT* descriptor) { + return parent_features; +} + +template <> +const FeatureSet* DescriptorBuilder::GetLegacyFeatureOverride( + const FeatureSet* parent_features, const FieldDescriptor* descriptor) { + // Groups use delimited message encoding. + if (parent_features == &GetProto2Features() && + descriptor->type_ == FieldDescriptor::TYPE_GROUP) { + return &GetProto2GroupFeatures(); + } + return parent_features; +} + +void DescriptorBuilder::PostProcessFieldFeatures(FieldDescriptor& field) { + // TODO(b/285013359) This can be replace by a runtime check in `is_required` + // once the `label` getter is hidden. + if (field.features().field_presence() == FeatureSet::LEGACY_REQUIRED && + field.label_ == FieldDescriptor::LABEL_OPTIONAL) { + field.label_ = FieldDescriptor::LABEL_REQUIRED; + } + // TODO(b/285024320) This can be replace by a runtime check of `is_delimited` + // once the `TYPE_GROUP` value is removed. + if (field.type_ == FieldDescriptor::TYPE_MESSAGE && + field.features().message_encoding() == FeatureSet::DELIMITED) { + field.type_ = FieldDescriptor::TYPE_GROUP; + } +} + +#endif // PROTOBUF_FUTURE_EDITIONS // A common pattern: We want to convert a repeated field in the descriptor // to an array of values, calling some method to build each value. @@ -5103,6 +5566,9 @@ static void PlanAllocationSize( alloc.PlanArray(2 * values.size()); // name + full_name for (const auto& v : values) { if (v.has_options()) alloc.PlanArray(1); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (HasFeatures(v.options())) alloc.PlanArray(2); +#endif // !PROTOBUF_FUTURE_EDITIONS } } @@ -5113,6 +5579,9 @@ static void PlanAllocationSize( alloc.PlanArray(2 * enums.size()); // name + full_name for (const auto& e : enums) { if (e.has_options()) alloc.PlanArray(1); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (HasFeatures(e.options())) alloc.PlanArray(2); +#endif // !PROTOBUF_FUTURE_EDITIONS PlanAllocationSize(e.value(), alloc); alloc.PlanArray(e.reserved_range_size()); alloc.PlanArray(e.reserved_name_size()); @@ -5127,6 +5596,9 @@ static void PlanAllocationSize( alloc.PlanArray(2 * oneofs.size()); // name + full_name for (const auto& oneof : oneofs) { if (oneof.has_options()) alloc.PlanArray(1); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (HasFeatures(oneof.options())) alloc.PlanArray(2); +#endif // !PROTOBUF_FUTURE_EDITIONS } } @@ -5136,6 +5608,9 @@ static void PlanAllocationSize( alloc.PlanArray(fields.size()); for (const auto& field : fields) { if (field.has_options()) alloc.PlanArray(1); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (HasFeatures(field.options())) alloc.PlanArray(2); +#endif // !PROTOBUF_FUTURE_EDITIONS alloc.PlanFieldNames(field.name(), field.has_json_name() ? &field.json_name() : nullptr); if (field.has_default_value() && field.has_type() && @@ -5153,6 +5628,9 @@ static void PlanAllocationSize( alloc.PlanArray(ranges.size()); for (const auto& r : ranges) { if (r.has_options()) alloc.PlanArray(1); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (HasFeatures(r.options())) alloc.PlanArray(2); +#endif // !PROTOBUF_FUTURE_EDITIONS } } @@ -5164,6 +5642,9 @@ static void PlanAllocationSize( for (const auto& message : messages) { if (message.has_options()) alloc.PlanArray(1); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (HasFeatures(message.options())) alloc.PlanArray(2); +#endif // !PROTOBUF_FUTURE_EDITIONS PlanAllocationSize(message.nested_type(), alloc); PlanAllocationSize(message.field(), alloc); PlanAllocationSize(message.extension(), alloc); @@ -5183,6 +5664,9 @@ static void PlanAllocationSize( alloc.PlanArray(2 * methods.size()); // name + full_name for (const auto& m : methods) { if (m.has_options()) alloc.PlanArray(1); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (HasFeatures(m.options())) alloc.PlanArray(2); +#endif // !PROTOBUF_FUTURE_EDITIONS } } @@ -5193,6 +5677,9 @@ static void PlanAllocationSize( alloc.PlanArray(2 * services.size()); // name + full_name for (const auto& service : services) { if (service.has_options()) alloc.PlanArray(1); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (HasFeatures(service.options())) alloc.PlanArray(2); +#endif // !PROTOBUF_FUTURE_EDITIONS PlanAllocationSize(service.method(), alloc); } } @@ -5202,8 +5689,19 @@ static void PlanAllocationSize(const FileDescriptorProto& proto, alloc.PlanArray(1); alloc.PlanArray(1); alloc.PlanArray(2 +#ifdef PROTOBUF_FUTURE_EDITIONS + + (proto.has_edition() ? 1 : 0) +#endif // !PROTOBUF_FUTURE_EDITIONS ); // name + package if (proto.has_options()) alloc.PlanArray(1); +#ifdef PROTOBUF_FUTURE_EDITIONS + if (proto.has_edition()) { + alloc.PlanArray(1); + if (HasFeatures(proto.options())) { + alloc.PlanArray(1); + } + } +#endif // !PROTOBUF_FUTURE_EDITIONS if (proto.has_source_code_info()) alloc.PlanArray(1); PlanAllocationSize(proto.service(), alloc); @@ -5305,6 +5803,29 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl( FileDescriptor* result = alloc.AllocateArray(1); file_ = result; +#ifdef PROTOBUF_FUTURE_EDITIONS + if (proto.has_edition()) { + Symbol symbol = FindSymbolNotEnforcingDeps("google.protobuf.FeatureSet"); + const Descriptor* descriptor = symbol.descriptor(); + if (descriptor == nullptr) { + // descriptor.proto is not in the pool. This means no custom features are + // used so we are safe to proceed with the compiled FeatureSet message + // type. + descriptor = FeatureSet::descriptor(); + } + ABSL_CHECK(descriptor); + + absl::StatusOr feature_resolver = + FeatureResolver::Create(proto.edition(), descriptor); + if (!feature_resolver.ok()) { + AddError( + proto.name(), proto, DescriptorPool::ErrorCollector::EDITIONS, + [&] { return std::string(feature_resolver.status().message()); }); + } else { + feature_resolver_.emplace(std::move(feature_resolver).value()); + } + } +#endif // PROTOBUF_FUTURE_EDITIONS result->is_placeholder_ = false; result->finished_building_ = false; @@ -5331,12 +5852,21 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl( file_->syntax_ = FileDescriptorLegacy::SYNTAX_PROTO2; } else if (proto.syntax() == "proto3") { file_->syntax_ = FileDescriptorLegacy::SYNTAX_PROTO3; +#ifdef PROTOBUF_FUTURE_EDITIONS + } else if (proto.syntax() == "editions") { + file_->syntax_ = FileDescriptorLegacy::SYNTAX_EDITIONS; +#endif // !PROTOBUF_FUTURE_EDITIONS } else { file_->syntax_ = FileDescriptorLegacy::SYNTAX_UNKNOWN; AddError(proto.name(), proto, DescriptorPool::ErrorCollector::OTHER, [&] { return absl::StrCat("Unrecognized syntax: ", proto.syntax()); }); } +#ifdef PROTOBUF_FUTURE_EDITIONS + if (proto.has_edition()) { + file_->edition_ = alloc.AllocateStrings(proto.edition()); + } +#endif // !PROTOBUF_FUTURE_EDITIONS result->name_ = alloc.AllocateStrings(proto.name()); if (proto.has_package()) { @@ -5405,6 +5935,17 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl( return nullptr; } +#ifdef PROTOBUF_FUTURE_EDITIONS + // Look for feature extensions in regular imports. + if (feature_resolver_.has_value() && dependency != nullptr) { + absl::Status status = feature_resolver_->RegisterExtensions(*dependency); + if (!status.ok()) { + AddError(dependency->name(), proto, + DescriptorPool::ErrorCollector::EDITIONS, + [&] { return std::string(status.message()); }); + } + } +#endif // PROTOBUF_FUTURE_EDITIONS if (dependency == nullptr) { if (!pool_->lazily_build_dependencies_) { @@ -5527,6 +6068,40 @@ FileDescriptor* DescriptorBuilder::BuildFileImpl( SuggestFieldNumbers(result, proto); } +#ifdef PROTOBUF_FUTURE_EDITIONS + // Interpret only the feature options first. This has to be done in two + // passes, since options defined in this file may have features attached + // to them. + if (!had_errors_) { + OptionInterpreter option_interpreter(this); + for (std::vector::iterator iter = + options_to_interpret_.begin(); + iter != options_to_interpret_.end(); ++iter) { + option_interpreter.InterpretFeatures(&(*iter)); + } + } + // Handle feature resolution. This must occur after option interpretation, + // but before validation. + internal::VisitDescriptors( + *result, proto, [&](const auto& descriptor, const auto& proto) { + using OptionsT = + typename std::remove_const::type>::type; + using DescriptorT = typename std::remove_const< + typename std::remove_reference::type>::type; + + ResolveFeatures( + proto, const_cast(&descriptor), + const_cast( // NOLINT(google3-runtime-proto-const-cast) + descriptor.options_), + alloc); + }); + + // Post-process cleanup for field features. + internal::VisitDescriptors(*result, [&](const FieldDescriptor& field) { + PostProcessFieldFeatures(const_cast(field)); + }); +#endif // PROTOBUF_FUTURE_EDITIONS // Interpret any remaining uninterpreted options gathered into // options_to_interpret_ during descriptor building. Cross-linking has made @@ -5875,7 +6450,13 @@ void DescriptorBuilder::CheckFieldJsonNameUniqueness( }; bool involves_default = !details.is_custom || !match.is_custom; +#ifdef PROTOBUF_FUTURE_EDITIONS + if (descriptor->features().json_format() == + FeatureSet::LEGACY_BEST_EFFORT && + involves_default) { +#else // PROTOBUF_FUTURE_EDITIONS if (syntax == FileDescriptorLegacy::SYNTAX_PROTO2 && involves_default) { +#endif // PROTOBUF_FUTURE_EDITIONS // TODO(b/261750676) Upgrade this to an error once downstream protos have // been fixed. AddWarning(message_name, field, DescriptorPool::ErrorCollector::NAME, @@ -7383,6 +7964,54 @@ void DescriptorBuilder::ValidateOptions(const FieldDescriptor* field, void DescriptorBuilder::ValidateFieldFeatures( const FieldDescriptor* field, const FieldDescriptorProto& proto) { +#ifdef PROTOBUF_FUTURE_EDITIONS + // Rely on our legacy validation for proto2/proto3 files. + if (IsLegacyFeatureSet(field->features())) return; + + // Validate fully resolved features. + if (field->has_default_value() && + field->features().field_presence() == FeatureSet::IMPLICIT) { + AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NAME, + "Implicit presence fields can't specify defaults."); + } + if (field->enum_type() != nullptr && + field->enum_type()->features().enum_type() != FeatureSet::OPEN && + field->features().field_presence() == FeatureSet::IMPLICIT) { + AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NAME, + "Implicit presence enum fields must always be open."); + } + if (field->is_extension() && + field->features().field_presence() == FeatureSet::LEGACY_REQUIRED) { + AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NAME, + "Extensions can't be required."); + } + + // Validate explicitly specified features on the field proto. + if ((field->containing_oneof() != nullptr || field->is_repeated() || + field->message_type() != nullptr) && + proto.options().features().field_presence() == FeatureSet::IMPLICIT) { + AddError( + field->full_name(), proto, DescriptorPool::ErrorCollector::NAME, + "Only singular scalar fields can specify implicit field presence."); + } + if ((field->containing_oneof() != nullptr || field->is_repeated()) && + proto.options().features().field_presence() == + FeatureSet::LEGACY_REQUIRED) { + AddError( + field->full_name(), proto, DescriptorPool::ErrorCollector::NAME, + "Only singular scalar fields can specify required field presence."); + } + if (field->type() != FieldDescriptor::TYPE_STRING && + proto.options().features().has_string_field_validation()) { + AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NAME, + "Only string fields can specify `string_field_validation`."); + } + if (!field->is_repeated() && + proto.options().features().has_repeated_field_encoding()) { + AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::NAME, + "Only repeated fields can specify `repeated_field_encoding`."); + } +#endif // PROTOBUF_FUTURE_EDITIONS } void DescriptorBuilder::ValidateOptions(const EnumDescriptor* enm, @@ -7782,6 +8411,12 @@ bool DescriptorBuilder::OptionInterpreter::InterpretOptions( OptionsToInterpret* options_to_interpret) { return InterpretOptionsImpl(options_to_interpret, /*features=*/false); } +#ifdef PROTOBUF_FUTURE_EDITIONS +bool DescriptorBuilder::OptionInterpreter::InterpretFeatures( + OptionsToInterpret* options_to_interpret) { + return InterpretOptionsImpl(options_to_interpret, /*features=*/true); +} +#endif // PROTOBUF_FUTURE_EDITIONS bool DescriptorBuilder::OptionInterpreter::InterpretOptionsImpl( OptionsToInterpret* options_to_interpret, bool features) { // Note that these may be in different pools, so we can't use the same @@ -8928,6 +9563,12 @@ Utf8CheckMode GetUtf8CheckMode(const FieldDescriptor* field, bool is_lite) { } bool IsLazilyInitializedFile(absl::string_view filename) { +#ifdef PROTOBUF_FUTURE_EDITIONS + if (filename == "third_party/protobuf/cpp_features.proto" || + filename == "google/protobuf/cpp_features.proto") { + return true; + } +#endif // PROTOBUF_FUTURE_EDITIONS return filename == "net/proto2/proto/descriptor.proto" || filename == "google/protobuf/descriptor.proto"; } @@ -8935,6 +9576,17 @@ bool IsLazilyInitializedFile(absl::string_view filename) { } // namespace cpp } // namespace internal +#ifdef PROTOBUF_FUTURE_EDITIONS +absl::string_view FileDescriptor::edition() const { + // ASLR will help give this a random value across processes. + static const void* kAntiHyrumText = &kAntiHyrumText; + absl::string_view anti_hyrum_string( + reinterpret_cast(kAntiHyrumText), + (reinterpret_cast(kAntiHyrumText) >> 3) % sizeof(void*)); + + return edition_ == nullptr ? anti_hyrum_string : *edition_; +} +#endif // !PROTOBUF_FUTURE_EDITIONS } // namespace protobuf } // namespace google diff --git a/src/google/protobuf/descriptor.h b/src/google/protobuf/descriptor.h index db81ed790f..f39ddf696b 100644 --- a/src/google/protobuf/descriptor.h +++ b/src/google/protobuf/descriptor.h @@ -258,6 +258,25 @@ class PROTOBUF_EXPORT SymbolBase { template class PROTOBUF_EXPORT SymbolBaseN : public SymbolBase {}; +#ifdef PROTOBUF_FUTURE_EDITIONS +// This class is for internal use only and provides access to the FeatureSets +// defined on descriptors. These features are not designed to be stable, and +// depending directly on them (vs the public descriptor APIs) is not safe. +class InternalFeatureHelper { + public: + template + static const FeatureSet& GetFeatures(const DescriptorT& desc) { + return desc.features(); + } + + private: + friend class ::google::protobuf::compiler::CodeGenerator; + template + static const FeatureSet& GetRawFeatures(const DescriptorT& desc) { + return *desc.proto_features_; + } +}; +#endif // PROTOBUF_FUTURE_EDITIONS } // namespace internal @@ -473,7 +492,19 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { private: const Descriptor* containing_type_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const FeatureSet* proto_features_; + const FeatureSet* merged_features_; +#endif // PROTOBUF_FUTURE_EDITIONS +#ifdef PROTOBUF_FUTURE_EDITIONS + // Get the merged features that apply to this extension range. These are + // specified in the .proto file through the feature options in the message + // definition. Allowed features are defined by Features in descriptor.proto, + // along with any backend-specific extensions to it. + const FeatureSet& features() const { return *merged_features_; } + friend class internal::InternalFeatureHelper; +#endif // PROTOBUF_FUTURE_EDITIONS // Walks up the descriptor tree to generate the source location path // to this descriptor from the file root. @@ -598,6 +629,14 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { friend class io::Printer; friend class compiler::cpp::Formatter; +#ifdef PROTOBUF_FUTURE_EDITIONS + // Get the merged features that apply to this message type. These are + // specified in the .proto file through the feature options in the message + // definition. Allowed features are defined by Features in descriptor.proto, + // along with any backend-specific extensions to it. + const FeatureSet& features() const { return *merged_features_; } + friend class internal::InternalFeatureHelper; +#endif // PROTOBUF_FUTURE_EDITIONS // Fill the json_name field of FieldDescriptorProto. void CopyJsonNameTo(DescriptorProto* proto) const; @@ -637,6 +676,10 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { const FileDescriptor* file_; const Descriptor* containing_type_; const MessageOptions* options_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const FeatureSet* proto_features_; + const FeatureSet* merged_features_; +#endif // PROTOBUF_FUTURE_EDITIONS // These arrays are separated from their sizes to minimize padding on 64-bit. FieldDescriptor* fields_; @@ -673,7 +716,11 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { friend class FileDescriptor; }; +#ifdef PROTOBUF_FUTURE_EDITIONS +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(Descriptor, 152); +#else // PROTOBUF_FUTURE_EDITIONS PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(Descriptor, 136); +#endif // PROTOBUF_FUTURE_EDITIONS // Describes a single field of a message. To get the descriptor for a given // field, first get the Descriptor for the message in which it is defined, @@ -987,6 +1034,14 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { private: +#ifdef PROTOBUF_FUTURE_EDITIONS + // Get the merged features that apply to this field. These are specified in + // the .proto file through the feature options in the message definition. + // Allowed features are defined by Features in descriptor.proto, along with + // any backend-specific extensions to it. + const FeatureSet& features() const { return *merged_features_; } + friend class internal::InternalFeatureHelper; +#endif // PROTOBUF_FUTURE_EDITIONS // Fill the json_name field of FieldDescriptorProto. void CopyJsonNameTo(FieldDescriptorProto* proto) const; @@ -1055,6 +1110,10 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { mutable const EnumDescriptor* enum_type; } type_descriptor_; const FieldOptions* options_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const FeatureSet* proto_features_; + const FeatureSet* merged_features_; +#endif // PROTOBUF_FUTURE_EDITIONS // IMPORTANT: If you add a new field, make sure to search for all instances // of Allocate() and AllocateArray() in // descriptor.cc and update them to initialize the field. @@ -1089,7 +1148,11 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { friend class OneofDescriptor; }; +#ifdef PROTOBUF_FUTURE_EDITIONS +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(FieldDescriptor, 88); +#else // PROTOBUF_FUTURE_EDITIONS PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(FieldDescriptor, 72); +#endif // PROTOBUF_FUTURE_EDITIONS // Describes a oneof defined in a message type. class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase { @@ -1156,6 +1219,14 @@ class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase { private: +#ifdef PROTOBUF_FUTURE_EDITIONS + // Get the merged features that apply to this oneof. These are specified in + // the .proto file through the feature options in the oneof definition. + // Allowed features are defined by Features in descriptor.proto, along with + // any backend-specific extensions to it. + const FeatureSet& features() const { return *merged_features_; } + friend class internal::InternalFeatureHelper; +#endif // PROTOBUF_FUTURE_EDITIONS // See Descriptor::DebugString(). void DebugString(int depth, std::string* contents, @@ -1171,6 +1242,10 @@ class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase { const std::string* all_names_; const Descriptor* containing_type_; const OneofOptions* options_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const FeatureSet* proto_features_; + const FeatureSet* merged_features_; +#endif // PROTOBUF_FUTURE_EDITIONS const FieldDescriptor* fields_; // IMPORTANT: If you add a new field, make sure to search for all instances @@ -1184,7 +1259,11 @@ class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase { friend class FieldDescriptor; }; +#ifdef PROTOBUF_FUTURE_EDITIONS +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(OneofDescriptor, 56); +#else // PROTOBUF_FUTURE_EDITIONS PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(OneofDescriptor, 40); +#endif // PROTOBUF_FUTURE_EDITIONS // Describes an enum type defined in a .proto file. To get the EnumDescriptor // for a generated enum type, call TypeName_descriptor(). Use DescriptorPool @@ -1315,6 +1394,14 @@ class PROTOBUF_EXPORT EnumDescriptor : private internal::SymbolBase { // Allow access to FindValueByNumberCreatingIfUnknown. friend class descriptor_unittest::DescriptorTest; +#ifdef PROTOBUF_FUTURE_EDITIONS + // Get the merged features that apply to this enum type. These are specified + // in the .proto file through the feature options in the message definition. + // Allowed features are defined by Features in descriptor.proto, along with + // any backend-specific extensions to it. + const FeatureSet& features() const { return *merged_features_; } + friend class internal::InternalFeatureHelper; +#endif // PROTOBUF_FUTURE_EDITIONS // Looks up a value by number. If the value does not exist, dynamically // creates a new EnumValueDescriptor for that value, assuming that it was @@ -1356,6 +1443,10 @@ class PROTOBUF_EXPORT EnumDescriptor : private internal::SymbolBase { const FileDescriptor* file_; const Descriptor* containing_type_; const EnumOptions* options_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const FeatureSet* proto_features_; + const FeatureSet* merged_features_; +#endif // PROTOBUF_FUTURE_EDITIONS EnumValueDescriptor* values_; int reserved_range_count_; @@ -1379,7 +1470,11 @@ class PROTOBUF_EXPORT EnumDescriptor : private internal::SymbolBase { friend class Reflection; }; +#ifdef PROTOBUF_FUTURE_EDITIONS +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(EnumDescriptor, 88); +#else // PROTOBUF_FUTURE_EDITIONS PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(EnumDescriptor, 72); +#endif // PROTOBUF_FUTURE_EDITIONS // Describes an individual enum constant of a particular type. To get the // EnumValueDescriptor for a given enum value, first get the EnumDescriptor @@ -1442,6 +1537,14 @@ class PROTOBUF_EXPORT EnumValueDescriptor : private internal::SymbolBaseN<0>, friend class io::Printer; friend class compiler::cpp::Formatter; +#ifdef PROTOBUF_FUTURE_EDITIONS + // Get the merged features that apply to this enum value. These are specified + // in the .proto file through the feature options in the message definition. + // Allowed features are defined by Features in descriptor.proto, along with + // any backend-specific extensions to it. + const FeatureSet& features() const { return *merged_features_; } + friend class internal::InternalFeatureHelper; +#endif // PROTOBUF_FUTURE_EDITIONS // See Descriptor::DebugString(). void DebugString(int depth, std::string* contents, @@ -1456,6 +1559,10 @@ class PROTOBUF_EXPORT EnumValueDescriptor : private internal::SymbolBaseN<0>, const std::string* all_names_; const EnumDescriptor* type_; const EnumValueOptions* options_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const FeatureSet* proto_features_; + const FeatureSet* merged_features_; +#endif // PROTOBUF_FUTURE_EDITIONS // IMPORTANT: If you add a new field, make sure to search for all instances // of Allocate() and AllocateArray() // in descriptor.cc and update them to initialize the field. @@ -1469,7 +1576,11 @@ class PROTOBUF_EXPORT EnumValueDescriptor : private internal::SymbolBaseN<0>, friend class Reflection; }; +#ifdef PROTOBUF_FUTURE_EDITIONS +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(EnumValueDescriptor, 48); +#else // PROTOBUF_FUTURE_EDITIONS PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(EnumValueDescriptor, 32); +#endif // PROTOBUF_FUTURE_EDITIONS // Describes an RPC service. Use DescriptorPool to construct your own // descriptors. @@ -1531,6 +1642,14 @@ class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase { friend class io::Printer; friend class compiler::cpp::Formatter; +#ifdef PROTOBUF_FUTURE_EDITIONS + // Get the merged features that apply to this service type. These are + // specified in the .proto file through the feature options in the service + // definition. Allowed features are defined by Features in descriptor.proto, + // along with any backend-specific extensions to it. + const FeatureSet& features() const { return *merged_features_; } + friend class internal::InternalFeatureHelper; +#endif // PROTOBUF_FUTURE_EDITIONS // See Descriptor::DebugString(). void DebugString(std::string* contents, @@ -1544,6 +1663,10 @@ class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase { const std::string* all_names_; const FileDescriptor* file_; const ServiceOptions* options_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const FeatureSet* proto_features_; + const FeatureSet* merged_features_; +#endif // PROTOBUF_FUTURE_EDITIONS MethodDescriptor* methods_; int method_count_; // IMPORTANT: If you add a new field, make sure to search for all instances @@ -1557,7 +1680,11 @@ class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase { friend class MethodDescriptor; }; +#ifdef PROTOBUF_FUTURE_EDITIONS +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(ServiceDescriptor, 64); +#else // PROTOBUF_FUTURE_EDITIONS PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(ServiceDescriptor, 48); +#endif // PROTOBUF_FUTURE_EDITIONS // Describes an individual service method. To obtain a MethodDescriptor given // a service, first get its ServiceDescriptor, then call @@ -1624,6 +1751,14 @@ class PROTOBUF_EXPORT MethodDescriptor : private internal::SymbolBase { friend class io::Printer; friend class compiler::cpp::Formatter; +#ifdef PROTOBUF_FUTURE_EDITIONS + // Get the merged features that apply to this method. These are specified in + // the .proto file through the feature options in the method definition. + // Allowed features are defined by Features in descriptor.proto, along with + // any backend-specific extensions to it. + const FeatureSet& features() const { return *merged_features_; } + friend class internal::InternalFeatureHelper; +#endif // PROTOBUF_FUTURE_EDITIONS // See Descriptor::DebugString(). void DebugString(int depth, std::string* contents, @@ -1641,6 +1776,10 @@ class PROTOBUF_EXPORT MethodDescriptor : private internal::SymbolBase { mutable internal::LazyDescriptor input_type_; mutable internal::LazyDescriptor output_type_; const MethodOptions* options_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const FeatureSet* proto_features_; + const FeatureSet* merged_features_; +#endif // PROTOBUF_FUTURE_EDITIONS // IMPORTANT: If you add a new field, make sure to search for all instances // of Allocate() and AllocateArray() in // descriptor.cc and update them to initialize the field. @@ -1651,7 +1790,11 @@ class PROTOBUF_EXPORT MethodDescriptor : private internal::SymbolBase { friend class ServiceDescriptor; }; +#ifdef PROTOBUF_FUTURE_EDITIONS +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(MethodDescriptor, 80); +#else // PROTOBUF_FUTURE_EDITIONS PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(MethodDescriptor, 64); +#endif // PROTOBUF_FUTURE_EDITIONS // Describes a whole .proto file. To get the FileDescriptor for a compiled-in // file, get the descriptor for something defined in that file and call @@ -1750,6 +1893,9 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase { SYNTAX_UNKNOWN = 0, SYNTAX_PROTO2 = 2, SYNTAX_PROTO3 = 3, +#ifdef PROTOBUF_FUTURE_EDITIONS + SYNTAX_EDITIONS = 99, +#endif // PROTOBUF_FUTURE_EDITIONS }; PROTOBUF_IGNORE_DEPRECATION_START ABSL_DEPRECATED( @@ -1769,6 +1915,10 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase { PROTOBUF_IGNORE_DEPRECATION_STOP public: +#ifdef PROTOBUF_FUTURE_EDITIONS + // Returns an unspecified value if syntax() is not SYNTAX_EDITIONS. + absl::string_view edition() const; +#endif // PROTOBUF_FUTURE_EDITIONS // Find a top-level message type by name (not full_name). Returns nullptr if // not found. @@ -1847,7 +1997,18 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase { const std::string* name_; const std::string* package_; const DescriptorPool* pool_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const std::string* edition_ = nullptr; +#endif // PROTOBUF_FUTURE_EDITIONS +#ifdef PROTOBUF_FUTURE_EDITIONS + // Get the merged features that apply to this file. These are specified in + // the .proto file through the feature options in the message definition. + // Allowed features are defined by FeatureSet in descriptor.proto, along with + // any backend-specific extensions to it. + const FeatureSet& features() const { return *merged_features_; } + friend class internal::InternalFeatureHelper; +#endif // PROTOBUF_FUTURE_EDITIONS // dependencies_once_ contain a once_flag followed by N NUL terminated // strings. Dependencies that do not need to be loaded will be empty. ie just @@ -1872,6 +2033,10 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase { ServiceDescriptor* services_; FieldDescriptor* extensions_; const FileOptions* options_; +#ifdef PROTOBUF_FUTURE_EDITIONS + const FeatureSet* proto_features_; + const FeatureSet* merged_features_; +#endif // PROTOBUF_FUTURE_EDITIONS const FileDescriptorTables* tables_; const SourceCodeInfo* source_code_info_; @@ -1893,7 +2058,11 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase { friend class ServiceDescriptor; }; +#ifdef PROTOBUF_FUTURE_EDITIONS +PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(FileDescriptor, 168); +#else // PROTOBUF_FUTURE_EDITIONS PROTOBUF_INTERNAL_CHECK_CLASS_SIZE(FileDescriptor, 152); +#endif // PROTOBUF_FUTURE_EDITIONS // =================================================================== @@ -2039,6 +2208,9 @@ class PROTOBUF_EXPORT DescriptorPool { OPTION_NAME, // name in assignment OPTION_VALUE, // value in option assignment IMPORT, // import error +#ifdef PROTOBUF_FUTURE_EDITIONS + EDITIONS, // editions-related error +#endif // PROTOBUF_FUTURE_EDITIONS OTHER // some other problem }; static absl::string_view ErrorLocationName(ErrorLocation location); diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 3c89c4c1d7..a73eb9b8eb 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -211,6 +211,7 @@ PROTOBUF_CONSTEXPR ExtensionRangeOptions::ExtensionRangeOptions(::_pbi::Constant /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_.declaration_)*/ {}, /*decltype(_impl_.uninterpreted_option_)*/ {}, + /*decltype(_impl_.features_)*/ nullptr, /*decltype(_impl_.verification_)*/ 1, } {} struct ExtensionRangeOptionsDefaultTypeInternal { @@ -490,6 +491,7 @@ PROTOBUF_CONSTEXPR FileOptions::FileOptions(::_pbi::ConstantInitialized) &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}, }, + /*decltype(_impl_.features_)*/ nullptr, /*decltype(_impl_.java_multiple_files_)*/ false, /*decltype(_impl_.java_generate_equals_and_hash_)*/ false, /*decltype(_impl_.java_string_check_utf8_)*/ false, @@ -523,6 +525,7 @@ PROTOBUF_CONSTEXPR MessageOptions::MessageOptions(::_pbi::ConstantInitialized) /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_.uninterpreted_option_)*/ {}, + /*decltype(_impl_.features_)*/ nullptr, /*decltype(_impl_.message_set_wire_format_)*/ false, /*decltype(_impl_.no_standard_descriptor_accessor_)*/ false, /*decltype(_impl_.deprecated_)*/ false, @@ -545,13 +548,44 @@ struct MessageOptionsDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_EXPORT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOptionsDefaultTypeInternal _MessageOptions_default_instance_; template +PROTOBUF_CONSTEXPR FieldOptions_EditionDefault::FieldOptions_EditionDefault(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.edition_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + /*decltype(_impl_.value_)*/ { + &::_pbi::fixed_address_empty_string, + ::_pbi::ConstantInitialized{}, + }, + } {} +struct FieldOptions_EditionDefaultDefaultTypeInternal { +#if defined(PROTOBUF_CONSTINIT_DEFAULT_INSTANCES) + constexpr FieldOptions_EditionDefaultDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} +#else // defined(PROTOBUF_CONSTINIT_DEFAULT_INSTANCES) + FieldOptions_EditionDefaultDefaultTypeInternal() {} + void Init() { ::new (&_instance) FieldOptions_EditionDefault(); }; +#endif // defined(PROTOBUF_CONSTINIT_DEFAULT_INSTANCES) + ~FieldOptions_EditionDefaultDefaultTypeInternal() {} + union { + FieldOptions_EditionDefault _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_EXPORT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FieldOptions_EditionDefaultDefaultTypeInternal _FieldOptions_EditionDefault_default_instance_; + template PROTOBUF_CONSTEXPR FieldOptions::FieldOptions(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_._extensions_)*/ {}, /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_.targets_)*/ {}, + /*decltype(_impl_.edition_defaults_)*/ {}, /*decltype(_impl_.uninterpreted_option_)*/ {}, + /*decltype(_impl_.features_)*/ nullptr, /*decltype(_impl_.ctype_)*/ 0, /*decltype(_impl_.jstype_)*/ 0, /*decltype(_impl_.packed_)*/ false, @@ -582,8 +616,10 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_EXPORT PROTOBUF_CONSTEXPR OneofOptions::OneofOptions(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_._extensions_)*/ {}, - /*decltype(_impl_.uninterpreted_option_)*/ {}, + /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.uninterpreted_option_)*/ {}, + /*decltype(_impl_.features_)*/ nullptr, } {} struct OneofOptionsDefaultTypeInternal { #if defined(PROTOBUF_CONSTINIT_DEFAULT_INSTANCES) @@ -607,6 +643,7 @@ PROTOBUF_CONSTEXPR EnumOptions::EnumOptions(::_pbi::ConstantInitialized) /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_.uninterpreted_option_)*/ {}, + /*decltype(_impl_.features_)*/ nullptr, /*decltype(_impl_.allow_alias_)*/ false, /*decltype(_impl_.deprecated_)*/ false, /*decltype(_impl_.deprecated_legacy_json_field_conflicts_)*/ false, @@ -633,6 +670,7 @@ PROTOBUF_CONSTEXPR EnumValueOptions::EnumValueOptions(::_pbi::ConstantInitialize /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_.uninterpreted_option_)*/ {}, + /*decltype(_impl_.features_)*/ nullptr, /*decltype(_impl_.deprecated_)*/ false, /*decltype(_impl_.debug_redact_)*/ false, } {} @@ -658,6 +696,7 @@ PROTOBUF_CONSTEXPR ServiceOptions::ServiceOptions(::_pbi::ConstantInitialized) /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_.uninterpreted_option_)*/ {}, + /*decltype(_impl_.features_)*/ nullptr, /*decltype(_impl_.deprecated_)*/ false, } {} struct ServiceOptionsDefaultTypeInternal { @@ -682,6 +721,7 @@ PROTOBUF_CONSTEXPR MethodOptions::MethodOptions(::_pbi::ConstantInitialized) /*decltype(_impl_._has_bits_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}, /*decltype(_impl_.uninterpreted_option_)*/ {}, + /*decltype(_impl_.features_)*/ nullptr, /*decltype(_impl_.deprecated_)*/ false, /*decltype(_impl_.idempotency_level_)*/ 0, } {} @@ -764,6 +804,34 @@ struct UninterpretedOptionDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_EXPORT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UninterpretedOptionDefaultTypeInternal _UninterpretedOption_default_instance_; template +PROTOBUF_CONSTEXPR FeatureSet::FeatureSet(::_pbi::ConstantInitialized) + : _impl_{ + /*decltype(_impl_._extensions_)*/ {}, + /*decltype(_impl_._has_bits_)*/ {}, + /*decltype(_impl_._cached_size_)*/ {}, + /*decltype(_impl_.field_presence_)*/ 0, + /*decltype(_impl_.enum_type_)*/ 0, + /*decltype(_impl_.repeated_field_encoding_)*/ 0, + /*decltype(_impl_.string_field_validation_)*/ 0, + /*decltype(_impl_.message_encoding_)*/ 0, + /*decltype(_impl_.json_format_)*/ 0, + } {} +struct FeatureSetDefaultTypeInternal { +#if defined(PROTOBUF_CONSTINIT_DEFAULT_INSTANCES) + constexpr FeatureSetDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} +#else // defined(PROTOBUF_CONSTINIT_DEFAULT_INSTANCES) + FeatureSetDefaultTypeInternal() {} + void Init() { ::new (&_instance) FeatureSet(); }; +#endif // defined(PROTOBUF_CONSTINIT_DEFAULT_INSTANCES) + ~FeatureSetDefaultTypeInternal() {} + union { + FeatureSet _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_EXPORT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FeatureSetDefaultTypeInternal _FeatureSet_default_instance_; + template PROTOBUF_CONSTEXPR SourceCodeInfo_Location::SourceCodeInfo_Location(::_pbi::ConstantInitialized) : _impl_{ /*decltype(_impl_._has_bits_)*/ {}, @@ -871,8 +939,8 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_EXPORT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GeneratedCodeInfoDefaultTypeInternal _GeneratedCodeInfo_default_instance_; } // namespace protobuf } // namespace google -static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[28]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[10]; +static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[30]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[16]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_google_2fprotobuf_2fdescriptor_2eproto = nullptr; const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( @@ -1004,10 +1072,12 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _impl_.uninterpreted_option_), PROTOBUF_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _impl_.declaration_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::ExtensionRangeOptions, _impl_.verification_), ~0u, ~0u, 0, + 1, PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldDescriptorProto, _internal_metadata_), ~0u, // no _extensions_ @@ -1156,20 +1226,21 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P PROTOBUF_FIELD_OFFSET(::google::protobuf::FileOptions, _impl_.php_namespace_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FileOptions, _impl_.php_metadata_namespace_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FileOptions, _impl_.ruby_package_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FileOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FileOptions, _impl_.uninterpreted_option_), 0, 1, - 10, 11, 12, - 18, - 2, 13, + 19, + 2, 14, 15, 16, 17, - 19, + 18, + 20, 3, 4, 5, @@ -1177,6 +1248,7 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P 7, 8, 9, + 10, ~0u, PROTOBUF_FIELD_OFFSET(::google::protobuf::MessageOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::MessageOptions, _internal_metadata_), @@ -1191,13 +1263,27 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P PROTOBUF_FIELD_OFFSET(::google::protobuf::MessageOptions, _impl_.deprecated_), PROTOBUF_FIELD_OFFSET(::google::protobuf::MessageOptions, _impl_.map_entry_), PROTOBUF_FIELD_OFFSET(::google::protobuf::MessageOptions, _impl_.deprecated_legacy_json_field_conflicts_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::MessageOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::MessageOptions, _impl_.uninterpreted_option_), - 0, 1, 2, 3, 4, + 5, + 0, ~0u, + PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions_EditionDefault, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions_EditionDefault, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions_EditionDefault, _impl_.edition_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions_EditionDefault, _impl_.value_), + 0, + 1, PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _impl_._extensions_), @@ -1216,21 +1302,25 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _impl_.debug_redact_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _impl_.retention_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _impl_.targets_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _impl_.edition_defaults_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _impl_.uninterpreted_option_), PROTOBUF_FIELD_OFFSET(::google::protobuf::FieldOptions, _impl_.target_obsolete_do_not_use_), - 0, - 2, 1, 3, + 2, 4, 5, 6, 7, 8, - ~0u, - ~0u, 9, - ~0u, // no _has_bits_ + ~0u, + ~0u, + 0, + ~0u, + 10, + PROTOBUF_FIELD_OFFSET(::google::protobuf::OneofOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::OneofOptions, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::google::protobuf::OneofOptions, _impl_._extensions_), ~0u, // no _oneof_case_ @@ -1238,7 +1328,10 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::google::protobuf::OneofOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::OneofOptions, _impl_.uninterpreted_option_), + 0, + ~0u, PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumOptions, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumOptions, _impl_._extensions_), @@ -1250,10 +1343,12 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumOptions, _impl_.allow_alias_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumOptions, _impl_.deprecated_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumOptions, _impl_.deprecated_legacy_json_field_conflicts_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumOptions, _impl_.uninterpreted_option_), - 0, 1, 2, + 3, + 0, ~0u, PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _internal_metadata_), @@ -1264,10 +1359,12 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P ~0u, // no _split_ ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.deprecated_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.debug_redact_), PROTOBUF_FIELD_OFFSET(::google::protobuf::EnumValueOptions, _impl_.uninterpreted_option_), - 0, 1, + 0, + 2, ~0u, PROTOBUF_FIELD_OFFSET(::google::protobuf::ServiceOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::ServiceOptions, _internal_metadata_), @@ -1277,9 +1374,11 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P ~0u, // no _inlined_string_donated_ ~0u, // no _split_ ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::google::protobuf::ServiceOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::ServiceOptions, _impl_.deprecated_), PROTOBUF_FIELD_OFFSET(::google::protobuf::ServiceOptions, _impl_.uninterpreted_option_), 0, + 1, ~0u, PROTOBUF_FIELD_OFFSET(::google::protobuf::MethodOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::MethodOptions, _internal_metadata_), @@ -1291,9 +1390,11 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::google::protobuf::MethodOptions, _impl_.deprecated_), PROTOBUF_FIELD_OFFSET(::google::protobuf::MethodOptions, _impl_.idempotency_level_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::MethodOptions, _impl_.features_), PROTOBUF_FIELD_OFFSET(::google::protobuf::MethodOptions, _impl_.uninterpreted_option_), - 0, 1, + 2, + 0, ~0u, PROTOBUF_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::UninterpretedOption_NamePart, _internal_metadata_), @@ -1329,6 +1430,26 @@ const ::uint32_t TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets[] P 5, 1, 2, + PROTOBUF_FIELD_OFFSET(::google::protobuf::FeatureSet, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FeatureSet, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FeatureSet, _impl_._extensions_), + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::google::protobuf::FeatureSet, _impl_.field_presence_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FeatureSet, _impl_.enum_type_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FeatureSet, _impl_.repeated_field_encoding_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FeatureSet, _impl_.string_field_validation_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FeatureSet, _impl_.message_encoding_), + PROTOBUF_FIELD_OFFSET(::google::protobuf::FeatureSet, _impl_.json_format_), + 0, + 1, + 2, + 3, + 4, + 5, PROTOBUF_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::google::protobuf::SourceCodeInfo_Location, _internal_metadata_), ~0u, // no _extensions_ @@ -1393,28 +1514,30 @@ static const ::_pbi::MigrationSchema {57, 67, -1, sizeof(::google::protobuf::DescriptorProto_ReservedRange)}, {69, 87, -1, sizeof(::google::protobuf::DescriptorProto)}, {97, 111, -1, sizeof(::google::protobuf::ExtensionRangeOptions_Declaration)}, - {117, 128, -1, sizeof(::google::protobuf::ExtensionRangeOptions)}, - {131, 150, -1, sizeof(::google::protobuf::FieldDescriptorProto)}, - {161, 171, -1, sizeof(::google::protobuf::OneofDescriptorProto)}, - {173, 183, -1, sizeof(::google::protobuf::EnumDescriptorProto_EnumReservedRange)}, - {185, 198, -1, sizeof(::google::protobuf::EnumDescriptorProto)}, - {203, 214, -1, sizeof(::google::protobuf::EnumValueDescriptorProto)}, - {217, 228, -1, sizeof(::google::protobuf::ServiceDescriptorProto)}, - {231, 245, -1, sizeof(::google::protobuf::MethodDescriptorProto)}, - {251, 280, -1, sizeof(::google::protobuf::FileOptions)}, - {301, 315, -1, sizeof(::google::protobuf::MessageOptions)}, - {321, 341, -1, sizeof(::google::protobuf::FieldOptions)}, - {353, -1, -1, sizeof(::google::protobuf::OneofOptions)}, - {362, 374, -1, sizeof(::google::protobuf::EnumOptions)}, - {378, 389, -1, sizeof(::google::protobuf::EnumValueOptions)}, - {392, 402, -1, sizeof(::google::protobuf::ServiceOptions)}, - {404, 415, -1, sizeof(::google::protobuf::MethodOptions)}, - {418, 428, -1, sizeof(::google::protobuf::UninterpretedOption_NamePart)}, - {430, 445, -1, sizeof(::google::protobuf::UninterpretedOption)}, - {452, 465, -1, sizeof(::google::protobuf::SourceCodeInfo_Location)}, - {470, -1, -1, sizeof(::google::protobuf::SourceCodeInfo)}, - {479, 492, -1, sizeof(::google::protobuf::GeneratedCodeInfo_Annotation)}, - {497, -1, -1, sizeof(::google::protobuf::GeneratedCodeInfo)}, + {117, 129, -1, sizeof(::google::protobuf::ExtensionRangeOptions)}, + {133, 152, -1, sizeof(::google::protobuf::FieldDescriptorProto)}, + {163, 173, -1, sizeof(::google::protobuf::OneofDescriptorProto)}, + {175, 185, -1, sizeof(::google::protobuf::EnumDescriptorProto_EnumReservedRange)}, + {187, 200, -1, sizeof(::google::protobuf::EnumDescriptorProto)}, + {205, 216, -1, sizeof(::google::protobuf::EnumValueDescriptorProto)}, + {219, 230, -1, sizeof(::google::protobuf::ServiceDescriptorProto)}, + {233, 247, -1, sizeof(::google::protobuf::MethodDescriptorProto)}, + {253, 283, -1, sizeof(::google::protobuf::FileOptions)}, + {305, 320, -1, sizeof(::google::protobuf::MessageOptions)}, + {327, 337, -1, sizeof(::google::protobuf::FieldOptions_EditionDefault)}, + {339, 361, -1, sizeof(::google::protobuf::FieldOptions)}, + {375, 385, -1, sizeof(::google::protobuf::OneofOptions)}, + {387, 400, -1, sizeof(::google::protobuf::EnumOptions)}, + {405, 417, -1, sizeof(::google::protobuf::EnumValueOptions)}, + {421, 432, -1, sizeof(::google::protobuf::ServiceOptions)}, + {435, 447, -1, sizeof(::google::protobuf::MethodOptions)}, + {451, 461, -1, sizeof(::google::protobuf::UninterpretedOption_NamePart)}, + {463, 478, -1, sizeof(::google::protobuf::UninterpretedOption)}, + {485, 499, -1, sizeof(::google::protobuf::FeatureSet)}, + {505, 518, -1, sizeof(::google::protobuf::SourceCodeInfo_Location)}, + {523, -1, -1, sizeof(::google::protobuf::SourceCodeInfo)}, + {532, 545, -1, sizeof(::google::protobuf::GeneratedCodeInfo_Annotation)}, + {550, -1, -1, sizeof(::google::protobuf::GeneratedCodeInfo)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -1434,6 +1557,7 @@ static const ::_pb::Message* const file_default_instances[] = { &::google::protobuf::_MethodDescriptorProto_default_instance_._instance, &::google::protobuf::_FileOptions_default_instance_._instance, &::google::protobuf::_MessageOptions_default_instance_._instance, + &::google::protobuf::_FieldOptions_EditionDefault_default_instance_._instance, &::google::protobuf::_FieldOptions_default_instance_._instance, &::google::protobuf::_OneofOptions_default_instance_._instance, &::google::protobuf::_EnumOptions_default_instance_._instance, @@ -1442,6 +1566,7 @@ static const ::_pb::Message* const file_default_instances[] = { &::google::protobuf::_MethodOptions_default_instance_._instance, &::google::protobuf::_UninterpretedOption_NamePart_default_instance_._instance, &::google::protobuf::_UninterpretedOption_default_instance_._instance, + &::google::protobuf::_FeatureSet_default_instance_._instance, &::google::protobuf::_SourceCodeInfo_Location_default_instance_._instance, &::google::protobuf::_SourceCodeInfo_default_instance_._instance, &::google::protobuf::_GeneratedCodeInfo_Annotation_default_instance_._instance, @@ -1480,169 +1605,211 @@ const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] PR "xtensionRange\022\r\n\005start\030\001 \001(\005\022\013\n\003end\030\002 \001(" "\005\0227\n\007options\030\003 \001(\0132&.google.protobuf.Ext" "ensionRangeOptions\032+\n\rReservedRange\022\r\n\005s" - "tart\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\"\304\003\n\025ExtensionRan" + "tart\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\"\363\003\n\025ExtensionRan" "geOptions\022C\n\024uninterpreted_option\030\347\007 \003(\013" "2$.google.protobuf.UninterpretedOption\022L" "\n\013declaration\030\002 \003(\01322.google.protobuf.Ex" - "tensionRangeOptions.DeclarationB\003\210\001\002\022Z\n\014" - "verification\030\003 \001(\01628.google.protobuf.Ext" - "ensionRangeOptions.VerificationState:\nUN" - "VERIFIED\032{\n\013Declaration\022\016\n\006number\030\001 \001(\005\022" - "\021\n\tfull_name\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\022\027\n\013is_r" - "epeated\030\004 \001(\010B\002\030\001\022\020\n\010reserved\030\005 \001(\010\022\020\n\010r" - "epeated\030\006 \001(\010\"4\n\021VerificationState\022\017\n\013DE" - "CLARATION\020\000\022\016\n\nUNVERIFIED\020\001*\t\010\350\007\020\200\200\200\200\002\"\325" - "\005\n\024FieldDescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n" - "\006number\030\003 \001(\005\022:\n\005label\030\004 \001(\0162+.google.pr" - "otobuf.FieldDescriptorProto.Label\0228\n\004typ" - "e\030\005 \001(\0162*.google.protobuf.FieldDescripto" - "rProto.Type\022\021\n\ttype_name\030\006 \001(\t\022\020\n\010extend" - "ee\030\002 \001(\t\022\025\n\rdefault_value\030\007 \001(\t\022\023\n\013oneof" - "_index\030\t \001(\005\022\021\n\tjson_name\030\n \001(\t\022.\n\007optio" - "ns\030\010 \001(\0132\035.google.protobuf.FieldOptions\022" - "\027\n\017proto3_optional\030\021 \001(\010\"\266\002\n\004Type\022\017\n\013TYP" - "E_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTYPE_INT64" - "\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT32\020\005\022\020\n\014T" - "YPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022\r\n\tTYPE_" - "BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_GROUP\020\n\022" - "\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020\014\022\017\n\013TYP" - "E_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYPE_SFIXED" - "32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_SINT32\020\021" - "\022\017\n\013TYPE_SINT64\020\022\"C\n\005Label\022\022\n\016LABEL_OPTI" - "ONAL\020\001\022\022\n\016LABEL_REQUIRED\020\002\022\022\n\016LABEL_REPE" - "ATED\020\003\"T\n\024OneofDescriptorProto\022\014\n\004name\030\001" - " \001(\t\022.\n\007options\030\002 \001(\0132\035.google.protobuf." - "OneofOptions\"\244\002\n\023EnumDescriptorProto\022\014\n\004" - "name\030\001 \001(\t\0228\n\005value\030\002 \003(\0132).google.proto" - "buf.EnumValueDescriptorProto\022-\n\007options\030" - "\003 \001(\0132\034.google.protobuf.EnumOptions\022N\n\016r" - "eserved_range\030\004 \003(\01326.google.protobuf.En" - "umDescriptorProto.EnumReservedRange\022\025\n\rr" - "eserved_name\030\005 \003(\t\032/\n\021EnumReservedRange\022" - "\r\n\005start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\"l\n\030EnumValue" - "DescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n\006number\030" - "\002 \001(\005\0222\n\007options\030\003 \001(\0132!.google.protobuf" - ".EnumValueOptions\"\220\001\n\026ServiceDescriptorP" - "roto\022\014\n\004name\030\001 \001(\t\0226\n\006method\030\002 \003(\0132&.goo" - "gle.protobuf.MethodDescriptorProto\0220\n\007op" - "tions\030\003 \001(\0132\037.google.protobuf.ServiceOpt" - "ions\"\301\001\n\025MethodDescriptorProto\022\014\n\004name\030\001" - " \001(\t\022\022\n\ninput_type\030\002 \001(\t\022\023\n\013output_type\030" - "\003 \001(\t\022/\n\007options\030\004 \001(\0132\036.google.protobuf" - ".MethodOptions\022\037\n\020client_streaming\030\005 \001(\010" - ":\005false\022\037\n\020server_streaming\030\006 \001(\010:\005false" - "\"\245\006\n\013FileOptions\022\024\n\014java_package\030\001 \001(\t\022\034" - "\n\024java_outer_classname\030\010 \001(\t\022\"\n\023java_mul" - "tiple_files\030\n \001(\010:\005false\022)\n\035java_generat" - "e_equals_and_hash\030\024 \001(\010B\002\030\001\022%\n\026java_stri" - "ng_check_utf8\030\033 \001(\010:\005false\022F\n\014optimize_f" - "or\030\t \001(\0162).google.protobuf.FileOptions.O" - "ptimizeMode:\005SPEED\022\022\n\ngo_package\030\013 \001(\t\022\"" - "\n\023cc_generic_services\030\020 \001(\010:\005false\022$\n\025ja" - "va_generic_services\030\021 \001(\010:\005false\022\"\n\023py_g" - "eneric_services\030\022 \001(\010:\005false\022#\n\024php_gene" - "ric_services\030* \001(\010:\005false\022\031\n\ndeprecated\030" - "\027 \001(\010:\005false\022\036\n\020cc_enable_arenas\030\037 \001(\010:\004" - "true\022\031\n\021objc_class_prefix\030$ \001(\t\022\030\n\020cshar" - "p_namespace\030% \001(\t\022\024\n\014swift_prefix\030\' \001(\t\022" - "\030\n\020php_class_prefix\030( \001(\t\022\025\n\rphp_namespa" - "ce\030) \001(\t\022\036\n\026php_metadata_namespace\030, \001(\t" - "\022\024\n\014ruby_package\030- \001(\t\022C\n\024uninterpreted_" - "option\030\347\007 \003(\0132$.google.protobuf.Uninterp" - "retedOption\":\n\014OptimizeMode\022\t\n\005SPEED\020\001\022\r" - "\n\tCODE_SIZE\020\002\022\020\n\014LITE_RUNTIME\020\003*\t\010\350\007\020\200\200\200" - "\200\002J\004\010&\020\'\"\270\002\n\016MessageOptions\022&\n\027message_s" - "et_wire_format\030\001 \001(\010:\005false\022.\n\037no_standa" - "rd_descriptor_accessor\030\002 \001(\010:\005false\022\031\n\nd" - "eprecated\030\003 \001(\010:\005false\022\021\n\tmap_entry\030\007 \001(" - "\010\0222\n&deprecated_legacy_json_field_confli" - "cts\030\013 \001(\010B\002\030\001\022C\n\024uninterpreted_option\030\347\007" - " \003(\0132$.google.protobuf.UninterpretedOpti" - "on*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005J\004\010\005\020\006J\004\010\006\020\007J\004\010\010\020\tJ\004\010" - "\t\020\n\"\234\010\n\014FieldOptions\022:\n\005ctype\030\001 \001(\0162#.go" - "ogle.protobuf.FieldOptions.CType:\006STRING" - "\022\016\n\006packed\030\002 \001(\010\022\?\n\006jstype\030\006 \001(\0162$.googl" - "e.protobuf.FieldOptions.JSType:\tJS_NORMA" - "L\022\023\n\004lazy\030\005 \001(\010:\005false\022\036\n\017unverified_laz" - "y\030\017 \001(\010:\005false\022\031\n\ndeprecated\030\003 \001(\010:\005fals" - "e\022\023\n\004weak\030\n \001(\010:\005false\022\033\n\014debug_redact\030\020" - " \001(\010:\005false\022@\n\tretention\030\021 \001(\0162-.google." - "protobuf.FieldOptions.OptionRetention\022\?\n" - "\007targets\030\023 \003(\0162..google.protobuf.FieldOp" - "tions.OptionTargetType\022C\n\024uninterpreted_" - "option\030\347\007 \003(\0132$.google.protobuf.Uninterp" - "retedOption\022V\n\032target_obsolete_do_not_us" - "e\030\022 \001(\0162..google.protobuf.FieldOptions.O" - "ptionTargetTypeB\002\030\001\"/\n\005CType\022\n\n\006STRING\020\000" - "\022\010\n\004CORD\020\001\022\020\n\014STRING_PIECE\020\002\"5\n\006JSType\022\r" - "\n\tJS_NORMAL\020\000\022\r\n\tJS_STRING\020\001\022\r\n\tJS_NUMBE" - "R\020\002\"U\n\017OptionRetention\022\025\n\021RETENTION_UNKN" - "OWN\020\000\022\025\n\021RETENTION_RUNTIME\020\001\022\024\n\020RETENTIO" - "N_SOURCE\020\002\"\214\002\n\020OptionTargetType\022\027\n\023TARGE" - "T_TYPE_UNKNOWN\020\000\022\024\n\020TARGET_TYPE_FILE\020\001\022\037" - "\n\033TARGET_TYPE_EXTENSION_RANGE\020\002\022\027\n\023TARGE" - "T_TYPE_MESSAGE\020\003\022\025\n\021TARGET_TYPE_FIELD\020\004\022" - "\025\n\021TARGET_TYPE_ONEOF\020\005\022\024\n\020TARGET_TYPE_EN" - "UM\020\006\022\032\n\026TARGET_TYPE_ENUM_ENTRY\020\007\022\027\n\023TARG" - "ET_TYPE_SERVICE\020\010\022\026\n\022TARGET_TYPE_METHOD\020" - "\t*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005\"^\n\014OneofOptions\022C\n\024un" + "tensionRangeOptions.DeclarationB\003\210\001\002\022-\n\010" + "features\0302 \001(\0132\033.google.protobuf.Feature" + "Set\022Z\n\014verification\030\003 \001(\01628.google.proto" + "buf.ExtensionRangeOptions.VerificationSt" + "ate:\nUNVERIFIED\032{\n\013Declaration\022\016\n\006number" + "\030\001 \001(\005\022\021\n\tfull_name\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\022" + "\027\n\013is_repeated\030\004 \001(\010B\002\030\001\022\020\n\010reserved\030\005 \001" + "(\010\022\020\n\010repeated\030\006 \001(\010\"4\n\021VerificationStat" + "e\022\017\n\013DECLARATION\020\000\022\016\n\nUNVERIFIED\020\001*\t\010\350\007\020" + "\200\200\200\200\002\"\325\005\n\024FieldDescriptorProto\022\014\n\004name\030\001" + " \001(\t\022\016\n\006number\030\003 \001(\005\022:\n\005label\030\004 \001(\0162+.go" + "ogle.protobuf.FieldDescriptorProto.Label" + "\0228\n\004type\030\005 \001(\0162*.google.protobuf.FieldDe" + "scriptorProto.Type\022\021\n\ttype_name\030\006 \001(\t\022\020\n" + "\010extendee\030\002 \001(\t\022\025\n\rdefault_value\030\007 \001(\t\022\023" + "\n\013oneof_index\030\t \001(\005\022\021\n\tjson_name\030\n \001(\t\022." + "\n\007options\030\010 \001(\0132\035.google.protobuf.FieldO" + "ptions\022\027\n\017proto3_optional\030\021 \001(\010\"\266\002\n\004Type" + "\022\017\n\013TYPE_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTYP" + "E_INT64\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT32" + "\020\005\022\020\n\014TYPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022\r" + "\n\tTYPE_BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_G" + "ROUP\020\n\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020\014" + "\022\017\n\013TYPE_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYPE" + "_SFIXED32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_S" + "INT32\020\021\022\017\n\013TYPE_SINT64\020\022\"C\n\005Label\022\022\n\016LAB" + "EL_OPTIONAL\020\001\022\022\n\016LABEL_REQUIRED\020\002\022\022\n\016LAB" + "EL_REPEATED\020\003\"T\n\024OneofDescriptorProto\022\014\n" + "\004name\030\001 \001(\t\022.\n\007options\030\002 \001(\0132\035.google.pr" + "otobuf.OneofOptions\"\244\002\n\023EnumDescriptorPr" + "oto\022\014\n\004name\030\001 \001(\t\0228\n\005value\030\002 \003(\0132).googl" + "e.protobuf.EnumValueDescriptorProto\022-\n\007o" + "ptions\030\003 \001(\0132\034.google.protobuf.EnumOptio" + "ns\022N\n\016reserved_range\030\004 \003(\01326.google.prot" + "obuf.EnumDescriptorProto.EnumReservedRan" + "ge\022\025\n\rreserved_name\030\005 \003(\t\032/\n\021EnumReserve" + "dRange\022\r\n\005start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\"l\n\030En" + "umValueDescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n\006" + "number\030\002 \001(\005\0222\n\007options\030\003 \001(\0132!.google.p" + "rotobuf.EnumValueOptions\"\220\001\n\026ServiceDesc" + "riptorProto\022\014\n\004name\030\001 \001(\t\0226\n\006method\030\002 \003(" + "\0132&.google.protobuf.MethodDescriptorProt" + "o\0220\n\007options\030\003 \001(\0132\037.google.protobuf.Ser" + "viceOptions\"\301\001\n\025MethodDescriptorProto\022\014\n" + "\004name\030\001 \001(\t\022\022\n\ninput_type\030\002 \001(\t\022\023\n\013outpu" + "t_type\030\003 \001(\t\022/\n\007options\030\004 \001(\0132\036.google.p" + "rotobuf.MethodOptions\022\037\n\020client_streamin" + "g\030\005 \001(\010:\005false\022\037\n\020server_streaming\030\006 \001(\010" + ":\005false\"\324\006\n\013FileOptions\022\024\n\014java_package\030" + "\001 \001(\t\022\034\n\024java_outer_classname\030\010 \001(\t\022\"\n\023j" + "ava_multiple_files\030\n \001(\010:\005false\022)\n\035java_" + "generate_equals_and_hash\030\024 \001(\010B\002\030\001\022%\n\026ja" + "va_string_check_utf8\030\033 \001(\010:\005false\022F\n\014opt" + "imize_for\030\t \001(\0162).google.protobuf.FileOp" + "tions.OptimizeMode:\005SPEED\022\022\n\ngo_package\030" + "\013 \001(\t\022\"\n\023cc_generic_services\030\020 \001(\010:\005fals" + "e\022$\n\025java_generic_services\030\021 \001(\010:\005false\022" + "\"\n\023py_generic_services\030\022 \001(\010:\005false\022#\n\024p" + "hp_generic_services\030* \001(\010:\005false\022\031\n\ndepr" + "ecated\030\027 \001(\010:\005false\022\036\n\020cc_enable_arenas\030" + "\037 \001(\010:\004true\022\031\n\021objc_class_prefix\030$ \001(\t\022\030" + "\n\020csharp_namespace\030% \001(\t\022\024\n\014swift_prefix" + "\030\' \001(\t\022\030\n\020php_class_prefix\030( \001(\t\022\025\n\rphp_" + "namespace\030) \001(\t\022\036\n\026php_metadata_namespac" + "e\030, \001(\t\022\024\n\014ruby_package\030- \001(\t\022-\n\010feature" + "s\0302 \001(\0132\033.google.protobuf.FeatureSet\022C\n\024" + "uninterpreted_option\030\347\007 \003(\0132$.google.pro" + "tobuf.UninterpretedOption\":\n\014OptimizeMod" + "e\022\t\n\005SPEED\020\001\022\r\n\tCODE_SIZE\020\002\022\020\n\014LITE_RUNT" + "IME\020\003*\t\010\350\007\020\200\200\200\200\002J\004\010&\020\'\"\347\002\n\016MessageOption" + "s\022&\n\027message_set_wire_format\030\001 \001(\010:\005fals" + "e\022.\n\037no_standard_descriptor_accessor\030\002 \001" + "(\010:\005false\022\031\n\ndeprecated\030\003 \001(\010:\005false\022\021\n\t" + "map_entry\030\007 \001(\010\0222\n&deprecated_legacy_jso" + "n_field_conflicts\030\013 \001(\010B\002\030\001\022-\n\010features\030" + "\014 \001(\0132\033.google.protobuf.FeatureSet\022C\n\024un" "interpreted_option\030\347\007 \003(\0132$.google.proto" - "buf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\307\001\n\013E" - "numOptions\022\023\n\013allow_alias\030\002 \001(\010\022\031\n\ndepre" - "cated\030\003 \001(\010:\005false\0222\n&deprecated_legacy_" - "json_field_conflicts\030\006 \001(\010B\002\030\001\022C\n\024uninte" - "rpreted_option\030\347\007 \003(\0132$.google.protobuf." - "UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020\006\"\232\001\n" - "\020EnumValueOptions\022\031\n\ndeprecated\030\001 \001(\010:\005f" - "alse\022\033\n\014debug_redact\030\003 \001(\010:\005false\022C\n\024uni" - "nterpreted_option\030\347\007 \003(\0132$.google.protob" - "uf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"{\n\016Ser" - "viceOptions\022\031\n\ndeprecated\030! \001(\010:\005false\022C" - "\n\024uninterpreted_option\030\347\007 \003(\0132$.google.p" - "rotobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\255" - "\002\n\rMethodOptions\022\031\n\ndeprecated\030! \001(\010:\005fa" - "lse\022_\n\021idempotency_level\030\" \001(\0162/.google." - "protobuf.MethodOptions.IdempotencyLevel:" - "\023IDEMPOTENCY_UNKNOWN\022C\n\024uninterpreted_op" - "tion\030\347\007 \003(\0132$.google.protobuf.Uninterpre" - "tedOption\"P\n\020IdempotencyLevel\022\027\n\023IDEMPOT" - "ENCY_UNKNOWN\020\000\022\023\n\017NO_SIDE_EFFECTS\020\001\022\016\n\nI" - "DEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200\002\"\236\002\n\023Uninterpreted" - "Option\022;\n\004name\030\002 \003(\0132-.google.protobuf.U" - "ninterpretedOption.NamePart\022\030\n\020identifie" - "r_value\030\003 \001(\t\022\032\n\022positive_int_value\030\004 \001(" - "\004\022\032\n\022negative_int_value\030\005 \001(\003\022\024\n\014double_" - "value\030\006 \001(\001\022\024\n\014string_value\030\007 \001(\014\022\027\n\017agg" - "regate_value\030\010 \001(\t\0323\n\010NamePart\022\021\n\tname_p" - "art\030\001 \002(\t\022\024\n\014is_extension\030\002 \002(\010\"\325\001\n\016Sour" - "ceCodeInfo\022:\n\010location\030\001 \003(\0132(.google.pr" - "otobuf.SourceCodeInfo.Location\032\206\001\n\010Locat" - "ion\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020\001\022" - "\030\n\020leading_comments\030\003 \001(\t\022\031\n\021trailing_co" - "mments\030\004 \001(\t\022!\n\031leading_detached_comment" - "s\030\006 \003(\t\"\234\002\n\021GeneratedCodeInfo\022A\n\nannotat" - "ion\030\001 \003(\0132-.google.protobuf.GeneratedCod" - "eInfo.Annotation\032\303\001\n\nAnnotation\022\020\n\004path\030" - "\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 \001(\t\022\r\n\005begin\030" - "\003 \001(\005\022\013\n\003end\030\004 \001(\005\022H\n\010semantic\030\005 \001(\01626.g" - "oogle.protobuf.GeneratedCodeInfo.Annotat" - "ion.Semantic\"(\n\010Semantic\022\010\n\004NONE\020\000\022\007\n\003SE" - "T\020\001\022\t\n\005ALIAS\020\002B~\n\023com.google.protobufB\020D" - "escriptorProtosH\001Z-google.golang.org/pro" - "tobuf/types/descriptorpb\370\001\001\242\002\003GPB\252\002\032Goog" - "le.Protobuf.Reflection" + "buf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005" + "J\004\010\005\020\006J\004\010\006\020\007J\004\010\010\020\tJ\004\010\t\020\n\"\305\t\n\014FieldOption" + "s\022:\n\005ctype\030\001 \001(\0162#.google.protobuf.Field" + "Options.CType:\006STRING\022\016\n\006packed\030\002 \001(\010\022\?\n" + "\006jstype\030\006 \001(\0162$.google.protobuf.FieldOpt" + "ions.JSType:\tJS_NORMAL\022\023\n\004lazy\030\005 \001(\010:\005fa" + "lse\022\036\n\017unverified_lazy\030\017 \001(\010:\005false\022\031\n\nd" + "eprecated\030\003 \001(\010:\005false\022\023\n\004weak\030\n \001(\010:\005fa" + "lse\022\033\n\014debug_redact\030\020 \001(\010:\005false\022@\n\trete" + "ntion\030\021 \001(\0162-.google.protobuf.FieldOptio" + "ns.OptionRetention\022\?\n\007targets\030\023 \003(\0162..go" + "ogle.protobuf.FieldOptions.OptionTargetT" + "ype\022F\n\020edition_defaults\030\024 \003(\0132,.google.p" + "rotobuf.FieldOptions.EditionDefault\022-\n\010f" + "eatures\030\025 \001(\0132\033.google.protobuf.FeatureS" + "et\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.goog" + "le.protobuf.UninterpretedOption\022V\n\032targe" + "t_obsolete_do_not_use\030\022 \001(\0162..google.pro" + "tobuf.FieldOptions.OptionTargetTypeB\002\030\001\032" + "0\n\016EditionDefault\022\017\n\007edition\030\001 \001(\t\022\r\n\005va" + "lue\030\002 \001(\t\"/\n\005CType\022\n\n\006STRING\020\000\022\010\n\004CORD\020\001" + "\022\020\n\014STRING_PIECE\020\002\"5\n\006JSType\022\r\n\tJS_NORMA" + "L\020\000\022\r\n\tJS_STRING\020\001\022\r\n\tJS_NUMBER\020\002\"U\n\017Opt" + "ionRetention\022\025\n\021RETENTION_UNKNOWN\020\000\022\025\n\021R" + "ETENTION_RUNTIME\020\001\022\024\n\020RETENTION_SOURCE\020\002" + "\"\214\002\n\020OptionTargetType\022\027\n\023TARGET_TYPE_UNK" + "NOWN\020\000\022\024\n\020TARGET_TYPE_FILE\020\001\022\037\n\033TARGET_T" + "YPE_EXTENSION_RANGE\020\002\022\027\n\023TARGET_TYPE_MES" + "SAGE\020\003\022\025\n\021TARGET_TYPE_FIELD\020\004\022\025\n\021TARGET_" + "TYPE_ONEOF\020\005\022\024\n\020TARGET_TYPE_ENUM\020\006\022\032\n\026TA" + "RGET_TYPE_ENUM_ENTRY\020\007\022\027\n\023TARGET_TYPE_SE" + "RVICE\020\010\022\026\n\022TARGET_TYPE_METHOD\020\t*\t\010\350\007\020\200\200\200" + "\200\002J\004\010\004\020\005\"\215\001\n\014OneofOptions\022-\n\010features\030\001 " + "\001(\0132\033.google.protobuf.FeatureSet\022C\n\024unin" + "terpreted_option\030\347\007 \003(\0132$.google.protobu" + "f.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\366\001\n\013Enu" + "mOptions\022\023\n\013allow_alias\030\002 \001(\010\022\031\n\ndepreca" + "ted\030\003 \001(\010:\005false\0222\n&deprecated_legacy_js" + "on_field_conflicts\030\006 \001(\010B\002\030\001\022-\n\010features" + "\030\007 \001(\0132\033.google.protobuf.FeatureSet\022C\n\024u" + "ninterpreted_option\030\347\007 \003(\0132$.google.prot" + "obuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020" + "\006\"\311\001\n\020EnumValueOptions\022\031\n\ndeprecated\030\001 \001" + "(\010:\005false\022-\n\010features\030\002 \001(\0132\033.google.pro" + "tobuf.FeatureSet\022\033\n\014debug_redact\030\003 \001(\010:\005" + "false\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.g" + "oogle.protobuf.UninterpretedOption*\t\010\350\007\020" + "\200\200\200\200\002\"\252\001\n\016ServiceOptions\022-\n\010features\030\" \001" + "(\0132\033.google.protobuf.FeatureSet\022\031\n\ndepre" + "cated\030! \001(\010:\005false\022C\n\024uninterpreted_opti" + "on\030\347\007 \003(\0132$.google.protobuf.Uninterprete" + "dOption*\t\010\350\007\020\200\200\200\200\002\"\334\002\n\rMethodOptions\022\031\n\n" + "deprecated\030! \001(\010:\005false\022_\n\021idempotency_l" + "evel\030\" \001(\0162/.google.protobuf.MethodOptio" + "ns.IdempotencyLevel:\023IDEMPOTENCY_UNKNOWN" + "\022-\n\010features\030# \001(\0132\033.google.protobuf.Fea" + "tureSet\022C\n\024uninterpreted_option\030\347\007 \003(\0132$" + ".google.protobuf.UninterpretedOption\"P\n\020" + "IdempotencyLevel\022\027\n\023IDEMPOTENCY_UNKNOWN\020" + "\000\022\023\n\017NO_SIDE_EFFECTS\020\001\022\016\n\nIDEMPOTENT\020\002*\t" + "\010\350\007\020\200\200\200\200\002\"\236\002\n\023UninterpretedOption\022;\n\004nam" + "e\030\002 \003(\0132-.google.protobuf.UninterpretedO" + "ption.NamePart\022\030\n\020identifier_value\030\003 \001(\t" + "\022\032\n\022positive_int_value\030\004 \001(\004\022\032\n\022negative" + "_int_value\030\005 \001(\003\022\024\n\014double_value\030\006 \001(\001\022\024" + "\n\014string_value\030\007 \001(\014\022\027\n\017aggregate_value\030" + "\010 \001(\t\0323\n\010NamePart\022\021\n\tname_part\030\001 \002(\t\022\024\n\014" + "is_extension\030\002 \002(\010\"\361\010\n\nFeatureSet\022_\n\016fie" + "ld_presence\030\001 \001(\0162).google.protobuf.Feat" + "ureSet.FieldPresenceB\034\210\001\001\230\001\004\230\001\001\242\001\020\n\0042023" + "\022\010EXPLICIT\022Q\n\tenum_type\030\002 \001(\0162$.google.p" + "rotobuf.FeatureSet.EnumTypeB\030\210\001\001\230\001\006\230\001\001\242\001" + "\014\n\0042023\022\004OPEN\022n\n\027repeated_field_encoding" + "\030\003 \001(\01621.google.protobuf.FeatureSet.Repe" + "atedFieldEncodingB\032\210\001\001\230\001\004\230\001\001\242\001\016\n\0042023\022\006P" + "ACKED\022q\n\027string_field_validation\030\004 \001(\01621" + ".google.protobuf.FeatureSet.StringFieldV" + "alidationB\035\210\001\001\230\001\004\230\001\001\242\001\021\n\0042023\022\tMANDATORY" + "\022j\n\020message_encoding\030\005 \001(\0162+.google.prot" + "obuf.FeatureSet.MessageEncodingB#\210\001\001\230\001\004\230" + "\001\001\242\001\027\n\0042023\022\017LENGTH_PREFIXED\022Y\n\013json_for" + "mat\030\006 \001(\0162&.google.protobuf.FeatureSet.J" + "sonFormatB\034\210\001\001\230\001\003\230\001\006\230\001\001\242\001\r\n\0042023\022\005ALLOW\"" + "\\\n\rFieldPresence\022\032\n\026FIELD_PRESENCE_UNKNO" + "WN\020\000\022\014\n\010EXPLICIT\020\001\022\014\n\010IMPLICIT\020\002\022\023\n\017LEGA" + "CY_REQUIRED\020\003\"7\n\010EnumType\022\025\n\021ENUM_TYPE_U" + "NKNOWN\020\000\022\010\n\004OPEN\020\001\022\n\n\006CLOSED\020\002\"V\n\025Repeat" + "edFieldEncoding\022#\n\037REPEATED_FIELD_ENCODI" + "NG_UNKNOWN\020\000\022\n\n\006PACKED\020\001\022\014\n\010EXPANDED\020\002\"_" + "\n\025StringFieldValidation\022#\n\037STRING_FIELD_" + "VALIDATION_UNKNOWN\020\000\022\r\n\tMANDATORY\020\001\022\010\n\004H" + "INT\020\002\022\010\n\004NONE\020\003\"S\n\017MessageEncoding\022\034\n\030ME" + "SSAGE_ENCODING_UNKNOWN\020\000\022\023\n\017LENGTH_PREFI" + "XED\020\001\022\r\n\tDELIMITED\020\002\"H\n\nJsonFormat\022\027\n\023JS" + "ON_FORMAT_UNKNOWN\020\000\022\t\n\005ALLOW\020\001\022\026\n\022LEGACY" + "_BEST_EFFORT\020\002*\006\010\350\007\020\351\007*\006\010\351\007\020\352\007*\006\010\213N\020\220N\"\325" + "\001\n\016SourceCodeInfo\022:\n\010location\030\001 \003(\0132(.go" + "ogle.protobuf.SourceCodeInfo.Location\032\206\001" + "\n\010Location\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003" + "(\005B\002\020\001\022\030\n\020leading_comments\030\003 \001(\t\022\031\n\021trai" + "ling_comments\030\004 \001(\t\022!\n\031leading_detached_" + "comments\030\006 \003(\t\"\234\002\n\021GeneratedCodeInfo\022A\n\n" + "annotation\030\001 \003(\0132-.google.protobuf.Gener" + "atedCodeInfo.Annotation\032\303\001\n\nAnnotation\022\020" + "\n\004path\030\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 \001(\t\022\r\n" + "\005begin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005\022H\n\010semantic\030\005 " + "\001(\01626.google.protobuf.GeneratedCodeInfo." + "Annotation.Semantic\"(\n\010Semantic\022\010\n\004NONE\020" + "\000\022\007\n\003SET\020\001\022\t\n\005ALIAS\020\002B~\n\023com.google.prot" + "obufB\020DescriptorProtosH\001Z-google.golang." + "org/protobuf/types/descriptorpb\370\001\001\242\002\003GPB" + "\252\002\032Google.Protobuf.Reflection" }; static ::absl::once_flag descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto = { false, false, - 7302, + 8989, descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto, "google/protobuf/descriptor.proto", &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, nullptr, 0, - 28, + 30, schemas, file_default_instances, TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets, @@ -1686,6 +1853,7 @@ _ServiceDescriptorProto_default_instance_.Init(); _MethodDescriptorProto_default_instance_.Init(); _FileOptions_default_instance_.Init(); _MessageOptions_default_instance_.Init(); +_FieldOptions_EditionDefault_default_instance_.Init(); _FieldOptions_default_instance_.Init(); _OneofOptions_default_instance_.Init(); _EnumOptions_default_instance_.Init(); @@ -1694,6 +1862,7 @@ _ServiceOptions_default_instance_.Init(); _MethodOptions_default_instance_.Init(); _UninterpretedOption_NamePart_default_instance_.Init(); _UninterpretedOption_default_instance_.Init(); +_FeatureSet_default_instance_.Init(); _SourceCodeInfo_Location_default_instance_.Init(); _SourceCodeInfo_default_instance_.Init(); _GeneratedCodeInfo_Annotation_default_instance_.Init(); @@ -1984,10 +2153,170 @@ constexpr int MethodOptions::IdempotencyLevel_ARRAYSIZE; #endif // (__cplusplus < 201703) && // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::google::protobuf::EnumDescriptor* GeneratedCodeInfo_Annotation_Semantic_descriptor() { +const ::google::protobuf::EnumDescriptor* FeatureSet_FieldPresence_descriptor() { ::google::protobuf::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[9]; } +bool FeatureSet_FieldPresence_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} +#if (__cplusplus < 201703) && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +constexpr FeatureSet_FieldPresence FeatureSet::FIELD_PRESENCE_UNKNOWN; +constexpr FeatureSet_FieldPresence FeatureSet::EXPLICIT; +constexpr FeatureSet_FieldPresence FeatureSet::IMPLICIT; +constexpr FeatureSet_FieldPresence FeatureSet::LEGACY_REQUIRED; +constexpr FeatureSet_FieldPresence FeatureSet::FieldPresence_MIN; +constexpr FeatureSet_FieldPresence FeatureSet::FieldPresence_MAX; +constexpr int FeatureSet::FieldPresence_ARRAYSIZE; + +#endif // (__cplusplus < 201703) && + // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::google::protobuf::EnumDescriptor* FeatureSet_EnumType_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); + return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[10]; +} +bool FeatureSet_EnumType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} +#if (__cplusplus < 201703) && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +constexpr FeatureSet_EnumType FeatureSet::ENUM_TYPE_UNKNOWN; +constexpr FeatureSet_EnumType FeatureSet::OPEN; +constexpr FeatureSet_EnumType FeatureSet::CLOSED; +constexpr FeatureSet_EnumType FeatureSet::EnumType_MIN; +constexpr FeatureSet_EnumType FeatureSet::EnumType_MAX; +constexpr int FeatureSet::EnumType_ARRAYSIZE; + +#endif // (__cplusplus < 201703) && + // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::google::protobuf::EnumDescriptor* FeatureSet_RepeatedFieldEncoding_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); + return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[11]; +} +bool FeatureSet_RepeatedFieldEncoding_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} +#if (__cplusplus < 201703) && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +constexpr FeatureSet_RepeatedFieldEncoding FeatureSet::REPEATED_FIELD_ENCODING_UNKNOWN; +constexpr FeatureSet_RepeatedFieldEncoding FeatureSet::PACKED; +constexpr FeatureSet_RepeatedFieldEncoding FeatureSet::EXPANDED; +constexpr FeatureSet_RepeatedFieldEncoding FeatureSet::RepeatedFieldEncoding_MIN; +constexpr FeatureSet_RepeatedFieldEncoding FeatureSet::RepeatedFieldEncoding_MAX; +constexpr int FeatureSet::RepeatedFieldEncoding_ARRAYSIZE; + +#endif // (__cplusplus < 201703) && + // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::google::protobuf::EnumDescriptor* FeatureSet_StringFieldValidation_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); + return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[12]; +} +bool FeatureSet_StringFieldValidation_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} +#if (__cplusplus < 201703) && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +constexpr FeatureSet_StringFieldValidation FeatureSet::STRING_FIELD_VALIDATION_UNKNOWN; +constexpr FeatureSet_StringFieldValidation FeatureSet::MANDATORY; +constexpr FeatureSet_StringFieldValidation FeatureSet::HINT; +constexpr FeatureSet_StringFieldValidation FeatureSet::NONE; +constexpr FeatureSet_StringFieldValidation FeatureSet::StringFieldValidation_MIN; +constexpr FeatureSet_StringFieldValidation FeatureSet::StringFieldValidation_MAX; +constexpr int FeatureSet::StringFieldValidation_ARRAYSIZE; + +#endif // (__cplusplus < 201703) && + // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::google::protobuf::EnumDescriptor* FeatureSet_MessageEncoding_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); + return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[13]; +} +bool FeatureSet_MessageEncoding_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} +#if (__cplusplus < 201703) && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +constexpr FeatureSet_MessageEncoding FeatureSet::MESSAGE_ENCODING_UNKNOWN; +constexpr FeatureSet_MessageEncoding FeatureSet::LENGTH_PREFIXED; +constexpr FeatureSet_MessageEncoding FeatureSet::DELIMITED; +constexpr FeatureSet_MessageEncoding FeatureSet::MessageEncoding_MIN; +constexpr FeatureSet_MessageEncoding FeatureSet::MessageEncoding_MAX; +constexpr int FeatureSet::MessageEncoding_ARRAYSIZE; + +#endif // (__cplusplus < 201703) && + // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::google::protobuf::EnumDescriptor* FeatureSet_JsonFormat_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); + return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[14]; +} +bool FeatureSet_JsonFormat_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} +#if (__cplusplus < 201703) && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +constexpr FeatureSet_JsonFormat FeatureSet::JSON_FORMAT_UNKNOWN; +constexpr FeatureSet_JsonFormat FeatureSet::ALLOW; +constexpr FeatureSet_JsonFormat FeatureSet::LEGACY_BEST_EFFORT; +constexpr FeatureSet_JsonFormat FeatureSet::JsonFormat_MIN; +constexpr FeatureSet_JsonFormat FeatureSet::JsonFormat_MAX; +constexpr int FeatureSet::JsonFormat_ARRAYSIZE; + +#endif // (__cplusplus < 201703) && + // (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::google::protobuf::EnumDescriptor* GeneratedCodeInfo_Annotation_Semantic_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto); + return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[15]; +} bool GeneratedCodeInfo_Annotation_Semantic_IsValid(int value) { switch (value) { case 0: @@ -4199,11 +4528,18 @@ class ExtensionRangeOptions::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_._has_bits_); - static void set_has_verification(HasBits* has_bits) { + static const ::google::protobuf::FeatureSet& features(const ExtensionRangeOptions* msg); + static void set_has_features(HasBits* has_bits) { (*has_bits)[0] |= 1u; } + static void set_has_verification(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } }; +const ::google::protobuf::FeatureSet& ExtensionRangeOptions::_Internal::features(const ExtensionRangeOptions* msg) { + return *msg->_impl_.features_; +} ExtensionRangeOptions::ExtensionRangeOptions(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -4218,12 +4554,16 @@ ExtensionRangeOptions::ExtensionRangeOptions(const ExtensionRangeOptions& from) /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.declaration_){from._impl_.declaration_}, decltype(_impl_.uninterpreted_option_){from._impl_.uninterpreted_option_}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.verification_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.features_ = new ::google::protobuf::FeatureSet(*from._impl_.features_); + } _this->_impl_.verification_ = from._impl_.verification_; // @@protoc_insertion_point(copy_constructor:google.protobuf.ExtensionRangeOptions) @@ -4236,6 +4576,7 @@ inline void ExtensionRangeOptions::SharedCtor(::_pb::Arena* arena) { /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.declaration_){arena}, decltype(_impl_.uninterpreted_option_){arena}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.verification_){1}, }; } @@ -4249,6 +4590,7 @@ inline void ExtensionRangeOptions::SharedDtor() { _impl_._extensions_.~ExtensionSet(); _impl_.declaration_.~RepeatedPtrField(); _impl_.uninterpreted_option_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.features_; } void ExtensionRangeOptions::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -4263,7 +4605,14 @@ PROTOBUF_NOINLINE void ExtensionRangeOptions::Clear() { _impl_._extensions_.Clear(); _internal_mutable_declaration()->Clear(); _internal_mutable_uninterpreted_option()->Clear(); - _impl_.verification_ = 1; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.features_ != nullptr); + _impl_.features_->Clear(); + } + _impl_.verification_ = 1; + } _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -4275,43 +4624,56 @@ const char* ExtensionRangeOptions::_InternalParse( } -constexpr ::_pbi::TcParseTable<1, 3, 3, 0, 7> ExtensionRangeOptions::_table_ = { +constexpr ::_pbi::TcParseTable<3, 4, 4, 0, 12> ExtensionRangeOptions::_table_ = { { PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_._extensions_), - 999, 8, // max_field_number, fast_idx_mask + 999, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), 4294967289, // skipmap offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 3, // num_aux_entries + 4, // num_field_entries + 4, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_ExtensionRangeOptions_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, // repeated .google.protobuf.ExtensionRangeOptions.Declaration declaration = 2 [retention = RETENTION_SOURCE]; {::_pbi::TcParser::FastMtR1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.declaration_)}}, // optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; {::_pbi::TcParser::FastEr0S1, - {24, 0, 1, PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.verification_)}}, + {24, 1, 1, PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.verification_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + {::_pbi::TcParser::FastMtR2, + {16058, 63, 3, PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.uninterpreted_option_)}}, }}, {{ - 999, 0, 1, - 65534, 2, + 50, 0, 1, + 65534, 2,999, 0, 1, + 65534, 3, 65535, 65535 }}, {{ // repeated .google.protobuf.ExtensionRangeOptions.Declaration declaration = 2 [retention = RETENTION_SOURCE]; {PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.declaration_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, // optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; - {PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.verification_), _Internal::kHasBitsOffset + 0, 1, + {PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.verification_), _Internal::kHasBitsOffset + 1, 1, (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + // optional .google.protobuf.FeatureSet features = 50; + {PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 2, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.uninterpreted_option_), -1, 2, + {PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.uninterpreted_option_), -1, 3, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ {::_pbi::TcParser::GetTable<::google::protobuf::ExtensionRangeOptions_Declaration>()}, {0, 2}, + {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, }}, {{ }}, @@ -4334,12 +4696,19 @@ constexpr ::_pbi::TcParseTable<1, 3, 3, 0, 7> ExtensionRangeOptions::_table_ = { cached_has_bits = _impl_._has_bits_[0]; // optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; - if (cached_has_bits & 0x00000001u) { + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( 3, this->_internal_verification(), target); } + // optional .google.protobuf.FeatureSet features = 50; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(50, _Internal::features(this), + _Internal::features(this).GetCachedSize(), target, stream); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned i = 0, n = static_cast(this->_internal_uninterpreted_option_size()); i < n; i++) { @@ -4382,13 +4751,22 @@ constexpr ::_pbi::TcParseTable<1, 3, 3, 0, 7> ExtensionRangeOptions::_table_ = { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } - // optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_verification()); - } + if (cached_has_bits & 0x00000003u) { + // optional .google.protobuf.FeatureSet features = 50; + if (cached_has_bits & 0x00000001u) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.features_); + } + // optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_verification()); + } + + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -4409,8 +4787,16 @@ void ExtensionRangeOptions::MergeImpl(::google::protobuf::Message& to_msg, const _this->_internal_mutable_declaration()->MergeFrom(from._internal_declaration()); _this->_internal_mutable_uninterpreted_option()->MergeFrom(from._internal_uninterpreted_option()); - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_set_verification(from._internal_verification()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_mutable_features()->::google::protobuf::FeatureSet::MergeFrom( + from._internal_features()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.verification_ = from._impl_.verification_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); @@ -4429,6 +4815,9 @@ PROTOBUF_NOINLINE bool ExtensionRangeOptions::IsInitialized() const { } if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false; + if ((_impl_._has_bits_[0] & 0x00000001u) != 0) { + if (!_impl_.features_->IsInitialized()) return false; + } return true; } @@ -4439,7 +4828,12 @@ void ExtensionRangeOptions::InternalSwap(ExtensionRangeOptions* other) { swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); _impl_.declaration_.InternalSwap(&other->_impl_.declaration_); _impl_.uninterpreted_option_.InternalSwap(&other->_impl_.uninterpreted_option_); - swap(_impl_.verification_, other->_impl_.verification_); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.verification_) + + sizeof(ExtensionRangeOptions::_impl_.verification_) + - PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_.features_)>( + reinterpret_cast(&_impl_.features_), + reinterpret_cast(&other->_impl_.features_)); } ::google::protobuf::Metadata ExtensionRangeOptions::GetMetadata() const { @@ -6878,37 +7272,37 @@ class FileOptions::_Internal { (*has_bits)[0] |= 2u; } static void set_has_java_multiple_files(HasBits* has_bits) { - (*has_bits)[0] |= 1024u; - } - static void set_has_java_generate_equals_and_hash(HasBits* has_bits) { (*has_bits)[0] |= 2048u; } - static void set_has_java_string_check_utf8(HasBits* has_bits) { + static void set_has_java_generate_equals_and_hash(HasBits* has_bits) { (*has_bits)[0] |= 4096u; } + static void set_has_java_string_check_utf8(HasBits* has_bits) { + (*has_bits)[0] |= 8192u; + } static void set_has_optimize_for(HasBits* has_bits) { - (*has_bits)[0] |= 262144u; + (*has_bits)[0] |= 524288u; } static void set_has_go_package(HasBits* has_bits) { (*has_bits)[0] |= 4u; } static void set_has_cc_generic_services(HasBits* has_bits) { - (*has_bits)[0] |= 8192u; - } - static void set_has_java_generic_services(HasBits* has_bits) { (*has_bits)[0] |= 16384u; } - static void set_has_py_generic_services(HasBits* has_bits) { + static void set_has_java_generic_services(HasBits* has_bits) { (*has_bits)[0] |= 32768u; } - static void set_has_php_generic_services(HasBits* has_bits) { + static void set_has_py_generic_services(HasBits* has_bits) { (*has_bits)[0] |= 65536u; } - static void set_has_deprecated(HasBits* has_bits) { + static void set_has_php_generic_services(HasBits* has_bits) { (*has_bits)[0] |= 131072u; } + static void set_has_deprecated(HasBits* has_bits) { + (*has_bits)[0] |= 262144u; + } static void set_has_cc_enable_arenas(HasBits* has_bits) { - (*has_bits)[0] |= 524288u; + (*has_bits)[0] |= 1048576u; } static void set_has_objc_class_prefix(HasBits* has_bits) { (*has_bits)[0] |= 8u; @@ -6931,8 +7325,15 @@ class FileOptions::_Internal { static void set_has_ruby_package(HasBits* has_bits) { (*has_bits)[0] |= 512u; } + static const ::google::protobuf::FeatureSet& features(const FileOptions* msg); + static void set_has_features(HasBits* has_bits) { + (*has_bits)[0] |= 1024u; + } }; +const ::google::protobuf::FeatureSet& FileOptions::_Internal::features(const FileOptions* msg) { + return *msg->_impl_.features_; +} FileOptions::FileOptions(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -6956,6 +7357,7 @@ FileOptions::FileOptions(const FileOptions& from) : ::google::protobuf::Message( decltype(_impl_.php_namespace_){}, decltype(_impl_.php_metadata_namespace_){}, decltype(_impl_.ruby_package_){}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.java_multiple_files_){}, decltype(_impl_.java_generate_equals_and_hash_){}, decltype(_impl_.java_string_check_utf8_){}, @@ -7041,6 +7443,9 @@ FileOptions::FileOptions(const FileOptions& from) : ::google::protobuf::Message( if ((from._impl_._has_bits_[0] & 0x00000200u) != 0) { _this->_impl_.ruby_package_.Set(from._internal_ruby_package(), _this->GetArenaForAllocation()); } + if ((from._impl_._has_bits_[0] & 0x00000400u) != 0) { + _this->_impl_.features_ = new ::google::protobuf::FeatureSet(*from._impl_.features_); + } ::memcpy(&_impl_.java_multiple_files_, &from._impl_.java_multiple_files_, static_cast<::size_t>(reinterpret_cast(&_impl_.cc_enable_arenas_) - reinterpret_cast(&_impl_.java_multiple_files_)) + sizeof(_impl_.cc_enable_arenas_)); @@ -7064,6 +7469,7 @@ inline void FileOptions::SharedCtor(::_pb::Arena* arena) { decltype(_impl_.php_namespace_){}, decltype(_impl_.php_metadata_namespace_){}, decltype(_impl_.ruby_package_){}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.java_multiple_files_){false}, decltype(_impl_.java_generate_equals_and_hash_){false}, decltype(_impl_.java_string_check_utf8_){false}, @@ -7135,6 +7541,7 @@ inline void FileOptions::SharedDtor() { _impl_.php_namespace_.Destroy(); _impl_.php_metadata_namespace_.Destroy(); _impl_.ruby_package_.Destroy(); + if (this != internal_default_instance()) delete _impl_.features_; } void FileOptions::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -7175,23 +7582,27 @@ PROTOBUF_NOINLINE void FileOptions::Clear() { _impl_.php_namespace_.ClearNonDefaultToEmpty(); } } - if (cached_has_bits & 0x00000300u) { + if (cached_has_bits & 0x00000700u) { if (cached_has_bits & 0x00000100u) { _impl_.php_metadata_namespace_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000200u) { _impl_.ruby_package_.ClearNonDefaultToEmpty(); } + if (cached_has_bits & 0x00000400u) { + ABSL_DCHECK(_impl_.features_ != nullptr); + _impl_.features_->Clear(); + } } - if (cached_has_bits & 0x0000fc00u) { + if (cached_has_bits & 0x0000f800u) { ::memset(&_impl_.java_multiple_files_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.py_generic_services_) - - reinterpret_cast(&_impl_.java_multiple_files_)) + sizeof(_impl_.py_generic_services_)); + reinterpret_cast(&_impl_.java_generic_services_) - + reinterpret_cast(&_impl_.java_multiple_files_)) + sizeof(_impl_.java_generic_services_)); } - if (cached_has_bits & 0x000f0000u) { - ::memset(&_impl_.php_generic_services_, 0, static_cast<::size_t>( + if (cached_has_bits & 0x001f0000u) { + ::memset(&_impl_.py_generic_services_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.deprecated_) - - reinterpret_cast(&_impl_.php_generic_services_)) + sizeof(_impl_.deprecated_)); + reinterpret_cast(&_impl_.py_generic_services_)) + sizeof(_impl_.deprecated_)); _impl_.optimize_for_ = 1; _impl_.cc_enable_arenas_ = true; } @@ -7206,7 +7617,7 @@ const char* FileOptions::_InternalParse( } -constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { +constexpr ::_pbi::TcParseTable<5, 22, 3, 202, 12> FileOptions::_table_ = { { PROTOBUF_FIELD_OFFSET(FileOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(FileOptions, _impl_._extensions_), @@ -7214,8 +7625,8 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { offsetof(decltype(_table_), field_lookup_table), 3149166718, // skipmap offsetof(decltype(_table_), field_entries), - 21, // num_field_entries - 2, // num_aux_entries + 22, // num_field_entries + 3, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_FileOptions_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback @@ -7235,10 +7646,10 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { {66, 1, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_outer_classname_)}}, // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; {::_pbi::TcParser::FastEr1S1, - {72, 18, 3, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.optimize_for_)}}, + {72, 19, 3, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.optimize_for_)}}, // optional bool java_multiple_files = 10 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {80, 10, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_multiple_files_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {80, 11, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_multiple_files_)}}, // optional string go_package = 11; {::_pbi::TcParser::FastSS1, {90, 2, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.go_package_)}}, @@ -7248,24 +7659,24 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { {::_pbi::TcParser::MiniParse, {}}, // optional bool cc_generic_services = 16 [default = false]; {::_pbi::TcParser::FastV8S2, - {384, 13, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.cc_generic_services_)}}, + {384, 14, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.cc_generic_services_)}}, // optional bool java_generic_services = 17 [default = false]; {::_pbi::TcParser::FastV8S2, - {392, 14, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_generic_services_)}}, + {392, 15, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_generic_services_)}}, // optional bool py_generic_services = 18 [default = false]; {::_pbi::TcParser::FastV8S2, - {400, 15, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.py_generic_services_)}}, + {400, 16, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.py_generic_services_)}}, {::_pbi::TcParser::MiniParse, {}}, // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; {::_pbi::TcParser::FastV8S2, - {416, 11, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_generate_equals_and_hash_)}}, + {416, 12, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_generate_equals_and_hash_)}}, // optional string csharp_namespace = 37; {::_pbi::TcParser::FastSS2, {682, 4, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.csharp_namespace_)}}, {::_pbi::TcParser::MiniParse, {}}, // optional bool deprecated = 23 [default = false]; {::_pbi::TcParser::FastV8S2, - {440, 17, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.deprecated_)}}, + {440, 18, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.deprecated_)}}, // optional string php_class_prefix = 40; {::_pbi::TcParser::FastSS2, {706, 6, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.php_class_prefix_)}}, @@ -7274,10 +7685,10 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { {714, 7, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.php_namespace_)}}, // optional bool php_generic_services = 42 [default = false]; {::_pbi::TcParser::FastV8S2, - {720, 16, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.php_generic_services_)}}, + {720, 17, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.php_generic_services_)}}, // optional bool java_string_check_utf8 = 27 [default = false]; {::_pbi::TcParser::FastV8S2, - {472, 12, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_string_check_utf8_)}}, + {472, 13, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_string_check_utf8_)}}, // optional string php_metadata_namespace = 44; {::_pbi::TcParser::FastSS2, {738, 8, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.php_metadata_namespace_)}}, @@ -7287,11 +7698,11 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { {::_pbi::TcParser::MiniParse, {}}, // optional bool cc_enable_arenas = 31 [default = true]; {::_pbi::TcParser::FastV8S2, - {504, 19, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.cc_enable_arenas_)}}, + {504, 20, 0, PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.cc_enable_arenas_)}}, }}, {{ 36, 0, 1, - 64644, 12,999, 0, 1, - 65534, 20, + 48260, 12,999, 0, 1, + 65534, 21, 65535, 65535 }}, {{ // optional string java_package = 1; @@ -7301,34 +7712,34 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_outer_classname_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.optimize_for_), _Internal::kHasBitsOffset + 18, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.optimize_for_), _Internal::kHasBitsOffset + 19, 0, (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, // optional bool java_multiple_files = 10 [default = false]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_multiple_files_), _Internal::kHasBitsOffset + 10, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_multiple_files_), _Internal::kHasBitsOffset + 11, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional string go_package = 11; {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.go_package_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, // optional bool cc_generic_services = 16 [default = false]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.cc_generic_services_), _Internal::kHasBitsOffset + 13, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.cc_generic_services_), _Internal::kHasBitsOffset + 14, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool java_generic_services = 17 [default = false]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_generic_services_), _Internal::kHasBitsOffset + 14, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_generic_services_), _Internal::kHasBitsOffset + 15, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool py_generic_services = 18 [default = false]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.py_generic_services_), _Internal::kHasBitsOffset + 15, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.py_generic_services_), _Internal::kHasBitsOffset + 16, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_generate_equals_and_hash_), _Internal::kHasBitsOffset + 11, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_generate_equals_and_hash_), _Internal::kHasBitsOffset + 12, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool deprecated = 23 [default = false]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 17, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 18, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool java_string_check_utf8 = 27 [default = false]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_string_check_utf8_), _Internal::kHasBitsOffset + 12, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_string_check_utf8_), _Internal::kHasBitsOffset + 13, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool cc_enable_arenas = 31 [default = true]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.cc_enable_arenas_), _Internal::kHasBitsOffset + 19, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.cc_enable_arenas_), _Internal::kHasBitsOffset + 20, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional string objc_class_prefix = 36; {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.objc_class_prefix_), _Internal::kHasBitsOffset + 3, 0, @@ -7346,7 +7757,7 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.php_namespace_), _Internal::kHasBitsOffset + 7, 0, (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, // optional bool php_generic_services = 42 [default = false]; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.php_generic_services_), _Internal::kHasBitsOffset + 16, 0, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.php_generic_services_), _Internal::kHasBitsOffset + 17, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional string php_metadata_namespace = 44; {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.php_metadata_namespace_), _Internal::kHasBitsOffset + 8, 0, @@ -7354,11 +7765,15 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { // optional string ruby_package = 45; {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.ruby_package_), _Internal::kHasBitsOffset + 9, 0, (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, + // optional .google.protobuf.FeatureSet features = 50; + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.features_), _Internal::kHasBitsOffset + 10, 1, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.uninterpreted_option_), -1, 1, + {PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.uninterpreted_option_), -1, 2, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ {1, 3}, + {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, }}, {{ "\33\14\24\0\0\12\0\0\0\0\0\0\0\21\20\14\20\15\0\26\14\0\0\0" @@ -7401,14 +7816,14 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { } // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; - if (cached_has_bits & 0x00040000u) { + if (cached_has_bits & 0x00080000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( 9, this->_internal_optimize_for(), target); } // optional bool java_multiple_files = 10 [default = false]; - if (cached_has_bits & 0x00000400u) { + if (cached_has_bits & 0x00000800u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 10, this->_internal_java_multiple_files(), target); @@ -7423,49 +7838,49 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { } // optional bool cc_generic_services = 16 [default = false]; - if (cached_has_bits & 0x00002000u) { + if (cached_has_bits & 0x00004000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 16, this->_internal_cc_generic_services(), target); } // optional bool java_generic_services = 17 [default = false]; - if (cached_has_bits & 0x00004000u) { + if (cached_has_bits & 0x00008000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 17, this->_internal_java_generic_services(), target); } // optional bool py_generic_services = 18 [default = false]; - if (cached_has_bits & 0x00008000u) { + if (cached_has_bits & 0x00010000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 18, this->_internal_py_generic_services(), target); } // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; - if (cached_has_bits & 0x00000800u) { + if (cached_has_bits & 0x00001000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 20, this->_internal_java_generate_equals_and_hash(), target); } // optional bool deprecated = 23 [default = false]; - if (cached_has_bits & 0x00020000u) { + if (cached_has_bits & 0x00040000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 23, this->_internal_deprecated(), target); } // optional bool java_string_check_utf8 = 27 [default = false]; - if (cached_has_bits & 0x00001000u) { + if (cached_has_bits & 0x00002000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 27, this->_internal_java_string_check_utf8(), target); } // optional bool cc_enable_arenas = 31 [default = true]; - if (cached_has_bits & 0x00080000u) { + if (cached_has_bits & 0x00100000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 31, this->_internal_cc_enable_arenas(), target); @@ -7512,7 +7927,7 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { } // optional bool php_generic_services = 42 [default = false]; - if (cached_has_bits & 0x00010000u) { + if (cached_has_bits & 0x00020000u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 42, this->_internal_php_generic_services(), target); @@ -7534,6 +7949,13 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { target = stream->WriteStringMaybeAliased(45, _s, target); } + // optional .google.protobuf.FeatureSet features = 50; + if (cached_has_bits & 0x00000400u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(50, _Internal::features(this), + _Internal::features(this).GetCachedSize(), target, stream); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned i = 0, n = static_cast(this->_internal_uninterpreted_option_size()); i < n; i++) { @@ -7634,56 +8056,63 @@ constexpr ::_pbi::TcParseTable<5, 21, 2, 202, 12> FileOptions::_table_ = { this->_internal_ruby_package()); } - // optional bool java_multiple_files = 10 [default = false]; + // optional .google.protobuf.FeatureSet features = 50; if (cached_has_bits & 0x00000400u) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.features_); + } + + // optional bool java_multiple_files = 10 [default = false]; + if (cached_has_bits & 0x00000800u) { total_size += 2; } // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; - if (cached_has_bits & 0x00000800u) { - total_size += 3; - } - - // optional bool java_string_check_utf8 = 27 [default = false]; if (cached_has_bits & 0x00001000u) { total_size += 3; } - // optional bool cc_generic_services = 16 [default = false]; + // optional bool java_string_check_utf8 = 27 [default = false]; if (cached_has_bits & 0x00002000u) { total_size += 3; } - // optional bool java_generic_services = 17 [default = false]; + // optional bool cc_generic_services = 16 [default = false]; if (cached_has_bits & 0x00004000u) { total_size += 3; } - // optional bool py_generic_services = 18 [default = false]; + // optional bool java_generic_services = 17 [default = false]; if (cached_has_bits & 0x00008000u) { total_size += 3; } } - if (cached_has_bits & 0x000f0000u) { - // optional bool php_generic_services = 42 [default = false]; + if (cached_has_bits & 0x001f0000u) { + // optional bool py_generic_services = 18 [default = false]; if (cached_has_bits & 0x00010000u) { total_size += 3; } - // optional bool deprecated = 23 [default = false]; + // optional bool php_generic_services = 42 [default = false]; if (cached_has_bits & 0x00020000u) { total_size += 3; } - // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + // optional bool deprecated = 23 [default = false]; if (cached_has_bits & 0x00040000u) { + total_size += 3; + } + + // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + if (cached_has_bits & 0x00080000u) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_optimize_for()); } // optional bool cc_enable_arenas = 31 [default = true]; - if (cached_has_bits & 0x00080000u) { + if (cached_has_bits & 0x00100000u) { total_size += 3; } @@ -7742,36 +8171,40 @@ void FileOptions::MergeImpl(::google::protobuf::Message& to_msg, const ::google: _this->_internal_set_ruby_package(from._internal_ruby_package()); } if (cached_has_bits & 0x00000400u) { - _this->_impl_.java_multiple_files_ = from._impl_.java_multiple_files_; + _this->_internal_mutable_features()->::google::protobuf::FeatureSet::MergeFrom( + from._internal_features()); } if (cached_has_bits & 0x00000800u) { - _this->_impl_.java_generate_equals_and_hash_ = from._impl_.java_generate_equals_and_hash_; + _this->_impl_.java_multiple_files_ = from._impl_.java_multiple_files_; } if (cached_has_bits & 0x00001000u) { - _this->_impl_.java_string_check_utf8_ = from._impl_.java_string_check_utf8_; + _this->_impl_.java_generate_equals_and_hash_ = from._impl_.java_generate_equals_and_hash_; } if (cached_has_bits & 0x00002000u) { - _this->_impl_.cc_generic_services_ = from._impl_.cc_generic_services_; + _this->_impl_.java_string_check_utf8_ = from._impl_.java_string_check_utf8_; } if (cached_has_bits & 0x00004000u) { - _this->_impl_.java_generic_services_ = from._impl_.java_generic_services_; + _this->_impl_.cc_generic_services_ = from._impl_.cc_generic_services_; } if (cached_has_bits & 0x00008000u) { - _this->_impl_.py_generic_services_ = from._impl_.py_generic_services_; + _this->_impl_.java_generic_services_ = from._impl_.java_generic_services_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (cached_has_bits & 0x000f0000u) { + if (cached_has_bits & 0x001f0000u) { if (cached_has_bits & 0x00010000u) { - _this->_impl_.php_generic_services_ = from._impl_.php_generic_services_; + _this->_impl_.py_generic_services_ = from._impl_.py_generic_services_; } if (cached_has_bits & 0x00020000u) { - _this->_impl_.deprecated_ = from._impl_.deprecated_; + _this->_impl_.php_generic_services_ = from._impl_.php_generic_services_; } if (cached_has_bits & 0x00040000u) { - _this->_impl_.optimize_for_ = from._impl_.optimize_for_; + _this->_impl_.deprecated_ = from._impl_.deprecated_; } if (cached_has_bits & 0x00080000u) { + _this->_impl_.optimize_for_ = from._impl_.optimize_for_; + } + if (cached_has_bits & 0x00100000u) { _this->_impl_.cc_enable_arenas_ = from._impl_.cc_enable_arenas_; } _this->_impl_._has_bits_[0] |= cached_has_bits; @@ -7793,6 +8226,9 @@ PROTOBUF_NOINLINE bool FileOptions::IsInitialized() const { } if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false; + if ((_impl_._has_bits_[0] & 0x00000400u) != 0) { + if (!_impl_.features_->IsInitialized()) return false; + } return true; } @@ -7827,9 +8263,9 @@ void FileOptions::InternalSwap(FileOptions* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.cc_enable_arenas_) + sizeof(FileOptions::_impl_.cc_enable_arenas_) - - PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.java_multiple_files_)>( - reinterpret_cast(&_impl_.java_multiple_files_), - reinterpret_cast(&other->_impl_.java_multiple_files_)); + - PROTOBUF_FIELD_OFFSET(FileOptions, _impl_.features_)>( + reinterpret_cast(&_impl_.features_), + reinterpret_cast(&other->_impl_.features_)); } ::google::protobuf::Metadata FileOptions::GetMetadata() const { @@ -7845,22 +8281,29 @@ class MessageOptions::_Internal { static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_._has_bits_); static void set_has_message_set_wire_format(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static void set_has_no_standard_descriptor_accessor(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_deprecated(HasBits* has_bits) { + static void set_has_no_standard_descriptor_accessor(HasBits* has_bits) { (*has_bits)[0] |= 4u; } - static void set_has_map_entry(HasBits* has_bits) { + static void set_has_deprecated(HasBits* has_bits) { (*has_bits)[0] |= 8u; } - static void set_has_deprecated_legacy_json_field_conflicts(HasBits* has_bits) { + static void set_has_map_entry(HasBits* has_bits) { (*has_bits)[0] |= 16u; } + static void set_has_deprecated_legacy_json_field_conflicts(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } + static const ::google::protobuf::FeatureSet& features(const MessageOptions* msg); + static void set_has_features(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } }; +const ::google::protobuf::FeatureSet& MessageOptions::_Internal::features(const MessageOptions* msg) { + return *msg->_impl_.features_; +} MessageOptions::MessageOptions(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -7874,6 +8317,7 @@ MessageOptions::MessageOptions(const MessageOptions& from) : ::google::protobuf: decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){from._impl_.uninterpreted_option_}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.message_set_wire_format_){}, decltype(_impl_.no_standard_descriptor_accessor_){}, decltype(_impl_.deprecated_){}, @@ -7884,6 +8328,9 @@ MessageOptions::MessageOptions(const MessageOptions& from) : ::google::protobuf: from._internal_metadata_); _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.features_ = new ::google::protobuf::FeatureSet(*from._impl_.features_); + } ::memcpy(&_impl_.message_set_wire_format_, &from._impl_.message_set_wire_format_, static_cast<::size_t>(reinterpret_cast(&_impl_.deprecated_legacy_json_field_conflicts_) - reinterpret_cast(&_impl_.message_set_wire_format_)) + sizeof(_impl_.deprecated_legacy_json_field_conflicts_)); @@ -7897,6 +8344,7 @@ inline void MessageOptions::SharedCtor(::_pb::Arena* arena) { decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){arena}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.message_set_wire_format_){false}, decltype(_impl_.no_standard_descriptor_accessor_){false}, decltype(_impl_.deprecated_){false}, @@ -7913,6 +8361,7 @@ inline void MessageOptions::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_._extensions_.~ExtensionSet(); _impl_.uninterpreted_option_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.features_; } void MessageOptions::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -7927,7 +8376,11 @@ PROTOBUF_NOINLINE void MessageOptions::Clear() { _impl_._extensions_.Clear(); _internal_mutable_uninterpreted_option()->Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000001fu) { + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.features_ != nullptr); + _impl_.features_->Clear(); + } + if (cached_has_bits & 0x0000003eu) { ::memset(&_impl_.message_set_wire_format_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.deprecated_legacy_json_field_conflicts_) - reinterpret_cast(&_impl_.message_set_wire_format_)) + sizeof(_impl_.deprecated_legacy_json_field_conflicts_)); @@ -7943,60 +8396,66 @@ const char* MessageOptions::_InternalParse( } -constexpr ::_pbi::TcParseTable<3, 6, 1, 0, 7> MessageOptions::_table_ = { +constexpr ::_pbi::TcParseTable<3, 7, 2, 0, 7> MessageOptions::_table_ = { { PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_._extensions_), 999, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294966200, // skipmap + 4294964152, // skipmap offsetof(decltype(_table_), field_entries), - 6, // num_field_entries - 1, // num_aux_entries + 7, // num_field_entries + 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_MessageOptions_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ {::_pbi::TcParser::MiniParse, {}}, // optional bool message_set_wire_format = 1 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {8, 0, 0, PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.message_set_wire_format_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {8, 1, 0, PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.message_set_wire_format_)}}, // optional bool no_standard_descriptor_accessor = 2 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {16, 1, 0, PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.no_standard_descriptor_accessor_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {16, 2, 0, PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.no_standard_descriptor_accessor_)}}, // optional bool deprecated = 3 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 2, 0, PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.deprecated_)}}, - {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 3, 0, PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.deprecated_)}}, + // optional .google.protobuf.FeatureSet features = 12; + {::_pbi::TcParser::FastMtS1, + {98, 0, 0, PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.features_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, // optional bool map_entry = 7; - {::_pbi::TcParser::SingularVarintNoZag1(), - {56, 3, 0, PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.map_entry_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {56, 4, 0, PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.map_entry_)}}, }}, {{ 999, 0, 1, - 65534, 5, + 65534, 6, 65535, 65535 }}, {{ // optional bool message_set_wire_format = 1 [default = false]; - {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.message_set_wire_format_), _Internal::kHasBitsOffset + 0, 0, + {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.message_set_wire_format_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool no_standard_descriptor_accessor = 2 [default = false]; - {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.no_standard_descriptor_accessor_), _Internal::kHasBitsOffset + 1, 0, + {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.no_standard_descriptor_accessor_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool deprecated = 3 [default = false]; - {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 2, 0, + {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool map_entry = 7; - {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.map_entry_), _Internal::kHasBitsOffset + 3, 0, + {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.map_entry_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; - {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.deprecated_legacy_json_field_conflicts_), _Internal::kHasBitsOffset + 4, 0, + {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.deprecated_legacy_json_field_conflicts_), _Internal::kHasBitsOffset + 5, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + // optional .google.protobuf.FeatureSet features = 12; + {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.uninterpreted_option_), -1, 0, + {PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.uninterpreted_option_), -1, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ + {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, }}, {{ }}, @@ -8011,40 +8470,47 @@ constexpr ::_pbi::TcParseTable<3, 6, 1, 0, 7> MessageOptions::_table_ = { cached_has_bits = _impl_._has_bits_[0]; // optional bool message_set_wire_format = 1 [default = false]; - if (cached_has_bits & 0x00000001u) { + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 1, this->_internal_message_set_wire_format(), target); } // optional bool no_standard_descriptor_accessor = 2 [default = false]; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 2, this->_internal_no_standard_descriptor_accessor(), target); } // optional bool deprecated = 3 [default = false]; - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 3, this->_internal_deprecated(), target); } // optional bool map_entry = 7; - if (cached_has_bits & 0x00000008u) { + if (cached_has_bits & 0x00000010u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 7, this->_internal_map_entry(), target); } // optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; - if (cached_has_bits & 0x00000010u) { + if (cached_has_bits & 0x00000020u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 11, this->_internal_deprecated_legacy_json_field_conflicts(), target); } + // optional .google.protobuf.FeatureSet features = 12; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(12, _Internal::features(this), + _Internal::features(this).GetCachedSize(), target, stream); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned i = 0, n = static_cast(this->_internal_uninterpreted_option_size()); i < n; i++) { @@ -8082,32 +8548,39 @@ constexpr ::_pbi::TcParseTable<3, 6, 1, 0, 7> MessageOptions::_table_ = { ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000001fu) { - // optional bool message_set_wire_format = 1 [default = false]; + if (cached_has_bits & 0x0000003fu) { + // optional .google.protobuf.FeatureSet features = 12; if (cached_has_bits & 0x00000001u) { - total_size += 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.features_); } - // optional bool no_standard_descriptor_accessor = 2 [default = false]; + // optional bool message_set_wire_format = 1 [default = false]; if (cached_has_bits & 0x00000002u) { total_size += 2; } - // optional bool deprecated = 3 [default = false]; + // optional bool no_standard_descriptor_accessor = 2 [default = false]; if (cached_has_bits & 0x00000004u) { total_size += 2; } - // optional bool map_entry = 7; + // optional bool deprecated = 3 [default = false]; if (cached_has_bits & 0x00000008u) { total_size += 2; } - // optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + // optional bool map_entry = 7; if (cached_has_bits & 0x00000010u) { total_size += 2; } + // optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + if (cached_has_bits & 0x00000020u) { + total_size += 2; + } + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -8129,20 +8602,24 @@ void MessageOptions::MergeImpl(::google::protobuf::Message& to_msg, const ::goog _this->_internal_mutable_uninterpreted_option()->MergeFrom(from._internal_uninterpreted_option()); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000001fu) { + if (cached_has_bits & 0x0000003fu) { if (cached_has_bits & 0x00000001u) { - _this->_impl_.message_set_wire_format_ = from._impl_.message_set_wire_format_; + _this->_internal_mutable_features()->::google::protobuf::FeatureSet::MergeFrom( + from._internal_features()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.no_standard_descriptor_accessor_ = from._impl_.no_standard_descriptor_accessor_; + _this->_impl_.message_set_wire_format_ = from._impl_.message_set_wire_format_; } if (cached_has_bits & 0x00000004u) { - _this->_impl_.deprecated_ = from._impl_.deprecated_; + _this->_impl_.no_standard_descriptor_accessor_ = from._impl_.no_standard_descriptor_accessor_; } if (cached_has_bits & 0x00000008u) { - _this->_impl_.map_entry_ = from._impl_.map_entry_; + _this->_impl_.deprecated_ = from._impl_.deprecated_; } if (cached_has_bits & 0x00000010u) { + _this->_impl_.map_entry_ = from._impl_.map_entry_; + } + if (cached_has_bits & 0x00000020u) { _this->_impl_.deprecated_legacy_json_field_conflicts_ = from._impl_.deprecated_legacy_json_field_conflicts_; } _this->_impl_._has_bits_[0] |= cached_has_bits; @@ -8164,6 +8641,9 @@ PROTOBUF_NOINLINE bool MessageOptions::IsInitialized() const { } if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false; + if ((_impl_._has_bits_[0] & 0x00000001u) != 0) { + if (!_impl_.features_->IsInitialized()) return false; + } return true; } @@ -8176,9 +8656,9 @@ void MessageOptions::InternalSwap(MessageOptions* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.deprecated_legacy_json_field_conflicts_) + sizeof(MessageOptions::_impl_.deprecated_legacy_json_field_conflicts_) - - PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.message_set_wire_format_)>( - reinterpret_cast(&_impl_.message_set_wire_format_), - reinterpret_cast(&other->_impl_.message_set_wire_format_)); + - PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_.features_)>( + reinterpret_cast(&_impl_.features_), + reinterpret_cast(&other->_impl_.features_)); } ::google::protobuf::Metadata MessageOptions::GetMetadata() const { @@ -8188,43 +8668,308 @@ void MessageOptions::InternalSwap(MessageOptions* other) { } // =================================================================== +class FieldOptions_EditionDefault::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(FieldOptions_EditionDefault, _impl_._has_bits_); + static void set_has_edition(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_value(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } +}; + +FieldOptions_EditionDefault::FieldOptions_EditionDefault(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.FieldOptions.EditionDefault) +} +FieldOptions_EditionDefault::FieldOptions_EditionDefault(const FieldOptions_EditionDefault& from) : ::google::protobuf::Message() { + FieldOptions_EditionDefault* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.edition_){}, + decltype(_impl_.value_){}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _impl_.edition_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.edition_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.edition_.Set(from._internal_edition(), _this->GetArenaForAllocation()); + } + _impl_.value_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if ((from._impl_._has_bits_[0] & 0x00000002u) != 0) { + _this->_impl_.value_.Set(from._internal_value(), _this->GetArenaForAllocation()); + } + + // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldOptions.EditionDefault) +} +inline void FieldOptions_EditionDefault::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.edition_){}, + decltype(_impl_.value_){}, + }; + _impl_.edition_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.edition_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} +FieldOptions_EditionDefault::~FieldOptions_EditionDefault() { + // @@protoc_insertion_point(destructor:google.protobuf.FieldOptions.EditionDefault) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void FieldOptions_EditionDefault::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.edition_.Destroy(); + _impl_.value_.Destroy(); +} +void FieldOptions_EditionDefault::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void FieldOptions_EditionDefault::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FieldOptions.EditionDefault) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _impl_.edition_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.value_.ClearNonDefaultToEmpty(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* FieldOptions_EditionDefault::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +constexpr ::_pbi::TcParseTable<1, 2, 0, 64, 2> FieldOptions_EditionDefault::_table_ = { + { + PROTOBUF_FIELD_OFFSET(FieldOptions_EditionDefault, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_FieldOptions_EditionDefault_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // optional string value = 2; + {::_pbi::TcParser::FastSS1, + {18, 1, 0, PROTOBUF_FIELD_OFFSET(FieldOptions_EditionDefault, _impl_.value_)}}, + // optional string edition = 1; + {::_pbi::TcParser::FastSS1, + {10, 0, 0, PROTOBUF_FIELD_OFFSET(FieldOptions_EditionDefault, _impl_.edition_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // optional string edition = 1; + {PROTOBUF_FIELD_OFFSET(FieldOptions_EditionDefault, _impl_.edition_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, + // optional string value = 2; + {PROTOBUF_FIELD_OFFSET(FieldOptions_EditionDefault, _impl_.value_), _Internal::kHasBitsOffset + 1, 0, + (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\53\7\5\0\0\0\0\0" + "google.protobuf.FieldOptions.EditionDefault" + "edition" + "value" + }}, +}; + +::uint8_t* FieldOptions_EditionDefault::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldOptions.EditionDefault) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // optional string edition = 1; + if (cached_has_bits & 0x00000001u) { + const std::string& _s = this->_internal_edition(); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldOptions.EditionDefault.edition"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + + // optional string value = 2; + if (cached_has_bits & 0x00000002u) { + const std::string& _s = this->_internal_value(); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(_s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldOptions.EditionDefault.value"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldOptions.EditionDefault) + return target; +} + +::size_t FieldOptions_EditionDefault::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldOptions.EditionDefault) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional string edition = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_edition()); + } + + // optional string value = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->_internal_value()); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData FieldOptions_EditionDefault::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + FieldOptions_EditionDefault::MergeImpl +}; +const ::google::protobuf::Message::ClassData*FieldOptions_EditionDefault::GetClassData() const { return &_class_data_; } + + +void FieldOptions_EditionDefault::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldOptions.EditionDefault) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_edition(from._internal_edition()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_value(from._internal_value()); + } + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void FieldOptions_EditionDefault::CopyFrom(const FieldOptions_EditionDefault& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FieldOptions.EditionDefault) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool FieldOptions_EditionDefault::IsInitialized() const { + return true; +} + +void FieldOptions_EditionDefault::InternalSwap(FieldOptions_EditionDefault* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.edition_, lhs_arena, + &other->_impl_.edition_, rhs_arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.value_, lhs_arena, + &other->_impl_.value_, rhs_arena); +} + +::google::protobuf::Metadata FieldOptions_EditionDefault::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[16]); +} +// =================================================================== + class FieldOptions::_Internal { public: using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_._has_bits_); static void set_has_ctype(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static void set_has_packed(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static void set_has_jstype(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_lazy(HasBits* has_bits) { + static void set_has_packed(HasBits* has_bits) { (*has_bits)[0] |= 8u; } - static void set_has_unverified_lazy(HasBits* has_bits) { + static void set_has_jstype(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_lazy(HasBits* has_bits) { (*has_bits)[0] |= 16u; } - static void set_has_deprecated(HasBits* has_bits) { + static void set_has_unverified_lazy(HasBits* has_bits) { (*has_bits)[0] |= 32u; } - static void set_has_weak(HasBits* has_bits) { + static void set_has_deprecated(HasBits* has_bits) { (*has_bits)[0] |= 64u; } - static void set_has_debug_redact(HasBits* has_bits) { + static void set_has_weak(HasBits* has_bits) { (*has_bits)[0] |= 128u; } - static void set_has_retention(HasBits* has_bits) { + static void set_has_debug_redact(HasBits* has_bits) { (*has_bits)[0] |= 256u; } - static void set_has_target_obsolete_do_not_use(HasBits* has_bits) { + static void set_has_retention(HasBits* has_bits) { (*has_bits)[0] |= 512u; } + static const ::google::protobuf::FeatureSet& features(const FieldOptions* msg); + static void set_has_features(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_target_obsolete_do_not_use(HasBits* has_bits) { + (*has_bits)[0] |= 1024u; + } }; +const ::google::protobuf::FeatureSet& FieldOptions::_Internal::features(const FieldOptions* msg) { + return *msg->_impl_.features_; +} FieldOptions::FieldOptions(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -8238,7 +8983,9 @@ FieldOptions::FieldOptions(const FieldOptions& from) : ::google::protobuf::Messa decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.targets_){from._internal_targets()}, + decltype(_impl_.edition_defaults_){from._impl_.edition_defaults_}, decltype(_impl_.uninterpreted_option_){from._impl_.uninterpreted_option_}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.ctype_){}, decltype(_impl_.jstype_){}, decltype(_impl_.packed_){}, @@ -8254,6 +9001,9 @@ FieldOptions::FieldOptions(const FieldOptions& from) : ::google::protobuf::Messa from._internal_metadata_); _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.features_ = new ::google::protobuf::FeatureSet(*from._impl_.features_); + } ::memcpy(&_impl_.ctype_, &from._impl_.ctype_, static_cast<::size_t>(reinterpret_cast(&_impl_.target_obsolete_do_not_use_) - reinterpret_cast(&_impl_.ctype_)) + sizeof(_impl_.target_obsolete_do_not_use_)); @@ -8267,7 +9017,9 @@ inline void FieldOptions::SharedCtor(::_pb::Arena* arena) { decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.targets_){arena}, + decltype(_impl_.edition_defaults_){arena}, decltype(_impl_.uninterpreted_option_){arena}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.ctype_){0}, decltype(_impl_.jstype_){0}, decltype(_impl_.packed_){false}, @@ -8289,7 +9041,9 @@ inline void FieldOptions::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_._extensions_.~ExtensionSet(); _internal_mutable_targets()->~RepeatedField(); + _impl_.edition_defaults_.~RepeatedPtrField(); _impl_.uninterpreted_option_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.features_; } void FieldOptions::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -8303,17 +9057,22 @@ PROTOBUF_NOINLINE void FieldOptions::Clear() { _impl_._extensions_.Clear(); _internal_mutable_targets()->Clear(); + _internal_mutable_edition_defaults()->Clear(); _internal_mutable_uninterpreted_option()->Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - ::memset(&_impl_.ctype_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.debug_redact_) - - reinterpret_cast(&_impl_.ctype_)) + sizeof(_impl_.debug_redact_)); + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.features_ != nullptr); + _impl_.features_->Clear(); } - if (cached_has_bits & 0x00000300u) { - ::memset(&_impl_.retention_, 0, static_cast<::size_t>( + if (cached_has_bits & 0x000000feu) { + ::memset(&_impl_.ctype_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.weak_) - + reinterpret_cast(&_impl_.ctype_)) + sizeof(_impl_.weak_)); + } + if (cached_has_bits & 0x00000700u) { + ::memset(&_impl_.debug_redact_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.target_obsolete_do_not_use_) - - reinterpret_cast(&_impl_.retention_)) + sizeof(_impl_.target_obsolete_do_not_use_)); + reinterpret_cast(&_impl_.debug_redact_)) + sizeof(_impl_.target_obsolete_do_not_use_)); } _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); @@ -8326,94 +9085,102 @@ const char* FieldOptions::_InternalParse( } -constexpr ::_pbi::TcParseTable<4, 12, 6, 0, 7> FieldOptions::_table_ = { +constexpr ::_pbi::TcParseTable<4, 14, 8, 0, 7> FieldOptions::_table_ = { { PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_._extensions_), 999, 120, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294458824, // skipmap + 4292885960, // skipmap offsetof(decltype(_table_), field_entries), - 12, // num_field_entries - 6, // num_aux_entries + 14, // num_field_entries + 8, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_FieldOptions_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ // optional bool debug_redact = 16 [default = false]; {::_pbi::TcParser::FastV8S2, - {384, 7, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.debug_redact_)}}, + {384, 8, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.debug_redact_)}}, // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; {::_pbi::TcParser::FastEr0S1, - {8, 0, 2, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.ctype_)}}, + {8, 1, 2, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.ctype_)}}, // optional bool packed = 2; - {::_pbi::TcParser::SingularVarintNoZag1(), - {16, 2, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.packed_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {16, 3, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.packed_)}}, // optional bool deprecated = 3 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 5, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.deprecated_)}}, - {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 6, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.deprecated_)}}, + // repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + {::_pbi::TcParser::FastMtR2, + {418, 63, 5, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.edition_defaults_)}}, // optional bool lazy = 5 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {40, 3, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.lazy_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {40, 4, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.lazy_)}}, // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; {::_pbi::TcParser::FastEr0S1, - {48, 1, 2, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.jstype_)}}, + {48, 2, 2, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.jstype_)}}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; {::_pbi::TcParser::FastMtR2, - {16058, 63, 5, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.uninterpreted_option_)}}, + {16058, 63, 7, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.uninterpreted_option_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, // optional bool weak = 10 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {80, 6, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.weak_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {80, 7, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.weak_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, // optional bool unverified_lazy = 15 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {120, 4, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.unverified_lazy_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {120, 5, 0, PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.unverified_lazy_)}}, }}, {{ 999, 0, 1, - 65534, 11, + 65534, 13, 65535, 65535 }}, {{ // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.ctype_), _Internal::kHasBitsOffset + 0, 0, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.ctype_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, // optional bool packed = 2; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.packed_), _Internal::kHasBitsOffset + 2, 0, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.packed_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool deprecated = 3 [default = false]; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 5, 0, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 6, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool lazy = 5 [default = false]; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.lazy_), _Internal::kHasBitsOffset + 3, 0, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.lazy_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.jstype_), _Internal::kHasBitsOffset + 1, 1, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.jstype_), _Internal::kHasBitsOffset + 2, 1, (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, // optional bool weak = 10 [default = false]; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.weak_), _Internal::kHasBitsOffset + 6, 0, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.weak_), _Internal::kHasBitsOffset + 7, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool unverified_lazy = 15 [default = false]; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.unverified_lazy_), _Internal::kHasBitsOffset + 4, 0, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.unverified_lazy_), _Internal::kHasBitsOffset + 5, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool debug_redact = 16 [default = false]; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.debug_redact_), _Internal::kHasBitsOffset + 7, 0, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.debug_redact_), _Internal::kHasBitsOffset + 8, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional .google.protobuf.FieldOptions.OptionRetention retention = 17; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.retention_), _Internal::kHasBitsOffset + 8, 2, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.retention_), _Internal::kHasBitsOffset + 9, 2, (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, // optional .google.protobuf.FieldOptions.OptionTargetType target_obsolete_do_not_use = 18 [deprecated = true]; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.target_obsolete_do_not_use_), _Internal::kHasBitsOffset + 9, 3, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.target_obsolete_do_not_use_), _Internal::kHasBitsOffset + 10, 3, (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, // repeated .google.protobuf.FieldOptions.OptionTargetType targets = 19; {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.targets_), -1, 4, (0 | ::_fl::kFcRepeated | ::_fl::kEnumRange)}, + // repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.edition_defaults_), -1, 5, + (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + // optional .google.protobuf.FeatureSet features = 21; + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 6, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.uninterpreted_option_), -1, 5, + {PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.uninterpreted_option_), -1, 7, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ {0, 3}, @@ -8421,6 +9188,8 @@ constexpr ::_pbi::TcParseTable<4, 12, 6, 0, 7> FieldOptions::_table_ = { {0, 3}, {0, 10}, {0, 10}, + {::_pbi::TcParser::GetTable<::google::protobuf::FieldOptions_EditionDefault>()}, + {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, }}, {{ }}, @@ -8435,70 +9204,70 @@ constexpr ::_pbi::TcParseTable<4, 12, 6, 0, 7> FieldOptions::_table_ = { cached_has_bits = _impl_._has_bits_[0]; // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; - if (cached_has_bits & 0x00000001u) { + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( 1, this->_internal_ctype(), target); } // optional bool packed = 2; - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 2, this->_internal_packed(), target); } // optional bool deprecated = 3 [default = false]; - if (cached_has_bits & 0x00000020u) { + if (cached_has_bits & 0x00000040u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 3, this->_internal_deprecated(), target); } // optional bool lazy = 5 [default = false]; - if (cached_has_bits & 0x00000008u) { + if (cached_has_bits & 0x00000010u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 5, this->_internal_lazy(), target); } // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( 6, this->_internal_jstype(), target); } // optional bool weak = 10 [default = false]; - if (cached_has_bits & 0x00000040u) { + if (cached_has_bits & 0x00000080u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 10, this->_internal_weak(), target); } // optional bool unverified_lazy = 15 [default = false]; - if (cached_has_bits & 0x00000010u) { + if (cached_has_bits & 0x00000020u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 15, this->_internal_unverified_lazy(), target); } // optional bool debug_redact = 16 [default = false]; - if (cached_has_bits & 0x00000080u) { + if (cached_has_bits & 0x00000100u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 16, this->_internal_debug_redact(), target); } // optional .google.protobuf.FieldOptions.OptionRetention retention = 17; - if (cached_has_bits & 0x00000100u) { + if (cached_has_bits & 0x00000200u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( 17, this->_internal_retention(), target); } // optional .google.protobuf.FieldOptions.OptionTargetType target_obsolete_do_not_use = 18 [deprecated = true]; - if (cached_has_bits & 0x00000200u) { + if (cached_has_bits & 0x00000400u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( 18, this->_internal_target_obsolete_do_not_use(), target); @@ -8512,6 +9281,21 @@ constexpr ::_pbi::TcParseTable<4, 12, 6, 0, 7> FieldOptions::_table_ = { target); } + // repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + for (unsigned i = 0, + n = static_cast(this->_internal_edition_defaults_size()); i < n; i++) { + const auto& repfield = this->_internal_edition_defaults().Get(i); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(20, repfield, repfield.GetCachedSize(), target, stream); + } + + // optional .google.protobuf.FeatureSet features = 21; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(21, _Internal::features(this), + _Internal::features(this).GetCachedSize(), target, stream); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned i = 0, n = static_cast(this->_internal_uninterpreted_option_size()); i < n; i++) { @@ -8554,6 +9338,12 @@ constexpr ::_pbi::TcParseTable<4, 12, 6, 0, 7> FieldOptions::_table_ = { total_size += data_size; total_size += std::size_t{2} * count; } + // repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + total_size += 2UL * this->_internal_edition_defaults_size(); + for (const auto& msg : this->_internal_edition_defaults()) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; total_size += 2UL * this->_internal_uninterpreted_option_size(); for (const auto& msg : this->_internal_uninterpreted_option()) { @@ -8562,58 +9352,65 @@ constexpr ::_pbi::TcParseTable<4, 12, 6, 0, 7> FieldOptions::_table_ = { } cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x000000ffu) { - // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + // optional .google.protobuf.FeatureSet features = 21; if (cached_has_bits & 0x00000001u) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.features_); + } + + // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + if (cached_has_bits & 0x00000002u) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_ctype()); } // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000004u) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this->_internal_jstype()); } // optional bool packed = 2; - if (cached_has_bits & 0x00000004u) { - total_size += 2; - } - - // optional bool lazy = 5 [default = false]; if (cached_has_bits & 0x00000008u) { total_size += 2; } - // optional bool unverified_lazy = 15 [default = false]; + // optional bool lazy = 5 [default = false]; if (cached_has_bits & 0x00000010u) { total_size += 2; } - // optional bool deprecated = 3 [default = false]; + // optional bool unverified_lazy = 15 [default = false]; if (cached_has_bits & 0x00000020u) { total_size += 2; } - // optional bool weak = 10 [default = false]; + // optional bool deprecated = 3 [default = false]; if (cached_has_bits & 0x00000040u) { total_size += 2; } - // optional bool debug_redact = 16 [default = false]; + // optional bool weak = 10 [default = false]; if (cached_has_bits & 0x00000080u) { - total_size += 3; + total_size += 2; } } - if (cached_has_bits & 0x00000300u) { - // optional .google.protobuf.FieldOptions.OptionRetention retention = 17; + if (cached_has_bits & 0x00000700u) { + // optional bool debug_redact = 16 [default = false]; if (cached_has_bits & 0x00000100u) { + total_size += 3; + } + + // optional .google.protobuf.FieldOptions.OptionRetention retention = 17; + if (cached_has_bits & 0x00000200u) { total_size += 2 + ::_pbi::WireFormatLite::EnumSize(this->_internal_retention()); } // optional .google.protobuf.FieldOptions.OptionTargetType target_obsolete_do_not_use = 18 [deprecated = true]; - if (cached_has_bits & 0x00000200u) { + if (cached_has_bits & 0x00000400u) { total_size += 2 + ::_pbi::WireFormatLite::EnumSize(this->_internal_target_obsolete_do_not_use()); } @@ -8638,40 +9435,45 @@ void FieldOptions::MergeImpl(::google::protobuf::Message& to_msg, const ::google (void) cached_has_bits; _this->_internal_mutable_targets()->MergeFrom(from._internal_targets()); + _this->_internal_mutable_edition_defaults()->MergeFrom(from._internal_edition_defaults()); _this->_internal_mutable_uninterpreted_option()->MergeFrom(from._internal_uninterpreted_option()); cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x000000ffu) { if (cached_has_bits & 0x00000001u) { - _this->_impl_.ctype_ = from._impl_.ctype_; + _this->_internal_mutable_features()->::google::protobuf::FeatureSet::MergeFrom( + from._internal_features()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.jstype_ = from._impl_.jstype_; + _this->_impl_.ctype_ = from._impl_.ctype_; } if (cached_has_bits & 0x00000004u) { - _this->_impl_.packed_ = from._impl_.packed_; + _this->_impl_.jstype_ = from._impl_.jstype_; } if (cached_has_bits & 0x00000008u) { - _this->_impl_.lazy_ = from._impl_.lazy_; + _this->_impl_.packed_ = from._impl_.packed_; } if (cached_has_bits & 0x00000010u) { - _this->_impl_.unverified_lazy_ = from._impl_.unverified_lazy_; + _this->_impl_.lazy_ = from._impl_.lazy_; } if (cached_has_bits & 0x00000020u) { - _this->_impl_.deprecated_ = from._impl_.deprecated_; + _this->_impl_.unverified_lazy_ = from._impl_.unverified_lazy_; } if (cached_has_bits & 0x00000040u) { - _this->_impl_.weak_ = from._impl_.weak_; + _this->_impl_.deprecated_ = from._impl_.deprecated_; } if (cached_has_bits & 0x00000080u) { - _this->_impl_.debug_redact_ = from._impl_.debug_redact_; + _this->_impl_.weak_ = from._impl_.weak_; } _this->_impl_._has_bits_[0] |= cached_has_bits; } - if (cached_has_bits & 0x00000300u) { + if (cached_has_bits & 0x00000700u) { if (cached_has_bits & 0x00000100u) { - _this->_impl_.retention_ = from._impl_.retention_; + _this->_impl_.debug_redact_ = from._impl_.debug_redact_; } if (cached_has_bits & 0x00000200u) { + _this->_impl_.retention_ = from._impl_.retention_; + } + if (cached_has_bits & 0x00000400u) { _this->_impl_.target_obsolete_do_not_use_ = from._impl_.target_obsolete_do_not_use_; } _this->_impl_._has_bits_[0] |= cached_has_bits; @@ -8693,6 +9495,9 @@ PROTOBUF_NOINLINE bool FieldOptions::IsInitialized() const { } if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false; + if ((_impl_._has_bits_[0] & 0x00000001u) != 0) { + if (!_impl_.features_->IsInitialized()) return false; + } return true; } @@ -8702,26 +9507,37 @@ void FieldOptions::InternalSwap(FieldOptions* other) { _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); _impl_.targets_.InternalSwap(&other->_impl_.targets_); + _impl_.edition_defaults_.InternalSwap(&other->_impl_.edition_defaults_); _impl_.uninterpreted_option_.InternalSwap(&other->_impl_.uninterpreted_option_); ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.target_obsolete_do_not_use_) + sizeof(FieldOptions::_impl_.target_obsolete_do_not_use_) - - PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.ctype_)>( - reinterpret_cast(&_impl_.ctype_), - reinterpret_cast(&other->_impl_.ctype_)); + - PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_.features_)>( + reinterpret_cast(&_impl_.features_), + reinterpret_cast(&other->_impl_.features_)); } ::google::protobuf::Metadata FieldOptions::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[16]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[17]); } // =================================================================== class OneofOptions::_Internal { public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_._has_bits_); + static const ::google::protobuf::FeatureSet& features(const OneofOptions* msg); + static void set_has_features(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } }; +const ::google::protobuf::FeatureSet& OneofOptions::_Internal::features(const OneofOptions* msg) { + return *msg->_impl_.features_; +} OneofOptions::OneofOptions(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -8732,13 +9548,18 @@ OneofOptions::OneofOptions(const OneofOptions& from) : ::google::protobuf::Messa (void)_this; new (&_impl_) Impl_{ /*decltype(_impl_._extensions_)*/ {}, - decltype(_impl_.uninterpreted_option_){from._impl_.uninterpreted_option_}, + decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.uninterpreted_option_){from._impl_.uninterpreted_option_}, + decltype(_impl_.features_){nullptr}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.features_ = new ::google::protobuf::FeatureSet(*from._impl_.features_); + } // @@protoc_insertion_point(copy_constructor:google.protobuf.OneofOptions) } @@ -8746,8 +9567,10 @@ inline void OneofOptions::SharedCtor(::_pb::Arena* arena) { (void)arena; new (&_impl_) Impl_{ /*decltype(_impl_._extensions_)*/ {::_pbi::ArenaInitialized(), arena}, - decltype(_impl_.uninterpreted_option_){arena}, + decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.uninterpreted_option_){arena}, + decltype(_impl_.features_){nullptr}, }; } OneofOptions::~OneofOptions() { @@ -8759,6 +9582,7 @@ inline void OneofOptions::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_._extensions_.~ExtensionSet(); _impl_.uninterpreted_option_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.features_; } void OneofOptions::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -8772,6 +9596,12 @@ PROTOBUF_NOINLINE void OneofOptions::Clear() { _impl_._extensions_.Clear(); _internal_mutable_uninterpreted_option()->Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.features_ != nullptr); + _impl_.features_->Clear(); + } + _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -8782,32 +9612,41 @@ const char* OneofOptions::_InternalParse( } -constexpr ::_pbi::TcParseTable<0, 1, 1, 0, 7> OneofOptions::_table_ = { +constexpr ::_pbi::TcParseTable<2, 2, 2, 0, 7> OneofOptions::_table_ = { { - 0, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_._extensions_), - 999, 0, // max_field_number, fast_idx_mask + 999, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967295, // skipmap + 4294967294, // skipmap offsetof(decltype(_table_), field_entries), - 1, // num_field_entries - 1, // num_aux_entries + 2, // num_field_entries + 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_OneofOptions_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // optional .google.protobuf.FeatureSet features = 1; + {::_pbi::TcParser::FastMtS1, + {10, 0, 0, PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_.features_)}}, + {::_pbi::TcParser::MiniParse, {}}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; {::_pbi::TcParser::FastMtR2, - {16058, 63, 0, PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_.uninterpreted_option_)}}, + {16058, 63, 1, PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_.uninterpreted_option_)}}, }}, {{ 999, 0, 1, - 65534, 0, + 65534, 1, 65535, 65535 }}, {{ + // optional .google.protobuf.FeatureSet features = 1; + {PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_.uninterpreted_option_), 0, 0, + {PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_.uninterpreted_option_), -1, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ + {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, }}, {{ }}, @@ -8820,6 +9659,14 @@ constexpr ::_pbi::TcParseTable<0, 1, 1, 0, 7> OneofOptions::_table_ = { ::uint32_t cached_has_bits = 0; (void)cached_has_bits; + cached_has_bits = _impl_._has_bits_[0]; + // optional .google.protobuf.FeatureSet features = 1; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::features(this), + _Internal::features(this).GetCachedSize(), target, stream); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned i = 0, n = static_cast(this->_internal_uninterpreted_option_size()); i < n; i++) { @@ -8856,6 +9703,14 @@ constexpr ::_pbi::TcParseTable<0, 1, 1, 0, 7> OneofOptions::_table_ = { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } + // optional .google.protobuf.FeatureSet features = 1; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.features_); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -8875,6 +9730,10 @@ void OneofOptions::MergeImpl(::google::protobuf::Message& to_msg, const ::google (void) cached_has_bits; _this->_internal_mutable_uninterpreted_option()->MergeFrom(from._internal_uninterpreted_option()); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_mutable_features()->::google::protobuf::FeatureSet::MergeFrom( + from._internal_features()); + } _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); } @@ -8892,6 +9751,9 @@ PROTOBUF_NOINLINE bool OneofOptions::IsInitialized() const { } if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false; + if ((_impl_._has_bits_[0] & 0x00000001u) != 0) { + if (!_impl_.features_->IsInitialized()) return false; + } return true; } @@ -8899,13 +9761,15 @@ void OneofOptions::InternalSwap(OneofOptions* other) { using std::swap; _impl_._extensions_.InternalSwap(&other->_impl_._extensions_); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); _impl_.uninterpreted_option_.InternalSwap(&other->_impl_.uninterpreted_option_); + swap(_impl_.features_, other->_impl_.features_); } ::google::protobuf::Metadata OneofOptions::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[17]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[18]); } // =================================================================== @@ -8915,16 +9779,23 @@ class EnumOptions::_Internal { static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_._has_bits_); static void set_has_allow_alias(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static void set_has_deprecated(HasBits* has_bits) { (*has_bits)[0] |= 2u; } - static void set_has_deprecated_legacy_json_field_conflicts(HasBits* has_bits) { + static void set_has_deprecated(HasBits* has_bits) { (*has_bits)[0] |= 4u; } + static void set_has_deprecated_legacy_json_field_conflicts(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static const ::google::protobuf::FeatureSet& features(const EnumOptions* msg); + static void set_has_features(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } }; +const ::google::protobuf::FeatureSet& EnumOptions::_Internal::features(const EnumOptions* msg) { + return *msg->_impl_.features_; +} EnumOptions::EnumOptions(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -8938,6 +9809,7 @@ EnumOptions::EnumOptions(const EnumOptions& from) : ::google::protobuf::Message( decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){from._impl_.uninterpreted_option_}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.allow_alias_){}, decltype(_impl_.deprecated_){}, decltype(_impl_.deprecated_legacy_json_field_conflicts_){}, @@ -8946,6 +9818,9 @@ EnumOptions::EnumOptions(const EnumOptions& from) : ::google::protobuf::Message( from._internal_metadata_); _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.features_ = new ::google::protobuf::FeatureSet(*from._impl_.features_); + } ::memcpy(&_impl_.allow_alias_, &from._impl_.allow_alias_, static_cast<::size_t>(reinterpret_cast(&_impl_.deprecated_legacy_json_field_conflicts_) - reinterpret_cast(&_impl_.allow_alias_)) + sizeof(_impl_.deprecated_legacy_json_field_conflicts_)); @@ -8959,6 +9834,7 @@ inline void EnumOptions::SharedCtor(::_pb::Arena* arena) { decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){arena}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.allow_alias_){false}, decltype(_impl_.deprecated_){false}, decltype(_impl_.deprecated_legacy_json_field_conflicts_){false}, @@ -8973,6 +9849,7 @@ inline void EnumOptions::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_._extensions_.~ExtensionSet(); _impl_.uninterpreted_option_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.features_; } void EnumOptions::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -8986,6 +9863,11 @@ PROTOBUF_NOINLINE void EnumOptions::Clear() { _impl_._extensions_.Clear(); _internal_mutable_uninterpreted_option()->Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.features_ != nullptr); + _impl_.features_->Clear(); + } ::memset(&_impl_.allow_alias_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.deprecated_legacy_json_field_conflicts_) - reinterpret_cast(&_impl_.allow_alias_)) + sizeof(_impl_.deprecated_legacy_json_field_conflicts_)); @@ -9000,16 +9882,16 @@ const char* EnumOptions::_InternalParse( } -constexpr ::_pbi::TcParseTable<3, 4, 1, 0, 7> EnumOptions::_table_ = { +constexpr ::_pbi::TcParseTable<3, 5, 2, 0, 7> EnumOptions::_table_ = { { PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_._extensions_), 999, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967257, // skipmap + 4294967193, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries - 1, // num_aux_entries + 5, // num_field_entries + 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_EnumOptions_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback @@ -9017,37 +9899,41 @@ constexpr ::_pbi::TcParseTable<3, 4, 1, 0, 7> EnumOptions::_table_ = { {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, // optional bool allow_alias = 2; - {::_pbi::TcParser::SingularVarintNoZag1(), - {16, 0, 0, PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.allow_alias_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {16, 1, 0, PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.allow_alias_)}}, // optional bool deprecated = 3 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 1, 0, PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.deprecated_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 2, 0, PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.deprecated_)}}, {::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}}, // optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {48, 2, 0, PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.deprecated_legacy_json_field_conflicts_)}}, - // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {::_pbi::TcParser::FastMtR2, - {16058, 63, 0, PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.uninterpreted_option_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {48, 3, 0, PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.deprecated_legacy_json_field_conflicts_)}}, + // optional .google.protobuf.FeatureSet features = 7; + {::_pbi::TcParser::FastMtS1, + {58, 0, 0, PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.features_)}}, }}, {{ 999, 0, 1, - 65534, 3, + 65534, 4, 65535, 65535 }}, {{ // optional bool allow_alias = 2; - {PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.allow_alias_), _Internal::kHasBitsOffset + 0, 0, + {PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.allow_alias_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool deprecated = 3 [default = false]; - {PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 1, 0, + {PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; - {PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.deprecated_legacy_json_field_conflicts_), _Internal::kHasBitsOffset + 2, 0, + {PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.deprecated_legacy_json_field_conflicts_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + // optional .google.protobuf.FeatureSet features = 7; + {PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.uninterpreted_option_), -1, 0, + {PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.uninterpreted_option_), -1, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ + {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, }}, {{ }}, @@ -9062,26 +9948,33 @@ constexpr ::_pbi::TcParseTable<3, 4, 1, 0, 7> EnumOptions::_table_ = { cached_has_bits = _impl_._has_bits_[0]; // optional bool allow_alias = 2; - if (cached_has_bits & 0x00000001u) { + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 2, this->_internal_allow_alias(), target); } // optional bool deprecated = 3 [default = false]; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 3, this->_internal_deprecated(), target); } // optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x00000008u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 6, this->_internal_deprecated_legacy_json_field_conflicts(), target); } + // optional .google.protobuf.FeatureSet features = 7; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::features(this), + _Internal::features(this).GetCachedSize(), target, stream); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned i = 0, n = static_cast(this->_internal_uninterpreted_option_size()); i < n; i++) { @@ -9119,22 +10012,29 @@ constexpr ::_pbi::TcParseTable<3, 4, 1, 0, 7> EnumOptions::_table_ = { ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // optional bool allow_alias = 2; + if (cached_has_bits & 0x0000000fu) { + // optional .google.protobuf.FeatureSet features = 7; if (cached_has_bits & 0x00000001u) { - total_size += 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.features_); } - // optional bool deprecated = 3 [default = false]; + // optional bool allow_alias = 2; if (cached_has_bits & 0x00000002u) { total_size += 2; } - // optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + // optional bool deprecated = 3 [default = false]; if (cached_has_bits & 0x00000004u) { total_size += 2; } + // optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + if (cached_has_bits & 0x00000008u) { + total_size += 2; + } + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -9156,14 +10056,18 @@ void EnumOptions::MergeImpl(::google::protobuf::Message& to_msg, const ::google: _this->_internal_mutable_uninterpreted_option()->MergeFrom(from._internal_uninterpreted_option()); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x0000000fu) { if (cached_has_bits & 0x00000001u) { - _this->_impl_.allow_alias_ = from._impl_.allow_alias_; + _this->_internal_mutable_features()->::google::protobuf::FeatureSet::MergeFrom( + from._internal_features()); } if (cached_has_bits & 0x00000002u) { - _this->_impl_.deprecated_ = from._impl_.deprecated_; + _this->_impl_.allow_alias_ = from._impl_.allow_alias_; } if (cached_has_bits & 0x00000004u) { + _this->_impl_.deprecated_ = from._impl_.deprecated_; + } + if (cached_has_bits & 0x00000008u) { _this->_impl_.deprecated_legacy_json_field_conflicts_ = from._impl_.deprecated_legacy_json_field_conflicts_; } _this->_impl_._has_bits_[0] |= cached_has_bits; @@ -9185,6 +10089,9 @@ PROTOBUF_NOINLINE bool EnumOptions::IsInitialized() const { } if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false; + if ((_impl_._has_bits_[0] & 0x00000001u) != 0) { + if (!_impl_.features_->IsInitialized()) return false; + } return true; } @@ -9197,15 +10104,15 @@ void EnumOptions::InternalSwap(EnumOptions* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.deprecated_legacy_json_field_conflicts_) + sizeof(EnumOptions::_impl_.deprecated_legacy_json_field_conflicts_) - - PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.allow_alias_)>( - reinterpret_cast(&_impl_.allow_alias_), - reinterpret_cast(&other->_impl_.allow_alias_)); + - PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_.features_)>( + reinterpret_cast(&_impl_.features_), + reinterpret_cast(&other->_impl_.features_)); } ::google::protobuf::Metadata EnumOptions::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[18]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[19]); } // =================================================================== @@ -9215,13 +10122,20 @@ class EnumValueOptions::_Internal { static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_._has_bits_); static void set_has_deprecated(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static const ::google::protobuf::FeatureSet& features(const EnumValueOptions* msg); + static void set_has_features(HasBits* has_bits) { (*has_bits)[0] |= 1u; } static void set_has_debug_redact(HasBits* has_bits) { - (*has_bits)[0] |= 2u; + (*has_bits)[0] |= 4u; } }; +const ::google::protobuf::FeatureSet& EnumValueOptions::_Internal::features(const EnumValueOptions* msg) { + return *msg->_impl_.features_; +} EnumValueOptions::EnumValueOptions(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -9235,6 +10149,7 @@ EnumValueOptions::EnumValueOptions(const EnumValueOptions& from) : ::google::pro decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){from._impl_.uninterpreted_option_}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.deprecated_){}, decltype(_impl_.debug_redact_){}, }; @@ -9242,6 +10157,9 @@ EnumValueOptions::EnumValueOptions(const EnumValueOptions& from) : ::google::pro from._internal_metadata_); _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.features_ = new ::google::protobuf::FeatureSet(*from._impl_.features_); + } ::memcpy(&_impl_.deprecated_, &from._impl_.deprecated_, static_cast<::size_t>(reinterpret_cast(&_impl_.debug_redact_) - reinterpret_cast(&_impl_.deprecated_)) + sizeof(_impl_.debug_redact_)); @@ -9255,6 +10173,7 @@ inline void EnumValueOptions::SharedCtor(::_pb::Arena* arena) { decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){arena}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.deprecated_){false}, decltype(_impl_.debug_redact_){false}, }; @@ -9268,6 +10187,7 @@ inline void EnumValueOptions::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_._extensions_.~ExtensionSet(); _impl_.uninterpreted_option_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.features_; } void EnumValueOptions::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -9281,6 +10201,11 @@ PROTOBUF_NOINLINE void EnumValueOptions::Clear() { _impl_._extensions_.Clear(); _internal_mutable_uninterpreted_option()->Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.features_ != nullptr); + _impl_.features_->Clear(); + } ::memset(&_impl_.deprecated_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.debug_redact_) - reinterpret_cast(&_impl_.deprecated_)) + sizeof(_impl_.debug_redact_)); @@ -9295,43 +10220,55 @@ const char* EnumValueOptions::_InternalParse( } -constexpr ::_pbi::TcParseTable<2, 3, 1, 0, 7> EnumValueOptions::_table_ = { +constexpr ::_pbi::TcParseTable<3, 4, 2, 0, 7> EnumValueOptions::_table_ = { { PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_._extensions_), - 999, 24, // max_field_number, fast_idx_mask + 999, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967290, // skipmap + 4294967288, // skipmap offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 1, // num_aux_entries + 4, // num_field_entries + 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_EnumValueOptions_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback }, {{ {::_pbi::TcParser::MiniParse, {}}, // optional bool deprecated = 1 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {8, 0, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.deprecated_)}}, - {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {8, 1, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.deprecated_)}}, + // optional .google.protobuf.FeatureSet features = 2; + {::_pbi::TcParser::FastMtS1, + {18, 0, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.features_)}}, // optional bool debug_redact = 3 [default = false]; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 1, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.debug_redact_)}}, + {::_pbi::TcParser::SingularVarintNoZag1(), + {24, 2, 0, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.debug_redact_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + {::_pbi::TcParser::FastMtR2, + {16058, 63, 1, PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.uninterpreted_option_)}}, }}, {{ 999, 0, 1, - 65534, 2, + 65534, 3, 65535, 65535 }}, {{ // optional bool deprecated = 1 [default = false]; - {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 0, 0, + {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + // optional .google.protobuf.FeatureSet features = 2; + {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // optional bool debug_redact = 3 [default = false]; - {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.debug_redact_), _Internal::kHasBitsOffset + 1, 0, + {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.debug_redact_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.uninterpreted_option_), -1, 0, + {PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.uninterpreted_option_), -1, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ + {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, }}, {{ }}, @@ -9346,14 +10283,21 @@ constexpr ::_pbi::TcParseTable<2, 3, 1, 0, 7> EnumValueOptions::_table_ = { cached_has_bits = _impl_._has_bits_[0]; // optional bool deprecated = 1 [default = false]; - if (cached_has_bits & 0x00000001u) { + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 1, this->_internal_deprecated(), target); } + // optional .google.protobuf.FeatureSet features = 2; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::features(this), + _Internal::features(this).GetCachedSize(), target, stream); + } + // optional bool debug_redact = 3 [default = false]; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 3, this->_internal_debug_redact(), target); @@ -9396,14 +10340,21 @@ constexpr ::_pbi::TcParseTable<2, 3, 1, 0, 7> EnumValueOptions::_table_ = { ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - // optional bool deprecated = 1 [default = false]; + if (cached_has_bits & 0x00000007u) { + // optional .google.protobuf.FeatureSet features = 2; if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.features_); + } + + // optional bool deprecated = 1 [default = false]; + if (cached_has_bits & 0x00000002u) { total_size += 2; } // optional bool debug_redact = 3 [default = false]; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000004u) { total_size += 2; } @@ -9428,11 +10379,15 @@ void EnumValueOptions::MergeImpl(::google::protobuf::Message& to_msg, const ::go _this->_internal_mutable_uninterpreted_option()->MergeFrom(from._internal_uninterpreted_option()); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _this->_impl_.deprecated_ = from._impl_.deprecated_; + _this->_internal_mutable_features()->::google::protobuf::FeatureSet::MergeFrom( + from._internal_features()); } if (cached_has_bits & 0x00000002u) { + _this->_impl_.deprecated_ = from._impl_.deprecated_; + } + if (cached_has_bits & 0x00000004u) { _this->_impl_.debug_redact_ = from._impl_.debug_redact_; } _this->_impl_._has_bits_[0] |= cached_has_bits; @@ -9454,6 +10409,9 @@ PROTOBUF_NOINLINE bool EnumValueOptions::IsInitialized() const { } if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false; + if ((_impl_._has_bits_[0] & 0x00000001u) != 0) { + if (!_impl_.features_->IsInitialized()) return false; + } return true; } @@ -9466,15 +10424,15 @@ void EnumValueOptions::InternalSwap(EnumValueOptions* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.debug_redact_) + sizeof(EnumValueOptions::_impl_.debug_redact_) - - PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.deprecated_)>( - reinterpret_cast(&_impl_.deprecated_), - reinterpret_cast(&other->_impl_.deprecated_)); + - PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_.features_)>( + reinterpret_cast(&_impl_.features_), + reinterpret_cast(&other->_impl_.features_)); } ::google::protobuf::Metadata EnumValueOptions::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[19]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[20]); } // =================================================================== @@ -9483,11 +10441,18 @@ class ServiceOptions::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_._has_bits_); - static void set_has_deprecated(HasBits* has_bits) { + static const ::google::protobuf::FeatureSet& features(const ServiceOptions* msg); + static void set_has_features(HasBits* has_bits) { (*has_bits)[0] |= 1u; } + static void set_has_deprecated(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } }; +const ::google::protobuf::FeatureSet& ServiceOptions::_Internal::features(const ServiceOptions* msg) { + return *msg->_impl_.features_; +} ServiceOptions::ServiceOptions(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -9501,12 +10466,16 @@ ServiceOptions::ServiceOptions(const ServiceOptions& from) : ::google::protobuf: decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){from._impl_.uninterpreted_option_}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.deprecated_){}, }; _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( from._internal_metadata_); _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.features_ = new ::google::protobuf::FeatureSet(*from._impl_.features_); + } _this->_impl_.deprecated_ = from._impl_.deprecated_; // @@protoc_insertion_point(copy_constructor:google.protobuf.ServiceOptions) @@ -9518,6 +10487,7 @@ inline void ServiceOptions::SharedCtor(::_pb::Arena* arena) { decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){arena}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.deprecated_){false}, }; } @@ -9530,6 +10500,7 @@ inline void ServiceOptions::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_._extensions_.~ExtensionSet(); _impl_.uninterpreted_option_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.features_; } void ServiceOptions::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -9543,6 +10514,11 @@ PROTOBUF_NOINLINE void ServiceOptions::Clear() { _impl_._extensions_.Clear(); _internal_mutable_uninterpreted_option()->Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.features_ != nullptr); + _impl_.features_->Clear(); + } _impl_.deprecated_ = false; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); @@ -9555,7 +10531,7 @@ const char* ServiceOptions::_InternalParse( } -constexpr ::_pbi::TcParseTable<2, 2, 1, 0, 12> ServiceOptions::_table_ = { +constexpr ::_pbi::TcParseTable<2, 3, 2, 0, 12> ServiceOptions::_table_ = { { PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_._extensions_), @@ -9563,8 +10539,8 @@ constexpr ::_pbi::TcParseTable<2, 2, 1, 0, 12> ServiceOptions::_table_ = { offsetof(decltype(_table_), field_lookup_table), 4294967295, // skipmap offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries + 3, // num_field_entries + 2, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_ServiceOptions_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback @@ -9572,24 +10548,30 @@ constexpr ::_pbi::TcParseTable<2, 2, 1, 0, 12> ServiceOptions::_table_ = { {::_pbi::TcParser::MiniParse, {}}, // optional bool deprecated = 33 [default = false]; {::_pbi::TcParser::FastV8S2, - {648, 0, 0, PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.deprecated_)}}, - {::_pbi::TcParser::MiniParse, {}}, + {648, 1, 0, PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.deprecated_)}}, + // optional .google.protobuf.FeatureSet features = 34; + {::_pbi::TcParser::FastMtS2, + {658, 0, 0, PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.features_)}}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; {::_pbi::TcParser::FastMtR2, - {16058, 63, 0, PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.uninterpreted_option_)}}, + {16058, 63, 1, PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.uninterpreted_option_)}}, }}, {{ 33, 0, 1, - 65534, 0,999, 0, 1, - 65534, 1, + 65532, 0,999, 0, 1, + 65534, 2, 65535, 65535 }}, {{ // optional bool deprecated = 33 [default = false]; - {PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 0, 0, + {PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + // optional .google.protobuf.FeatureSet features = 34; + {PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.uninterpreted_option_), -1, 0, + {PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.uninterpreted_option_), -1, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ + {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, }}, {{ }}, @@ -9604,12 +10586,19 @@ constexpr ::_pbi::TcParseTable<2, 2, 1, 0, 12> ServiceOptions::_table_ = { cached_has_bits = _impl_._has_bits_[0]; // optional bool deprecated = 33 [default = false]; - if (cached_has_bits & 0x00000001u) { + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 33, this->_internal_deprecated(), target); } + // optional .google.protobuf.FeatureSet features = 34; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(34, _Internal::features(this), + _Internal::features(this).GetCachedSize(), target, stream); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned i = 0, n = static_cast(this->_internal_uninterpreted_option_size()); i < n; i++) { @@ -9646,12 +10635,21 @@ constexpr ::_pbi::TcParseTable<2, 2, 1, 0, 12> ServiceOptions::_table_ = { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } - // optional bool deprecated = 33 [default = false]; cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += 3; - } + if (cached_has_bits & 0x00000003u) { + // optional .google.protobuf.FeatureSet features = 34; + if (cached_has_bits & 0x00000001u) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.features_); + } + // optional bool deprecated = 33 [default = false]; + if (cached_has_bits & 0x00000002u) { + total_size += 3; + } + + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -9671,8 +10669,16 @@ void ServiceOptions::MergeImpl(::google::protobuf::Message& to_msg, const ::goog (void) cached_has_bits; _this->_internal_mutable_uninterpreted_option()->MergeFrom(from._internal_uninterpreted_option()); - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_set_deprecated(from._internal_deprecated()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_mutable_features()->::google::protobuf::FeatureSet::MergeFrom( + from._internal_features()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.deprecated_ = from._impl_.deprecated_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; } _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); @@ -9691,6 +10697,9 @@ PROTOBUF_NOINLINE bool ServiceOptions::IsInitialized() const { } if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false; + if ((_impl_._has_bits_[0] & 0x00000001u) != 0) { + if (!_impl_.features_->IsInitialized()) return false; + } return true; } @@ -9700,13 +10709,18 @@ void ServiceOptions::InternalSwap(ServiceOptions* other) { _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); _impl_.uninterpreted_option_.InternalSwap(&other->_impl_.uninterpreted_option_); - swap(_impl_.deprecated_, other->_impl_.deprecated_); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.deprecated_) + + sizeof(ServiceOptions::_impl_.deprecated_) + - PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_.features_)>( + reinterpret_cast(&_impl_.features_), + reinterpret_cast(&other->_impl_.features_)); } ::google::protobuf::Metadata ServiceOptions::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[20]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[21]); } // =================================================================== @@ -9716,13 +10730,20 @@ class MethodOptions::_Internal { static constexpr ::int32_t kHasBitsOffset = 8 * PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_._has_bits_); static void set_has_deprecated(HasBits* has_bits) { - (*has_bits)[0] |= 1u; + (*has_bits)[0] |= 2u; } static void set_has_idempotency_level(HasBits* has_bits) { - (*has_bits)[0] |= 2u; + (*has_bits)[0] |= 4u; + } + static const ::google::protobuf::FeatureSet& features(const MethodOptions* msg); + static void set_has_features(HasBits* has_bits) { + (*has_bits)[0] |= 1u; } }; +const ::google::protobuf::FeatureSet& MethodOptions::_Internal::features(const MethodOptions* msg) { + return *msg->_impl_.features_; +} MethodOptions::MethodOptions(::google::protobuf::Arena* arena) : ::google::protobuf::Message(arena) { SharedCtor(arena); @@ -9736,6 +10757,7 @@ MethodOptions::MethodOptions(const MethodOptions& from) : ::google::protobuf::Me decltype(_impl_._has_bits_){from._impl_._has_bits_}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){from._impl_.uninterpreted_option_}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.deprecated_){}, decltype(_impl_.idempotency_level_){}, }; @@ -9743,6 +10765,9 @@ MethodOptions::MethodOptions(const MethodOptions& from) : ::google::protobuf::Me from._internal_metadata_); _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_impl_.features_ = new ::google::protobuf::FeatureSet(*from._impl_.features_); + } ::memcpy(&_impl_.deprecated_, &from._impl_.deprecated_, static_cast<::size_t>(reinterpret_cast(&_impl_.idempotency_level_) - reinterpret_cast(&_impl_.deprecated_)) + sizeof(_impl_.idempotency_level_)); @@ -9756,6 +10781,7 @@ inline void MethodOptions::SharedCtor(::_pb::Arena* arena) { decltype(_impl_._has_bits_){}, /*decltype(_impl_._cached_size_)*/ {}, decltype(_impl_.uninterpreted_option_){arena}, + decltype(_impl_.features_){nullptr}, decltype(_impl_.deprecated_){false}, decltype(_impl_.idempotency_level_){0}, }; @@ -9769,6 +10795,7 @@ inline void MethodOptions::SharedDtor() { ABSL_DCHECK(GetArenaForAllocation() == nullptr); _impl_._extensions_.~ExtensionSet(); _impl_.uninterpreted_option_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.features_; } void MethodOptions::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); @@ -9783,7 +10810,11 @@ PROTOBUF_NOINLINE void MethodOptions::Clear() { _impl_._extensions_.Clear(); _internal_mutable_uninterpreted_option()->Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.features_ != nullptr); + _impl_.features_->Clear(); + } + if (cached_has_bits & 0x00000006u) { ::memset(&_impl_.deprecated_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.idempotency_level_) - reinterpret_cast(&_impl_.deprecated_)) + sizeof(_impl_.idempotency_level_)); @@ -9799,16 +10830,16 @@ const char* MethodOptions::_InternalParse( } -constexpr ::_pbi::TcParseTable<2, 3, 2, 0, 12> MethodOptions::_table_ = { +constexpr ::_pbi::TcParseTable<3, 4, 3, 0, 12> MethodOptions::_table_ = { { PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_._extensions_), - 999, 24, // max_field_number, fast_idx_mask + 999, 56, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), 4294967295, // skipmap offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 2, // num_aux_entries + 4, // num_field_entries + 3, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_MethodOptions_default_instance_._instance, ::_pbi::TcParser::GenericFallback, // fallback @@ -9816,30 +10847,40 @@ constexpr ::_pbi::TcParseTable<2, 3, 2, 0, 12> MethodOptions::_table_ = { {::_pbi::TcParser::MiniParse, {}}, // optional bool deprecated = 33 [default = false]; {::_pbi::TcParser::FastV8S2, - {648, 0, 0, PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.deprecated_)}}, + {648, 1, 0, PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.deprecated_)}}, // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; {::_pbi::TcParser::FastEr0S2, - {656, 1, 2, PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.idempotency_level_)}}, + {656, 2, 2, PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.idempotency_level_)}}, + // optional .google.protobuf.FeatureSet features = 35; + {::_pbi::TcParser::FastMtS2, + {666, 0, 1, PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.features_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; {::_pbi::TcParser::FastMtR2, - {16058, 63, 1, PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.uninterpreted_option_)}}, + {16058, 63, 2, PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.uninterpreted_option_)}}, }}, {{ 33, 0, 1, - 65532, 0,999, 0, 1, - 65534, 2, + 65528, 0,999, 0, 1, + 65534, 3, 65535, 65535 }}, {{ // optional bool deprecated = 33 [default = false]; - {PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 0, 0, + {PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.deprecated_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; - {PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.idempotency_level_), _Internal::kHasBitsOffset + 1, 0, + {PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.idempotency_level_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + // optional .google.protobuf.FeatureSet features = 35; + {PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.features_), _Internal::kHasBitsOffset + 0, 1, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; - {PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.uninterpreted_option_), -1, 1, + {PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.uninterpreted_option_), -1, 2, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ {0, 3}, + {::_pbi::TcParser::GetTable<::google::protobuf::FeatureSet>()}, {::_pbi::TcParser::GetTable<::google::protobuf::UninterpretedOption>()}, }}, {{ }}, @@ -9854,19 +10895,26 @@ constexpr ::_pbi::TcParseTable<2, 3, 2, 0, 12> MethodOptions::_table_ = { cached_has_bits = _impl_._has_bits_[0]; // optional bool deprecated = 33 [default = false]; - if (cached_has_bits & 0x00000001u) { + if (cached_has_bits & 0x00000002u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( 33, this->_internal_deprecated(), target); } // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000004u) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( 34, this->_internal_idempotency_level(), target); } + // optional .google.protobuf.FeatureSet features = 35; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessage(35, _Internal::features(this), + _Internal::features(this).GetCachedSize(), target, stream); + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; for (unsigned i = 0, n = static_cast(this->_internal_uninterpreted_option_size()); i < n; i++) { @@ -9904,14 +10952,21 @@ constexpr ::_pbi::TcParseTable<2, 3, 2, 0, 12> MethodOptions::_table_ = { ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - // optional bool deprecated = 33 [default = false]; + if (cached_has_bits & 0x00000007u) { + // optional .google.protobuf.FeatureSet features = 35; if (cached_has_bits & 0x00000001u) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *_impl_.features_); + } + + // optional bool deprecated = 33 [default = false]; + if (cached_has_bits & 0x00000002u) { total_size += 3; } // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000004u) { total_size += 2 + ::_pbi::WireFormatLite::EnumSize(this->_internal_idempotency_level()); } @@ -9937,11 +10992,15 @@ void MethodOptions::MergeImpl(::google::protobuf::Message& to_msg, const ::googl _this->_internal_mutable_uninterpreted_option()->MergeFrom(from._internal_uninterpreted_option()); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { - _this->_impl_.deprecated_ = from._impl_.deprecated_; + _this->_internal_mutable_features()->::google::protobuf::FeatureSet::MergeFrom( + from._internal_features()); } if (cached_has_bits & 0x00000002u) { + _this->_impl_.deprecated_ = from._impl_.deprecated_; + } + if (cached_has_bits & 0x00000004u) { _this->_impl_.idempotency_level_ = from._impl_.idempotency_level_; } _this->_impl_._has_bits_[0] |= cached_has_bits; @@ -9963,6 +11022,9 @@ PROTOBUF_NOINLINE bool MethodOptions::IsInitialized() const { } if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false; + if ((_impl_._has_bits_[0] & 0x00000001u) != 0) { + if (!_impl_.features_->IsInitialized()) return false; + } return true; } @@ -9975,15 +11037,15 @@ void MethodOptions::InternalSwap(MethodOptions* other) { ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.idempotency_level_) + sizeof(MethodOptions::_impl_.idempotency_level_) - - PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.deprecated_)>( - reinterpret_cast(&_impl_.deprecated_), - reinterpret_cast(&other->_impl_.deprecated_)); + - PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_.features_)>( + reinterpret_cast(&_impl_.features_), + reinterpret_cast(&other->_impl_.features_)); } ::google::protobuf::Metadata MethodOptions::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[21]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[22]); } // =================================================================== @@ -10229,7 +11291,7 @@ void UninterpretedOption_NamePart::InternalSwap(UninterpretedOption_NamePart* ot ::google::protobuf::Metadata UninterpretedOption_NamePart::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[22]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[23]); } // =================================================================== @@ -10654,7 +11716,367 @@ void UninterpretedOption::InternalSwap(UninterpretedOption* other) { ::google::protobuf::Metadata UninterpretedOption::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[23]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[24]); +} +// =================================================================== + +class FeatureSet::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_._has_bits_); + static void set_has_field_presence(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_enum_type(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_repeated_field_encoding(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_string_field_validation(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static void set_has_message_encoding(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static void set_has_json_format(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } +}; + +FeatureSet::FeatureSet(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:google.protobuf.FeatureSet) +} +FeatureSet::FeatureSet(const FeatureSet& from) : ::google::protobuf::Message() { + FeatureSet* const _this = this; + (void)_this; + new (&_impl_) Impl_{ + /*decltype(_impl_._extensions_)*/ {}, + decltype(_impl_._has_bits_){from._impl_._has_bits_}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.field_presence_){}, + decltype(_impl_.enum_type_){}, + decltype(_impl_.repeated_field_encoding_){}, + decltype(_impl_.string_field_validation_){}, + decltype(_impl_.message_encoding_){}, + decltype(_impl_.json_format_){}, + }; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + _impl_._extensions_.MergeFrom(internal_default_instance(), + from._impl_._extensions_); + ::memcpy(&_impl_.field_presence_, &from._impl_.field_presence_, + static_cast<::size_t>(reinterpret_cast(&_impl_.json_format_) - + reinterpret_cast(&_impl_.field_presence_)) + sizeof(_impl_.json_format_)); + + // @@protoc_insertion_point(copy_constructor:google.protobuf.FeatureSet) +} +inline void FeatureSet::SharedCtor(::_pb::Arena* arena) { + (void)arena; + new (&_impl_) Impl_{ + /*decltype(_impl_._extensions_)*/ {::_pbi::ArenaInitialized(), arena}, + decltype(_impl_._has_bits_){}, + /*decltype(_impl_._cached_size_)*/ {}, + decltype(_impl_.field_presence_){0}, + decltype(_impl_.enum_type_){0}, + decltype(_impl_.repeated_field_encoding_){0}, + decltype(_impl_.string_field_validation_){0}, + decltype(_impl_.message_encoding_){0}, + decltype(_impl_.json_format_){0}, + }; +} +FeatureSet::~FeatureSet() { + // @@protoc_insertion_point(destructor:google.protobuf.FeatureSet) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void FeatureSet::SharedDtor() { + ABSL_DCHECK(GetArenaForAllocation() == nullptr); + _impl_._extensions_.~ExtensionSet(); +} +void FeatureSet::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +PROTOBUF_NOINLINE void FeatureSet::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FeatureSet) + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_._extensions_.Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000003fu) { + ::memset(&_impl_.field_presence_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.json_format_) - + reinterpret_cast(&_impl_.field_presence_)) + sizeof(_impl_.json_format_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* FeatureSet::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +constexpr ::_pbi::TcParseTable<3, 6, 6, 0, 2> FeatureSet::_table_ = { + { + PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_._extensions_), + 6, 56, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967232, // skipmap + offsetof(decltype(_table_), field_entries), + 6, // num_field_entries + 6, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_FeatureSet_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {::_pbi::TcParser::FastEr0S1, + {8, 0, 3, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.field_presence_)}}, + // optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + {::_pbi::TcParser::FastEr0S1, + {16, 1, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.enum_type_)}}, + // optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {::_pbi::TcParser::FastEr0S1, + {24, 2, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.repeated_field_encoding_)}}, + // optional .google.protobuf.FeatureSet.StringFieldValidation string_field_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {::_pbi::TcParser::FastEr0S1, + {32, 3, 3, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.string_field_validation_)}}, + // optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {::_pbi::TcParser::FastEr0S1, + {40, 4, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.message_encoding_)}}, + // optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + {::_pbi::TcParser::FastEr0S1, + {48, 5, 2, PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.json_format_)}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.field_presence_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + // optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.enum_type_), _Internal::kHasBitsOffset + 1, 1, + (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + // optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.repeated_field_encoding_), _Internal::kHasBitsOffset + 2, 2, + (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + // optional .google.protobuf.FeatureSet.StringFieldValidation string_field_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.string_field_validation_), _Internal::kHasBitsOffset + 3, 3, + (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + // optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.message_encoding_), _Internal::kHasBitsOffset + 4, 4, + (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + // optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + {PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.json_format_), _Internal::kHasBitsOffset + 5, 5, + (0 | ::_fl::kFcOptional | ::_fl::kEnumRange)}, + }}, {{ + {0, 4}, + {0, 3}, + {0, 3}, + {0, 4}, + {0, 3}, + {0, 3}, + }}, {{ + }}, +}; + +::uint8_t* FeatureSet::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FeatureSet) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000001u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_field_presence(), target); + } + + // optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000002u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_enum_type(), target); + } + + // optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000004u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this->_internal_repeated_field_encoding(), target); + } + + // optional .google.protobuf.FeatureSet.StringFieldValidation string_field_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000008u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_string_field_validation(), target); + } + + // optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000010u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 5, this->_internal_message_encoding(), target); + } + + // optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000020u) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 6, this->_internal_json_format(), target); + } + + // Extension range [1000, 10000) + target = _impl_._extensions_._InternalSerialize( + internal_default_instance(), 1000, 10000, target, stream); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FeatureSet) + return target; +} + +::size_t FeatureSet::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FeatureSet) + ::size_t total_size = 0; + + total_size += _impl_._extensions_.ByteSize(); + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000003fu) { + // optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_field_presence()); + } + + // optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_enum_type()); + } + + // optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_repeated_field_encoding()); + } + + // optional .google.protobuf.FeatureSet.StringFieldValidation string_field_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_string_field_validation()); + } + + // optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000010u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_message_encoding()); + } + + // optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + if (cached_has_bits & 0x00000020u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_json_format()); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData FeatureSet::_class_data_ = { + ::google::protobuf::Message::CopyWithSourceCheck, + FeatureSet::MergeImpl +}; +const ::google::protobuf::Message::ClassData*FeatureSet::GetClassData() const { return &_class_data_; } + + +void FeatureSet::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FeatureSet) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x0000003fu) { + if (cached_has_bits & 0x00000001u) { + _this->_impl_.field_presence_ = from._impl_.field_presence_; + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.enum_type_ = from._impl_.enum_type_; + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.repeated_field_encoding_ = from._impl_.repeated_field_encoding_; + } + if (cached_has_bits & 0x00000008u) { + _this->_impl_.string_field_validation_ = from._impl_.string_field_validation_; + } + if (cached_has_bits & 0x00000010u) { + _this->_impl_.message_encoding_ = from._impl_.message_encoding_; + } + if (cached_has_bits & 0x00000020u) { + _this->_impl_.json_format_ = from._impl_.json_format_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_); + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void FeatureSet::CopyFrom(const FeatureSet& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FeatureSet) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool FeatureSet::IsInitialized() const { + if (!_impl_._extensions_.IsInitialized(internal_default_instance())) { + return false; + } + return true; +} + +void FeatureSet::InternalSwap(FeatureSet* other) { + using std::swap; + _impl_._extensions_.InternalSwap(&other->_impl_._extensions_); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.json_format_) + + sizeof(FeatureSet::_impl_.json_format_) + - PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_.field_presence_)>( + reinterpret_cast(&_impl_.field_presence_), + reinterpret_cast(&other->_impl_.field_presence_)); +} + +::google::protobuf::Metadata FeatureSet::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[25]); } // =================================================================== @@ -11014,7 +12436,7 @@ void SourceCodeInfo_Location::InternalSwap(SourceCodeInfo_Location* other) { ::google::protobuf::Metadata SourceCodeInfo_Location::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[24]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[26]); } // =================================================================== @@ -11185,7 +12607,7 @@ void SourceCodeInfo::InternalSwap(SourceCodeInfo* other) { ::google::protobuf::Metadata SourceCodeInfo::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[25]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[27]); } // =================================================================== @@ -11530,7 +12952,7 @@ void GeneratedCodeInfo_Annotation::InternalSwap(GeneratedCodeInfo_Annotation* ot ::google::protobuf::Metadata GeneratedCodeInfo_Annotation::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[26]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[28]); } // =================================================================== @@ -11701,7 +13123,7 @@ void GeneratedCodeInfo::InternalSwap(GeneratedCodeInfo* other) { ::google::protobuf::Metadata GeneratedCodeInfo::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter, &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, - file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[27]); + file_level_metadata_google_2fprotobuf_2fdescriptor_2eproto[29]); } // @@protoc_insertion_point(namespace_scope) } // namespace protobuf @@ -11772,6 +13194,10 @@ template<> PROTOBUF_NOINLINE ::google::protobuf::MessageOptions* Arena::CreateMaybeMessage< ::google::protobuf::MessageOptions >(Arena* arena) { return Arena::CreateMessageInternal< ::google::protobuf::MessageOptions >(arena); } +template<> PROTOBUF_NOINLINE ::google::protobuf::FieldOptions_EditionDefault* +Arena::CreateMaybeMessage< ::google::protobuf::FieldOptions_EditionDefault >(Arena* arena) { + return Arena::CreateMessageInternal< ::google::protobuf::FieldOptions_EditionDefault >(arena); +} template<> PROTOBUF_NOINLINE ::google::protobuf::FieldOptions* Arena::CreateMaybeMessage< ::google::protobuf::FieldOptions >(Arena* arena) { return Arena::CreateMessageInternal< ::google::protobuf::FieldOptions >(arena); @@ -11804,6 +13230,10 @@ template<> PROTOBUF_NOINLINE ::google::protobuf::UninterpretedOption* Arena::CreateMaybeMessage< ::google::protobuf::UninterpretedOption >(Arena* arena) { return Arena::CreateMessageInternal< ::google::protobuf::UninterpretedOption >(arena); } +template<> PROTOBUF_NOINLINE ::google::protobuf::FeatureSet* +Arena::CreateMaybeMessage< ::google::protobuf::FeatureSet >(Arena* arena) { + return Arena::CreateMessageInternal< ::google::protobuf::FeatureSet >(arena); +} template<> PROTOBUF_NOINLINE ::google::protobuf::SourceCodeInfo_Location* Arena::CreateMaybeMessage< ::google::protobuf::SourceCodeInfo_Location >(Arena* arena) { return Arena::CreateMessageInternal< ::google::protobuf::SourceCodeInfo_Location >(arena); diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index f57fdae93e..d581050c37 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -86,12 +86,18 @@ PROTOBUF_EXPORT extern ExtensionRangeOptionsDefaultTypeInternal _ExtensionRangeO class ExtensionRangeOptions_Declaration; struct ExtensionRangeOptions_DeclarationDefaultTypeInternal; PROTOBUF_EXPORT extern ExtensionRangeOptions_DeclarationDefaultTypeInternal _ExtensionRangeOptions_Declaration_default_instance_; +class FeatureSet; +struct FeatureSetDefaultTypeInternal; +PROTOBUF_EXPORT extern FeatureSetDefaultTypeInternal _FeatureSet_default_instance_; class FieldDescriptorProto; struct FieldDescriptorProtoDefaultTypeInternal; PROTOBUF_EXPORT extern FieldDescriptorProtoDefaultTypeInternal _FieldDescriptorProto_default_instance_; class FieldOptions; struct FieldOptionsDefaultTypeInternal; PROTOBUF_EXPORT extern FieldOptionsDefaultTypeInternal _FieldOptions_default_instance_; +class FieldOptions_EditionDefault; +struct FieldOptions_EditionDefaultDefaultTypeInternal; +PROTOBUF_EXPORT extern FieldOptions_EditionDefaultDefaultTypeInternal _FieldOptions_EditionDefault_default_instance_; class FileDescriptorProto; struct FileDescriptorProtoDefaultTypeInternal; PROTOBUF_EXPORT extern FileDescriptorProtoDefaultTypeInternal _FileDescriptorProto_default_instance_; @@ -161,10 +167,14 @@ PROTOBUF_EXPORT ::google::protobuf::ExtensionRangeOptions* Arena::CreateMaybeMes template <> PROTOBUF_EXPORT ::google::protobuf::ExtensionRangeOptions_Declaration* Arena::CreateMaybeMessage<::google::protobuf::ExtensionRangeOptions_Declaration>(Arena*); template <> +PROTOBUF_EXPORT ::google::protobuf::FeatureSet* Arena::CreateMaybeMessage<::google::protobuf::FeatureSet>(Arena*); +template <> PROTOBUF_EXPORT ::google::protobuf::FieldDescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::FieldDescriptorProto>(Arena*); template <> PROTOBUF_EXPORT ::google::protobuf::FieldOptions* Arena::CreateMaybeMessage<::google::protobuf::FieldOptions>(Arena*); template <> +PROTOBUF_EXPORT ::google::protobuf::FieldOptions_EditionDefault* Arena::CreateMaybeMessage<::google::protobuf::FieldOptions_EditionDefault>(Arena*); +template <> PROTOBUF_EXPORT ::google::protobuf::FileDescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::FileDescriptorProto>(Arena*); template <> PROTOBUF_EXPORT ::google::protobuf::FileDescriptorSet* Arena::CreateMaybeMessage<::google::protobuf::FileDescriptorSet>(Arena*); @@ -488,6 +498,182 @@ inline bool MethodOptions_IdempotencyLevel_Parse(absl::string_view name, MethodO return ::google::protobuf::internal::ParseNamedEnum( MethodOptions_IdempotencyLevel_descriptor(), name, value); } +enum FeatureSet_FieldPresence : int { + FeatureSet_FieldPresence_FIELD_PRESENCE_UNKNOWN = 0, + FeatureSet_FieldPresence_EXPLICIT = 1, + FeatureSet_FieldPresence_IMPLICIT = 2, + FeatureSet_FieldPresence_LEGACY_REQUIRED = 3, +}; + +PROTOBUF_EXPORT bool FeatureSet_FieldPresence_IsValid(int value); +constexpr FeatureSet_FieldPresence FeatureSet_FieldPresence_FieldPresence_MIN = static_cast(0); +constexpr FeatureSet_FieldPresence FeatureSet_FieldPresence_FieldPresence_MAX = static_cast(3); +constexpr int FeatureSet_FieldPresence_FieldPresence_ARRAYSIZE = 3 + 1; +PROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* +FeatureSet_FieldPresence_descriptor(); +template +const std::string& FeatureSet_FieldPresence_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to FieldPresence_Name()."); + return FeatureSet_FieldPresence_Name(static_cast(value)); +} +template <> +inline const std::string& FeatureSet_FieldPresence_Name(FeatureSet_FieldPresence value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool FeatureSet_FieldPresence_Parse(absl::string_view name, FeatureSet_FieldPresence* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FeatureSet_FieldPresence_descriptor(), name, value); +} +enum FeatureSet_EnumType : int { + FeatureSet_EnumType_ENUM_TYPE_UNKNOWN = 0, + FeatureSet_EnumType_OPEN = 1, + FeatureSet_EnumType_CLOSED = 2, +}; + +PROTOBUF_EXPORT bool FeatureSet_EnumType_IsValid(int value); +constexpr FeatureSet_EnumType FeatureSet_EnumType_EnumType_MIN = static_cast(0); +constexpr FeatureSet_EnumType FeatureSet_EnumType_EnumType_MAX = static_cast(2); +constexpr int FeatureSet_EnumType_EnumType_ARRAYSIZE = 2 + 1; +PROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* +FeatureSet_EnumType_descriptor(); +template +const std::string& FeatureSet_EnumType_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to EnumType_Name()."); + return FeatureSet_EnumType_Name(static_cast(value)); +} +template <> +inline const std::string& FeatureSet_EnumType_Name(FeatureSet_EnumType value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool FeatureSet_EnumType_Parse(absl::string_view name, FeatureSet_EnumType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FeatureSet_EnumType_descriptor(), name, value); +} +enum FeatureSet_RepeatedFieldEncoding : int { + FeatureSet_RepeatedFieldEncoding_REPEATED_FIELD_ENCODING_UNKNOWN = 0, + FeatureSet_RepeatedFieldEncoding_PACKED = 1, + FeatureSet_RepeatedFieldEncoding_EXPANDED = 2, +}; + +PROTOBUF_EXPORT bool FeatureSet_RepeatedFieldEncoding_IsValid(int value); +constexpr FeatureSet_RepeatedFieldEncoding FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MIN = static_cast(0); +constexpr FeatureSet_RepeatedFieldEncoding FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MAX = static_cast(2); +constexpr int FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_ARRAYSIZE = 2 + 1; +PROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* +FeatureSet_RepeatedFieldEncoding_descriptor(); +template +const std::string& FeatureSet_RepeatedFieldEncoding_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to RepeatedFieldEncoding_Name()."); + return FeatureSet_RepeatedFieldEncoding_Name(static_cast(value)); +} +template <> +inline const std::string& FeatureSet_RepeatedFieldEncoding_Name(FeatureSet_RepeatedFieldEncoding value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool FeatureSet_RepeatedFieldEncoding_Parse(absl::string_view name, FeatureSet_RepeatedFieldEncoding* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FeatureSet_RepeatedFieldEncoding_descriptor(), name, value); +} +enum FeatureSet_StringFieldValidation : int { + FeatureSet_StringFieldValidation_STRING_FIELD_VALIDATION_UNKNOWN = 0, + FeatureSet_StringFieldValidation_MANDATORY = 1, + FeatureSet_StringFieldValidation_HINT = 2, + FeatureSet_StringFieldValidation_NONE = 3, +}; + +PROTOBUF_EXPORT bool FeatureSet_StringFieldValidation_IsValid(int value); +constexpr FeatureSet_StringFieldValidation FeatureSet_StringFieldValidation_StringFieldValidation_MIN = static_cast(0); +constexpr FeatureSet_StringFieldValidation FeatureSet_StringFieldValidation_StringFieldValidation_MAX = static_cast(3); +constexpr int FeatureSet_StringFieldValidation_StringFieldValidation_ARRAYSIZE = 3 + 1; +PROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* +FeatureSet_StringFieldValidation_descriptor(); +template +const std::string& FeatureSet_StringFieldValidation_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to StringFieldValidation_Name()."); + return FeatureSet_StringFieldValidation_Name(static_cast(value)); +} +template <> +inline const std::string& FeatureSet_StringFieldValidation_Name(FeatureSet_StringFieldValidation value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool FeatureSet_StringFieldValidation_Parse(absl::string_view name, FeatureSet_StringFieldValidation* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FeatureSet_StringFieldValidation_descriptor(), name, value); +} +enum FeatureSet_MessageEncoding : int { + FeatureSet_MessageEncoding_MESSAGE_ENCODING_UNKNOWN = 0, + FeatureSet_MessageEncoding_LENGTH_PREFIXED = 1, + FeatureSet_MessageEncoding_DELIMITED = 2, +}; + +PROTOBUF_EXPORT bool FeatureSet_MessageEncoding_IsValid(int value); +constexpr FeatureSet_MessageEncoding FeatureSet_MessageEncoding_MessageEncoding_MIN = static_cast(0); +constexpr FeatureSet_MessageEncoding FeatureSet_MessageEncoding_MessageEncoding_MAX = static_cast(2); +constexpr int FeatureSet_MessageEncoding_MessageEncoding_ARRAYSIZE = 2 + 1; +PROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* +FeatureSet_MessageEncoding_descriptor(); +template +const std::string& FeatureSet_MessageEncoding_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to MessageEncoding_Name()."); + return FeatureSet_MessageEncoding_Name(static_cast(value)); +} +template <> +inline const std::string& FeatureSet_MessageEncoding_Name(FeatureSet_MessageEncoding value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool FeatureSet_MessageEncoding_Parse(absl::string_view name, FeatureSet_MessageEncoding* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FeatureSet_MessageEncoding_descriptor(), name, value); +} +enum FeatureSet_JsonFormat : int { + FeatureSet_JsonFormat_JSON_FORMAT_UNKNOWN = 0, + FeatureSet_JsonFormat_ALLOW = 1, + FeatureSet_JsonFormat_LEGACY_BEST_EFFORT = 2, +}; + +PROTOBUF_EXPORT bool FeatureSet_JsonFormat_IsValid(int value); +constexpr FeatureSet_JsonFormat FeatureSet_JsonFormat_JsonFormat_MIN = static_cast(0); +constexpr FeatureSet_JsonFormat FeatureSet_JsonFormat_JsonFormat_MAX = static_cast(2); +constexpr int FeatureSet_JsonFormat_JsonFormat_ARRAYSIZE = 2 + 1; +PROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* +FeatureSet_JsonFormat_descriptor(); +template +const std::string& FeatureSet_JsonFormat_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to JsonFormat_Name()."); + return FeatureSet_JsonFormat_Name(static_cast(value)); +} +template <> +inline const std::string& FeatureSet_JsonFormat_Name(FeatureSet_JsonFormat value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool FeatureSet_JsonFormat_Parse(absl::string_view name, FeatureSet_JsonFormat* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FeatureSet_JsonFormat_descriptor(), name, value); +} enum GeneratedCodeInfo_Annotation_Semantic : int { GeneratedCodeInfo_Annotation_Semantic_NONE = 0, GeneratedCodeInfo_Annotation_Semantic_SET = 1, @@ -2204,6 +2390,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : enum : int { kDeclarationFieldNumber = 2, kUninterpretedOptionFieldNumber = 999, + kFeaturesFieldNumber = 50, kVerificationFieldNumber = 3, }; // repeated .google.protobuf.ExtensionRangeOptions.Declaration declaration = 2 [retention = RETENTION_SOURCE]; @@ -2242,6 +2429,21 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional .google.protobuf.FeatureSet features = 50; + bool has_features() const; + void clear_features() ; + const ::google::protobuf::FeatureSet& features() const; + PROTOBUF_NODISCARD ::google::protobuf::FeatureSet* release_features(); + ::google::protobuf::FeatureSet* mutable_features(); + void set_allocated_features(::google::protobuf::FeatureSet* value); + void unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value); + ::google::protobuf::FeatureSet* unsafe_arena_release_features(); + + private: + const ::google::protobuf::FeatureSet& _internal_features() const; + ::google::protobuf::FeatureSet* _internal_mutable_features(); + + public: // optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; bool has_verification() const; void clear_verification() ; @@ -2409,7 +2611,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 3, 3, 0, 7> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 4, 4, 0, 12> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -2420,6 +2622,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::ExtensionRangeOptions_Declaration > declaration_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + ::google::protobuf::FeatureSet* features_; int verification_; PROTOBUF_TSAN_DECLARE_MEMBER; }; @@ -4225,6 +4428,7 @@ class PROTOBUF_EXPORT FileOptions final : kPhpNamespaceFieldNumber = 41, kPhpMetadataNamespaceFieldNumber = 44, kRubyPackageFieldNumber = 45, + kFeaturesFieldNumber = 50, kJavaMultipleFilesFieldNumber = 10, kJavaGenerateEqualsAndHashFieldNumber = 20, kJavaStringCheckUtf8FieldNumber = 27, @@ -4423,6 +4627,21 @@ class PROTOBUF_EXPORT FileOptions final : const std::string& value); std::string* _internal_mutable_ruby_package(); + public: + // optional .google.protobuf.FeatureSet features = 50; + bool has_features() const; + void clear_features() ; + const ::google::protobuf::FeatureSet& features() const; + PROTOBUF_NODISCARD ::google::protobuf::FeatureSet* release_features(); + ::google::protobuf::FeatureSet* mutable_features(); + void set_allocated_features(::google::protobuf::FeatureSet* value); + void unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value); + ::google::protobuf::FeatureSet* unsafe_arena_release_features(); + + private: + const ::google::protobuf::FeatureSet& _internal_features() const; + ::google::protobuf::FeatureSet* _internal_mutable_features(); + public: // optional bool java_multiple_files = 10 [default = false]; bool has_java_multiple_files() const; @@ -4690,7 +4909,7 @@ class PROTOBUF_EXPORT FileOptions final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<5, 21, 2, 202, 12> _table_; + static const ::google::protobuf::internal::TcParseTable<5, 22, 3, 202, 12> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -4710,6 +4929,7 @@ class PROTOBUF_EXPORT FileOptions final : ::google::protobuf::internal::ArenaStringPtr php_namespace_; ::google::protobuf::internal::ArenaStringPtr php_metadata_namespace_; ::google::protobuf::internal::ArenaStringPtr ruby_package_; + ::google::protobuf::FeatureSet* features_; bool java_multiple_files_; bool java_generate_equals_and_hash_; bool java_string_check_utf8_; @@ -4855,6 +5075,7 @@ class PROTOBUF_EXPORT MessageOptions final : enum : int { kUninterpretedOptionFieldNumber = 999, + kFeaturesFieldNumber = 12, kMessageSetWireFormatFieldNumber = 1, kNoStandardDescriptorAccessorFieldNumber = 2, kDeprecatedFieldNumber = 3, @@ -4879,6 +5100,21 @@ class PROTOBUF_EXPORT MessageOptions final : ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional .google.protobuf.FeatureSet features = 12; + bool has_features() const; + void clear_features() ; + const ::google::protobuf::FeatureSet& features() const; + PROTOBUF_NODISCARD ::google::protobuf::FeatureSet* release_features(); + ::google::protobuf::FeatureSet* mutable_features(); + void set_allocated_features(::google::protobuf::FeatureSet* value); + void unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value); + ::google::protobuf::FeatureSet* unsafe_arena_release_features(); + + private: + const ::google::protobuf::FeatureSet& _internal_features() const; + ::google::protobuf::FeatureSet* _internal_mutable_features(); + + public: // optional bool message_set_wire_format = 1 [default = false]; bool has_message_set_wire_format() const; void clear_message_set_wire_format() ; @@ -5090,7 +5326,7 @@ class PROTOBUF_EXPORT MessageOptions final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 6, 1, 0, 7> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 7, 2, 0, 7> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -5100,6 +5336,7 @@ class PROTOBUF_EXPORT MessageOptions final : ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + ::google::protobuf::FeatureSet* features_; bool message_set_wire_format_; bool no_standard_descriptor_accessor_; bool deprecated_; @@ -5111,6 +5348,191 @@ class PROTOBUF_EXPORT MessageOptions final : friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; };// ------------------------------------------------------------------- +class PROTOBUF_EXPORT FieldOptions_EditionDefault final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldOptions.EditionDefault) */ { + public: + inline FieldOptions_EditionDefault() : FieldOptions_EditionDefault(nullptr) {} + ~FieldOptions_EditionDefault() override; + template + explicit PROTOBUF_CONSTEXPR FieldOptions_EditionDefault(::google::protobuf::internal::ConstantInitialized); + + FieldOptions_EditionDefault(const FieldOptions_EditionDefault& from); + FieldOptions_EditionDefault(FieldOptions_EditionDefault&& from) noexcept + : FieldOptions_EditionDefault() { + *this = ::std::move(from); + } + + inline FieldOptions_EditionDefault& operator=(const FieldOptions_EditionDefault& from) { + CopyFrom(from); + return *this; + } + inline FieldOptions_EditionDefault& operator=(FieldOptions_EditionDefault&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const FieldOptions_EditionDefault& default_instance() { + return *internal_default_instance(); + } + static inline const FieldOptions_EditionDefault* internal_default_instance() { + return reinterpret_cast( + &_FieldOptions_EditionDefault_default_instance_); + } + static constexpr int kIndexInFileMessages = + 16; + + friend void swap(FieldOptions_EditionDefault& a, FieldOptions_EditionDefault& b) { + a.Swap(&b); + } + inline void Swap(FieldOptions_EditionDefault* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(FieldOptions_EditionDefault* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + FieldOptions_EditionDefault* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const FieldOptions_EditionDefault& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const FieldOptions_EditionDefault& from) { + FieldOptions_EditionDefault::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FieldOptions_EditionDefault* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "google.protobuf.FieldOptions.EditionDefault"; + } + protected: + explicit FieldOptions_EditionDefault(::google::protobuf::Arena* arena); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kEditionFieldNumber = 1, + kValueFieldNumber = 2, + }; + // optional string edition = 1; + bool has_edition() const; + void clear_edition() ; + const std::string& edition() const; + template + void set_edition(Arg_&& arg, Args_... args); + std::string* mutable_edition(); + PROTOBUF_NODISCARD std::string* release_edition(); + void set_allocated_edition(std::string* ptr); + + private: + const std::string& _internal_edition() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_edition( + const std::string& value); + std::string* _internal_mutable_edition(); + + public: + // optional string value = 2; + bool has_value() const; + void clear_value() ; + const std::string& value() const; + template + void set_value(Arg_&& arg, Args_... args); + std::string* mutable_value(); + PROTOBUF_NODISCARD std::string* release_value(); + void set_allocated_value(std::string* ptr); + + private: + const std::string& _internal_value() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_value( + const std::string& value); + std::string* _internal_mutable_value(); + + public: + // @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions.EditionDefault) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, 0, 64, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr edition_; + ::google::protobuf::internal::ArenaStringPtr value_; + PROTOBUF_TSAN_DECLARE_MEMBER; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; +};// ------------------------------------------------------------------- + class PROTOBUF_EXPORT FieldOptions final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldOptions) */ { public: @@ -5167,7 +5589,7 @@ class PROTOBUF_EXPORT FieldOptions final : &_FieldOptions_default_instance_); } static constexpr int kIndexInFileMessages = - 16; + 17; friend void swap(FieldOptions& a, FieldOptions& b) { a.Swap(&b); @@ -5236,6 +5658,8 @@ class PROTOBUF_EXPORT FieldOptions final : // nested types ---------------------------------------------------- + typedef FieldOptions_EditionDefault EditionDefault; + using CType = FieldOptions_CType; static constexpr CType STRING = FieldOptions_CType_STRING; static constexpr CType CORD = FieldOptions_CType_CORD; @@ -5331,7 +5755,9 @@ class PROTOBUF_EXPORT FieldOptions final : enum : int { kTargetsFieldNumber = 19, + kEditionDefaultsFieldNumber = 20, kUninterpretedOptionFieldNumber = 999, + kFeaturesFieldNumber = 21, kCtypeFieldNumber = 1, kJstypeFieldNumber = 6, kPackedFieldNumber = 2, @@ -5362,6 +5788,24 @@ class PROTOBUF_EXPORT FieldOptions final : ::google::protobuf::RepeatedField* _internal_mutable_targets(); public: + // repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + int edition_defaults_size() const; + private: + int _internal_edition_defaults_size() const; + + public: + void clear_edition_defaults() ; + ::google::protobuf::FieldOptions_EditionDefault* mutable_edition_defaults(int index); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldOptions_EditionDefault >* + mutable_edition_defaults(); + private: + const ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldOptions_EditionDefault>& _internal_edition_defaults() const; + ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldOptions_EditionDefault>* _internal_mutable_edition_defaults(); + public: + const ::google::protobuf::FieldOptions_EditionDefault& edition_defaults(int index) const; + ::google::protobuf::FieldOptions_EditionDefault* add_edition_defaults(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldOptions_EditionDefault >& + edition_defaults() const; // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; int uninterpreted_option_size() const; private: @@ -5380,6 +5824,21 @@ class PROTOBUF_EXPORT FieldOptions final : ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional .google.protobuf.FeatureSet features = 21; + bool has_features() const; + void clear_features() ; + const ::google::protobuf::FeatureSet& features() const; + PROTOBUF_NODISCARD ::google::protobuf::FeatureSet* release_features(); + ::google::protobuf::FeatureSet* mutable_features(); + void set_allocated_features(::google::protobuf::FeatureSet* value); + void unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value); + ::google::protobuf::FeatureSet* unsafe_arena_release_features(); + + private: + const ::google::protobuf::FeatureSet& _internal_features() const; + ::google::protobuf::FeatureSet* _internal_mutable_features(); + + public: // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; bool has_ctype() const; void clear_ctype() ; @@ -5646,7 +6105,7 @@ class PROTOBUF_EXPORT FieldOptions final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<4, 12, 6, 0, 7> _table_; + static const ::google::protobuf::internal::TcParseTable<4, 14, 8, 0, 7> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -5656,7 +6115,9 @@ class PROTOBUF_EXPORT FieldOptions final : ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::RepeatedField targets_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldOptions_EditionDefault > edition_defaults_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + ::google::protobuf::FeatureSet* features_; int ctype_; int jstype_; bool packed_; @@ -5729,7 +6190,7 @@ class PROTOBUF_EXPORT OneofOptions final : &_OneofOptions_default_instance_); } static constexpr int kIndexInFileMessages = - 17; + 18; friend void swap(OneofOptions& a, OneofOptions& b) { a.Swap(&b); @@ -5802,6 +6263,7 @@ class PROTOBUF_EXPORT OneofOptions final : enum : int { kUninterpretedOptionFieldNumber = 999, + kFeaturesFieldNumber = 1, }; // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; int uninterpreted_option_size() const; @@ -5821,6 +6283,21 @@ class PROTOBUF_EXPORT OneofOptions final : ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional .google.protobuf.FeatureSet features = 1; + bool has_features() const; + void clear_features() ; + const ::google::protobuf::FeatureSet& features() const; + PROTOBUF_NODISCARD ::google::protobuf::FeatureSet* release_features(); + ::google::protobuf::FeatureSet* mutable_features(); + void set_allocated_features(::google::protobuf::FeatureSet* value); + void unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value); + ::google::protobuf::FeatureSet* unsafe_arena_release_features(); + + private: + const ::google::protobuf::FeatureSet& _internal_features() const; + ::google::protobuf::FeatureSet* _internal_mutable_features(); + + public: template inline bool HasExtension( @@ -5977,15 +6454,17 @@ class PROTOBUF_EXPORT OneofOptions final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 1, 1, 0, 7> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 2, 2, 0, 7> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { ::google::protobuf::internal::ExtensionSet _extensions_; - ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + ::google::protobuf::FeatureSet* features_; PROTOBUF_TSAN_DECLARE_MEMBER; }; union { Impl_ _impl_; }; @@ -6048,7 +6527,7 @@ class PROTOBUF_EXPORT EnumOptions final : &_EnumOptions_default_instance_); } static constexpr int kIndexInFileMessages = - 18; + 19; friend void swap(EnumOptions& a, EnumOptions& b) { a.Swap(&b); @@ -6121,6 +6600,7 @@ class PROTOBUF_EXPORT EnumOptions final : enum : int { kUninterpretedOptionFieldNumber = 999, + kFeaturesFieldNumber = 7, kAllowAliasFieldNumber = 2, kDeprecatedFieldNumber = 3, kDeprecatedLegacyJsonFieldConflictsFieldNumber = 6, @@ -6143,6 +6623,21 @@ class PROTOBUF_EXPORT EnumOptions final : ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional .google.protobuf.FeatureSet features = 7; + bool has_features() const; + void clear_features() ; + const ::google::protobuf::FeatureSet& features() const; + PROTOBUF_NODISCARD ::google::protobuf::FeatureSet* release_features(); + ::google::protobuf::FeatureSet* mutable_features(); + void set_allocated_features(::google::protobuf::FeatureSet* value); + void unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value); + ::google::protobuf::FeatureSet* unsafe_arena_release_features(); + + private: + const ::google::protobuf::FeatureSet& _internal_features() const; + ::google::protobuf::FeatureSet* _internal_mutable_features(); + + public: // optional bool allow_alias = 2; bool has_allow_alias() const; void clear_allow_alias() ; @@ -6332,7 +6827,7 @@ class PROTOBUF_EXPORT EnumOptions final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 4, 1, 0, 7> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 5, 2, 0, 7> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -6342,6 +6837,7 @@ class PROTOBUF_EXPORT EnumOptions final : ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + ::google::protobuf::FeatureSet* features_; bool allow_alias_; bool deprecated_; bool deprecated_legacy_json_field_conflicts_; @@ -6407,7 +6903,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : &_EnumValueOptions_default_instance_); } static constexpr int kIndexInFileMessages = - 19; + 20; friend void swap(EnumValueOptions& a, EnumValueOptions& b) { a.Swap(&b); @@ -6480,6 +6976,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : enum : int { kUninterpretedOptionFieldNumber = 999, + kFeaturesFieldNumber = 2, kDeprecatedFieldNumber = 1, kDebugRedactFieldNumber = 3, }; @@ -6501,6 +6998,21 @@ class PROTOBUF_EXPORT EnumValueOptions final : ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional .google.protobuf.FeatureSet features = 2; + bool has_features() const; + void clear_features() ; + const ::google::protobuf::FeatureSet& features() const; + PROTOBUF_NODISCARD ::google::protobuf::FeatureSet* release_features(); + ::google::protobuf::FeatureSet* mutable_features(); + void set_allocated_features(::google::protobuf::FeatureSet* value); + void unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value); + ::google::protobuf::FeatureSet* unsafe_arena_release_features(); + + private: + const ::google::protobuf::FeatureSet& _internal_features() const; + ::google::protobuf::FeatureSet* _internal_mutable_features(); + + public: // optional bool deprecated = 1 [default = false]; bool has_deprecated() const; void clear_deprecated() ; @@ -6679,7 +7191,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 3, 1, 0, 7> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 4, 2, 0, 7> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -6689,6 +7201,7 @@ class PROTOBUF_EXPORT EnumValueOptions final : ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + ::google::protobuf::FeatureSet* features_; bool deprecated_; bool debug_redact_; PROTOBUF_TSAN_DECLARE_MEMBER; @@ -6753,7 +7266,7 @@ class PROTOBUF_EXPORT ServiceOptions final : &_ServiceOptions_default_instance_); } static constexpr int kIndexInFileMessages = - 20; + 21; friend void swap(ServiceOptions& a, ServiceOptions& b) { a.Swap(&b); @@ -6826,6 +7339,7 @@ class PROTOBUF_EXPORT ServiceOptions final : enum : int { kUninterpretedOptionFieldNumber = 999, + kFeaturesFieldNumber = 34, kDeprecatedFieldNumber = 33, }; // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; @@ -6846,6 +7360,21 @@ class PROTOBUF_EXPORT ServiceOptions final : ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional .google.protobuf.FeatureSet features = 34; + bool has_features() const; + void clear_features() ; + const ::google::protobuf::FeatureSet& features() const; + PROTOBUF_NODISCARD ::google::protobuf::FeatureSet* release_features(); + ::google::protobuf::FeatureSet* mutable_features(); + void set_allocated_features(::google::protobuf::FeatureSet* value); + void unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value); + ::google::protobuf::FeatureSet* unsafe_arena_release_features(); + + private: + const ::google::protobuf::FeatureSet& _internal_features() const; + ::google::protobuf::FeatureSet* _internal_mutable_features(); + + public: // optional bool deprecated = 33 [default = false]; bool has_deprecated() const; void clear_deprecated() ; @@ -7013,7 +7542,7 @@ class PROTOBUF_EXPORT ServiceOptions final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 2, 1, 0, 12> _table_; + static const ::google::protobuf::internal::TcParseTable<2, 3, 2, 0, 12> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -7023,6 +7552,7 @@ class PROTOBUF_EXPORT ServiceOptions final : ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + ::google::protobuf::FeatureSet* features_; bool deprecated_; PROTOBUF_TSAN_DECLARE_MEMBER; }; @@ -7086,7 +7616,7 @@ class PROTOBUF_EXPORT MethodOptions final : &_MethodOptions_default_instance_); } static constexpr int kIndexInFileMessages = - 21; + 22; friend void swap(MethodOptions& a, MethodOptions& b) { a.Swap(&b); @@ -7180,6 +7710,7 @@ class PROTOBUF_EXPORT MethodOptions final : enum : int { kUninterpretedOptionFieldNumber = 999, + kFeaturesFieldNumber = 35, kDeprecatedFieldNumber = 33, kIdempotencyLevelFieldNumber = 34, }; @@ -7201,6 +7732,21 @@ class PROTOBUF_EXPORT MethodOptions final : ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& uninterpreted_option() const; + // optional .google.protobuf.FeatureSet features = 35; + bool has_features() const; + void clear_features() ; + const ::google::protobuf::FeatureSet& features() const; + PROTOBUF_NODISCARD ::google::protobuf::FeatureSet* release_features(); + ::google::protobuf::FeatureSet* mutable_features(); + void set_allocated_features(::google::protobuf::FeatureSet* value); + void unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value); + ::google::protobuf::FeatureSet* unsafe_arena_release_features(); + + private: + const ::google::protobuf::FeatureSet& _internal_features() const; + ::google::protobuf::FeatureSet* _internal_mutable_features(); + + public: // optional bool deprecated = 33 [default = false]; bool has_deprecated() const; void clear_deprecated() ; @@ -7379,7 +7925,7 @@ class PROTOBUF_EXPORT MethodOptions final : class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 3, 2, 0, 12> _table_; + static const ::google::protobuf::internal::TcParseTable<3, 4, 3, 0, 12> _table_; template friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; @@ -7389,6 +7935,7 @@ class PROTOBUF_EXPORT MethodOptions final : ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + ::google::protobuf::FeatureSet* features_; bool deprecated_; int idempotency_level_; PROTOBUF_TSAN_DECLARE_MEMBER; @@ -7453,7 +8000,7 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : &_UninterpretedOption_NamePart_default_instance_); } static constexpr int kIndexInFileMessages = - 22; + 23; friend void swap(UninterpretedOption_NamePart& a, UninterpretedOption_NamePart& b) { a.Swap(&b); @@ -7632,7 +8179,7 @@ class PROTOBUF_EXPORT UninterpretedOption final : &_UninterpretedOption_default_instance_); } static constexpr int kIndexInFileMessages = - 23; + 24; friend void swap(UninterpretedOption& a, UninterpretedOption& b) { a.Swap(&b); @@ -7841,6 +8388,512 @@ class PROTOBUF_EXPORT UninterpretedOption final : friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; };// ------------------------------------------------------------------- +class PROTOBUF_EXPORT FeatureSet final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FeatureSet) */ { + public: + inline FeatureSet() : FeatureSet(nullptr) {} + ~FeatureSet() override; + template + explicit PROTOBUF_CONSTEXPR FeatureSet(::google::protobuf::internal::ConstantInitialized); + + FeatureSet(const FeatureSet& from); + FeatureSet(FeatureSet&& from) noexcept + : FeatureSet() { + *this = ::std::move(from); + } + + inline FeatureSet& operator=(const FeatureSet& from) { + CopyFrom(from); + return *this; + } + inline FeatureSet& operator=(FeatureSet&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const FeatureSet& default_instance() { + return *internal_default_instance(); + } + static inline const FeatureSet* internal_default_instance() { + return reinterpret_cast( + &_FeatureSet_default_instance_); + } + static constexpr int kIndexInFileMessages = + 25; + + friend void swap(FeatureSet& a, FeatureSet& b) { + a.Swap(&b); + } + inline void Swap(FeatureSet* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(FeatureSet* other) { + if (other == this) return; + ABSL_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + FeatureSet* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const FeatureSet& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const FeatureSet& from) { + FeatureSet::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FeatureSet* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "google.protobuf.FeatureSet"; + } + protected: + explicit FeatureSet(::google::protobuf::Arena* arena); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + using FieldPresence = FeatureSet_FieldPresence; + static constexpr FieldPresence FIELD_PRESENCE_UNKNOWN = FeatureSet_FieldPresence_FIELD_PRESENCE_UNKNOWN; + static constexpr FieldPresence EXPLICIT = FeatureSet_FieldPresence_EXPLICIT; + static constexpr FieldPresence IMPLICIT = FeatureSet_FieldPresence_IMPLICIT; + static constexpr FieldPresence LEGACY_REQUIRED = FeatureSet_FieldPresence_LEGACY_REQUIRED; + static inline bool FieldPresence_IsValid(int value) { + return FeatureSet_FieldPresence_IsValid(value); + } + static constexpr FieldPresence FieldPresence_MIN = FeatureSet_FieldPresence_FieldPresence_MIN; + static constexpr FieldPresence FieldPresence_MAX = FeatureSet_FieldPresence_FieldPresence_MAX; + static constexpr int FieldPresence_ARRAYSIZE = FeatureSet_FieldPresence_FieldPresence_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* FieldPresence_descriptor() { + return FeatureSet_FieldPresence_descriptor(); + } + template + static inline const std::string& FieldPresence_Name(T value) { + return FeatureSet_FieldPresence_Name(value); + } + static inline bool FieldPresence_Parse(absl::string_view name, FieldPresence* value) { + return FeatureSet_FieldPresence_Parse(name, value); + } + + using EnumType = FeatureSet_EnumType; + static constexpr EnumType ENUM_TYPE_UNKNOWN = FeatureSet_EnumType_ENUM_TYPE_UNKNOWN; + static constexpr EnumType OPEN = FeatureSet_EnumType_OPEN; + static constexpr EnumType CLOSED = FeatureSet_EnumType_CLOSED; + static inline bool EnumType_IsValid(int value) { + return FeatureSet_EnumType_IsValid(value); + } + static constexpr EnumType EnumType_MIN = FeatureSet_EnumType_EnumType_MIN; + static constexpr EnumType EnumType_MAX = FeatureSet_EnumType_EnumType_MAX; + static constexpr int EnumType_ARRAYSIZE = FeatureSet_EnumType_EnumType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* EnumType_descriptor() { + return FeatureSet_EnumType_descriptor(); + } + template + static inline const std::string& EnumType_Name(T value) { + return FeatureSet_EnumType_Name(value); + } + static inline bool EnumType_Parse(absl::string_view name, EnumType* value) { + return FeatureSet_EnumType_Parse(name, value); + } + + using RepeatedFieldEncoding = FeatureSet_RepeatedFieldEncoding; + static constexpr RepeatedFieldEncoding REPEATED_FIELD_ENCODING_UNKNOWN = FeatureSet_RepeatedFieldEncoding_REPEATED_FIELD_ENCODING_UNKNOWN; + static constexpr RepeatedFieldEncoding PACKED = FeatureSet_RepeatedFieldEncoding_PACKED; + static constexpr RepeatedFieldEncoding EXPANDED = FeatureSet_RepeatedFieldEncoding_EXPANDED; + static inline bool RepeatedFieldEncoding_IsValid(int value) { + return FeatureSet_RepeatedFieldEncoding_IsValid(value); + } + static constexpr RepeatedFieldEncoding RepeatedFieldEncoding_MIN = FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MIN; + static constexpr RepeatedFieldEncoding RepeatedFieldEncoding_MAX = FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MAX; + static constexpr int RepeatedFieldEncoding_ARRAYSIZE = FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* RepeatedFieldEncoding_descriptor() { + return FeatureSet_RepeatedFieldEncoding_descriptor(); + } + template + static inline const std::string& RepeatedFieldEncoding_Name(T value) { + return FeatureSet_RepeatedFieldEncoding_Name(value); + } + static inline bool RepeatedFieldEncoding_Parse(absl::string_view name, RepeatedFieldEncoding* value) { + return FeatureSet_RepeatedFieldEncoding_Parse(name, value); + } + + using StringFieldValidation = FeatureSet_StringFieldValidation; + static constexpr StringFieldValidation STRING_FIELD_VALIDATION_UNKNOWN = FeatureSet_StringFieldValidation_STRING_FIELD_VALIDATION_UNKNOWN; + static constexpr StringFieldValidation MANDATORY = FeatureSet_StringFieldValidation_MANDATORY; + static constexpr StringFieldValidation HINT = FeatureSet_StringFieldValidation_HINT; + static constexpr StringFieldValidation NONE = FeatureSet_StringFieldValidation_NONE; + static inline bool StringFieldValidation_IsValid(int value) { + return FeatureSet_StringFieldValidation_IsValid(value); + } + static constexpr StringFieldValidation StringFieldValidation_MIN = FeatureSet_StringFieldValidation_StringFieldValidation_MIN; + static constexpr StringFieldValidation StringFieldValidation_MAX = FeatureSet_StringFieldValidation_StringFieldValidation_MAX; + static constexpr int StringFieldValidation_ARRAYSIZE = FeatureSet_StringFieldValidation_StringFieldValidation_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* StringFieldValidation_descriptor() { + return FeatureSet_StringFieldValidation_descriptor(); + } + template + static inline const std::string& StringFieldValidation_Name(T value) { + return FeatureSet_StringFieldValidation_Name(value); + } + static inline bool StringFieldValidation_Parse(absl::string_view name, StringFieldValidation* value) { + return FeatureSet_StringFieldValidation_Parse(name, value); + } + + using MessageEncoding = FeatureSet_MessageEncoding; + static constexpr MessageEncoding MESSAGE_ENCODING_UNKNOWN = FeatureSet_MessageEncoding_MESSAGE_ENCODING_UNKNOWN; + static constexpr MessageEncoding LENGTH_PREFIXED = FeatureSet_MessageEncoding_LENGTH_PREFIXED; + static constexpr MessageEncoding DELIMITED = FeatureSet_MessageEncoding_DELIMITED; + static inline bool MessageEncoding_IsValid(int value) { + return FeatureSet_MessageEncoding_IsValid(value); + } + static constexpr MessageEncoding MessageEncoding_MIN = FeatureSet_MessageEncoding_MessageEncoding_MIN; + static constexpr MessageEncoding MessageEncoding_MAX = FeatureSet_MessageEncoding_MessageEncoding_MAX; + static constexpr int MessageEncoding_ARRAYSIZE = FeatureSet_MessageEncoding_MessageEncoding_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* MessageEncoding_descriptor() { + return FeatureSet_MessageEncoding_descriptor(); + } + template + static inline const std::string& MessageEncoding_Name(T value) { + return FeatureSet_MessageEncoding_Name(value); + } + static inline bool MessageEncoding_Parse(absl::string_view name, MessageEncoding* value) { + return FeatureSet_MessageEncoding_Parse(name, value); + } + + using JsonFormat = FeatureSet_JsonFormat; + static constexpr JsonFormat JSON_FORMAT_UNKNOWN = FeatureSet_JsonFormat_JSON_FORMAT_UNKNOWN; + static constexpr JsonFormat ALLOW = FeatureSet_JsonFormat_ALLOW; + static constexpr JsonFormat LEGACY_BEST_EFFORT = FeatureSet_JsonFormat_LEGACY_BEST_EFFORT; + static inline bool JsonFormat_IsValid(int value) { + return FeatureSet_JsonFormat_IsValid(value); + } + static constexpr JsonFormat JsonFormat_MIN = FeatureSet_JsonFormat_JsonFormat_MIN; + static constexpr JsonFormat JsonFormat_MAX = FeatureSet_JsonFormat_JsonFormat_MAX; + static constexpr int JsonFormat_ARRAYSIZE = FeatureSet_JsonFormat_JsonFormat_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* JsonFormat_descriptor() { + return FeatureSet_JsonFormat_descriptor(); + } + template + static inline const std::string& JsonFormat_Name(T value) { + return FeatureSet_JsonFormat_Name(value); + } + static inline bool JsonFormat_Parse(absl::string_view name, JsonFormat* value) { + return FeatureSet_JsonFormat_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kFieldPresenceFieldNumber = 1, + kEnumTypeFieldNumber = 2, + kRepeatedFieldEncodingFieldNumber = 3, + kStringFieldValidationFieldNumber = 4, + kMessageEncodingFieldNumber = 5, + kJsonFormatFieldNumber = 6, + }; + // optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + bool has_field_presence() const; + void clear_field_presence() ; + ::google::protobuf::FeatureSet_FieldPresence field_presence() const; + void set_field_presence(::google::protobuf::FeatureSet_FieldPresence value); + + private: + ::google::protobuf::FeatureSet_FieldPresence _internal_field_presence() const; + void _internal_set_field_presence(::google::protobuf::FeatureSet_FieldPresence value); + + public: + // optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + bool has_enum_type() const; + void clear_enum_type() ; + ::google::protobuf::FeatureSet_EnumType enum_type() const; + void set_enum_type(::google::protobuf::FeatureSet_EnumType value); + + private: + ::google::protobuf::FeatureSet_EnumType _internal_enum_type() const; + void _internal_set_enum_type(::google::protobuf::FeatureSet_EnumType value); + + public: + // optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + bool has_repeated_field_encoding() const; + void clear_repeated_field_encoding() ; + ::google::protobuf::FeatureSet_RepeatedFieldEncoding repeated_field_encoding() const; + void set_repeated_field_encoding(::google::protobuf::FeatureSet_RepeatedFieldEncoding value); + + private: + ::google::protobuf::FeatureSet_RepeatedFieldEncoding _internal_repeated_field_encoding() const; + void _internal_set_repeated_field_encoding(::google::protobuf::FeatureSet_RepeatedFieldEncoding value); + + public: + // optional .google.protobuf.FeatureSet.StringFieldValidation string_field_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + bool has_string_field_validation() const; + void clear_string_field_validation() ; + ::google::protobuf::FeatureSet_StringFieldValidation string_field_validation() const; + void set_string_field_validation(::google::protobuf::FeatureSet_StringFieldValidation value); + + private: + ::google::protobuf::FeatureSet_StringFieldValidation _internal_string_field_validation() const; + void _internal_set_string_field_validation(::google::protobuf::FeatureSet_StringFieldValidation value); + + public: + // optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { + bool has_message_encoding() const; + void clear_message_encoding() ; + ::google::protobuf::FeatureSet_MessageEncoding message_encoding() const; + void set_message_encoding(::google::protobuf::FeatureSet_MessageEncoding value); + + private: + ::google::protobuf::FeatureSet_MessageEncoding _internal_message_encoding() const; + void _internal_set_message_encoding(::google::protobuf::FeatureSet_MessageEncoding value); + + public: + // optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { + bool has_json_format() const; + void clear_json_format() ; + ::google::protobuf::FeatureSet_JsonFormat json_format() const; + void set_json_format(::google::protobuf::FeatureSet_JsonFormat value); + + private: + ::google::protobuf::FeatureSet_JsonFormat _internal_json_format() const; + void _internal_set_json_format(::google::protobuf::FeatureSet_JsonFormat value); + + public: + template + inline bool HasExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id) const { + return _impl_._extensions_.Has(id.number()); + } + + template + inline void ClearExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id) { + _impl_._extensions_.ClearExtension(id.number()); + } + + template + inline int ExtensionSize( + const ::google::protobuf::internal::ExtensionIdentifier& id) const { + return _impl_._extensions_.ExtensionSize(id.number()); + } + + template + inline typename _proto_TypeTraits::Singular::ConstType GetExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id) const { + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, id.default_value()); + } + + template + inline typename _proto_TypeTraits::Singular::MutableType MutableExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id) { + return _proto_TypeTraits::Mutable(id.number(), _field_type, &_impl_._extensions_); + } + + template + inline void SetExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id, + typename _proto_TypeTraits::Singular::ConstType value) { + _proto_TypeTraits::Set(id.number(), _field_type, value, &_impl_._extensions_); + } + + template + inline void SetAllocatedExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id, + typename _proto_TypeTraits::Singular::MutableType value) { + _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, + &_impl_._extensions_); + } + template + inline void UnsafeArenaSetAllocatedExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id, + typename _proto_TypeTraits::Singular::MutableType value) { + _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, + value, &_impl_._extensions_); + } + template + PROTOBUF_NODISCARD inline + typename _proto_TypeTraits::Singular::MutableType + ReleaseExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id) { + return _proto_TypeTraits::Release(id.number(), _field_type, &_impl_._extensions_); + } + template + inline typename _proto_TypeTraits::Singular::MutableType + UnsafeArenaReleaseExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id) { + return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, + &_impl_._extensions_); + } + + template + inline typename _proto_TypeTraits::Repeated::ConstType GetExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id, + int index) const { + return _proto_TypeTraits::Get(id.number(), _impl_._extensions_, index); + } + + template + inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id, + int index) { + return _proto_TypeTraits::Mutable(id.number(), index, &_impl_._extensions_); + } + + template + inline void SetExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id, + int index, typename _proto_TypeTraits::Repeated::ConstType value) { + _proto_TypeTraits::Set(id.number(), index, value, &_impl_._extensions_); + } + + template + inline typename _proto_TypeTraits::Repeated::MutableType AddExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id) { + typename _proto_TypeTraits::Repeated::MutableType to_add = + _proto_TypeTraits::Add(id.number(), _field_type, &_impl_._extensions_); + return to_add; + } + + template + inline void AddExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id, + typename _proto_TypeTraits::Repeated::ConstType value) { + _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, + &_impl_._extensions_); + } + + template + inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType& + GetRepeatedExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id) const { + return _proto_TypeTraits::GetRepeated(id.number(), _impl_._extensions_); + } + + template + inline typename _proto_TypeTraits::Repeated::RepeatedFieldType* + MutableRepeatedExtension( + const ::google::protobuf::internal::ExtensionIdentifier& id) { + return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, + _is_packed, &_impl_._extensions_); + } + // @@protoc_insertion_point(class_scope:google.protobuf.FeatureSet) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<3, 6, 6, 0, 2> _table_; + template friend class ::google::protobuf::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::google::protobuf::internal::ExtensionSet _extensions_; + + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + int field_presence_; + int enum_type_; + int repeated_field_encoding_; + int string_field_validation_; + int message_encoding_; + int json_format_; + PROTOBUF_TSAN_DECLARE_MEMBER; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_google_2fprotobuf_2fdescriptor_2eproto; +};// ------------------------------------------------------------------- + class PROTOBUF_EXPORT SourceCodeInfo_Location final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo.Location) */ { public: @@ -7897,7 +8950,7 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : &_SourceCodeInfo_Location_default_instance_); } static constexpr int kIndexInFileMessages = - 24; + 26; friend void swap(SourceCodeInfo_Location& a, SourceCodeInfo_Location& b) { a.Swap(&b); @@ -8154,7 +9207,7 @@ class PROTOBUF_EXPORT SourceCodeInfo final : &_SourceCodeInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 25; + 27; friend void swap(SourceCodeInfo& a, SourceCodeInfo& b) { a.Swap(&b); @@ -8322,7 +9375,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : &_GeneratedCodeInfo_Annotation_default_instance_); } static constexpr int kIndexInFileMessages = - 26; + 28; friend void swap(GeneratedCodeInfo_Annotation& a, GeneratedCodeInfo_Annotation& b) { a.Swap(&b); @@ -8569,7 +9622,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : &_GeneratedCodeInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 27; + 29; friend void swap(GeneratedCodeInfo& a, GeneratedCodeInfo& b) { a.Swap(&b); @@ -10724,14 +11777,110 @@ ExtensionRangeOptions::_internal_mutable_declaration() { return &_impl_.declaration_; } +// optional .google.protobuf.FeatureSet features = 50; +inline bool ExtensionRangeOptions::has_features() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.features_ != nullptr); + return value; +} +inline void ExtensionRangeOptions::clear_features() { + if (_impl_.features_ != nullptr) _impl_.features_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::google::protobuf::FeatureSet& ExtensionRangeOptions::_internal_features() const { + PROTOBUF_TSAN_READ_MESSAGE(&_impl_._tsan_detect_race); + const ::google::protobuf::FeatureSet* p = _impl_.features_; + return p != nullptr ? *p : reinterpret_cast(::google::protobuf::_FeatureSet_default_instance_); +} +inline const ::google::protobuf::FeatureSet& ExtensionRangeOptions::features() const { + // @@protoc_insertion_point(field_get:google.protobuf.ExtensionRangeOptions.features) + return _internal_features(); +} +inline void ExtensionRangeOptions::unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value) { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.features_); + } + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ExtensionRangeOptions.features) +} +inline ::google::protobuf::FeatureSet* ExtensionRangeOptions::release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* released = _impl_.features_; + _impl_.features_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::google::protobuf::FeatureSet* ExtensionRangeOptions::unsafe_arena_release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.ExtensionRangeOptions.features) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* temp = _impl_.features_; + _impl_.features_ = nullptr; + return temp; +} +inline ::google::protobuf::FeatureSet* ExtensionRangeOptions::_internal_mutable_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.features_ == nullptr) { + auto* p = CreateMaybeMessage<::google::protobuf::FeatureSet>(GetArenaForAllocation()); + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(p); + } + return _impl_.features_; +} +inline ::google::protobuf::FeatureSet* ExtensionRangeOptions::mutable_features() { + ::google::protobuf::FeatureSet* _msg = _internal_mutable_features(); + // @@protoc_insertion_point(field_mutable:google.protobuf.ExtensionRangeOptions.features) + return _msg; +} +inline void ExtensionRangeOptions::set_allocated_features(::google::protobuf::FeatureSet* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::FeatureSet*>(_impl_.features_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::FeatureSet*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.ExtensionRangeOptions.features) +} + // optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED]; inline bool ExtensionRangeOptions::has_verification() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline void ExtensionRangeOptions::clear_verification() { _impl_.verification_ = 1; - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000002u; } inline ::google::protobuf::ExtensionRangeOptions_VerificationState ExtensionRangeOptions::verification() const { // @@protoc_insertion_point(field_get:google.protobuf.ExtensionRangeOptions.verification) @@ -10748,7 +11897,7 @@ inline ::google::protobuf::ExtensionRangeOptions_VerificationState ExtensionRang inline void ExtensionRangeOptions::_internal_set_verification(::google::protobuf::ExtensionRangeOptions_VerificationState value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); assert(::google::protobuf::ExtensionRangeOptions_VerificationState_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000002u; _impl_.verification_ = value; } @@ -12834,12 +13983,12 @@ inline void FileOptions::set_allocated_java_outer_classname(std::string* value) // optional bool java_multiple_files = 10 [default = false]; inline bool FileOptions::has_java_multiple_files() const { - bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; return value; } inline void FileOptions::clear_java_multiple_files() { _impl_.java_multiple_files_ = false; - _impl_._has_bits_[0] &= ~0x00000400u; + _impl_._has_bits_[0] &= ~0x00000800u; } inline bool FileOptions::java_multiple_files() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_multiple_files) @@ -12855,18 +14004,18 @@ inline bool FileOptions::_internal_java_multiple_files() const { } inline void FileOptions::_internal_set_java_multiple_files(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000400u; + _impl_._has_bits_[0] |= 0x00000800u; _impl_.java_multiple_files_ = value; } // optional bool java_generate_equals_and_hash = 20 [deprecated = true]; inline bool FileOptions::has_java_generate_equals_and_hash() const { - bool value = (_impl_._has_bits_[0] & 0x00000800u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00001000u) != 0; return value; } inline void FileOptions::clear_java_generate_equals_and_hash() { _impl_.java_generate_equals_and_hash_ = false; - _impl_._has_bits_[0] &= ~0x00000800u; + _impl_._has_bits_[0] &= ~0x00001000u; } inline bool FileOptions::java_generate_equals_and_hash() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generate_equals_and_hash) @@ -12882,18 +14031,18 @@ inline bool FileOptions::_internal_java_generate_equals_and_hash() const { } inline void FileOptions::_internal_set_java_generate_equals_and_hash(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000800u; + _impl_._has_bits_[0] |= 0x00001000u; _impl_.java_generate_equals_and_hash_ = value; } // optional bool java_string_check_utf8 = 27 [default = false]; inline bool FileOptions::has_java_string_check_utf8() const { - bool value = (_impl_._has_bits_[0] & 0x00001000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00002000u) != 0; return value; } inline void FileOptions::clear_java_string_check_utf8() { _impl_.java_string_check_utf8_ = false; - _impl_._has_bits_[0] &= ~0x00001000u; + _impl_._has_bits_[0] &= ~0x00002000u; } inline bool FileOptions::java_string_check_utf8() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_string_check_utf8) @@ -12909,18 +14058,18 @@ inline bool FileOptions::_internal_java_string_check_utf8() const { } inline void FileOptions::_internal_set_java_string_check_utf8(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00001000u; + _impl_._has_bits_[0] |= 0x00002000u; _impl_.java_string_check_utf8_ = value; } // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; inline bool FileOptions::has_optimize_for() const { - bool value = (_impl_._has_bits_[0] & 0x00040000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00080000u) != 0; return value; } inline void FileOptions::clear_optimize_for() { _impl_.optimize_for_ = 1; - _impl_._has_bits_[0] &= ~0x00040000u; + _impl_._has_bits_[0] &= ~0x00080000u; } inline ::google::protobuf::FileOptions_OptimizeMode FileOptions::optimize_for() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.optimize_for) @@ -12937,7 +14086,7 @@ inline ::google::protobuf::FileOptions_OptimizeMode FileOptions::_internal_optim inline void FileOptions::_internal_set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); assert(::google::protobuf::FileOptions_OptimizeMode_IsValid(value)); - _impl_._has_bits_[0] |= 0x00040000u; + _impl_._has_bits_[0] |= 0x00080000u; _impl_.optimize_for_ = value; } @@ -13012,12 +14161,12 @@ inline void FileOptions::set_allocated_go_package(std::string* value) { // optional bool cc_generic_services = 16 [default = false]; inline bool FileOptions::has_cc_generic_services() const { - bool value = (_impl_._has_bits_[0] & 0x00002000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00004000u) != 0; return value; } inline void FileOptions::clear_cc_generic_services() { _impl_.cc_generic_services_ = false; - _impl_._has_bits_[0] &= ~0x00002000u; + _impl_._has_bits_[0] &= ~0x00004000u; } inline bool FileOptions::cc_generic_services() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_generic_services) @@ -13033,18 +14182,18 @@ inline bool FileOptions::_internal_cc_generic_services() const { } inline void FileOptions::_internal_set_cc_generic_services(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00002000u; + _impl_._has_bits_[0] |= 0x00004000u; _impl_.cc_generic_services_ = value; } // optional bool java_generic_services = 17 [default = false]; inline bool FileOptions::has_java_generic_services() const { - bool value = (_impl_._has_bits_[0] & 0x00004000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00008000u) != 0; return value; } inline void FileOptions::clear_java_generic_services() { _impl_.java_generic_services_ = false; - _impl_._has_bits_[0] &= ~0x00004000u; + _impl_._has_bits_[0] &= ~0x00008000u; } inline bool FileOptions::java_generic_services() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generic_services) @@ -13060,18 +14209,18 @@ inline bool FileOptions::_internal_java_generic_services() const { } inline void FileOptions::_internal_set_java_generic_services(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00004000u; + _impl_._has_bits_[0] |= 0x00008000u; _impl_.java_generic_services_ = value; } // optional bool py_generic_services = 18 [default = false]; inline bool FileOptions::has_py_generic_services() const { - bool value = (_impl_._has_bits_[0] & 0x00008000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00010000u) != 0; return value; } inline void FileOptions::clear_py_generic_services() { _impl_.py_generic_services_ = false; - _impl_._has_bits_[0] &= ~0x00008000u; + _impl_._has_bits_[0] &= ~0x00010000u; } inline bool FileOptions::py_generic_services() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.py_generic_services) @@ -13087,18 +14236,18 @@ inline bool FileOptions::_internal_py_generic_services() const { } inline void FileOptions::_internal_set_py_generic_services(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00008000u; + _impl_._has_bits_[0] |= 0x00010000u; _impl_.py_generic_services_ = value; } // optional bool php_generic_services = 42 [default = false]; inline bool FileOptions::has_php_generic_services() const { - bool value = (_impl_._has_bits_[0] & 0x00010000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00020000u) != 0; return value; } inline void FileOptions::clear_php_generic_services() { _impl_.php_generic_services_ = false; - _impl_._has_bits_[0] &= ~0x00010000u; + _impl_._has_bits_[0] &= ~0x00020000u; } inline bool FileOptions::php_generic_services() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_generic_services) @@ -13114,18 +14263,18 @@ inline bool FileOptions::_internal_php_generic_services() const { } inline void FileOptions::_internal_set_php_generic_services(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00010000u; + _impl_._has_bits_[0] |= 0x00020000u; _impl_.php_generic_services_ = value; } // optional bool deprecated = 23 [default = false]; inline bool FileOptions::has_deprecated() const { - bool value = (_impl_._has_bits_[0] & 0x00020000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00040000u) != 0; return value; } inline void FileOptions::clear_deprecated() { _impl_.deprecated_ = false; - _impl_._has_bits_[0] &= ~0x00020000u; + _impl_._has_bits_[0] &= ~0x00040000u; } inline bool FileOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.deprecated) @@ -13141,18 +14290,18 @@ inline bool FileOptions::_internal_deprecated() const { } inline void FileOptions::_internal_set_deprecated(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00020000u; + _impl_._has_bits_[0] |= 0x00040000u; _impl_.deprecated_ = value; } // optional bool cc_enable_arenas = 31 [default = true]; inline bool FileOptions::has_cc_enable_arenas() const { - bool value = (_impl_._has_bits_[0] & 0x00080000u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00100000u) != 0; return value; } inline void FileOptions::clear_cc_enable_arenas() { _impl_.cc_enable_arenas_ = true; - _impl_._has_bits_[0] &= ~0x00080000u; + _impl_._has_bits_[0] &= ~0x00100000u; } inline bool FileOptions::cc_enable_arenas() const { // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_enable_arenas) @@ -13168,7 +14317,7 @@ inline bool FileOptions::_internal_cc_enable_arenas() const { } inline void FileOptions::_internal_set_cc_enable_arenas(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00080000u; + _impl_._has_bits_[0] |= 0x00100000u; _impl_.cc_enable_arenas_ = value; } @@ -13655,6 +14804,102 @@ inline void FileOptions::set_allocated_ruby_package(std::string* value) { // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.ruby_package) } +// optional .google.protobuf.FeatureSet features = 50; +inline bool FileOptions::has_features() const { + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; + PROTOBUF_ASSUME(!value || _impl_.features_ != nullptr); + return value; +} +inline void FileOptions::clear_features() { + if (_impl_.features_ != nullptr) _impl_.features_->Clear(); + _impl_._has_bits_[0] &= ~0x00000400u; +} +inline const ::google::protobuf::FeatureSet& FileOptions::_internal_features() const { + PROTOBUF_TSAN_READ_MESSAGE(&_impl_._tsan_detect_race); + const ::google::protobuf::FeatureSet* p = _impl_.features_; + return p != nullptr ? *p : reinterpret_cast(::google::protobuf::_FeatureSet_default_instance_); +} +inline const ::google::protobuf::FeatureSet& FileOptions::features() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.features) + return _internal_features(); +} +inline void FileOptions::unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value) { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.features_); + } + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000400u; + } else { + _impl_._has_bits_[0] &= ~0x00000400u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.features) +} +inline ::google::protobuf::FeatureSet* FileOptions::release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000400u; + ::google::protobuf::FeatureSet* released = _impl_.features_; + _impl_.features_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::google::protobuf::FeatureSet* FileOptions::unsafe_arena_release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.features) + + _impl_._has_bits_[0] &= ~0x00000400u; + ::google::protobuf::FeatureSet* temp = _impl_.features_; + _impl_.features_ = nullptr; + return temp; +} +inline ::google::protobuf::FeatureSet* FileOptions::_internal_mutable_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000400u; + if (_impl_.features_ == nullptr) { + auto* p = CreateMaybeMessage<::google::protobuf::FeatureSet>(GetArenaForAllocation()); + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(p); + } + return _impl_.features_; +} +inline ::google::protobuf::FeatureSet* FileOptions::mutable_features() { + ::google::protobuf::FeatureSet* _msg = _internal_mutable_features(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.features) + return _msg; +} +inline void FileOptions::set_allocated_features(::google::protobuf::FeatureSet* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::FeatureSet*>(_impl_.features_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::FeatureSet*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000400u; + } else { + _impl_._has_bits_[0] &= ~0x00000400u; + } + + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.features) +} + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int FileOptions::_internal_uninterpreted_option_size() const { return _internal_uninterpreted_option().size(); @@ -13707,12 +14952,12 @@ FileOptions::_internal_mutable_uninterpreted_option() { // optional bool message_set_wire_format = 1 [default = false]; inline bool MessageOptions::has_message_set_wire_format() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline void MessageOptions::clear_message_set_wire_format() { _impl_.message_set_wire_format_ = false; - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000002u; } inline bool MessageOptions::message_set_wire_format() const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.message_set_wire_format) @@ -13728,18 +14973,18 @@ inline bool MessageOptions::_internal_message_set_wire_format() const { } inline void MessageOptions::_internal_set_message_set_wire_format(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000002u; _impl_.message_set_wire_format_ = value; } // optional bool no_standard_descriptor_accessor = 2 [default = false]; inline bool MessageOptions::has_no_standard_descriptor_accessor() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline void MessageOptions::clear_no_standard_descriptor_accessor() { _impl_.no_standard_descriptor_accessor_ = false; - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000004u; } inline bool MessageOptions::no_standard_descriptor_accessor() const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.no_standard_descriptor_accessor) @@ -13755,18 +15000,18 @@ inline bool MessageOptions::_internal_no_standard_descriptor_accessor() const { } inline void MessageOptions::_internal_set_no_standard_descriptor_accessor(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000004u; _impl_.no_standard_descriptor_accessor_ = value; } // optional bool deprecated = 3 [default = false]; inline bool MessageOptions::has_deprecated() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } inline void MessageOptions::clear_deprecated() { _impl_.deprecated_ = false; - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000008u; } inline bool MessageOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.deprecated) @@ -13782,18 +15027,18 @@ inline bool MessageOptions::_internal_deprecated() const { } inline void MessageOptions::_internal_set_deprecated(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000008u; _impl_.deprecated_ = value; } // optional bool map_entry = 7; inline bool MessageOptions::has_map_entry() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } inline void MessageOptions::clear_map_entry() { _impl_.map_entry_ = false; - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000010u; } inline bool MessageOptions::map_entry() const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.map_entry) @@ -13809,18 +15054,18 @@ inline bool MessageOptions::_internal_map_entry() const { } inline void MessageOptions::_internal_set_map_entry(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000010u; _impl_.map_entry_ = value; } // optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; inline bool MessageOptions::has_deprecated_legacy_json_field_conflicts() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; return value; } inline void MessageOptions::clear_deprecated_legacy_json_field_conflicts() { _impl_.deprecated_legacy_json_field_conflicts_ = false; - _impl_._has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000020u; } inline bool MessageOptions::deprecated_legacy_json_field_conflicts() const { // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.deprecated_legacy_json_field_conflicts) @@ -13836,10 +15081,106 @@ inline bool MessageOptions::_internal_deprecated_legacy_json_field_conflicts() c } inline void MessageOptions::_internal_set_deprecated_legacy_json_field_conflicts(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000010u; + _impl_._has_bits_[0] |= 0x00000020u; _impl_.deprecated_legacy_json_field_conflicts_ = value; } +// optional .google.protobuf.FeatureSet features = 12; +inline bool MessageOptions::has_features() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.features_ != nullptr); + return value; +} +inline void MessageOptions::clear_features() { + if (_impl_.features_ != nullptr) _impl_.features_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::google::protobuf::FeatureSet& MessageOptions::_internal_features() const { + PROTOBUF_TSAN_READ_MESSAGE(&_impl_._tsan_detect_race); + const ::google::protobuf::FeatureSet* p = _impl_.features_; + return p != nullptr ? *p : reinterpret_cast(::google::protobuf::_FeatureSet_default_instance_); +} +inline const ::google::protobuf::FeatureSet& MessageOptions::features() const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.features) + return _internal_features(); +} +inline void MessageOptions::unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value) { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.features_); + } + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MessageOptions.features) +} +inline ::google::protobuf::FeatureSet* MessageOptions::release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* released = _impl_.features_; + _impl_.features_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::google::protobuf::FeatureSet* MessageOptions::unsafe_arena_release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.MessageOptions.features) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* temp = _impl_.features_; + _impl_.features_ = nullptr; + return temp; +} +inline ::google::protobuf::FeatureSet* MessageOptions::_internal_mutable_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.features_ == nullptr) { + auto* p = CreateMaybeMessage<::google::protobuf::FeatureSet>(GetArenaForAllocation()); + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(p); + } + return _impl_.features_; +} +inline ::google::protobuf::FeatureSet* MessageOptions::mutable_features() { + ::google::protobuf::FeatureSet* _msg = _internal_mutable_features(); + // @@protoc_insertion_point(field_mutable:google.protobuf.MessageOptions.features) + return _msg; +} +inline void MessageOptions::set_allocated_features(::google::protobuf::FeatureSet* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::FeatureSet*>(_impl_.features_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::FeatureSet*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MessageOptions.features) +} + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int MessageOptions::_internal_uninterpreted_option_size() const { return _internal_uninterpreted_option().size(); @@ -13888,16 +15229,158 @@ MessageOptions::_internal_mutable_uninterpreted_option() { // ------------------------------------------------------------------- +// FieldOptions_EditionDefault + +// optional string edition = 1; +inline bool FieldOptions_EditionDefault::has_edition() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void FieldOptions_EditionDefault::clear_edition() { + _impl_.edition_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& FieldOptions_EditionDefault::edition() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.EditionDefault.edition) + return _internal_edition(); +} +template +inline PROTOBUF_ALWAYS_INLINE void FieldOptions_EditionDefault::set_edition(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.edition_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.EditionDefault.edition) +} +inline std::string* FieldOptions_EditionDefault::mutable_edition() { + std::string* _s = _internal_mutable_edition(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.EditionDefault.edition) + return _s; +} +inline const std::string& FieldOptions_EditionDefault::_internal_edition() const { + PROTOBUF_TSAN_READ_STRING(&_impl_._tsan_detect_race); + return _impl_.edition_.Get(); +} +inline void FieldOptions_EditionDefault::_internal_set_edition(const std::string& value) { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.edition_.Set(value, GetArenaForAllocation()); +} +inline std::string* FieldOptions_EditionDefault::_internal_mutable_edition() { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.edition_.Mutable( GetArenaForAllocation()); +} +inline std::string* FieldOptions_EditionDefault::release_edition() { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.FieldOptions.EditionDefault.edition) + if ((_impl_._has_bits_[0] & 0x00000001u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* released = _impl_.edition_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.edition_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; +} +inline void FieldOptions_EditionDefault::set_allocated_edition(std::string* value) { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.edition_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.edition_.IsDefault()) { + _impl_.edition_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldOptions.EditionDefault.edition) +} + +// optional string value = 2; +inline bool FieldOptions_EditionDefault::has_value() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline void FieldOptions_EditionDefault::clear_value() { + _impl_.value_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& FieldOptions_EditionDefault::value() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.EditionDefault.value) + return _internal_value(); +} +template +inline PROTOBUF_ALWAYS_INLINE void FieldOptions_EditionDefault::set_value(Arg_&& arg, + Args_... args) { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.value_.Set(static_cast(arg), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.EditionDefault.value) +} +inline std::string* FieldOptions_EditionDefault::mutable_value() { + std::string* _s = _internal_mutable_value(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.EditionDefault.value) + return _s; +} +inline const std::string& FieldOptions_EditionDefault::_internal_value() const { + PROTOBUF_TSAN_READ_STRING(&_impl_._tsan_detect_race); + return _impl_.value_.Get(); +} +inline void FieldOptions_EditionDefault::_internal_set_value(const std::string& value) { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.value_.Set(value, GetArenaForAllocation()); +} +inline std::string* FieldOptions_EditionDefault::_internal_mutable_value() { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.value_.Mutable( GetArenaForAllocation()); +} +inline std::string* FieldOptions_EditionDefault::release_value() { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.FieldOptions.EditionDefault.value) + if ((_impl_._has_bits_[0] & 0x00000002u) == 0) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* released = _impl_.value_.Release(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return released; +} +inline void FieldOptions_EditionDefault::set_allocated_value(std::string* value) { + PROTOBUF_TSAN_WRITE_STRING(&_impl_._tsan_detect_race); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.value_.SetAllocated(value, GetArenaForAllocation()); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.value_.IsDefault()) { + _impl_.value_.Set("", GetArenaForAllocation()); + } + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldOptions.EditionDefault.value) +} + +// ------------------------------------------------------------------- + // FieldOptions // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; inline bool FieldOptions::has_ctype() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline void FieldOptions::clear_ctype() { _impl_.ctype_ = 0; - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000002u; } inline ::google::protobuf::FieldOptions_CType FieldOptions::ctype() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.ctype) @@ -13914,18 +15397,18 @@ inline ::google::protobuf::FieldOptions_CType FieldOptions::_internal_ctype() co inline void FieldOptions::_internal_set_ctype(::google::protobuf::FieldOptions_CType value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); assert(::google::protobuf::FieldOptions_CType_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000002u; _impl_.ctype_ = value; } // optional bool packed = 2; inline bool FieldOptions::has_packed() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } inline void FieldOptions::clear_packed() { _impl_.packed_ = false; - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000008u; } inline bool FieldOptions::packed() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.packed) @@ -13941,18 +15424,18 @@ inline bool FieldOptions::_internal_packed() const { } inline void FieldOptions::_internal_set_packed(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000008u; _impl_.packed_ = value; } // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; inline bool FieldOptions::has_jstype() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline void FieldOptions::clear_jstype() { _impl_.jstype_ = 0; - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000004u; } inline ::google::protobuf::FieldOptions_JSType FieldOptions::jstype() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.jstype) @@ -13969,18 +15452,18 @@ inline ::google::protobuf::FieldOptions_JSType FieldOptions::_internal_jstype() inline void FieldOptions::_internal_set_jstype(::google::protobuf::FieldOptions_JSType value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); assert(::google::protobuf::FieldOptions_JSType_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000004u; _impl_.jstype_ = value; } // optional bool lazy = 5 [default = false]; inline bool FieldOptions::has_lazy() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; return value; } inline void FieldOptions::clear_lazy() { _impl_.lazy_ = false; - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000010u; } inline bool FieldOptions::lazy() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.lazy) @@ -13996,18 +15479,18 @@ inline bool FieldOptions::_internal_lazy() const { } inline void FieldOptions::_internal_set_lazy(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000010u; _impl_.lazy_ = value; } // optional bool unverified_lazy = 15 [default = false]; inline bool FieldOptions::has_unverified_lazy() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; return value; } inline void FieldOptions::clear_unverified_lazy() { _impl_.unverified_lazy_ = false; - _impl_._has_bits_[0] &= ~0x00000010u; + _impl_._has_bits_[0] &= ~0x00000020u; } inline bool FieldOptions::unverified_lazy() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.unverified_lazy) @@ -14023,18 +15506,18 @@ inline bool FieldOptions::_internal_unverified_lazy() const { } inline void FieldOptions::_internal_set_unverified_lazy(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000010u; + _impl_._has_bits_[0] |= 0x00000020u; _impl_.unverified_lazy_ = value; } // optional bool deprecated = 3 [default = false]; inline bool FieldOptions::has_deprecated() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; return value; } inline void FieldOptions::clear_deprecated() { _impl_.deprecated_ = false; - _impl_._has_bits_[0] &= ~0x00000020u; + _impl_._has_bits_[0] &= ~0x00000040u; } inline bool FieldOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.deprecated) @@ -14050,18 +15533,18 @@ inline bool FieldOptions::_internal_deprecated() const { } inline void FieldOptions::_internal_set_deprecated(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000020u; + _impl_._has_bits_[0] |= 0x00000040u; _impl_.deprecated_ = value; } // optional bool weak = 10 [default = false]; inline bool FieldOptions::has_weak() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; return value; } inline void FieldOptions::clear_weak() { _impl_.weak_ = false; - _impl_._has_bits_[0] &= ~0x00000040u; + _impl_._has_bits_[0] &= ~0x00000080u; } inline bool FieldOptions::weak() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.weak) @@ -14077,18 +15560,18 @@ inline bool FieldOptions::_internal_weak() const { } inline void FieldOptions::_internal_set_weak(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000040u; + _impl_._has_bits_[0] |= 0x00000080u; _impl_.weak_ = value; } // optional bool debug_redact = 16 [default = false]; inline bool FieldOptions::has_debug_redact() const { - bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; return value; } inline void FieldOptions::clear_debug_redact() { _impl_.debug_redact_ = false; - _impl_._has_bits_[0] &= ~0x00000080u; + _impl_._has_bits_[0] &= ~0x00000100u; } inline bool FieldOptions::debug_redact() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.debug_redact) @@ -14104,18 +15587,18 @@ inline bool FieldOptions::_internal_debug_redact() const { } inline void FieldOptions::_internal_set_debug_redact(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000080u; + _impl_._has_bits_[0] |= 0x00000100u; _impl_.debug_redact_ = value; } // optional .google.protobuf.FieldOptions.OptionRetention retention = 17; inline bool FieldOptions::has_retention() const { - bool value = (_impl_._has_bits_[0] & 0x00000100u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; return value; } inline void FieldOptions::clear_retention() { _impl_.retention_ = 0; - _impl_._has_bits_[0] &= ~0x00000100u; + _impl_._has_bits_[0] &= ~0x00000200u; } inline ::google::protobuf::FieldOptions_OptionRetention FieldOptions::retention() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.retention) @@ -14132,7 +15615,7 @@ inline ::google::protobuf::FieldOptions_OptionRetention FieldOptions::_internal_ inline void FieldOptions::_internal_set_retention(::google::protobuf::FieldOptions_OptionRetention value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); assert(::google::protobuf::FieldOptions_OptionRetention_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000100u; + _impl_._has_bits_[0] |= 0x00000200u; _impl_.retention_ = value; } @@ -14179,6 +15662,148 @@ inline ::google::protobuf::RepeatedField* FieldOptions::_internal_mutable_t return &_impl_.targets_; } +// repeated .google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; +inline int FieldOptions::_internal_edition_defaults_size() const { + return _internal_edition_defaults().size(); +} +inline int FieldOptions::edition_defaults_size() const { + return _internal_edition_defaults_size(); +} +inline void FieldOptions::clear_edition_defaults() { + _internal_mutable_edition_defaults()->Clear(); +} +inline ::google::protobuf::FieldOptions_EditionDefault* FieldOptions::mutable_edition_defaults(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.edition_defaults) + return _internal_mutable_edition_defaults()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldOptions_EditionDefault >* +FieldOptions::mutable_edition_defaults() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldOptions.edition_defaults) + PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race); + return _internal_mutable_edition_defaults(); +} +inline const ::google::protobuf::FieldOptions_EditionDefault& FieldOptions::edition_defaults(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.edition_defaults) + return _internal_edition_defaults().Get(index); +} +inline ::google::protobuf::FieldOptions_EditionDefault* FieldOptions::add_edition_defaults() { + PROTOBUF_TSAN_WRITE_REPEATED(&_impl_._tsan_detect_race); + ::google::protobuf::FieldOptions_EditionDefault* _add = _internal_mutable_edition_defaults()->Add(); + // @@protoc_insertion_point(field_add:google.protobuf.FieldOptions.edition_defaults) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldOptions_EditionDefault >& +FieldOptions::edition_defaults() const { + // @@protoc_insertion_point(field_list:google.protobuf.FieldOptions.edition_defaults) + return _internal_edition_defaults(); +} +inline const ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldOptions_EditionDefault>& +FieldOptions::_internal_edition_defaults() const { + PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race); + return _impl_.edition_defaults_; +} +inline ::google::protobuf::RepeatedPtrField<::google::protobuf::FieldOptions_EditionDefault>* +FieldOptions::_internal_mutable_edition_defaults() { + PROTOBUF_TSAN_READ_REPEATED(&_impl_._tsan_detect_race); + return &_impl_.edition_defaults_; +} + +// optional .google.protobuf.FeatureSet features = 21; +inline bool FieldOptions::has_features() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.features_ != nullptr); + return value; +} +inline void FieldOptions::clear_features() { + if (_impl_.features_ != nullptr) _impl_.features_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::google::protobuf::FeatureSet& FieldOptions::_internal_features() const { + PROTOBUF_TSAN_READ_MESSAGE(&_impl_._tsan_detect_race); + const ::google::protobuf::FeatureSet* p = _impl_.features_; + return p != nullptr ? *p : reinterpret_cast(::google::protobuf::_FeatureSet_default_instance_); +} +inline const ::google::protobuf::FeatureSet& FieldOptions::features() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.features) + return _internal_features(); +} +inline void FieldOptions::unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value) { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.features_); + } + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldOptions.features) +} +inline ::google::protobuf::FeatureSet* FieldOptions::release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* released = _impl_.features_; + _impl_.features_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::google::protobuf::FeatureSet* FieldOptions::unsafe_arena_release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.FieldOptions.features) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* temp = _impl_.features_; + _impl_.features_ = nullptr; + return temp; +} +inline ::google::protobuf::FeatureSet* FieldOptions::_internal_mutable_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.features_ == nullptr) { + auto* p = CreateMaybeMessage<::google::protobuf::FeatureSet>(GetArenaForAllocation()); + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(p); + } + return _impl_.features_; +} +inline ::google::protobuf::FeatureSet* FieldOptions::mutable_features() { + ::google::protobuf::FeatureSet* _msg = _internal_mutable_features(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.features) + return _msg; +} +inline void FieldOptions::set_allocated_features(::google::protobuf::FeatureSet* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::FeatureSet*>(_impl_.features_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::FeatureSet*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldOptions.features) +} + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int FieldOptions::_internal_uninterpreted_option_size() const { return _internal_uninterpreted_option().size(); @@ -14227,12 +15852,12 @@ FieldOptions::_internal_mutable_uninterpreted_option() { // optional .google.protobuf.FieldOptions.OptionTargetType target_obsolete_do_not_use = 18 [deprecated = true]; inline bool FieldOptions::has_target_obsolete_do_not_use() const { - bool value = (_impl_._has_bits_[0] & 0x00000200u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000400u) != 0; return value; } inline void FieldOptions::clear_target_obsolete_do_not_use() { _impl_.target_obsolete_do_not_use_ = 0; - _impl_._has_bits_[0] &= ~0x00000200u; + _impl_._has_bits_[0] &= ~0x00000400u; } inline ::google::protobuf::FieldOptions_OptionTargetType FieldOptions::target_obsolete_do_not_use() const { // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.target_obsolete_do_not_use) @@ -14249,7 +15874,7 @@ inline ::google::protobuf::FieldOptions_OptionTargetType FieldOptions::_internal inline void FieldOptions::_internal_set_target_obsolete_do_not_use(::google::protobuf::FieldOptions_OptionTargetType value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); assert(::google::protobuf::FieldOptions_OptionTargetType_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000200u; + _impl_._has_bits_[0] |= 0x00000400u; _impl_.target_obsolete_do_not_use_ = value; } @@ -14257,6 +15882,102 @@ inline void FieldOptions::_internal_set_target_obsolete_do_not_use(::google::pro // OneofOptions +// optional .google.protobuf.FeatureSet features = 1; +inline bool OneofOptions::has_features() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.features_ != nullptr); + return value; +} +inline void OneofOptions::clear_features() { + if (_impl_.features_ != nullptr) _impl_.features_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::google::protobuf::FeatureSet& OneofOptions::_internal_features() const { + PROTOBUF_TSAN_READ_MESSAGE(&_impl_._tsan_detect_race); + const ::google::protobuf::FeatureSet* p = _impl_.features_; + return p != nullptr ? *p : reinterpret_cast(::google::protobuf::_FeatureSet_default_instance_); +} +inline const ::google::protobuf::FeatureSet& OneofOptions::features() const { + // @@protoc_insertion_point(field_get:google.protobuf.OneofOptions.features) + return _internal_features(); +} +inline void OneofOptions::unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value) { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.features_); + } + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.OneofOptions.features) +} +inline ::google::protobuf::FeatureSet* OneofOptions::release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* released = _impl_.features_; + _impl_.features_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::google::protobuf::FeatureSet* OneofOptions::unsafe_arena_release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.OneofOptions.features) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* temp = _impl_.features_; + _impl_.features_ = nullptr; + return temp; +} +inline ::google::protobuf::FeatureSet* OneofOptions::_internal_mutable_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.features_ == nullptr) { + auto* p = CreateMaybeMessage<::google::protobuf::FeatureSet>(GetArenaForAllocation()); + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(p); + } + return _impl_.features_; +} +inline ::google::protobuf::FeatureSet* OneofOptions::mutable_features() { + ::google::protobuf::FeatureSet* _msg = _internal_mutable_features(); + // @@protoc_insertion_point(field_mutable:google.protobuf.OneofOptions.features) + return _msg; +} +inline void OneofOptions::set_allocated_features(::google::protobuf::FeatureSet* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::FeatureSet*>(_impl_.features_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::FeatureSet*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofOptions.features) +} + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int OneofOptions::_internal_uninterpreted_option_size() const { return _internal_uninterpreted_option().size(); @@ -14309,12 +16030,12 @@ OneofOptions::_internal_mutable_uninterpreted_option() { // optional bool allow_alias = 2; inline bool EnumOptions::has_allow_alias() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline void EnumOptions::clear_allow_alias() { _impl_.allow_alias_ = false; - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000002u; } inline bool EnumOptions::allow_alias() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.allow_alias) @@ -14330,18 +16051,18 @@ inline bool EnumOptions::_internal_allow_alias() const { } inline void EnumOptions::_internal_set_allow_alias(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000002u; _impl_.allow_alias_ = value; } // optional bool deprecated = 3 [default = false]; inline bool EnumOptions::has_deprecated() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline void EnumOptions::clear_deprecated() { _impl_.deprecated_ = false; - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000004u; } inline bool EnumOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.deprecated) @@ -14357,18 +16078,18 @@ inline bool EnumOptions::_internal_deprecated() const { } inline void EnumOptions::_internal_set_deprecated(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000004u; _impl_.deprecated_ = value; } // optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; inline bool EnumOptions::has_deprecated_legacy_json_field_conflicts() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; return value; } inline void EnumOptions::clear_deprecated_legacy_json_field_conflicts() { _impl_.deprecated_legacy_json_field_conflicts_ = false; - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000008u; } inline bool EnumOptions::deprecated_legacy_json_field_conflicts() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.deprecated_legacy_json_field_conflicts) @@ -14384,10 +16105,106 @@ inline bool EnumOptions::_internal_deprecated_legacy_json_field_conflicts() cons } inline void EnumOptions::_internal_set_deprecated_legacy_json_field_conflicts(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000008u; _impl_.deprecated_legacy_json_field_conflicts_ = value; } +// optional .google.protobuf.FeatureSet features = 7; +inline bool EnumOptions::has_features() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.features_ != nullptr); + return value; +} +inline void EnumOptions::clear_features() { + if (_impl_.features_ != nullptr) _impl_.features_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::google::protobuf::FeatureSet& EnumOptions::_internal_features() const { + PROTOBUF_TSAN_READ_MESSAGE(&_impl_._tsan_detect_race); + const ::google::protobuf::FeatureSet* p = _impl_.features_; + return p != nullptr ? *p : reinterpret_cast(::google::protobuf::_FeatureSet_default_instance_); +} +inline const ::google::protobuf::FeatureSet& EnumOptions::features() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.features) + return _internal_features(); +} +inline void EnumOptions::unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value) { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.features_); + } + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumOptions.features) +} +inline ::google::protobuf::FeatureSet* EnumOptions::release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* released = _impl_.features_; + _impl_.features_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::google::protobuf::FeatureSet* EnumOptions::unsafe_arena_release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.EnumOptions.features) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* temp = _impl_.features_; + _impl_.features_ = nullptr; + return temp; +} +inline ::google::protobuf::FeatureSet* EnumOptions::_internal_mutable_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.features_ == nullptr) { + auto* p = CreateMaybeMessage<::google::protobuf::FeatureSet>(GetArenaForAllocation()); + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(p); + } + return _impl_.features_; +} +inline ::google::protobuf::FeatureSet* EnumOptions::mutable_features() { + ::google::protobuf::FeatureSet* _msg = _internal_mutable_features(); + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumOptions.features) + return _msg; +} +inline void EnumOptions::set_allocated_features(::google::protobuf::FeatureSet* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::FeatureSet*>(_impl_.features_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::FeatureSet*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumOptions.features) +} + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int EnumOptions::_internal_uninterpreted_option_size() const { return _internal_uninterpreted_option().size(); @@ -14440,12 +16257,12 @@ EnumOptions::_internal_mutable_uninterpreted_option() { // optional bool deprecated = 1 [default = false]; inline bool EnumValueOptions::has_deprecated() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline void EnumValueOptions::clear_deprecated() { _impl_.deprecated_ = false; - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000002u; } inline bool EnumValueOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.deprecated) @@ -14461,18 +16278,114 @@ inline bool EnumValueOptions::_internal_deprecated() const { } inline void EnumValueOptions::_internal_set_deprecated(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000002u; _impl_.deprecated_ = value; } +// optional .google.protobuf.FeatureSet features = 2; +inline bool EnumValueOptions::has_features() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.features_ != nullptr); + return value; +} +inline void EnumValueOptions::clear_features() { + if (_impl_.features_ != nullptr) _impl_.features_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::google::protobuf::FeatureSet& EnumValueOptions::_internal_features() const { + PROTOBUF_TSAN_READ_MESSAGE(&_impl_._tsan_detect_race); + const ::google::protobuf::FeatureSet* p = _impl_.features_; + return p != nullptr ? *p : reinterpret_cast(::google::protobuf::_FeatureSet_default_instance_); +} +inline const ::google::protobuf::FeatureSet& EnumValueOptions::features() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.features) + return _internal_features(); +} +inline void EnumValueOptions::unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value) { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.features_); + } + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueOptions.features) +} +inline ::google::protobuf::FeatureSet* EnumValueOptions::release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* released = _impl_.features_; + _impl_.features_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::google::protobuf::FeatureSet* EnumValueOptions::unsafe_arena_release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.EnumValueOptions.features) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* temp = _impl_.features_; + _impl_.features_ = nullptr; + return temp; +} +inline ::google::protobuf::FeatureSet* EnumValueOptions::_internal_mutable_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.features_ == nullptr) { + auto* p = CreateMaybeMessage<::google::protobuf::FeatureSet>(GetArenaForAllocation()); + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(p); + } + return _impl_.features_; +} +inline ::google::protobuf::FeatureSet* EnumValueOptions::mutable_features() { + ::google::protobuf::FeatureSet* _msg = _internal_mutable_features(); + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueOptions.features) + return _msg; +} +inline void EnumValueOptions::set_allocated_features(::google::protobuf::FeatureSet* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::FeatureSet*>(_impl_.features_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::FeatureSet*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueOptions.features) +} + // optional bool debug_redact = 3 [default = false]; inline bool EnumValueOptions::has_debug_redact() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline void EnumValueOptions::clear_debug_redact() { _impl_.debug_redact_ = false; - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000004u; } inline bool EnumValueOptions::debug_redact() const { // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.debug_redact) @@ -14488,7 +16401,7 @@ inline bool EnumValueOptions::_internal_debug_redact() const { } inline void EnumValueOptions::_internal_set_debug_redact(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000004u; _impl_.debug_redact_ = value; } @@ -14542,14 +16455,110 @@ EnumValueOptions::_internal_mutable_uninterpreted_option() { // ServiceOptions +// optional .google.protobuf.FeatureSet features = 34; +inline bool ServiceOptions::has_features() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.features_ != nullptr); + return value; +} +inline void ServiceOptions::clear_features() { + if (_impl_.features_ != nullptr) _impl_.features_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::google::protobuf::FeatureSet& ServiceOptions::_internal_features() const { + PROTOBUF_TSAN_READ_MESSAGE(&_impl_._tsan_detect_race); + const ::google::protobuf::FeatureSet* p = _impl_.features_; + return p != nullptr ? *p : reinterpret_cast(::google::protobuf::_FeatureSet_default_instance_); +} +inline const ::google::protobuf::FeatureSet& ServiceOptions::features() const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.features) + return _internal_features(); +} +inline void ServiceOptions::unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value) { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.features_); + } + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ServiceOptions.features) +} +inline ::google::protobuf::FeatureSet* ServiceOptions::release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* released = _impl_.features_; + _impl_.features_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::google::protobuf::FeatureSet* ServiceOptions::unsafe_arena_release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.ServiceOptions.features) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* temp = _impl_.features_; + _impl_.features_ = nullptr; + return temp; +} +inline ::google::protobuf::FeatureSet* ServiceOptions::_internal_mutable_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.features_ == nullptr) { + auto* p = CreateMaybeMessage<::google::protobuf::FeatureSet>(GetArenaForAllocation()); + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(p); + } + return _impl_.features_; +} +inline ::google::protobuf::FeatureSet* ServiceOptions::mutable_features() { + ::google::protobuf::FeatureSet* _msg = _internal_mutable_features(); + // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceOptions.features) + return _msg; +} +inline void ServiceOptions::set_allocated_features(::google::protobuf::FeatureSet* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::FeatureSet*>(_impl_.features_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::FeatureSet*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceOptions.features) +} + // optional bool deprecated = 33 [default = false]; inline bool ServiceOptions::has_deprecated() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline void ServiceOptions::clear_deprecated() { _impl_.deprecated_ = false; - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000002u; } inline bool ServiceOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.deprecated) @@ -14565,7 +16574,7 @@ inline bool ServiceOptions::_internal_deprecated() const { } inline void ServiceOptions::_internal_set_deprecated(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000002u; _impl_.deprecated_ = value; } @@ -14621,12 +16630,12 @@ ServiceOptions::_internal_mutable_uninterpreted_option() { // optional bool deprecated = 33 [default = false]; inline bool MethodOptions::has_deprecated() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; return value; } inline void MethodOptions::clear_deprecated() { _impl_.deprecated_ = false; - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000002u; } inline bool MethodOptions::deprecated() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.deprecated) @@ -14642,18 +16651,18 @@ inline bool MethodOptions::_internal_deprecated() const { } inline void MethodOptions::_internal_set_deprecated(bool value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000002u; _impl_.deprecated_ = value; } // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; inline bool MethodOptions::has_idempotency_level() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; return value; } inline void MethodOptions::clear_idempotency_level() { _impl_.idempotency_level_ = 0; - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000004u; } inline ::google::protobuf::MethodOptions_IdempotencyLevel MethodOptions::idempotency_level() const { // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.idempotency_level) @@ -14670,10 +16679,106 @@ inline ::google::protobuf::MethodOptions_IdempotencyLevel MethodOptions::_intern inline void MethodOptions::_internal_set_idempotency_level(::google::protobuf::MethodOptions_IdempotencyLevel value) { PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); assert(::google::protobuf::MethodOptions_IdempotencyLevel_IsValid(value)); - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000004u; _impl_.idempotency_level_ = value; } +// optional .google.protobuf.FeatureSet features = 35; +inline bool MethodOptions::has_features() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.features_ != nullptr); + return value; +} +inline void MethodOptions::clear_features() { + if (_impl_.features_ != nullptr) _impl_.features_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::google::protobuf::FeatureSet& MethodOptions::_internal_features() const { + PROTOBUF_TSAN_READ_MESSAGE(&_impl_._tsan_detect_race); + const ::google::protobuf::FeatureSet* p = _impl_.features_; + return p != nullptr ? *p : reinterpret_cast(::google::protobuf::_FeatureSet_default_instance_); +} +inline const ::google::protobuf::FeatureSet& MethodOptions::features() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.features) + return _internal_features(); +} +inline void MethodOptions::unsafe_arena_set_allocated_features(::google::protobuf::FeatureSet* value) { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.features_); + } + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodOptions.features) +} +inline ::google::protobuf::FeatureSet* MethodOptions::release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* released = _impl_.features_; + _impl_.features_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArenaForAllocation() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::google::protobuf::FeatureSet* MethodOptions::unsafe_arena_release_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:google.protobuf.MethodOptions.features) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::google::protobuf::FeatureSet* temp = _impl_.features_; + _impl_.features_ = nullptr; + return temp; +} +inline ::google::protobuf::FeatureSet* MethodOptions::_internal_mutable_features() { + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.features_ == nullptr) { + auto* p = CreateMaybeMessage<::google::protobuf::FeatureSet>(GetArenaForAllocation()); + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(p); + } + return _impl_.features_; +} +inline ::google::protobuf::FeatureSet* MethodOptions::mutable_features() { + ::google::protobuf::FeatureSet* _msg = _internal_mutable_features(); + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodOptions.features) + return _msg; +} +inline void MethodOptions::set_allocated_features(::google::protobuf::FeatureSet* value) { + ::google::protobuf::Arena* message_arena = GetArenaForAllocation(); + PROTOBUF_TSAN_WRITE_MESSAGE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::FeatureSet*>(_impl_.features_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = + ::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::FeatureSet*>(value)); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.features_ = reinterpret_cast<::google::protobuf::FeatureSet*>(value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodOptions.features) +} + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; inline int MethodOptions::_internal_uninterpreted_option_size() const { return _internal_uninterpreted_option().size(); @@ -15160,6 +17265,178 @@ inline void UninterpretedOption::set_allocated_aggregate_value(std::string* valu // ------------------------------------------------------------------- +// FeatureSet + +// optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { +inline bool FeatureSet::has_field_presence() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void FeatureSet::clear_field_presence() { + _impl_.field_presence_ = 0; + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline ::google::protobuf::FeatureSet_FieldPresence FeatureSet::field_presence() const { + // @@protoc_insertion_point(field_get:google.protobuf.FeatureSet.field_presence) + return _internal_field_presence(); +} +inline void FeatureSet::set_field_presence(::google::protobuf::FeatureSet_FieldPresence value) { + _internal_set_field_presence(value); + // @@protoc_insertion_point(field_set:google.protobuf.FeatureSet.field_presence) +} +inline ::google::protobuf::FeatureSet_FieldPresence FeatureSet::_internal_field_presence() const { + PROTOBUF_TSAN_READ_PRIMITIVE(&_impl_._tsan_detect_race); + return static_cast<::google::protobuf::FeatureSet_FieldPresence>(_impl_.field_presence_); +} +inline void FeatureSet::_internal_set_field_presence(::google::protobuf::FeatureSet_FieldPresence value) { + PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); + assert(::google::protobuf::FeatureSet_FieldPresence_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.field_presence_ = value; +} + +// optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { +inline bool FeatureSet::has_enum_type() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline void FeatureSet::clear_enum_type() { + _impl_.enum_type_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline ::google::protobuf::FeatureSet_EnumType FeatureSet::enum_type() const { + // @@protoc_insertion_point(field_get:google.protobuf.FeatureSet.enum_type) + return _internal_enum_type(); +} +inline void FeatureSet::set_enum_type(::google::protobuf::FeatureSet_EnumType value) { + _internal_set_enum_type(value); + // @@protoc_insertion_point(field_set:google.protobuf.FeatureSet.enum_type) +} +inline ::google::protobuf::FeatureSet_EnumType FeatureSet::_internal_enum_type() const { + PROTOBUF_TSAN_READ_PRIMITIVE(&_impl_._tsan_detect_race); + return static_cast<::google::protobuf::FeatureSet_EnumType>(_impl_.enum_type_); +} +inline void FeatureSet::_internal_set_enum_type(::google::protobuf::FeatureSet_EnumType value) { + PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); + assert(::google::protobuf::FeatureSet_EnumType_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.enum_type_ = value; +} + +// optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { +inline bool FeatureSet::has_repeated_field_encoding() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline void FeatureSet::clear_repeated_field_encoding() { + _impl_.repeated_field_encoding_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline ::google::protobuf::FeatureSet_RepeatedFieldEncoding FeatureSet::repeated_field_encoding() const { + // @@protoc_insertion_point(field_get:google.protobuf.FeatureSet.repeated_field_encoding) + return _internal_repeated_field_encoding(); +} +inline void FeatureSet::set_repeated_field_encoding(::google::protobuf::FeatureSet_RepeatedFieldEncoding value) { + _internal_set_repeated_field_encoding(value); + // @@protoc_insertion_point(field_set:google.protobuf.FeatureSet.repeated_field_encoding) +} +inline ::google::protobuf::FeatureSet_RepeatedFieldEncoding FeatureSet::_internal_repeated_field_encoding() const { + PROTOBUF_TSAN_READ_PRIMITIVE(&_impl_._tsan_detect_race); + return static_cast<::google::protobuf::FeatureSet_RepeatedFieldEncoding>(_impl_.repeated_field_encoding_); +} +inline void FeatureSet::_internal_set_repeated_field_encoding(::google::protobuf::FeatureSet_RepeatedFieldEncoding value) { + PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); + assert(::google::protobuf::FeatureSet_RepeatedFieldEncoding_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.repeated_field_encoding_ = value; +} + +// optional .google.protobuf.FeatureSet.StringFieldValidation string_field_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { +inline bool FeatureSet::has_string_field_validation() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; +} +inline void FeatureSet::clear_string_field_validation() { + _impl_.string_field_validation_ = 0; + _impl_._has_bits_[0] &= ~0x00000008u; +} +inline ::google::protobuf::FeatureSet_StringFieldValidation FeatureSet::string_field_validation() const { + // @@protoc_insertion_point(field_get:google.protobuf.FeatureSet.string_field_validation) + return _internal_string_field_validation(); +} +inline void FeatureSet::set_string_field_validation(::google::protobuf::FeatureSet_StringFieldValidation value) { + _internal_set_string_field_validation(value); + // @@protoc_insertion_point(field_set:google.protobuf.FeatureSet.string_field_validation) +} +inline ::google::protobuf::FeatureSet_StringFieldValidation FeatureSet::_internal_string_field_validation() const { + PROTOBUF_TSAN_READ_PRIMITIVE(&_impl_._tsan_detect_race); + return static_cast<::google::protobuf::FeatureSet_StringFieldValidation>(_impl_.string_field_validation_); +} +inline void FeatureSet::_internal_set_string_field_validation(::google::protobuf::FeatureSet_StringFieldValidation value) { + PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); + assert(::google::protobuf::FeatureSet_StringFieldValidation_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.string_field_validation_ = value; +} + +// optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = { +inline bool FeatureSet::has_message_encoding() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline void FeatureSet::clear_message_encoding() { + _impl_.message_encoding_ = 0; + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline ::google::protobuf::FeatureSet_MessageEncoding FeatureSet::message_encoding() const { + // @@protoc_insertion_point(field_get:google.protobuf.FeatureSet.message_encoding) + return _internal_message_encoding(); +} +inline void FeatureSet::set_message_encoding(::google::protobuf::FeatureSet_MessageEncoding value) { + _internal_set_message_encoding(value); + // @@protoc_insertion_point(field_set:google.protobuf.FeatureSet.message_encoding) +} +inline ::google::protobuf::FeatureSet_MessageEncoding FeatureSet::_internal_message_encoding() const { + PROTOBUF_TSAN_READ_PRIMITIVE(&_impl_._tsan_detect_race); + return static_cast<::google::protobuf::FeatureSet_MessageEncoding>(_impl_.message_encoding_); +} +inline void FeatureSet::_internal_set_message_encoding(::google::protobuf::FeatureSet_MessageEncoding value) { + PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); + assert(::google::protobuf::FeatureSet_MessageEncoding_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.message_encoding_ = value; +} + +// optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = { +inline bool FeatureSet::has_json_format() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + return value; +} +inline void FeatureSet::clear_json_format() { + _impl_.json_format_ = 0; + _impl_._has_bits_[0] &= ~0x00000020u; +} +inline ::google::protobuf::FeatureSet_JsonFormat FeatureSet::json_format() const { + // @@protoc_insertion_point(field_get:google.protobuf.FeatureSet.json_format) + return _internal_json_format(); +} +inline void FeatureSet::set_json_format(::google::protobuf::FeatureSet_JsonFormat value) { + _internal_set_json_format(value); + // @@protoc_insertion_point(field_set:google.protobuf.FeatureSet.json_format) +} +inline ::google::protobuf::FeatureSet_JsonFormat FeatureSet::_internal_json_format() const { + PROTOBUF_TSAN_READ_PRIMITIVE(&_impl_._tsan_detect_race); + return static_cast<::google::protobuf::FeatureSet_JsonFormat>(_impl_.json_format_); +} +inline void FeatureSet::_internal_set_json_format(::google::protobuf::FeatureSet_JsonFormat value) { + PROTOBUF_TSAN_WRITE_PRIMITIVE(&_impl_._tsan_detect_race); + assert(::google::protobuf::FeatureSet_JsonFormat_IsValid(value)); + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.json_format_ = value; +} + +// ------------------------------------------------------------------- + // SourceCodeInfo_Location // repeated int32 path = 1 [packed = true]; @@ -15844,6 +18121,42 @@ inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::MethodOptions return ::google::protobuf::MethodOptions_IdempotencyLevel_descriptor(); } template <> +struct is_proto_enum<::google::protobuf::FeatureSet_FieldPresence> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::FeatureSet_FieldPresence>() { + return ::google::protobuf::FeatureSet_FieldPresence_descriptor(); +} +template <> +struct is_proto_enum<::google::protobuf::FeatureSet_EnumType> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::FeatureSet_EnumType>() { + return ::google::protobuf::FeatureSet_EnumType_descriptor(); +} +template <> +struct is_proto_enum<::google::protobuf::FeatureSet_RepeatedFieldEncoding> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::FeatureSet_RepeatedFieldEncoding>() { + return ::google::protobuf::FeatureSet_RepeatedFieldEncoding_descriptor(); +} +template <> +struct is_proto_enum<::google::protobuf::FeatureSet_StringFieldValidation> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::FeatureSet_StringFieldValidation>() { + return ::google::protobuf::FeatureSet_StringFieldValidation_descriptor(); +} +template <> +struct is_proto_enum<::google::protobuf::FeatureSet_MessageEncoding> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::FeatureSet_MessageEncoding>() { + return ::google::protobuf::FeatureSet_MessageEncoding_descriptor(); +} +template <> +struct is_proto_enum<::google::protobuf::FeatureSet_JsonFormat> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::FeatureSet_JsonFormat>() { + return ::google::protobuf::FeatureSet_JsonFormat_descriptor(); +} +template <> struct is_proto_enum<::google::protobuf::GeneratedCodeInfo_Annotation_Semantic> : std::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::GeneratedCodeInfo_Annotation_Semantic>() { diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index b29eaf46ce..ed2f8ddd0d 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -164,6 +164,9 @@ message ExtensionRangeOptions { // used externally. repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; + // Any features defined in the specific edition. + optional FeatureSet features = 50; + // The verification state of the extension range. enum VerificationState { // All the extensions of the range must be declared. @@ -490,6 +493,9 @@ message FileOptions { // determining the ruby package. optional string ruby_package = 45; + // Any features defined in the specific edition. + optional FeatureSet features = 50; + // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; @@ -573,6 +579,9 @@ message MessageOptions { // teams have had time to migrate. optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + // Any features defined in the specific edition. + optional FeatureSet features = 12; + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -712,6 +721,15 @@ message FieldOptions { repeated OptionTargetType targets = 19; + message EditionDefault { + optional string edition = 1; + optional string value = 2; // Textproto value. + } + repeated EditionDefault edition_defaults = 20; + + // Any features defined in the specific edition. + optional FeatureSet features = 21; + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -723,6 +741,8 @@ message FieldOptions { } message OneofOptions { + // Any features defined in the specific edition. + optional FeatureSet features = 1; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -753,6 +773,9 @@ message EnumOptions { // had time to migrate. optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + // Any features defined in the specific edition. + optional FeatureSet features = 7; + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -767,6 +790,9 @@ message EnumValueOptions { // this is a formalization for deprecating enum values. optional bool deprecated = 1 [default = false]; + // Any features defined in the specific edition. + optional FeatureSet features = 2; + // Indicate that fields annotated with this enum value should not be printed // out when using debug formats, e.g. when the field contains sensitive // credentials. @@ -781,6 +807,9 @@ message EnumValueOptions { message ServiceOptions { + // Any features defined in the specific edition. + optional FeatureSet features = 34; + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC // framework. We apologize for hoarding these numbers to ourselves, but // we were already using them long before we decided to release Protocol @@ -823,6 +852,9 @@ message MethodOptions { optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN]; + // Any features defined in the specific edition. + optional FeatureSet features = 35; + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -858,6 +890,97 @@ message UninterpretedOption { optional string aggregate_value = 8; } +// =================================================================== +// Features + +// TODO(b/274655146) Enums in C++ gencode (and potentially other languages) are +// not well scoped. This means that each of the feature enums below can clash +// with each other. The short names we've chosen maximize call-site +// readability, but leave us very open to this scenario. A future feature will +// be designed and implemented to handle this, hopefully before we ever hit a +// conflict here. +message FeatureSet { + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0; + EXPLICIT = 1; + IMPLICIT = 2; + LEGACY_REQUIRED = 3; + } + optional FieldPresence field_presence = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: "2023", value: "EXPLICIT" } + ]; + + enum EnumType { + ENUM_TYPE_UNKNOWN = 0; + OPEN = 1; + CLOSED = 2; + } + optional EnumType enum_type = 2 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: "2023", value: "OPEN" } + ]; + + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0; + PACKED = 1; + EXPANDED = 2; + } + optional RepeatedFieldEncoding repeated_field_encoding = 3 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: "2023", value: "PACKED" } + ]; + + enum StringFieldValidation { + STRING_FIELD_VALIDATION_UNKNOWN = 0; + MANDATORY = 1; + HINT = 2; + NONE = 3; + } + optional StringFieldValidation string_field_validation = 4 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: "2023", value: "MANDATORY" } + ]; + + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0; + LENGTH_PREFIXED = 1; + DELIMITED = 2; + } + optional MessageEncoding message_encoding = 5 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: "2023", value: "LENGTH_PREFIXED" } + ]; + + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0; + ALLOW = 1; + LEGACY_BEST_EFFORT = 2; + } + optional JsonFormat json_format = 6 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: "2023", value: "ALLOW" } + ]; + + extensions 1000; // for Protobuf C++ + extensions 1001; // for Protobuf Java + + extensions 9995 to 9999; // For internal testing +} + // =================================================================== // Optional source code info diff --git a/src/google/protobuf/descriptor_legacy.h b/src/google/protobuf/descriptor_legacy.h index 75b9cfa9ba..8d04b203fe 100644 --- a/src/google/protobuf/descriptor_legacy.h +++ b/src/google/protobuf/descriptor_legacy.h @@ -79,6 +79,9 @@ class PROTOBUF_EXPORT FileDescriptorLegacy { SYNTAX_UNKNOWN = FileDescriptor::SYNTAX_UNKNOWN, SYNTAX_PROTO2 = FileDescriptor::SYNTAX_PROTO2, SYNTAX_PROTO3 = FileDescriptor::SYNTAX_PROTO3, +#ifdef PROTOBUF_FUTURE_EDITIONS + SYNTAX_EDITIONS = FileDescriptor::SYNTAX_EDITIONS, +#endif // PROTOBUF_FUTURE_EDITIONS }; Syntax syntax() const { return static_cast(desc_->syntax()); } static absl::string_view SyntaxName(Syntax syntax) { diff --git a/src/google/protobuf/descriptor_unittest.cc b/src/google/protobuf/descriptor_unittest.cc index 516ae6566b..27c368c03d 100644 --- a/src/google/protobuf/descriptor_unittest.cc +++ b/src/google/protobuf/descriptor_unittest.cc @@ -56,6 +56,11 @@ #include "google/protobuf/test_textproto.h" #include "google/protobuf/unittest.pb.h" #include "google/protobuf/unittest_custom_options.pb.h" +#ifdef PROTOBUF_FUTURE_EDITIONS +#include "google/protobuf/cpp_features.pb.h" +#include "google/protobuf/unittest_features.pb.h" +#include "google/protobuf/unittest_invalid_features.pb.h" +#endif // PROTOBUF_FUTURE_EDITIONS #include "google/protobuf/stubs/common.h" #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/descriptor_database.h" @@ -492,6 +497,22 @@ TEST_F(FileDescriptorTest, Syntax) { file->CopyTo(&other); EXPECT_EQ("proto3", other.syntax()); } +#ifdef PROTOBUF_FUTURE_EDITIONS + { + proto.set_syntax("editions"); + proto.set_edition("very-cool"); + DescriptorPool pool; + const FileDescriptor* file = pool.BuildFile(proto); + ASSERT_TRUE(file != nullptr); + EXPECT_EQ(FileDescriptorLegacy::Syntax::SYNTAX_EDITIONS, + FileDescriptorLegacy(file).syntax()); + EXPECT_EQ("very-cool", file->edition()); + FileDescriptorProto other; + file->CopyTo(&other); + EXPECT_EQ("editions", other.syntax()); + EXPECT_EQ("very-cool", other.edition()); + } +#endif // PROTOBUF_FUTURE_EDITIONS } TEST_F(FileDescriptorTest, CopyHeadingTo) { @@ -515,6 +536,27 @@ TEST_F(FileDescriptorTest, CopyHeadingTo) { EXPECT_EQ(other.syntax(), "proto3"); EXPECT_EQ(other.options().java_package(), "foo.bar.baz"); EXPECT_TRUE(other.message_type().empty()); +#ifdef PROTOBUF_FUTURE_EDITIONS + EXPECT_EQ(&other.options().features(), &FeatureSet::default_instance()); + { + proto.set_syntax("editions"); + proto.set_edition("very-cool"); + + DescriptorPool pool; + const FileDescriptor* file = pool.BuildFile(proto); + ASSERT_NE(file, nullptr); + + FileDescriptorProto other; + file->CopyHeadingTo(&other); + EXPECT_EQ(other.name(), "foo.proto"); + EXPECT_EQ(other.package(), "foo.bar.baz"); + EXPECT_EQ(other.syntax(), "editions"); + EXPECT_EQ(other.edition(), "very-cool"); + EXPECT_EQ(other.options().java_package(), "foo.bar.baz"); + EXPECT_TRUE(other.message_type().empty()); + EXPECT_EQ(&other.options().features(), &FeatureSet::default_instance()); + } +#endif // PROTOBUF_FUTURE_EDITIONS } void ExtractDebugString( @@ -7136,6 +7178,2532 @@ TEST_F(ValidationErrorTest, UnusedImportWithOtherError) { "foo.proto: Foo.foo: EXTENDEE: \"Baz\" is not defined.\n"); } +#ifdef PROTOBUF_FUTURE_EDITIONS +using FeaturesTest = ValidationErrorTest; + +template +const FeatureSet& GetFeatures(const T* descriptor) { + return internal::InternalFeatureHelper::GetFeatures(*descriptor); +} + +TEST_F(FeaturesTest, InvalidProto2Features) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "proto2" + options { features { field_presence: IMPLICIT } } + )pb", + "foo.proto: foo.proto: EDITIONS: Features are only valid under " + "editions.\n"); +} + +TEST_F(FeaturesTest, InvalidProto3Features) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "proto3" + options { features { field_presence: IMPLICIT } } + )pb", + "foo.proto: foo.proto: EDITIONS: Features are only valid " + "under editions.\n"); +} + +TEST_F(FeaturesTest, Proto2Features) { + FileDescriptorProto file_proto = ParseTextOrDie(R"pb( + name: "foo.proto" + message_type { + name: "Foo" + field { name: "bar" number: 1 label: LABEL_OPTIONAL type: TYPE_INT64 } + field { + name: "group" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_GROUP + type_name: ".Foo" + } + field { name: "str" number: 3 label: LABEL_OPTIONAL type: TYPE_STRING } + field { name: "rep" number: 4 label: LABEL_REPEATED type: TYPE_INT32 } + field { + name: "packed" + number: 5 + label: LABEL_REPEATED + type: TYPE_INT64 + options { packed: true } + } + field { name: "utf8" number: 6 label: LABEL_REPEATED type: TYPE_STRING } + field { name: "req" number: 7 label: LABEL_REQUIRED type: TYPE_INT32 } + } + enum_type { + name: "Foo2" + value { name: "BAR" number: 1 } + } + )pb"); + + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::CppFeatures::GetDescriptor()->file()); + const FileDescriptor* file = ABSL_DIE_IF_NULL(pool_.BuildFile(file_proto)); + const Descriptor* message = file->message_type(0); + const FieldDescriptor* field = message->field(0); + const FieldDescriptor* group = message->field(1); + EXPECT_THAT(file->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(file), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: CLOSED + repeated_field_encoding: EXPANDED + string_field_validation: HINT + message_encoding: LENGTH_PREFIXED + json_format: LEGACY_BEST_EFFORT + [pb.cpp] { legacy_closed_enum: true })pb")); + EXPECT_THAT(GetFeatures(field), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: CLOSED + repeated_field_encoding: EXPANDED + string_field_validation: HINT + message_encoding: LENGTH_PREFIXED + json_format: LEGACY_BEST_EFFORT + [pb.cpp] { legacy_closed_enum: true })pb")); + EXPECT_THAT(GetFeatures(group), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: CLOSED + repeated_field_encoding: EXPANDED + string_field_validation: HINT + message_encoding: DELIMITED + json_format: LEGACY_BEST_EFFORT + [pb.cpp] { legacy_closed_enum: true })pb")); + EXPECT_TRUE(field->has_presence()); + EXPECT_FALSE(field->requires_utf8_validation()); + EXPECT_FALSE(field->is_packed()); + EXPECT_FALSE(field->legacy_enum_field_treated_as_closed()); + EXPECT_FALSE(message->FindFieldByName("str")->requires_utf8_validation()); + EXPECT_FALSE(message->FindFieldByName("rep")->is_packed()); + EXPECT_FALSE(message->FindFieldByName("utf8")->requires_utf8_validation()); + EXPECT_TRUE(message->FindFieldByName("packed")->is_packed()); + EXPECT_TRUE(message->FindFieldByName("req")->is_required()); + EXPECT_TRUE(file->enum_type(0)->is_closed()); + + // Check round-trip consistency. + FileDescriptorProto proto; + file->CopyTo(&proto); + EXPECT_THAT(proto, EqualsProto(file_proto.DebugString())); +} + +TEST_F(FeaturesTest, Proto3Features) { + FileDescriptorProto file_proto = ParseTextOrDie(R"pb( + name: "foo.proto" + syntax: "proto3" + message_type { + name: "Foo" + field { name: "bar" number: 1 label: LABEL_OPTIONAL type: TYPE_INT64 } + field { name: "rep" number: 2 label: LABEL_REPEATED type: TYPE_INT64 } + field { name: "str" number: 3 label: LABEL_OPTIONAL type: TYPE_STRING } + field { + name: "expanded" + number: 4 + label: LABEL_REPEATED + type: TYPE_INT64 + options { packed: false } + } + field { name: "utf8" number: 5 label: LABEL_OPTIONAL type: TYPE_STRING } + } + enum_type { + name: "Foo2" + value { name: "DEFAULT" number: 0 } + value { name: "BAR" number: 1 } + })pb"); + + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = ABSL_DIE_IF_NULL(pool_.BuildFile(file_proto)); + const Descriptor* message = file->message_type(0); + const FieldDescriptor* field = message->field(0); + EXPECT_THAT(file->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(file), EqualsProto(R"pb( + field_presence: IMPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); + EXPECT_THAT(GetFeatures(field), EqualsProto(R"pb( + field_presence: IMPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); + EXPECT_FALSE(field->has_presence()); + EXPECT_FALSE(field->requires_utf8_validation()); + EXPECT_FALSE(field->is_packed()); + EXPECT_FALSE(field->legacy_enum_field_treated_as_closed()); + EXPECT_TRUE(message->FindFieldByName("rep")->is_packed()); + EXPECT_TRUE(message->FindFieldByName("str")->requires_utf8_validation()); + EXPECT_FALSE(message->FindFieldByName("expanded")->is_packed()); + EXPECT_FALSE(file->enum_type(0)->is_closed()); + + // Check round-trip consistency. + FileDescriptorProto proto; + file->CopyTo(&proto); + EXPECT_THAT(proto, EqualsProto(file_proto.DebugString())); +} + +TEST_F(FeaturesTest, Proto2Proto3EnumFeatures) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::CppFeatures::GetDescriptor()->file()); + const FileDescriptor* file_proto3 = BuildFile(R"pb( + name: "foo3.proto" + syntax: "proto3" + enum_type { + name: "Enum3" + value { name: "DEFAULT_ENUM3" number: 0 } + value { name: "BAR_ENUM3" number: 1 } + } + message_type { + name: "Message3" + field { + name: "enum_field" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_ENUM + type_name: ".Enum3" + } + } + )pb"); + const FileDescriptor* file_proto2 = BuildFile(R"pb( + name: "foo2.proto" + dependency: "foo3.proto" + enum_type { + name: "Enum2" + value { name: "DEFAULT_ENUM2" number: 0 } + value { name: "BAR_ENUM2" number: 1 } + } + message_type { + name: "Message2" + field { + name: "enum_field2" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_ENUM + type_name: ".Enum2" + } + field { + name: "enum_field3" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_ENUM + type_name: ".Enum3" + } + } + )pb"); + const Descriptor* message_proto2 = file_proto2->message_type(0); + const Descriptor* message_proto3 = file_proto3->message_type(0); + const FieldDescriptor* field_proto3 = message_proto3->field(0); + const FieldDescriptor* field_proto2_closed = message_proto2->field(0); + const FieldDescriptor* field_proto2_open = message_proto2->field(1); + + EXPECT_FALSE(field_proto3->legacy_enum_field_treated_as_closed()); + EXPECT_TRUE(field_proto2_closed->legacy_enum_field_treated_as_closed()); + EXPECT_TRUE(field_proto2_open->legacy_enum_field_treated_as_closed()); +} + +// Reproduces the reported issue in b/286244726 where custom options in proto3 +// ended up losing implicit presence. This only occurs when options are defined +// and used in the same file. +TEST_F(FeaturesTest, Proto3Extensions) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "proto3" + dependency: "google/protobuf/descriptor.proto" + message_type { + name: "Ext" + field { name: "bar" number: 1 label: LABEL_OPTIONAL type: TYPE_STRING } + field { name: "baz" number: 2 label: LABEL_OPTIONAL type: TYPE_INT64 } + } + extension { + name: "bar_ext" + number: 99999 + label: LABEL_OPTIONAL + type: TYPE_MESSAGE + type_name: ".Ext" + extendee: ".google.protobuf.EnumValueOptions" + } + enum_type { + name: "Foo" + value { + name: "BAR" + number: 0 + options { + uninterpreted_option { + name { name_part: "bar_ext" is_extension: true } + aggregate_value: "bar: \"\" baz: 1" + } + } + } + } + )pb"); + EXPECT_THAT(file->enum_type(0)->value(0)->options(), + EqualsProtoSerialized(&pool_, "google.protobuf.EnumValueOptions", + R"pb([bar_ext] { baz: 1 })pb")); +} + +TEST_F(FeaturesTest, ClearsOptions) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { + java_package: "bar" + features { field_presence: IMPLICIT } + } + )pb"); + EXPECT_THAT(file->options(), EqualsProto("java_package: 'bar'")); + EXPECT_THAT(GetFeatures(file), EqualsProto(R"pb( + field_presence: IMPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, RestoresOptionsRoundTrip) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + java_package: "bar" + features { + [pb.test] { int_file_feature: 1 } + } + } + message_type { + name: "Foo" + options { + deprecated: true + features { + [pb.test] { int_message_feature: 3 } + } + } + field { + name: "bar" + number: 1 + label: LABEL_REPEATED + type: TYPE_INT64 + options { + packed: true + features { + [pb.test] { int_field_feature: 9 } + } + } + } + field { + name: "oneof_field" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_INT64 + oneof_index: 0 + } + oneof_decl { + name: "foo_oneof" + options { + features { + [pb.test] { int_oneof_feature: 7 } + } + } + } + extension_range { + start: 10 + end: 100 + options { + verification: UNVERIFIED + features { + [pb.test] { int_extension_range_feature: 15 } + } + } + } + } + enum_type { + name: "FooEnum" + options { + deprecated: true + features { + [pb.test] { int_enum_feature: 4 } + } + } + value { + name: "BAR" + number: 0 + options { + deprecated: true + features { + [pb.test] { int_enum_entry_feature: 8 } + } + } + } + } + service { + name: "FooService" + options { + deprecated: true + features { + [pb.test] { int_service_feature: 11 } + } + } + method { + name: "BarMethod" + input_type: "Foo" + output_type: "Foo" + options { + deprecated: true + features { + [pb.test] { int_method_feature: 12 } + } + } + } + } + )pb"); + FileDescriptorProto proto; + file->CopyTo(&proto); + EXPECT_THAT(proto.options(), + EqualsProto(R"pb(java_package: 'bar' + features { + [pb.test] { int_file_feature: 1 } + })pb")); + EXPECT_THAT(proto.message_type(0).options(), + EqualsProto(R"pb(deprecated: true + features { + [pb.test] { int_message_feature: 3 } + })pb")); + EXPECT_THAT(proto.message_type(0).field(0).options(), + EqualsProto(R"pb(packed: true + features { + [pb.test] { int_field_feature: 9 } + })pb")); + EXPECT_THAT(proto.message_type(0).oneof_decl(0).options(), + EqualsProto(R"pb(features { + [pb.test] { int_oneof_feature: 7 } + })pb")); + EXPECT_THAT(proto.message_type(0).extension_range(0).options(), + EqualsProto(R"pb(verification: UNVERIFIED + features { + [pb.test] { int_extension_range_feature: 15 } + })pb")); + EXPECT_THAT(proto.enum_type(0).options(), + EqualsProto(R"pb(deprecated: true + features { + [pb.test] { int_enum_feature: 4 } + })pb")); + EXPECT_THAT(proto.enum_type(0).value(0).options(), + EqualsProto(R"pb(deprecated: true + features { + [pb.test] { int_enum_entry_feature: 8 } + })pb")); + EXPECT_THAT(proto.service(0).options(), + EqualsProto(R"pb(deprecated: true + features { + [pb.test] { int_service_feature: 11 } + })pb")); + EXPECT_THAT(proto.service(0).method(0).options(), + EqualsProto(R"pb(deprecated: true + features { + [pb.test] { int_method_feature: 12 } + })pb")); +} + +TEST_F(FeaturesTest, RestoresLabelRoundTrip) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { features { field_presence: LEGACY_REQUIRED } } + } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->field(0); + ASSERT_EQ(field->label(), FieldDescriptor::LABEL_REQUIRED); + ASSERT_TRUE(field->is_required()); + + FileDescriptorProto proto; + file->CopyTo(&proto); + const FieldDescriptorProto& field_proto = proto.message_type(0).field(0); + EXPECT_EQ(field_proto.label(), FieldDescriptorProto::LABEL_OPTIONAL); + EXPECT_THAT( + field_proto.options(), + EqualsProto(R"pb(features { field_presence: LEGACY_REQUIRED })pb")); +} + +TEST_F(FeaturesTest, RestoresGroupRoundTrip) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + nested_type { + name: "FooGroup" + field { name: "bar" number: 1 label: LABEL_OPTIONAL type: TYPE_STRING } + } + field { + name: "baz" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_MESSAGE + type_name: ".Foo.FooGroup" + options { features { message_encoding: DELIMITED } } + } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->field(0); + ASSERT_EQ(field->type(), FieldDescriptor::TYPE_GROUP); + ASSERT_NE(field->message_type(), nullptr); + + FileDescriptorProto proto; + file->CopyTo(&proto); + const FieldDescriptorProto& field_proto = proto.message_type(0).field(0); + EXPECT_EQ(field_proto.type(), FieldDescriptorProto::TYPE_MESSAGE); + EXPECT_THAT(field_proto.options(), + EqualsProto(R"pb(features { message_encoding: DELIMITED })pb")); +} + +TEST_F(FeaturesTest, OnlyMessagesInheritGroupEncoding) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { features { message_encoding: DELIMITED } } + message_type { + name: "Foo" + nested_type { + name: "FooGroup" + field { name: "bar" number: 1 label: LABEL_OPTIONAL type: TYPE_STRING } + } + field { + name: "baz" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_MESSAGE + type_name: ".Foo.FooGroup" + } + field { name: "str" number: 2 label: LABEL_OPTIONAL type: TYPE_STRING } + } + )pb"); + const FieldDescriptor* group_field = file->message_type(0)->field(0); + const FieldDescriptor* string_field = file->message_type(0)->field(1); + EXPECT_EQ(group_field->type(), FieldDescriptor::TYPE_GROUP); + EXPECT_EQ(string_field->type(), FieldDescriptor::TYPE_STRING); + EXPECT_NE(group_field->message_type(), nullptr); + EXPECT_EQ(string_field->message_type(), nullptr); +} + +TEST_F(FeaturesTest, NoOptions) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = + BuildFile(R"pb( + name: "foo.proto" syntax: "editions" edition: "2023" + )pb"); + EXPECT_EQ(&file->options(), &FileOptions::default_instance()); + EXPECT_THAT(GetFeatures(file), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, InvalidEdition) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" syntax: "editions" edition: "2022" + )pb", + "foo.proto: foo.proto: EDITIONS: No valid default found for edition 2022 " + "in " + "feature field google.protobuf.FeatureSet.field_presence\n"); +} + +TEST_F(FeaturesTest, FileFeatures) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { features { field_presence: IMPLICIT } } + )pb"); + EXPECT_THAT(file->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(file), EqualsProto(R"pb( + field_presence: IMPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, FileFeaturesExtension) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2024" + dependency: "google/protobuf/unittest_features.proto" + options { features { field_presence: IMPLICIT } } + )pb"); + EXPECT_THAT(file->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(file).field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(GetFeatures(file).string_field_validation(), FeatureSet::MANDATORY); + EXPECT_EQ(GetFeatures(file).GetExtension(pb::test).int_file_feature(), 4); + EXPECT_EQ(GetFeatures(file) + .GetExtension(pb::TestMessage::test_message) + .int_file_feature(), + 4); + EXPECT_EQ(GetFeatures(file) + .GetExtension(pb::TestMessage::Nested::test_nested) + .int_file_feature(), + 4); +} + +TEST_F(FeaturesTest, FileFeaturesExtensionOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2024" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + field_presence: IMPLICIT + [pb.test] { int_file_feature: 9 } + [pb.TestMessage.test_message] { int_file_feature: 8 } + [pb.TestMessage.Nested.test_nested] { int_file_feature: 7 } + } + } + )pb"); + EXPECT_THAT(file->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(file).field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(GetFeatures(file).string_field_validation(), FeatureSet::MANDATORY); + EXPECT_EQ(GetFeatures(file).GetExtension(pb::test).int_file_feature(), 9); + EXPECT_EQ(GetFeatures(file) + .GetExtension(pb::TestMessage::test_message) + .int_file_feature(), + 8); + EXPECT_EQ(GetFeatures(file) + .GetExtension(pb::TestMessage::Nested::test_nested) + .int_file_feature(), + 7); +} + +TEST_F(FeaturesTest, MessageFeaturesDefault) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { name: "Foo" } + )pb"); + const Descriptor* message = file->message_type(0); + EXPECT_THAT(message->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(message), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, MessageFeaturesInherit) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { features { field_presence: IMPLICIT } } + message_type { name: "Foo" } + )pb"); + const Descriptor* message = file->message_type(0); + EXPECT_THAT(message->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(message).field_presence(), FeatureSet::IMPLICIT); +} + +TEST_F(FeaturesTest, MessageFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_multiple_feature: 2 } + } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 9 } + } + } + } + )pb"); + const Descriptor* message = file->message_type(0); + EXPECT_THAT(message->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(message).GetExtension(pb::test).int_multiple_feature(), + 9); +} + +TEST_F(FeaturesTest, NestedMessageFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_multiple_feature: 2 int_file_feature: 9 } + } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 10 int_message_feature: 3 } + } + } + nested_type { + name: "Bar" + options { + features { + [pb.test] { int_multiple_feature: 5 } + } + } + } + } + )pb"); + const Descriptor* message = file->message_type(0)->nested_type(0); + EXPECT_THAT(message->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(message).GetExtension(pb::test).int_field_feature(), 1); + EXPECT_EQ(GetFeatures(message).GetExtension(pb::test).int_multiple_feature(), + 5); + EXPECT_EQ(GetFeatures(message).GetExtension(pb::test).int_file_feature(), 9); + EXPECT_EQ(GetFeatures(message).GetExtension(pb::test).int_message_feature(), + 3); +} + +TEST_F(FeaturesTest, FieldFeaturesDefault) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { name: "bar" number: 1 label: LABEL_REPEATED type: TYPE_INT64 } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->field(0); + EXPECT_THAT(field->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(field), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, FieldFeaturesInherit) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + field_presence: IMPLICIT + [pb.test] { int_multiple_feature: 1 } + } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 9 } + } + } + field { name: "bar" number: 1 label: LABEL_REPEATED type: TYPE_INT64 } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->field(0); + EXPECT_THAT(field->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(field).field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_multiple_feature(), + 9); +} + +TEST_F(FeaturesTest, FieldFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + string_field_validation: HINT + field_presence: IMPLICIT + [pb.test] { int_multiple_feature: 2 } + } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 3 } + } + } + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { + features { + string_field_validation: NONE + [pb.test] { int_multiple_feature: 9 } + } + } + } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->field(0); + EXPECT_THAT(field->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(field).field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(GetFeatures(field).string_field_validation(), FeatureSet::NONE); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_multiple_feature(), + 9); +} + +TEST_F(FeaturesTest, OneofFieldFeaturesInherit) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + field_presence: IMPLICIT + [pb.test] { int_multiple_feature: 1 } + } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 6 } + } + } + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT64 + oneof_index: 0 + } + oneof_decl { + name: "foo_oneof" + options { + features { + [pb.test] { int_multiple_feature: 9 } + } + } + } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->field(0); + EXPECT_THAT(field->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(field).field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_multiple_feature(), + 9); +} + +TEST_F(FeaturesTest, OneofFieldFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_multiple_feature: 2 int_file_feature: 2 } + } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 3 int_message_feature: 3 } + } + } + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { + features { + string_field_validation: NONE + [pb.test] { int_multiple_feature: 9 } + } + } + oneof_index: 0 + } + oneof_decl { + name: "foo_oneof" + options { + features { + [pb.test] { int_multiple_feature: 6 int_oneof_feature: 6 } + } + } + } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->field(0); + EXPECT_THAT(field->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_multiple_feature(), + 9); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_oneof_feature(), 6); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_message_feature(), 3); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_file_feature(), 2); +} + +TEST_F(FeaturesTest, RootExtensionFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + string_field_validation: HINT + field_presence: IMPLICIT + [pb.test] { int_multiple_feature: 2 } + } + } + extension { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { + features { + string_field_validation: NONE + [pb.test] { int_multiple_feature: 9 } + } + } + extendee: "Foo" + } + message_type { + name: "Foo" + extension_range { start: 1 end: 2 } + } + )pb"); + const FieldDescriptor* field = file->extension(0); + EXPECT_THAT(field->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(field).field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(GetFeatures(field).string_field_validation(), FeatureSet::NONE); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_multiple_feature(), + 9); +} + +TEST_F(FeaturesTest, MessageExtensionFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + string_field_validation: HINT + field_presence: IMPLICIT + [pb.test] { int_multiple_feature: 2 } + } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 3 } + } + } + extension { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { features { string_field_validation: NONE } } + extendee: "Foo2" + } + } + message_type { + name: "Foo2" + extension_range { start: 1 end: 2 } + options { + features { + [pb.test] { int_multiple_feature: 7 } + } + } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->extension(0); + EXPECT_THAT(field->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(field).field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(GetFeatures(field).string_field_validation(), FeatureSet::NONE); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_multiple_feature(), + 3); +} + +TEST_F(FeaturesTest, EnumFeaturesDefault) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + enum_type { + name: "Foo" + value { name: "BAR" number: 0 } + } + )pb"); + const EnumDescriptor* enm = file->enum_type(0); + EXPECT_THAT(enm->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(enm), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, EnumFeaturesInherit) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { features { enum_type: CLOSED } } + enum_type { + name: "Foo" + value { name: "BAR" number: 0 } + } + )pb"); + const EnumDescriptor* enm = file->enum_type(0); + EXPECT_THAT(enm->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(enm).enum_type(), FeatureSet::CLOSED); +} + +TEST_F(FeaturesTest, EnumFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_multiple_feature: 2 } + } + } + enum_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 9 } + } + } + value { name: "BAR" number: 0 } + } + )pb"); + const EnumDescriptor* enm = file->enum_type(0); + EXPECT_THAT(enm->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(enm).GetExtension(pb::test).int_multiple_feature(), 9); +} + +TEST_F(FeaturesTest, NestedEnumFeatures) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_multiple_feature: 2 int_file_feature: 9 } + } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 10 int_message_feature: 3 } + } + } + enum_type { + name: "Bar" + options { + features { + [pb.test] { int_multiple_feature: 5 } + } + } + value { name: "BAR" number: 0 } + } + } + )pb"); + const EnumDescriptor* enm = file->message_type(0)->enum_type(0); + EXPECT_THAT(enm->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(enm).GetExtension(pb::test).int_field_feature(), 1); + EXPECT_EQ(GetFeatures(enm).GetExtension(pb::test).int_multiple_feature(), 5); + EXPECT_EQ(GetFeatures(enm).GetExtension(pb::test).int_file_feature(), 9); + EXPECT_EQ(GetFeatures(enm).GetExtension(pb::test).int_message_feature(), 3); +} + +TEST_F(FeaturesTest, EnumValueFeaturesDefault) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + enum_type { + name: "Foo" + value { name: "BAR" number: 0 } + } + )pb"); + const EnumValueDescriptor* value = file->enum_type(0)->value(0); + EXPECT_THAT(value->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(value), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, EnumValueFeaturesInherit) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { features { enum_type: CLOSED } } + enum_type { + name: "Foo" + options { + features { + [pb.test] { int_enum_feature: 9 } + } + } + value { name: "BAR" number: 0 } + } + )pb"); + const EnumValueDescriptor* value = file->enum_type(0)->value(0); + EXPECT_THAT(value->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(value).enum_type(), FeatureSet::CLOSED); + EXPECT_EQ(GetFeatures(value).GetExtension(pb::test).int_enum_feature(), 9); +} + +TEST_F(FeaturesTest, EnumValueFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_multiple_feature: 7 } + } + } + enum_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 8 } + } + } + value { + name: "BAR" + number: 0 + options { + features { + [pb.test] { int_multiple_feature: 9 int_enum_entry_feature: 87 } + } + } + } + } + )pb"); + const EnumValueDescriptor* value = file->enum_type(0)->value(0); + EXPECT_THAT(value->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(value).GetExtension(pb::test).int_multiple_feature(), + 9); + EXPECT_EQ(GetFeatures(value).GetExtension(pb::test).int_enum_entry_feature(), + 87); +} + +TEST_F(FeaturesTest, OneofFeaturesDefault) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "oneof_field" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT64 + oneof_index: 0 + } + oneof_decl { name: "foo_oneof" } + } + )pb"); + const OneofDescriptor* oneof = file->message_type(0)->oneof_decl(0); + EXPECT_THAT(oneof->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(oneof), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, OneofFeaturesInherit) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { features { enum_type: CLOSED } } + message_type { + name: "Foo" + field { + name: "oneof_field" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT64 + oneof_index: 0 + } + oneof_decl { name: "foo_oneof" } + options { + features { + [pb.test] { int_message_feature: 9 } + } + } + } + )pb"); + const OneofDescriptor* oneof = file->message_type(0)->oneof_decl(0); + EXPECT_THAT(oneof->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(oneof).enum_type(), FeatureSet::CLOSED); + EXPECT_EQ(GetFeatures(oneof).GetExtension(pb::test).int_message_feature(), 9); +} + +TEST_F(FeaturesTest, OneofFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_multiple_feature: 2 int_file_feature: 2 } + } + } + message_type { + name: "Foo" + field { + name: "oneof_field" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT64 + oneof_index: 0 + } + oneof_decl { + name: "foo_oneof" + options { + features { + [pb.test] { int_multiple_feature: 9 } + } + } + } + options { + features { + [pb.test] { int_multiple_feature: 5 int_message_feature: 5 } + } + } + } + )pb"); + const OneofDescriptor* oneof = file->message_type(0)->oneof_decl(0); + EXPECT_THAT(oneof->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(oneof).GetExtension(pb::test).int_multiple_feature(), + 9); + EXPECT_EQ(GetFeatures(oneof).GetExtension(pb::test).int_message_feature(), 5); + EXPECT_EQ(GetFeatures(oneof).GetExtension(pb::test).int_file_feature(), 2); +} + +TEST_F(FeaturesTest, ExtensionRangeFeaturesDefault) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + extension_range { start: 1 end: 100 } + } + )pb"); + const Descriptor::ExtensionRange* range = + file->message_type(0)->extension_range(0); + EXPECT_THAT(range->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(range), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, ExtensionRangeFeaturesInherit) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { features { enum_type: CLOSED } } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_message_feature: 9 } + } + } + extension_range { start: 1 end: 100 } + } + )pb"); + const Descriptor::ExtensionRange* range = + file->message_type(0)->extension_range(0); + EXPECT_THAT(range->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(range).enum_type(), FeatureSet::CLOSED); + EXPECT_EQ(GetFeatures(range).GetExtension(pb::test).int_message_feature(), 9); +} + +TEST_F(FeaturesTest, ExtensionRangeFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_multiple_feature: 2 int_file_feature: 2 } + } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 5 int_message_feature: 5 } + } + } + extension_range { + start: 1 + end: 100 + options { + features { + [pb.test] { int_multiple_feature: 9 } + } + } + } + } + )pb"); + const Descriptor::ExtensionRange* range = + file->message_type(0)->extension_range(0); + EXPECT_THAT(range->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(range).GetExtension(pb::test).int_multiple_feature(), + 9); + EXPECT_EQ(GetFeatures(range).GetExtension(pb::test).int_message_feature(), 5); + EXPECT_EQ(GetFeatures(range).GetExtension(pb::test).int_file_feature(), 2); +} + +TEST_F(FeaturesTest, ServiceFeaturesDefault) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + service { name: "Foo" } + )pb"); + const ServiceDescriptor* service = file->service(0); + EXPECT_THAT(service->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(service), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, ServiceFeaturesInherit) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { features { enum_type: CLOSED } } + service { name: "Foo" } + )pb"); + const ServiceDescriptor* service = file->service(0); + EXPECT_THAT(service->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(service).enum_type(), FeatureSet::CLOSED); +} + +TEST_F(FeaturesTest, ServiceFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_multiple_feature: 2 } + } + } + service { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 9 } + } + } + } + )pb"); + const ServiceDescriptor* service = file->service(0); + EXPECT_THAT(service->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(service).GetExtension(pb::test).int_multiple_feature(), + 9); +} + +TEST_F(FeaturesTest, MethodFeaturesDefault) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { name: "EmptyMsg" } + service { + name: "Foo" + method { name: "Bar" input_type: "EmptyMsg" output_type: "EmptyMsg" } + } + )pb"); + const MethodDescriptor* method = file->service(0)->method(0); + EXPECT_THAT(method->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(method), EqualsProto(R"pb( + field_presence: EXPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, MethodFeaturesInherit) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + message_type { name: "EmptyMsg" } + options { features { enum_type: CLOSED } } + service { + name: "Foo" + options { + features { + [pb.test] { int_service_feature: 9 } + } + } + method { name: "Bar" input_type: "EmptyMsg" output_type: "EmptyMsg" } + } + )pb"); + const MethodDescriptor* method = file->service(0)->method(0); + EXPECT_THAT(method->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(method).enum_type(), FeatureSet::CLOSED); + EXPECT_EQ(GetFeatures(method).GetExtension(pb::test).int_service_feature(), + 9); +} + +TEST_F(FeaturesTest, MethodFeaturesOverride) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + message_type { name: "EmptyMsg" } + options { + features { + enum_type: CLOSED + [pb.test] { int_multiple_feature: 2 } + } + } + service { + name: "Foo" + options { + features { + [pb.test] { int_service_feature: 4 int_multiple_feature: 4 } + } + } + method { + name: "Bar" + input_type: "EmptyMsg" + output_type: "EmptyMsg" + options { + features { + [pb.test] { int_multiple_feature: 9 } + } + } + } + } + )pb"); + const MethodDescriptor* method = file->service(0)->method(0); + EXPECT_THAT(method->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(method).enum_type(), FeatureSet::CLOSED); + EXPECT_EQ(GetFeatures(method).GetExtension(pb::test).int_service_feature(), + 4); + EXPECT_EQ(GetFeatures(method).GetExtension(pb::test).int_multiple_feature(), + 9); +} + +TEST_F(FeaturesTest, FieldFeatureHelpers) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { name: "def" number: 1 label: LABEL_OPTIONAL type: TYPE_STRING } + field { name: "rep" number: 2 label: LABEL_REPEATED type: TYPE_INT32 } + field { + name: "implicit_field" + number: 3 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { features { field_presence: IMPLICIT } } + } + field { + name: "required_field" + number: 4 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { features { field_presence: LEGACY_REQUIRED } } + } + field { + name: "required_message_field" + number: 5 + label: LABEL_OPTIONAL + type: TYPE_MESSAGE + type_name: "Foo" + options { features { field_presence: LEGACY_REQUIRED } } + } + field { + name: "expanded_field" + number: 6 + label: LABEL_REPEATED + type: TYPE_STRING + options { features { repeated_field_encoding: EXPANDED } } + } + field { + name: "utf8_verify_field" + number: 7 + label: LABEL_REPEATED + type: TYPE_STRING + options { features { string_field_validation: HINT } } + } + field { + name: "utf8_none_field" + number: 8 + label: LABEL_REPEATED + type: TYPE_STRING + options { features { string_field_validation: NONE } } + } + } + )pb"); + const Descriptor* message = file->message_type(0); + const FieldDescriptor* default_field = message->field(0); + const FieldDescriptor* default_repeated_field = message->field(1); + const FieldDescriptor* implicit_field = message->field(2); + const FieldDescriptor* required_field = message->field(3); + const FieldDescriptor* required_message_field = message->field(4); + const FieldDescriptor* expanded_field = message->field(5); + const FieldDescriptor* utf8_verify_field = message->field(6); + const FieldDescriptor* utf8_none_field = message->field(7); + + EXPECT_FALSE(default_field->is_packed()); + EXPECT_FALSE(default_field->is_required()); + EXPECT_TRUE(default_field->has_presence()); + EXPECT_TRUE(default_field->requires_utf8_validation()); + + EXPECT_TRUE(default_repeated_field->is_packed()); + EXPECT_FALSE(default_repeated_field->has_presence()); + EXPECT_FALSE(default_repeated_field->requires_utf8_validation()); + + EXPECT_TRUE(required_field->has_presence()); + EXPECT_TRUE(required_field->is_required()); + EXPECT_TRUE(required_message_field->has_presence()); + EXPECT_TRUE(required_message_field->is_required()); + + EXPECT_FALSE(implicit_field->has_presence()); + EXPECT_FALSE(expanded_field->is_packed()); + EXPECT_FALSE(utf8_verify_field->requires_utf8_validation()); + EXPECT_FALSE(utf8_none_field->requires_utf8_validation()); +} + +TEST_F(FeaturesTest, EnumFeatureHelpers) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::CppFeatures::GetDescriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + dependency: "google/protobuf/cpp_features.proto" + edition: "2023" + enum_type { + name: "FooOpen" + value { name: "BAR" number: 0 } + } + enum_type { + name: "FooClosed" + value { name: "BAZ" number: 0 } + options { features { enum_type: CLOSED } } + } + message_type { + name: "FooMessage" + field { + name: "open" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_ENUM + type_name: "FooOpen" + } + field { + name: "closed" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_ENUM + type_name: "FooClosed" + } + field { + name: "legacy_closed" + number: 3 + label: LABEL_OPTIONAL + type: TYPE_ENUM + type_name: "FooOpen" + options { + features { + [pb.cpp] { legacy_closed_enum: true } + } + } + } + } + )pb"); + const EnumDescriptor* open = file->enum_type(0); + const EnumDescriptor* closed = file->enum_type(1); + const FieldDescriptor* field_open = file->message_type(0)->field(0); + const FieldDescriptor* field_closed = file->message_type(0)->field(1); + const FieldDescriptor* field_legacy_closed = file->message_type(0)->field(2); + ASSERT_EQ(field_legacy_closed->enum_type(), field_open->enum_type()); + + EXPECT_FALSE(open->is_closed()); + EXPECT_TRUE(closed->is_closed()); + EXPECT_FALSE(field_open->legacy_enum_field_treated_as_closed()); + EXPECT_TRUE(field_closed->legacy_enum_field_treated_as_closed()); + EXPECT_TRUE(field_legacy_closed->legacy_enum_field_treated_as_closed()); +} + +TEST_F(FeaturesTest, MergeFeatureValidationFailed) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2024" + dependency: "google/protobuf/unittest_features.proto" + options { features { field_presence: FIELD_PRESENCE_UNKNOWN } } + )pb", + "foo.proto: foo.proto: EDITIONS: Feature field " + "google.protobuf.FeatureSet.field_presence must resolve to a known value, found " + "FIELD_PRESENCE_UNKNOWN\n"); +} + +TEST_F(FeaturesTest, FeaturesOutsideEditions) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "proto2" + dependency: "google/protobuf/unittest_features.proto" + options { features { field_presence: IMPLICIT } } + )pb", + "foo.proto: foo.proto: EDITIONS: Features are only valid under " + "editions.\n"); +} + +TEST_F(FeaturesTest, InvalidExtensionNonMessage) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(::pb::TestInvalid::descriptor()->file()); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_invalid_features.proto" + options { + features { + [pb.TestInvalid.scalar_extension]: "hello" + } + } + )pb", + "foo.proto: google/protobuf/unittest_invalid_features.proto: " + "EDITIONS: FeatureSet extension pb.TestInvalid.scalar_extension is not " + "of message type. Feature extensions should always use messages to " + "allow for evolution.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldImplicitDefault) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + default_value: "Hello world" + options { features { field_presence: IMPLICIT } } + } + } + )pb", + "foo.proto: Foo.bar: NAME: Implicit presence fields can't specify " + "defaults.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldImplicitOpen) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_ENUM + type_name: "Enum" + options { features { field_presence: IMPLICIT } } + } + } + enum_type { + name: "Enum" + value { name: "BAR" number: 0 } + options { features { enum_type: CLOSED } } + } + )pb", + "foo.proto: Foo.bar: NAME: Implicit presence enum fields must always " + "be open.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldRequiredExtension) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + extension_range { start: 1 end: 100 } + } + extension { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { features { field_presence: LEGACY_REQUIRED } } + extendee: "Foo" + } + )pb", + "foo.proto: bar: NAME: Extensions can't be required.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldMessageImplicit) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_MESSAGE + type_name: "Foo" + options { features { field_presence: IMPLICIT } } + } + } + )pb", + "foo.proto: Foo.bar: NAME: Only singular scalar fields can specify " + "implicit field presence.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldRepeatedImplicit) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_REPEATED + type: TYPE_STRING + options { features { field_presence: IMPLICIT } } + } + } + )pb", + "foo.proto: Foo.bar: NAME: Only singular scalar fields can specify " + "implicit field presence.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldOneofImplicit) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + oneof_index: 0 + label: LABEL_OPTIONAL + type: TYPE_INT64 + options { features { field_presence: IMPLICIT } } + } + oneof_decl { name: "_foo" } + } + )pb", + "foo.proto: Foo.bar: NAME: Only singular scalar fields can specify " + "implicit field presence.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldRepeatedRequired) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_REPEATED + type: TYPE_STRING + options { features { field_presence: LEGACY_REQUIRED } } + } + } + )pb", + "foo.proto: Foo.bar: NAME: Only singular scalar fields can specify " + "required field presence.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldOneofRequired) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + oneof_index: 0 + label: LABEL_OPTIONAL + type: TYPE_INT64 + options { features { field_presence: LEGACY_REQUIRED } } + } + oneof_decl { name: "_foo" } + } + )pb", + "foo.proto: Foo.bar: NAME: Only singular scalar fields can specify " + "required field presence.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldNonStringWithStringValidation) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT64 + options { features { string_field_validation: MANDATORY } } + } + } + )pb", + "foo.proto: Foo.bar: NAME: Only string fields can specify " + "`string_field_validation`.\n"); +} + +TEST_F(FeaturesTest, InvalidFieldNonRepeatedWithRepeatedEncoding) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT64 + options { features { repeated_field_encoding: PACKED } } + } + } + )pb", + "foo.proto: Foo.bar: NAME: Only repeated fields can specify " + "`repeated_field_encoding`.\n"); +} + +TEST_F(FeaturesTest, InvalidOpenEnumNonZeroFirstValue) { + BuildDescriptorMessagesInTestPool(); + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + enum_type { + name: "Enum" + value { name: "BAR" number: 1 } + options { features { enum_type: OPEN } } + } + )pb", + "foo.proto: Enum: NUMBER: The first enum value must be zero for open " + "enums.\n"); +} + +TEST_F(FeaturesTest, ClosedEnumNonZeroFirstValue) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + enum_type { + name: "Enum" + value { name: "BAR" number: 9 } + options { features { enum_type: CLOSED } } + } + )pb"); + + EXPECT_EQ(file->enum_type(0)->value(0)->number(), 9); +} + +TEST_F(FeaturesTest, CopyToIncludesFeatures) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + java_package: "pkg" + features { field_presence: IMPLICIT } + } + message_type { + name: "Foo" + options { + features { + [pb.test] { int_multiple_feature: 9 } + } + } + field { + name: "bar" + number: 1 + label: LABEL_REPEATED + type: TYPE_INT64 + options { features { repeated_field_encoding: EXPANDED } } + } + } + )pb"); + FileDescriptorProto proto; + file->CopyTo(&proto); + EXPECT_THAT(proto.options(), + EqualsProto(R"pb(java_package: "pkg" + features { field_presence: IMPLICIT })pb")); + EXPECT_THAT(proto.message_type(0).options(), + EqualsProto(R"pb(features { + [pb.test] { int_multiple_feature: 9 } + })pb")); + EXPECT_THAT( + proto.message_type(0).field(0).options(), + EqualsProto(R"pb(features { repeated_field_encoding: EXPANDED })pb")); +} + +TEST_F(FeaturesTest, UninterpretedOptions) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { + uninterpreted_option { + name { name_part: "features" is_extension: false } + name { name_part: "field_presence" is_extension: false } + identifier_value: "IMPLICIT" + } + } + )pb"); + EXPECT_THAT(file->options(), EqualsProto("")); + EXPECT_THAT(GetFeatures(file), EqualsProto(R"pb( + field_presence: IMPLICIT + enum_type: OPEN + repeated_field_encoding: PACKED + string_field_validation: MANDATORY + message_encoding: LENGTH_PREFIXED + json_format: ALLOW)pb")); +} + +TEST_F(FeaturesTest, UninterpretedOptionsMerge) { + BuildDescriptorMessagesInTestPool(); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + options { + uninterpreted_option { + name { name_part: "features" is_extension: false } + name { name_part: "string_field_validation" is_extension: false } + identifier_value: "HINT" + } + } + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { + uninterpreted_option { + name { name_part: "features" is_extension: false } + name { name_part: "string_field_validation" is_extension: false } + identifier_value: "NONE" + } + } + } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->field(0); + EXPECT_THAT(file->options(), EqualsProto("")); + EXPECT_THAT(field->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(file).string_field_validation(), FeatureSet::HINT); + EXPECT_EQ(GetFeatures(field).string_field_validation(), FeatureSet::NONE); +} + +TEST_F(FeaturesTest, UninterpretedOptionsMergeExtension) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + uninterpreted_option { + name { name_part: "features" is_extension: false } + name { name_part: "pb.test" is_extension: true } + name { name_part: "int_multiple_feature" is_extension: false } + positive_int_value: 5 + } + uninterpreted_option { + name { name_part: "features" is_extension: false } + name { name_part: "pb.test" is_extension: true } + name { name_part: "int_file_feature" is_extension: false } + positive_int_value: 5 + } + } + message_type { + name: "Foo" + options { + uninterpreted_option { + name { name_part: "features" is_extension: false } + name { name_part: "pb.test" is_extension: true } + name { name_part: "int_multiple_feature" is_extension: false } + positive_int_value: 7 + } + uninterpreted_option { + name { name_part: "features" is_extension: false } + name { name_part: "pb.test" is_extension: true } + name { name_part: "int_message_feature" is_extension: false } + positive_int_value: 7 + } + } + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + options { + uninterpreted_option { + name { name_part: "features" is_extension: false } + name { name_part: "pb.test" is_extension: true } + name { name_part: "int_multiple_feature" is_extension: false } + positive_int_value: 9 + } + uninterpreted_option { + name { name_part: "features" is_extension: false } + name { name_part: "pb.test" is_extension: true } + name { name_part: "int_field_feature" is_extension: false } + positive_int_value: 9 + } + } + } + } + )pb"); + const FieldDescriptor* field = file->message_type(0)->field(0); + EXPECT_THAT(field->options(), EqualsProto("")); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_file_feature(), 5); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_message_feature(), 7); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_field_feature(), 9); + EXPECT_EQ(GetFeatures(field).GetExtension(pb::test).int_multiple_feature(), + 9); +} + +TEST_F(FeaturesTest, InvalidJsonUniquenessDefaultWarning) { + BuildFileWithWarnings( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + } + field { + name: "bar_" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_STRING + } + options { features { json_format: LEGACY_BEST_EFFORT } } + } + )pb", + "foo.proto: Foo: NAME: The default JSON name of field \"bar_\" (\"bar\") " + "conflicts with the default JSON name of field \"bar\".\n"); +} + +TEST_F(FeaturesTest, InvalidJsonUniquenessDefaultError) { + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + } + field { + name: "bar_" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_STRING + } + options { features { json_format: ALLOW } } + } + )pb", + "foo.proto: Foo: NAME: The default JSON name of field \"bar_\" (\"bar\") " + "conflicts with the default JSON name of field \"bar\".\n"); +} + +TEST_F(FeaturesTest, InvalidJsonUniquenessCustomError) { + BuildFileWithErrors( + R"pb( + name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + json_name: "baz" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + } + field { + name: "bar2" + json_name: "baz" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_STRING + } + options { features { json_format: LEGACY_BEST_EFFORT } } + } + )pb", + "foo.proto: Foo: NAME: The custom JSON name of field \"bar2\" (\"baz\") " + "conflicts with the custom JSON name of field \"bar\".\n"); +} + +// Test that the result of FileDescriptor::DebugString() can be used to create +// the original descriptors. +class FeaturesDebugStringTest + : public FeaturesTest, + public testing::WithParamInterface< + std::tuple> { + protected: + const FileDescriptor* LoadFile(absl::string_view name, + absl::string_view content) { + io::ArrayInputStream input_stream(content.data(), content.size()); + SimpleErrorCollector error_collector; + io::Tokenizer tokenizer(&input_stream, &error_collector); + compiler::Parser parser; + parser.RecordErrorsTo(&error_collector); + FileDescriptorProto proto; + ABSL_CHECK(parser.Parse(&tokenizer, &proto)) + << error_collector.last_error() << "\n" + << content; + ABSL_CHECK_EQ("", error_collector.last_error()); + proto.set_name(name); + return ABSL_DIE_IF_NULL(roundtrip_pool_.BuildFile(proto)); + } + + std::string GetFileProto() { return std::string(std::get<1>(GetParam())); } + + auto EqualsRoundTrip() { return EqualsProto(std::get<1>(GetParam())); } + + private: + DescriptorPool roundtrip_pool_; +}; + +TEST_P(FeaturesDebugStringTest, RoundTrip) { + BuildDescriptorMessagesInTestPool(); + BuildFileInTestPool(pb::TestFeatures::descriptor()->file()); + const FileDescriptor* file = BuildFile(GetFileProto()); + ASSERT_THAT(file, NotNull()); + + LoadFile("google/protobuf/descriptor.proto", + DescriptorProto::GetDescriptor()->file()->DebugString()); + LoadFile("google/protobuf/unittest_features.proto", + pb::TestFeatures::GetDescriptor()->file()->DebugString()); + const FileDescriptor* roundtripped = + LoadFile(file->name(), file->DebugString()); + + FileDescriptorProto roundtripped_proto; + roundtripped->CopyTo(&roundtripped_proto); + EXPECT_THAT(roundtripped_proto, EqualsRoundTrip()) + << "With generated proto file: \n" + << file->DebugString(); +} + +INSTANTIATE_TEST_SUITE_P( + FeaturesDebugStringTestInst, FeaturesDebugStringTest, + testing::Values( + std::make_tuple("Empty", R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + )pb"), + std::make_tuple( + "FileFeature", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + options { + features { + [pb.test] { int_file_feature: 1 } + } + } + )pb"), + std::make_tuple("FieldFeature", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT64 + options { + features { field_presence: IMPLICIT } + } + } + } + )pb"), + std::make_tuple("Required", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT64 + options { + features { field_presence: LEGACY_REQUIRED } + } + } + } + )pb"), + std::make_tuple("Group", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + nested_type { + name: "Bar" + field { + name: "baz" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT32 + } + } + field { + name: "bar" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_MESSAGE + type_name: ".Foo.Bar" + options { + features { message_encoding: DELIMITED } + } + } + } + )pb"), + std::make_tuple("MessageFeature", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + message_type { + name: "Foo" + options { + features { json_format: LEGACY_BEST_EFFORT } + } + } + )pb"), + std::make_tuple( + "OneofFeature", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + message_type { + name: "Foo" + field { + name: "bar" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_INT64 + oneof_index: 0 + } + oneof_decl { + name: "foo_oneof" + options { + features { + [pb.test] { int_oneof_feature: 7 } + } + } + } + })pb"), + std::make_tuple( + "ExtensionRangeFeature", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + message_type { + name: "Foo" + extension_range { + start: 10 + end: 100 + options { + features { + [pb.test] { int_extension_range_feature: 15 } + } + } + } + } + )pb"), + std::make_tuple("EnumFeature", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + enum_type { + name: "Foo" + value { name: "BAR" number: 1 } + options { features { enum_type: CLOSED } } + } + )pb"), + std::make_tuple( + "EnumValueFeature", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + enum_type { + name: "Foo" + value { + name: "BAR" + number: 0 + options { + features { + [pb.test] { int_enum_entry_feature: 1 } + } + } + } + + } + )pb"), + std::make_tuple( + "ServiceFeature", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + service { + name: "FooService" + options { + features { + [pb.test] { int_service_feature: 11 } + } + } + } + )pb"), + std::make_tuple( + "MethodFeature", + R"pb(name: "foo.proto" + syntax: "editions" + edition: "2023" + dependency: "google/protobuf/unittest_features.proto" + message_type { name: "EmptyMessage" } + service { + name: "FooService" + method { + name: "BarMethod" + input_type: ".EmptyMessage" + output_type: ".EmptyMessage" + options { + features { + [pb.test] { int_method_feature: 12 } + } + } + } + })pb")), + [](const ::testing::TestParamInfo& + info) { return std::string(std::get<0>(info.param)); }); + +#endif // PROTOBUF_FUTURE_EDITIONS diff --git a/src/google/protobuf/editions/BUILD b/src/google/protobuf/editions/BUILD new file mode 100644 index 0000000000..9cf1f25307 --- /dev/null +++ b/src/google/protobuf/editions/BUILD @@ -0,0 +1,54 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") + +proto_library( + name = "test_messages_proto2_proto", + srcs = ["golden/test_messages_proto2.proto"], + strip_import_prefix = "/src", + deps = ["//src/google/protobuf:cpp_features_proto"], +) + +proto_library( + name = "test_messages_proto3_proto", + srcs = ["golden/test_messages_proto3.proto"], + strip_import_prefix = "/src", + deps = [ + "//:any_proto", + "//:duration_proto", + "//:field_mask_proto", + "//:struct_proto", + "//:timestamp_proto", + "//:wrappers_proto", + "//src/google/protobuf:cpp_features_proto", + ], +) + +cc_proto_library( + name = "test_messages_proto2_cc_proto", + deps = [":test_messages_proto2_proto"], +) + +cc_proto_library( + name = "test_messages_proto3_cc_proto", + deps = [":test_messages_proto3_proto"], +) + +cc_test( + name = "generated_files_test", + srcs = ["generated_files_test.cc"], + deps = [ + ":test_messages_proto2_cc_proto", + ":test_messages_proto3_cc_proto", + "//src/google/protobuf", + "//src/google/protobuf:test_textproto", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "generated_reflection_test", + srcs = ["generated_reflection_test.cc"], + deps = [ + ":test_messages_proto2_cc_proto", + "@com_google_googletest//:gtest_main", + ], +) diff --git a/src/google/protobuf/editions/codegen_tests/BUILD b/src/google/protobuf/editions/codegen_tests/BUILD new file mode 100644 index 0000000000..5bda10080b --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/BUILD @@ -0,0 +1,129 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") + +exports_files( + glob(["*.proto"]), + visibility = [ + "//src/google/protobuf/editions:__pkg__", + ], +) + +proto_library( + name = "proto2_required_proto", + srcs = ["proto2_required.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto3_optional_proto", + srcs = ["proto3_optional.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto3_implicit_proto", + srcs = ["proto3_implicit.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto2_optional_proto", + srcs = ["proto2_optional.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto2_enum_proto", + srcs = ["proto2_enum.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto3_enum_proto", + srcs = ["proto3_enum.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto2_packed_proto", + srcs = ["proto2_packed.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto3_packed_proto", + srcs = ["proto3_packed.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto2_group_proto", + srcs = ["proto2_group.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto2_unpacked_proto", + srcs = ["proto2_unpacked.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto3_unpacked_proto", + srcs = ["proto3_unpacked.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto2_utf8_verify_proto", + srcs = ["proto2_utf8_verify.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto3_utf8_disabled_proto", + srcs = ["proto3_utf8_disabled.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto2_import_proto", + srcs = ["proto2_import.proto"], + strip_import_prefix = "/src", + deps = [":proto2_optional_proto"], +) + +proto_library( + name = "proto2_utf8_disabled_proto", + srcs = ["proto2_utf8_disabled.proto"], + strip_import_prefix = "/src", +) + +cc_proto_library( + name = "proto2_utf8_disabled_cc_proto", + deps = [":proto2_utf8_disabled_proto"], +) + +proto_library( + name = "proto2_proto3_enum_proto", + srcs = ["proto2_proto3_enum.proto"], + strip_import_prefix = "/src", + deps = [":proto3_enum_proto"], +) + +proto_library( + name = "proto3_utf8_strict_proto", + srcs = ["proto3_utf8_strict.proto"], + strip_import_prefix = "/src", +) + +proto_library( + name = "proto3_import_proto", + srcs = ["proto3_import.proto"], + strip_import_prefix = "/src", + deps = [":proto3_implicit_proto"], +) + +cc_proto_library( + name = "proto3_import_cc_proto", + deps = [":proto3_import_proto"], +) diff --git a/src/google/protobuf/editions/codegen_tests/proto2_enum.proto b/src/google/protobuf/editions/codegen_tests/proto2_enum.proto new file mode 100644 index 0000000000..986a0e06a8 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_enum.proto @@ -0,0 +1,43 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + +enum Proto2Enum { + BAR = 1; + BAZ = 2; +} + +message Proto2EnumMessage { + optional Proto2Enum enum_field = 1; + optional Proto2Enum enum_field_default = 2 [default = BAZ]; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto2_group.proto b/src/google/protobuf/editions/codegen_tests/proto2_group.proto new file mode 100644 index 0000000000..fb59a91017 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_group.proto @@ -0,0 +1,41 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + +// LINT: ALLOW_GROUPS + +message Proto2Group { + optional group GroupField = 2 { + optional int32 int32_field = 1; + } +} diff --git a/src/google/protobuf/editions/codegen_tests/proto2_import.proto b/src/google/protobuf/editions/codegen_tests/proto2_import.proto new file mode 100644 index 0000000000..df8455a3ca --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_import.proto @@ -0,0 +1,39 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + +import "google/protobuf/editions/codegen_tests/proto2_optional.proto"; + +message Proto2ImportMessage { + optional Proto2Optional sub_message_field = 1; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto2_optional.proto b/src/google/protobuf/editions/codegen_tests/proto2_optional.proto new file mode 100644 index 0000000000..36b80682c8 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_optional.proto @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + +message Proto2Optional { + optional int32 int32_field = 1; + + message SubMessage { + optional int32 int32_field = 1; + } + optional SubMessage sub_message = 2; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto2_packed.proto b/src/google/protobuf/editions/codegen_tests/proto2_packed.proto new file mode 100644 index 0000000000..62bc16633a --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_packed.proto @@ -0,0 +1,37 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + +message Proto2Packed { + repeated int32 int32_field = 1 [packed = true]; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto2_proto3_enum.proto b/src/google/protobuf/editions/codegen_tests/proto2_proto3_enum.proto new file mode 100644 index 0000000000..b650f21913 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_proto3_enum.proto @@ -0,0 +1,43 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + +import "google/protobuf/editions/codegen_tests/proto3_enum.proto"; + +message Proto2ImportedEnumMessage { + optional protobuf_editions_test.proto3.Proto3Enum enum_field = 1; + // clang-format off + // TODO(b/284470608) Transforms don't support multi-line fields yet. + optional protobuf_editions_test.proto3.Proto3Enum enum_field_default = 2 [default = BAZ]; + // clang-format on +} diff --git a/src/google/protobuf/editions/codegen_tests/proto2_required.proto b/src/google/protobuf/editions/codegen_tests/proto2_required.proto new file mode 100644 index 0000000000..b76ee3af48 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_required.proto @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + +message Proto2Required { + required int32 int32_field = 1; + + message SubMessage { + required int32 int32_field = 1; + } + required SubMessage sub_message = 2; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto2_unpacked.proto b/src/google/protobuf/editions/codegen_tests/proto2_unpacked.proto new file mode 100644 index 0000000000..f82045ecf5 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_unpacked.proto @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + +message Proto2Unpacked { + repeated int32 int32_field = 1; + repeated string string_field = 2; + message SubMessage { + optional int32 int32_field = 1; + } + repeated SubMessage sub_message_field = 3; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto2_utf8_disabled.proto b/src/google/protobuf/editions/codegen_tests/proto2_utf8_disabled.proto new file mode 100644 index 0000000000..2d2033bacb --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_utf8_disabled.proto @@ -0,0 +1,38 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + + +message Proto2Utf8Strict { + optional string string_field = 1; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto2_utf8_verify.proto b/src/google/protobuf/editions/codegen_tests/proto2_utf8_verify.proto new file mode 100644 index 0000000000..c48f22cb19 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto2_utf8_verify.proto @@ -0,0 +1,37 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.proto2; + +message Proto2Utf8Verify { + optional string string_field = 1; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto3_enum.proto b/src/google/protobuf/editions/codegen_tests/proto3_enum.proto new file mode 100644 index 0000000000..921efa7508 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto3_enum.proto @@ -0,0 +1,43 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 = "proto3"; + +package protobuf_editions_test.proto3; + +enum Proto3Enum { + UNKNOWN = 0; + BAR = 1; + BAZ = 2; +} + +message Proto3EnumMessage { + Proto3Enum enum_field = 1; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto3_implicit.proto b/src/google/protobuf/editions/codegen_tests/proto3_implicit.proto new file mode 100644 index 0000000000..d65fd719ce --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto3_implicit.proto @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 = "proto3"; + +package protobuf_editions_test.proto3; + +message Proto3Implicit { + int32 int32_field = 1; + + message SubMessage { + int32 int32_field = 1; + } + SubMessage sub_message = 2; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto3_import.proto b/src/google/protobuf/editions/codegen_tests/proto3_import.proto new file mode 100644 index 0000000000..05699b1ba7 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto3_import.proto @@ -0,0 +1,39 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 = "proto3"; + +package protobuf_editions_test.proto3; + +import "google/protobuf/editions/codegen_tests/proto3_implicit.proto"; + +message Proto3ImportMessage { + Proto3Implicit sub_message_field = 1; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto3_optional.proto b/src/google/protobuf/editions/codegen_tests/proto3_optional.proto new file mode 100644 index 0000000000..767ad85e85 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto3_optional.proto @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 = "proto3"; + +package protobuf_editions_test.proto3; + +message Proto3Optional { + optional int32 int32_field = 1; + + message SubMessage { + optional int32 int32_field = 1; + } + optional SubMessage optional_message = 2; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto3_packed.proto b/src/google/protobuf/editions/codegen_tests/proto3_packed.proto new file mode 100644 index 0000000000..043355b619 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto3_packed.proto @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 = "proto3"; + +package protobuf_editions_test.proto3; + +message Proto3Packed { + repeated int32 int32_field = 1; + repeated string string_field = 2; + message SubMessage { + int32 int32_field = 1; + } + repeated SubMessage sub_message_field = 3; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto3_unpacked.proto b/src/google/protobuf/editions/codegen_tests/proto3_unpacked.proto new file mode 100644 index 0000000000..2ecf541613 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto3_unpacked.proto @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 = "proto3"; + +package protobuf_editions_test.proto3; + +message Proto3Unpacked { + repeated int32 int32_field = 1 [packed = false]; + repeated string string_field = 2 [packed = false]; + message SubMessage { + int32 int32_field = 1; + } + repeated SubMessage sub_message_field = 3 [packed = false]; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto3_utf8_disabled.proto b/src/google/protobuf/editions/codegen_tests/proto3_utf8_disabled.proto new file mode 100644 index 0000000000..11ad005ce7 --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto3_utf8_disabled.proto @@ -0,0 +1,37 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 = "proto3"; + +package protobuf_editions_test.proto3; + +message Proto3Utf8Disabled { + string string_field = 1; +} diff --git a/src/google/protobuf/editions/codegen_tests/proto3_utf8_strict.proto b/src/google/protobuf/editions/codegen_tests/proto3_utf8_strict.proto new file mode 100644 index 0000000000..018d09810d --- /dev/null +++ b/src/google/protobuf/editions/codegen_tests/proto3_utf8_strict.proto @@ -0,0 +1,37 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 = "proto3"; + +package protobuf_editions_test.proto3; + +message Proto3Utf8Strict { + string string_field = 1; +} diff --git a/src/google/protobuf/editions/generated_files_test.cc b/src/google/protobuf/editions/generated_files_test.cc new file mode 100644 index 0000000000..c772230e27 --- /dev/null +++ b/src/google/protobuf/editions/generated_files_test.cc @@ -0,0 +1,148 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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. + +#include +#include +#include "google/protobuf/descriptor.h" +#include "google/protobuf/editions/golden/test_messages_proto2.pb.h" +#include "google/protobuf/editions/golden/test_messages_proto3.pb.h" +#include "google/protobuf/test_textproto.h" + +// These tests provide some basic minimal coverage that protos work as expected. +// Full coverage will come as we migrate test protos to editions. + +namespace google { +namespace protobuf { +namespace { + +using ::protobuf_test_messages::proto2::TestAllRequiredTypesProto2; +using ::protobuf_test_messages::proto2::TestAllTypesProto2; +using ::protobuf_test_messages::proto3::TestAllTypesProto3; +using ::testing::NotNull; + +TEST(Gemerated, Parsing) { + TestAllTypesProto2 message = ParseTextOrDie(R"pb( + Data { group_int32: 9 } + )pb"); + + EXPECT_EQ(message.data().group_int32(), 9); +} + +TEST(Gemerated, GeneratedMethods) { + TestAllTypesProto3 message; + message.set_optional_int32(9); + + EXPECT_THAT(message, EqualsProto(R"pb(optional_int32: 9)pb")); +} + +TEST(Gemerated, ExplicitPresence) { + const FieldDescriptor* field = + TestAllTypesProto2::descriptor()->FindFieldByName("default_int32"); + ASSERT_THAT(field, NotNull()); + EXPECT_TRUE(field->has_presence()); +} + +TEST(Gemerated, RequiredPresence) { + const FieldDescriptor* field = + TestAllRequiredTypesProto2::descriptor()->FindFieldByName( + "required_int32"); + ASSERT_THAT(field, NotNull()); + EXPECT_TRUE(field->has_presence()); + EXPECT_TRUE(field->is_required()); + EXPECT_EQ(field->label(), FieldDescriptor::LABEL_REQUIRED); +} + +TEST(Gemerated, ImplicitPresence) { + const FieldDescriptor* field = + TestAllTypesProto3::descriptor()->FindFieldByName("optional_int32"); + ASSERT_THAT(field, NotNull()); + EXPECT_FALSE(field->has_presence()); +} + +TEST(Gemerated, ClosedEnum) { + const EnumDescriptor* enm = + TestAllTypesProto2::descriptor()->FindEnumTypeByName("NestedEnum"); + ASSERT_THAT(enm, NotNull()); + EXPECT_TRUE(enm->is_closed()); +} + +TEST(Gemerated, OpenEnum) { + const EnumDescriptor* enm = + TestAllTypesProto3::descriptor()->FindEnumTypeByName("NestedEnum"); + ASSERT_THAT(enm, NotNull()); + EXPECT_FALSE(enm->is_closed()); +} + +TEST(Gemerated, PackedRepeated) { + const FieldDescriptor* field = + TestAllTypesProto2::descriptor()->FindFieldByName("packed_int32"); + ASSERT_THAT(field, NotNull()); + EXPECT_TRUE(field->is_packed()); +} + +TEST(Gemerated, ExpandedRepeated) { + const FieldDescriptor* field = + TestAllTypesProto2::descriptor()->FindFieldByName("repeated_int32"); + ASSERT_THAT(field, NotNull()); + EXPECT_FALSE(field->is_packed()); +} + +TEST(Gemerated, DoesNotEnforceUtf8) { + const FieldDescriptor* field = + TestAllTypesProto2::descriptor()->FindFieldByName("optional_string"); + ASSERT_THAT(field, NotNull()); + EXPECT_FALSE(field->requires_utf8_validation()); +} + +TEST(Gemerated, EnforceUtf8) { + const FieldDescriptor* field = + TestAllTypesProto3::descriptor()->FindFieldByName("optional_string"); + ASSERT_THAT(field, NotNull()); + EXPECT_TRUE(field->requires_utf8_validation()); +} + +TEST(Gemerated, DelimitedEncoding) { + const FieldDescriptor* field = + TestAllTypesProto2::descriptor()->FindFieldByName("data"); + ASSERT_THAT(field, NotNull()); + EXPECT_EQ(field->type(), FieldDescriptor::TYPE_GROUP); +} + +TEST(Gemerated, LengthPrefixedEncoding) { + const FieldDescriptor* field = + TestAllTypesProto2::descriptor()->FindFieldByName( + "optional_nested_message"); + ASSERT_THAT(field, NotNull()); + EXPECT_EQ(field->type(), FieldDescriptor::TYPE_MESSAGE); +} + +} // namespace +} // namespace protobuf +} // namespace google diff --git a/src/google/protobuf/editions/generated_reflection_test.cc b/src/google/protobuf/editions/generated_reflection_test.cc new file mode 100644 index 0000000000..89815c0f89 --- /dev/null +++ b/src/google/protobuf/editions/generated_reflection_test.cc @@ -0,0 +1,53 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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. + +#include +#include "google/protobuf/editions/golden/test_messages_proto2.pb.h" + +namespace google { +namespace protobuf { +namespace { + +using ::protobuf_test_messages::proto2::TestAllTypesProto2; + +// It's important that no calls that would initialize the generated pool occur +// in any tests in this file. This test guarantees that there's no mutex +// deadlock from lazily loading cpp_features.proto during reflection. +TEST(Generated, Reflection) { + TestAllTypesProto2 message; + + message.GetReflection()->SetInt32( + &message, message.GetDescriptor()->FindFieldByName("optional_int32"), 1); + EXPECT_EQ(message.optional_int32(), 1); +} + +} // namespace +} // namespace protobuf +} // namespace google diff --git a/src/google/protobuf/editions/golden/compare_codegen_failure.txt b/src/google/protobuf/editions/golden/compare_codegen_failure.txt new file mode 100644 index 0000000000..fa33da63cd --- /dev/null +++ b/src/google/protobuf/editions/golden/compare_codegen_failure.txt @@ -0,0 +1,58 @@ +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc +@@ @@ + &_SimpleProto3_default_instance_._instance, + ::_pbi::TcParser::GenericFallbackLite, // fallback + }, {{ +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1 [features = { + {::_pbi::TcParser::FastV32S1, + {8, 0, 0, PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_)}}, + }}, {{ + 65535, 65535 + }}, {{ +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1 [features = { + {PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + }}, +@@ @@ + (void)cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1 [features = { + if (cached_has_bits & 0x00000001u) { + target = ::proto2::internal::WireFormatLite:: + WriteInt32ToArrayWithField<1>( +@@ @@ + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1 [features = { + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( +[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h +@@ @@ + enum : int { + kInt32FieldFieldNumber = 1, + }; +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1 [features = { + bool has_int32_field() const; + void clear_int32_field() ; + ::int32_t int32_field() const; +@@ @@ + + // SimpleProto3 + +-// optional int32 int32_field = 1; ++// int32 int32_field = 1 [features = { + inline bool SimpleProto3::has_int32_field() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.h +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h diff --git a/src/google/protobuf/editions/golden/compare_codegen_failure.xml b/src/google/protobuf/editions/golden/compare_codegen_failure.xml new file mode 100644 index 0000000000..c9668360bb --- /dev/null +++ b/src/google/protobuf/editions/golden/compare_codegen_failure.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/google/protobuf/editions/golden/compare_codegen_multiple.txt b/src/google/protobuf/editions/golden/compare_codegen_multiple.txt new file mode 100644 index 0000000000..b21fd68b70 --- /dev/null +++ b/src/google/protobuf/editions/golden/compare_codegen_multiple.txt @@ -0,0 +1,12 @@ +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.cc +[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.cc +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.h +[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.h +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h +[ OK ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h diff --git a/src/google/protobuf/editions/golden/compare_codegen_multiple.xml b/src/google/protobuf/editions/golden/compare_codegen_multiple.xml new file mode 100644 index 0000000000..c93b7f1e87 --- /dev/null +++ b/src/google/protobuf/editions/golden/compare_codegen_multiple.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/google/protobuf/editions/golden/compare_codegen_success.txt b/src/google/protobuf/editions/golden/compare_codegen_success.txt new file mode 100644 index 0000000000..0c5c6d459f --- /dev/null +++ b/src/google/protobuf/editions/golden/compare_codegen_success.txt @@ -0,0 +1,6 @@ +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h diff --git a/src/google/protobuf/editions/golden/compare_codegen_success.xml b/src/google/protobuf/editions/golden/compare_codegen_success.xml new file mode 100644 index 0000000000..65fc89aa2c --- /dev/null +++ b/src/google/protobuf/editions/golden/compare_codegen_success.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/google/protobuf/editions/golden/editions_transform_proto2.proto b/src/google/protobuf/editions/golden/editions_transform_proto2.proto new file mode 100644 index 0000000000..0857e8bc3c --- /dev/null +++ b/src/google/protobuf/editions/golden/editions_transform_proto2.proto @@ -0,0 +1,95 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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. + +edition = "2023"; +import "google/protobuf/cpp_features.proto"; +option features.enum_type = CLOSED; +option features.repeated_field_encoding = EXPANDED; +option features.string_field_validation = NONE; +option features.json_format = LEGACY_BEST_EFFORT; +option features.(pb.cpp).legacy_closed_enum = true; + +// This file contains various edge cases we've collected from migrating real +// protos in order to lock down the transformations. + +// LINT: ALLOW_GROUPS + +package protobuf_editions_test; + +option java_multiple_files = true; +option cc_enable_arenas = true; + +message EmptyMessage {} +message EmptyMessage2 {} + +service EmptyService {} + +service BasicService { + rpc BasicMethod(EmptyMessage) returns (EmptyMessage) {} +} + +// clang-format off +message UnformattedMessage{ + int32 a=1 ; + message Foo { int32 a = 1; } + Foo foo = 2 [features.message_encoding = DELIMITED]; + string string_piece_with_zero = 3 [ctype=STRING_PIECE, default="ab\000c"]; + float long_float_name_wrapped = 4; + +} +// clang-format on + +message ParentMessage { + message ExtendedMessage { + extensions 536860000 to 536869999 [declaration = { + number: 536860000 + full_name: ".protobuf_editions_test.extension" + type: ".protobuf_editions_test.EmptyMessage" + }]; + } +} + +extend ParentMessage.ExtendedMessage { + EmptyMessage extension = 536860000; +} + +message TestMessage { + message OptionalGroup { + int32 a = 17; + } + OptionalGroup optionalgroup = 16 [features.message_encoding = DELIMITED]; +} + +enum TestEnum { + FOO = 1; // Non-zero default + BAR = 2; + BAZ = 3; + NEG = -1; // Intentionally negative. +} diff --git a/src/google/protobuf/editions/golden/simple_proto2.proto b/src/google/protobuf/editions/golden/simple_proto2.proto new file mode 100644 index 0000000000..0e9731df1b --- /dev/null +++ b/src/google/protobuf/editions/golden/simple_proto2.proto @@ -0,0 +1,37 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.golden; + +message SimpleProto2 { + optional int32 int32_field = 1; +} diff --git a/src/google/protobuf/editions/golden/simple_proto2_import.proto b/src/google/protobuf/editions/golden/simple_proto2_import.proto new file mode 100644 index 0000000000..31f0d46b3f --- /dev/null +++ b/src/google/protobuf/editions/golden/simple_proto2_import.proto @@ -0,0 +1,39 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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_editions_test.golden; + +import "google/protobuf/editions/golden/simple_proto2.proto"; + +message AnotherMessage { + optional SimpleProto2 field = 1; +} diff --git a/src/google/protobuf/editions/golden/simple_proto3.proto b/src/google/protobuf/editions/golden/simple_proto3.proto new file mode 100644 index 0000000000..e04f40382a --- /dev/null +++ b/src/google/protobuf/editions/golden/simple_proto3.proto @@ -0,0 +1,37 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 = "proto3"; + +package protobuf_editions_test.golden; + +message SimpleProto3 { + optional int32 int32_field = 1; +} diff --git a/src/google/protobuf/editions/golden/test_messages_proto2.proto b/src/google/protobuf/editions/golden/test_messages_proto2.proto new file mode 100644 index 0000000000..e20b0987eb --- /dev/null +++ b/src/google/protobuf/editions/golden/test_messages_proto2.proto @@ -0,0 +1,406 @@ +// 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. +// +// Test schema for proto2 messages. This test schema is used by: +// +// - conformance tests +// + +// LINT: ALLOW_GROUPS + +edition = "2023"; +import "google/protobuf/cpp_features.proto"; +option features.enum_type = CLOSED; +option features.repeated_field_encoding = EXPANDED; +option features.string_field_validation = NONE; +option features.json_format = LEGACY_BEST_EFFORT; +option features.(pb.cpp).legacy_closed_enum = true; + +package protobuf_test_messages.proto2; + +option java_package = "com.google.protobuf_test_messages.proto2"; +option objc_class_prefix = "Proto2"; + +// This is the default, but we specify it here explicitly. +option optimize_for = SPEED; + +option cc_enable_arenas = true; + +// This proto includes every type of field in both singular and repeated +// forms. +// +// Also, crucially, all messages and enums in this file are eventually +// submessages of this message. So for example, a fuzz test of TestAllTypes +// could trigger bugs that occur in any message type in this file. We verify +// this stays true in a unit test. +message TestAllTypesProto2 { + message NestedMessage { + int32 a = 1; + TestAllTypesProto2 corecursive = 2; + } + + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + NEG = -1; // Intentionally negative. + } + + // Singular + int32 optional_int32 = 1; + int64 optional_int64 = 2; + uint32 optional_uint32 = 3; + uint64 optional_uint64 = 4; + sint32 optional_sint32 = 5; + sint64 optional_sint64 = 6; + fixed32 optional_fixed32 = 7; + fixed64 optional_fixed64 = 8; + sfixed32 optional_sfixed32 = 9; + sfixed64 optional_sfixed64 = 10; + float optional_float = 11; + double optional_double = 12; + bool optional_bool = 13; + string optional_string = 14; + bytes optional_bytes = 15; + + NestedMessage optional_nested_message = 18; + ForeignMessageProto2 optional_foreign_message = 19; + + NestedEnum optional_nested_enum = 21; + ForeignEnumProto2 optional_foreign_enum = 22; + + string optional_string_piece = 24 [ctype = STRING_PIECE]; + string optional_cord = 25 [ctype = CORD]; + + TestAllTypesProto2 recursive_message = 27; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessageProto2 repeated_foreign_message = 49; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnumProto2 repeated_foreign_enum = 52; + + repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; + repeated string repeated_cord = 55 [ctype = CORD]; + + // Packed + repeated int32 packed_int32 = 75 [features.repeated_field_encoding = PACKED]; + repeated int64 packed_int64 = 76 [features.repeated_field_encoding = PACKED]; + repeated uint32 packed_uint32 = 77 [features.repeated_field_encoding = PACKED]; + repeated uint64 packed_uint64 = 78 [features.repeated_field_encoding = PACKED]; + repeated sint32 packed_sint32 = 79 [features.repeated_field_encoding = PACKED]; + repeated sint64 packed_sint64 = 80 [features.repeated_field_encoding = PACKED]; + repeated fixed32 packed_fixed32 = 81 [features.repeated_field_encoding = PACKED]; + repeated fixed64 packed_fixed64 = 82 [features.repeated_field_encoding = PACKED]; + repeated sfixed32 packed_sfixed32 = 83 [features.repeated_field_encoding = PACKED]; + repeated sfixed64 packed_sfixed64 = 84 [features.repeated_field_encoding = PACKED]; + repeated float packed_float = 85 [features.repeated_field_encoding = PACKED]; + repeated double packed_double = 86 [features.repeated_field_encoding = PACKED]; + repeated bool packed_bool = 87 [features.repeated_field_encoding = PACKED]; + repeated NestedEnum packed_nested_enum = 88 [features.repeated_field_encoding = PACKED]; + + // Unpacked + repeated int32 unpacked_int32 = 89; + repeated int64 unpacked_int64 = 90; + repeated uint32 unpacked_uint32 = 91; + repeated uint64 unpacked_uint64 = 92; + repeated sint32 unpacked_sint32 = 93; + repeated sint64 unpacked_sint64 = 94; + repeated fixed32 unpacked_fixed32 = 95; + repeated fixed64 unpacked_fixed64 = 96; + repeated sfixed32 unpacked_sfixed32 = 97; + repeated sfixed64 unpacked_sfixed64 = 98; + repeated float unpacked_float = 99; + repeated double unpacked_double = 100; + repeated bool unpacked_bool = 101; + repeated NestedEnum unpacked_nested_enum = 102; + + // Map + map map_int32_int32 = 56; + map map_int64_int64 = 57; + map map_uint32_uint32 = 58; + map map_uint64_uint64 = 59; + map map_sint32_sint32 = 60; + map map_sint64_sint64 = 61; + map map_fixed32_fixed32 = 62; + map map_fixed64_fixed64 = 63; + map map_sfixed32_sfixed32 = 64; + map map_sfixed64_sfixed64 = 65; + map map_int32_float = 66; + map map_int32_double = 67; + map map_bool_bool = 68; + map map_string_string = 69; + map map_string_bytes = 70; + map map_string_nested_message = 71; + map map_string_foreign_message = 72; + map map_string_nested_enum = 73; + map map_string_foreign_enum = 74; + + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + bool oneof_bool = 115; + uint64 oneof_uint64 = 116; + float oneof_float = 117; + double oneof_double = 118; + NestedEnum oneof_enum = 119; + } + + // extensions + extensions 120 to 200; + + // groups + message Data { + int32 group_int32 = 202; + uint32 group_uint32 = 203; + } + Data data = 201 [features.message_encoding = DELIMITED]; + + // default values + int32 default_int32 = 241 [default = -123456789]; + int64 default_int64 = 242 [default = -9123456789123456789]; + uint32 default_uint32 = 243 [default = 2123456789]; + uint64 default_uint64 = 244 [default = 10123456789123456789]; + sint32 default_sint32 = 245 [default = -123456789]; + sint64 default_sint64 = 246 [default = -9123456789123456789]; + fixed32 default_fixed32 = 247 [default = 2123456789]; + fixed64 default_fixed64 = 248 [default = 10123456789123456789]; + sfixed32 default_sfixed32 = 249 [default = -123456789]; + sfixed64 default_sfixed64 = 250 [default = -9123456789123456789]; + float default_float = 251 [default = 9e9]; + double default_double = 252 [default = 7e22]; + bool default_bool = 253 [default = true]; + string default_string = 254 [default = "Rosebud"]; + bytes default_bytes = 255 [default = "joshua"]; + + // Test field-name-to-JSON-name convention. + // (protobuf says names can be any valid C/C++ identifier.) + int32 fieldname1 = 401; + int32 field_name2 = 402; + int32 _field_name3 = 403; + int32 field__name4_ = 404; + int32 field0name5 = 405; + int32 field_0_name6 = 406; + int32 fieldName7 = 407; + int32 FieldName8 = 408; + int32 field_Name9 = 409; + int32 Field_Name10 = 410; + int32 FIELD_NAME11 = 411; + int32 FIELD_name12 = 412; + int32 __field_name13 = 413; + int32 __Field_name14 = 414; + int32 field__name15 = 415; + int32 field__Name16 = 416; + int32 field_name17__ = 417; + int32 Field_name18__ = 418; + + // Reserved for unknown fields test. + reserved 1000 to 9999; + + // message_set test case. + message MessageSetCorrect { + option message_set_wire_format = true; + + extensions 4 to max; + } + + message MessageSetCorrectExtension1 { + extend MessageSetCorrect { + MessageSetCorrectExtension1 message_set_extension = 1547769; + } + string str = 25; + } + + message MessageSetCorrectExtension2 { + extend MessageSetCorrect { + MessageSetCorrectExtension2 message_set_extension = 4135312; + } + int32 i = 9; + } +} + +message ForeignMessageProto2 { + int32 c = 1; +} + +enum ForeignEnumProto2 { + FOREIGN_FOO = 0; + FOREIGN_BAR = 1; + FOREIGN_BAZ = 2; +} + +extend TestAllTypesProto2 { + int32 extension_int32 = 120; +} + +message UnknownToTestAllTypes { + int32 optional_int32 = 1001; + string optional_string = 1002; + ForeignMessageProto2 nested_message = 1003; + message OptionalGroup { + int32 a = 1; + } + OptionalGroup optionalgroup = 1004 [features.message_encoding = DELIMITED]; + bool optional_bool = 1006; + repeated int32 repeated_int32 = 1011; +} + +message NullHypothesisProto2 {} + +message EnumOnlyProto2 { + enum Bool { + kFalse = 0; + kTrue = 1; + } +} + +message OneStringProto2 { + string data = 1; +} + +message ProtoWithKeywords { + int32 inline = 1; + string concept = 2; + repeated string requires = 3; +} + +message TestAllRequiredTypesProto2 { + message NestedMessage { + int32 a = 1 [features.field_presence = LEGACY_REQUIRED]; + TestAllRequiredTypesProto2 corecursive = 2 [features.field_presence = LEGACY_REQUIRED]; + TestAllRequiredTypesProto2 optional_corecursive = 3; + } + + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + NEG = -1; // Intentionally negative. + } + + // Singular + int32 required_int32 = 1 [features.field_presence = LEGACY_REQUIRED]; + int64 required_int64 = 2 [features.field_presence = LEGACY_REQUIRED]; + uint32 required_uint32 = 3 [features.field_presence = LEGACY_REQUIRED]; + uint64 required_uint64 = 4 [features.field_presence = LEGACY_REQUIRED]; + sint32 required_sint32 = 5 [features.field_presence = LEGACY_REQUIRED]; + sint64 required_sint64 = 6 [features.field_presence = LEGACY_REQUIRED]; + fixed32 required_fixed32 = 7 [features.field_presence = LEGACY_REQUIRED]; + fixed64 required_fixed64 = 8 [features.field_presence = LEGACY_REQUIRED]; + sfixed32 required_sfixed32 = 9 [features.field_presence = LEGACY_REQUIRED]; + sfixed64 required_sfixed64 = 10 [features.field_presence = LEGACY_REQUIRED]; + float required_float = 11 [features.field_presence = LEGACY_REQUIRED]; + double required_double = 12 [features.field_presence = LEGACY_REQUIRED]; + bool required_bool = 13 [features.field_presence = LEGACY_REQUIRED]; + string required_string = 14 [features.field_presence = LEGACY_REQUIRED]; + bytes required_bytes = 15 [features.field_presence = LEGACY_REQUIRED]; + + NestedMessage required_nested_message = 18 [features.field_presence = LEGACY_REQUIRED]; + ForeignMessageProto2 required_foreign_message = 19 [features.field_presence = LEGACY_REQUIRED]; + + NestedEnum required_nested_enum = 21 [features.field_presence = LEGACY_REQUIRED]; + ForeignEnumProto2 required_foreign_enum = 22 [features.field_presence = LEGACY_REQUIRED]; + + string required_string_piece = 24 [ctype = STRING_PIECE, features.field_presence = LEGACY_REQUIRED]; + string required_cord = 25 [ctype = CORD, features.field_presence = LEGACY_REQUIRED]; + + TestAllRequiredTypesProto2 recursive_message = 27 [features.field_presence = LEGACY_REQUIRED]; + TestAllRequiredTypesProto2 optional_recursive_message = 28; + + // extensions + extensions 120 to 200; + + // groups + message Data { + int32 group_int32 = 202 [features.field_presence = LEGACY_REQUIRED]; + uint32 group_uint32 = 203 [features.field_presence = LEGACY_REQUIRED]; + } + Data data = 201 [features.message_encoding = DELIMITED, features.field_presence = LEGACY_REQUIRED]; + + // default values + int32 default_int32 = 241 [default = -123456789, features.field_presence = LEGACY_REQUIRED]; + int64 default_int64 = 242 [default = -9123456789123456789, features.field_presence = LEGACY_REQUIRED]; + uint32 default_uint32 = 243 [default = 2123456789, features.field_presence = LEGACY_REQUIRED]; + uint64 default_uint64 = 244 [default = 10123456789123456789, features.field_presence = LEGACY_REQUIRED]; + sint32 default_sint32 = 245 [default = -123456789, features.field_presence = LEGACY_REQUIRED]; + sint64 default_sint64 = 246 [default = -9123456789123456789, features.field_presence = LEGACY_REQUIRED]; + fixed32 default_fixed32 = 247 [default = 2123456789, features.field_presence = LEGACY_REQUIRED]; + fixed64 default_fixed64 = 248 [default = 10123456789123456789, features.field_presence = LEGACY_REQUIRED]; + sfixed32 default_sfixed32 = 249 [default = -123456789, features.field_presence = LEGACY_REQUIRED]; + sfixed64 default_sfixed64 = 250 [default = -9123456789123456789, features.field_presence = LEGACY_REQUIRED]; + float default_float = 251 [default = 9e9, features.field_presence = LEGACY_REQUIRED]; + double default_double = 252 [default = 7e22, features.field_presence = LEGACY_REQUIRED]; + bool default_bool = 253 [default = true, features.field_presence = LEGACY_REQUIRED]; + string default_string = 254 [default = "Rosebud", features.field_presence = LEGACY_REQUIRED]; + bytes default_bytes = 255 [default = "joshua", features.field_presence = LEGACY_REQUIRED]; + + // Reserved for unknown fields test. + reserved 1000 to 9999; + + // message_set test case. + message MessageSetCorrect { + option message_set_wire_format = true; + + extensions 4 to max; + } + + message MessageSetCorrectExtension1 { + extend MessageSetCorrect { + MessageSetCorrectExtension1 message_set_extension = 1547769; + } + string str = 25 [features.field_presence = LEGACY_REQUIRED]; + } + + message MessageSetCorrectExtension2 { + extend MessageSetCorrect { + MessageSetCorrectExtension2 message_set_extension = 4135312; + } + int32 i = 9 [features.field_presence = LEGACY_REQUIRED]; + } +} diff --git a/src/google/protobuf/editions/golden/test_messages_proto3.proto b/src/google/protobuf/editions/golden/test_messages_proto3.proto new file mode 100644 index 0000000000..ce24bf90b6 --- /dev/null +++ b/src/google/protobuf/editions/golden/test_messages_proto3.proto @@ -0,0 +1,289 @@ +// 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. +// +// Test schema for proto3 messages. This test schema is used by: +// +// - benchmarks +// - fuzz tests +// - conformance tests +// + +edition = "2023"; +option features.field_presence = IMPLICIT; + +package protobuf_test_messages.proto3; + +option java_package = "com.google.protobuf_test_messages.proto3"; +option objc_class_prefix = "Proto3"; + +// This is the default, but we specify it here explicitly. +option optimize_for = SPEED; + +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option cc_enable_arenas = true; + +// This proto includes every type of field in both singular and repeated +// forms. +// +// Also, crucially, all messages and enums in this file are eventually +// submessages of this message. So for example, a fuzz test of TestAllTypes +// could trigger bugs that occur in any message type in this file. We verify +// this stays true in a unit test. +message TestAllTypesProto3 { + message NestedMessage { + int32 a = 1; + TestAllTypesProto3 corecursive = 2; + } + + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + NEG = -1; // Intentionally negative. + } + + enum AliasedEnum { + option allow_alias = true; + + ALIAS_FOO = 0; + ALIAS_BAR = 1; + ALIAS_BAZ = 2; + MOO = 2; + moo = 2; + bAz = 2; + } + + // Singular + int32 optional_int32 = 1; + int64 optional_int64 = 2; + uint32 optional_uint32 = 3; + uint64 optional_uint64 = 4; + sint32 optional_sint32 = 5; + sint64 optional_sint64 = 6; + fixed32 optional_fixed32 = 7; + fixed64 optional_fixed64 = 8; + sfixed32 optional_sfixed32 = 9; + sfixed64 optional_sfixed64 = 10; + float optional_float = 11; + double optional_double = 12; + bool optional_bool = 13; + string optional_string = 14; + bytes optional_bytes = 15; + + NestedMessage optional_nested_message = 18; + ForeignMessage optional_foreign_message = 19; + + NestedEnum optional_nested_enum = 21; + ForeignEnum optional_foreign_enum = 22; + AliasedEnum optional_aliased_enum = 23; + + string optional_string_piece = 24 [ctype = STRING_PIECE]; + string optional_cord = 25 [ctype = CORD]; + + TestAllTypesProto3 recursive_message = 27; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + + repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; + repeated string repeated_cord = 55 [ctype = CORD]; + + // Packed + repeated int32 packed_int32 = 75; + repeated int64 packed_int64 = 76; + repeated uint32 packed_uint32 = 77; + repeated uint64 packed_uint64 = 78; + repeated sint32 packed_sint32 = 79; + repeated sint64 packed_sint64 = 80; + repeated fixed32 packed_fixed32 = 81; + repeated fixed64 packed_fixed64 = 82; + repeated sfixed32 packed_sfixed32 = 83; + repeated sfixed64 packed_sfixed64 = 84; + repeated float packed_float = 85; + repeated double packed_double = 86; + repeated bool packed_bool = 87; + repeated NestedEnum packed_nested_enum = 88; + + // Unpacked + repeated int32 unpacked_int32 = 89 [features.repeated_field_encoding = EXPANDED]; + repeated int64 unpacked_int64 = 90 [features.repeated_field_encoding = EXPANDED]; + repeated uint32 unpacked_uint32 = 91 [features.repeated_field_encoding = EXPANDED]; + repeated uint64 unpacked_uint64 = 92 [features.repeated_field_encoding = EXPANDED]; + repeated sint32 unpacked_sint32 = 93 [features.repeated_field_encoding = EXPANDED]; + repeated sint64 unpacked_sint64 = 94 [features.repeated_field_encoding = EXPANDED]; + repeated fixed32 unpacked_fixed32 = 95 [features.repeated_field_encoding = EXPANDED]; + repeated fixed64 unpacked_fixed64 = 96 [features.repeated_field_encoding = EXPANDED]; + repeated sfixed32 unpacked_sfixed32 = 97 [features.repeated_field_encoding = EXPANDED]; + repeated sfixed64 unpacked_sfixed64 = 98 [features.repeated_field_encoding = EXPANDED]; + repeated float unpacked_float = 99 [features.repeated_field_encoding = EXPANDED]; + repeated double unpacked_double = 100 [features.repeated_field_encoding = EXPANDED]; + repeated bool unpacked_bool = 101 [features.repeated_field_encoding = EXPANDED]; + repeated NestedEnum unpacked_nested_enum = 102 [features.repeated_field_encoding = EXPANDED]; + + // Map + map map_int32_int32 = 56; + map map_int64_int64 = 57; + map map_uint32_uint32 = 58; + map map_uint64_uint64 = 59; + map map_sint32_sint32 = 60; + map map_sint64_sint64 = 61; + map map_fixed32_fixed32 = 62; + map map_fixed64_fixed64 = 63; + map map_sfixed32_sfixed32 = 64; + map map_sfixed64_sfixed64 = 65; + map map_int32_float = 66; + map map_int32_double = 67; + map map_bool_bool = 68; + map map_string_string = 69; + map map_string_bytes = 70; + map map_string_nested_message = 71; + map map_string_foreign_message = 72; + map map_string_nested_enum = 73; + map map_string_foreign_enum = 74; + + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + bool oneof_bool = 115; + uint64 oneof_uint64 = 116; + float oneof_float = 117; + double oneof_double = 118; + NestedEnum oneof_enum = 119; + google.protobuf.NullValue oneof_null_value = 120; + } + + // Well-known types + google.protobuf.BoolValue optional_bool_wrapper = 201; + google.protobuf.Int32Value optional_int32_wrapper = 202; + google.protobuf.Int64Value optional_int64_wrapper = 203; + google.protobuf.UInt32Value optional_uint32_wrapper = 204; + google.protobuf.UInt64Value optional_uint64_wrapper = 205; + google.protobuf.FloatValue optional_float_wrapper = 206; + google.protobuf.DoubleValue optional_double_wrapper = 207; + google.protobuf.StringValue optional_string_wrapper = 208; + google.protobuf.BytesValue optional_bytes_wrapper = 209; + + repeated google.protobuf.BoolValue repeated_bool_wrapper = 211; + repeated google.protobuf.Int32Value repeated_int32_wrapper = 212; + repeated google.protobuf.Int64Value repeated_int64_wrapper = 213; + repeated google.protobuf.UInt32Value repeated_uint32_wrapper = 214; + repeated google.protobuf.UInt64Value repeated_uint64_wrapper = 215; + repeated google.protobuf.FloatValue repeated_float_wrapper = 216; + repeated google.protobuf.DoubleValue repeated_double_wrapper = 217; + repeated google.protobuf.StringValue repeated_string_wrapper = 218; + repeated google.protobuf.BytesValue repeated_bytes_wrapper = 219; + + google.protobuf.Duration optional_duration = 301; + google.protobuf.Timestamp optional_timestamp = 302; + google.protobuf.FieldMask optional_field_mask = 303; + google.protobuf.Struct optional_struct = 304; + google.protobuf.Any optional_any = 305; + google.protobuf.Value optional_value = 306; + google.protobuf.NullValue optional_null_value = 307; + + repeated google.protobuf.Duration repeated_duration = 311; + repeated google.protobuf.Timestamp repeated_timestamp = 312; + repeated google.protobuf.FieldMask repeated_fieldmask = 313; + repeated google.protobuf.Struct repeated_struct = 324; + repeated google.protobuf.Any repeated_any = 315; + repeated google.protobuf.Value repeated_value = 316; + repeated google.protobuf.ListValue repeated_list_value = 317; + + // Test field-name-to-JSON-name convention. + // (protobuf says names can be any valid C/C++ identifier.) + int32 fieldname1 = 401; + int32 field_name2 = 402; + int32 _field_name3 = 403; + int32 field__name4_ = 404; + int32 field0name5 = 405; + int32 field_0_name6 = 406; + int32 fieldName7 = 407; + int32 FieldName8 = 408; + int32 field_Name9 = 409; + int32 Field_Name10 = 410; + int32 FIELD_NAME11 = 411; + int32 FIELD_name12 = 412; + int32 __field_name13 = 413; + int32 __Field_name14 = 414; + int32 field__name15 = 415; + int32 field__Name16 = 416; + int32 field_name17__ = 417; + int32 Field_name18__ = 418; + + // Reserved for testing unknown fields + reserved 501 to 510; +} + +message ForeignMessage { + int32 c = 1; +} + +enum ForeignEnum { + FOREIGN_FOO = 0; + FOREIGN_BAR = 1; + FOREIGN_BAZ = 2; +} + +message NullHypothesisProto3 {} + +message EnumOnlyProto3 { + enum Bool { + kFalse = 0; + kTrue = 1; + } +} diff --git a/src/google/protobuf/editions/proto/editions_transform_proto2.proto b/src/google/protobuf/editions/proto/editions_transform_proto2.proto new file mode 100644 index 0000000000..829cd6468b --- /dev/null +++ b/src/google/protobuf/editions/proto/editions_transform_proto2.proto @@ -0,0 +1,89 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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"; + +// This file contains various edge cases we've collected from migrating real +// protos in order to lock down the transformations. + +// LINT: ALLOW_GROUPS + +package protobuf_editions_test; + +option java_multiple_files = true; +option cc_enable_arenas = true; + +message EmptyMessage {} +message EmptyMessage2 {} + +service EmptyService {} + +service BasicService { + rpc BasicMethod(EmptyMessage) returns (EmptyMessage) {} +} + +// clang-format off +message UnformattedMessage{ + optional int32 a=1 ; + optional group Foo = 2 { optional int32 a = 1; } + optional string string_piece_with_zero = 3 [ctype=STRING_PIECE, + default="ab\000c"]; + optional float + long_float_name_wrapped = 4; + +} +// clang-format on + +message ParentMessage { + message ExtendedMessage { + extensions 536860000 to 536869999 [declaration = { + number: 536860000 + full_name: ".protobuf_editions_test.extension" + type: ".protobuf_editions_test.EmptyMessage" + }]; + } +} + +extend ParentMessage.ExtendedMessage { + optional EmptyMessage extension = 536860000; +} + +message TestMessage { + optional group OptionalGroup = 16 { + optional int32 a = 17; + } +} + +enum TestEnum { + FOO = 1; // Non-zero default + BAR = 2; + BAZ = 3; + NEG = -1; // Intentionally negative. +} diff --git a/src/google/protobuf/editions/transform.awk b/src/google/protobuf/editions/transform.awk new file mode 100644 index 0000000000..58e3ae9f94 --- /dev/null +++ b/src/google/protobuf/editions/transform.awk @@ -0,0 +1,179 @@ +# Protocol Buffers - Google's data interchange format +# Copyright 2023 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. + +noop = 0 + +function join(array, len, sep) +{ + if(len== 0) { + return "" + } + result = array[1] + for (i = 2; i <= len; i++) + result = result sep array[i] + return result +} + +function transform_field(field) +{ + if (!match(field, /\w+\s*=\s*[0-9-]+/)) { + return field + } + if (match(field, /(.*[0-9])\s*\[(.*)\];(.*)/, arr)) { + field_def = arr[1] + existing_options = arr[2] + field_comments = arr[3] + } else { + match(field, /(.*);(.*)/, arr) + field_def = arr[1] + field_comments = arr[2] + existing_options = 0 + } + num_options = 0 + + if(syntax == 2) { + sub(/\/, "features.repeated_field_encoding = PACKED", existing_options) + sub(/\,/, "", existing_options) + sub(/,?packed = false\>/, "", existing_options) + if (match($0, /\/)) { + sub(/\/, "features.repeated_field_encoding = EXPANDED", existing_options) + sub(/\,/, "", existing_options) + sub(/,?packed = true\>/, "", existing_options) + if (match($0, /\/)) { + sub(/\ 0) { + ret = field_def " [" existing_options ", " join(options, num_options, ",") "];" field_comments + } else if (existing_options) { + ret = field_def " [" existing_options "];" field_comments + } else if(num_options > 0) { + ret = field_def " [" join(options, num_options, ",") "];" field_comments + } else { + ret = field_def ";" field_comments + } + delete options + return ret +} + +# Skip comments +/^\s*\/\// { + print $0 + next +} + +/syntax = "proto2"/ { + print "edition = \"2023\";" + print "import \"third_party/protobuf/cpp_features.proto\";" + print "option features.enum_type = CLOSED;" + print "option features.repeated_field_encoding = EXPANDED;" + print "option features.string_field_validation = NONE;" + print "option features.json_format = LEGACY_BEST_EFFORT;" + print "option features.(pb.cpp).legacy_closed_enum = true;" + syntax = 2 + next +} + +/syntax = "proto3"/ { + print "edition = \"2023\";" + print "option features.field_presence = IMPLICIT;" + syntax = 3 + next +} + +# Group handling. +/\/)) { + match($0, /(\s*)(\w*)\s*group\s*(\w*)\s*=\s*([0-9]*)\s*{(\s*[^}]*}?)/, arr) + if (arr[0, "length"] == 0) { + print("[ERROR] Invalid group match: ", $0) + exit + } + current_group_whitespace = arr[1] + current_group_presence = arr[2] + current_group_name = arr[3] + current_group_number = arr[4] + current_group_extra = transform_field(arr[5]) + + print current_group_whitespace "message", current_group_name, "{" current_group_extra + } else if (match($0, /}/)) { + print $0 + } + if (match($0, /}/)) { + $0 = current_group_whitespace current_group_presence " " current_group_name " " tolower(current_group_name) " = " current_group_number " [features.message_encoding = DELIMITED];" + } else if (match($0, /\/)) { + next + } +} + +# Skip declarations we don't transform. +/^\s*(message|enum|oneof|extend|service)\s+(\w|\.)*\s*{/ { + noop = 1 +} +/^\s*rpc\s+\w*\s*\(/ { + noop = 1 +} +/^\s*(}|\/\/|$)/ { + noop = 1 +} +/^\s*(extensions|package|reserved|import) .*;/ { + noop = 1 +} +/^\s*option\s+[a-zA-Z0-9._()]*\s*=.*;/ { + noop = 1 +} +/\s*extensions.* \[/, /\]/ { + noop = 1 +} +noop { + print $0 + next +} + +/./, /;/ { + if (buffered_field != "") { + sub(/\s+/, " ", $0) + } + buffered_field = (buffered_field $0) + if (!match($0, /;/)) { + next + } + print(transform_field(buffered_field)) + buffered_field = "" +} diff --git a/src/google/protobuf/extension_set.h b/src/google/protobuf/extension_set.h index 8eb49eaa8e..bfd75a5c61 100644 --- a/src/google/protobuf/extension_set.h +++ b/src/google/protobuf/extension_set.h @@ -76,6 +76,9 @@ class Message; // message.h class MessageFactory; // message.h class Reflection; // message.h class UnknownFieldSet; // unknown_field_set.h +#ifdef PROTOBUF_FUTURE_EDITIONS +class FeatureSet; +#endif // PROTOBUF_FUTURE_EDITIONS namespace internal { class FieldSkipper; // wire_format_lite.h class WireFormat; @@ -83,6 +86,11 @@ enum class LazyVerifyOption; } // namespace internal } // namespace protobuf } // namespace google +#ifdef PROTOBUF_FUTURE_EDITIONS +namespace pb { +class CppFeatures; +} // namespace pb +#endif // PROTOBUF_FUTURE_EDITIONS namespace google { namespace protobuf { @@ -1537,6 +1545,39 @@ class ExtensionIdentifier { extern PROTOBUF_ATTRIBUTE_WEAK ExtensionSet::LazyMessageExtension* MaybeCreateLazyExtension(Arena* arena); +#ifdef PROTOBUF_FUTURE_EDITIONS +// Define a specialization of ExtensionIdentifier for bootstrapped extensions +// that we need to register lazily. +template <> +class ExtensionIdentifier, 11, + false> { + public: + explicit constexpr ExtensionIdentifier(int number) : number_(number) {} + + int number() const { return number_; } + const ::pb::CppFeatures& default_value() const { return *default_value_; } + + template + void LazyRegister( + const MessageType& default_instance = MessageType::default_instance(), + LazyEagerVerifyFnType verify_func = nullptr) const { + absl::call_once(once_, [&] { + default_value_ = &default_instance; + MessageTypeTraits::template Register( + number_, 11, false, verify_func); + }); + } + + const ::pb::CppFeatures& default_value_ref() const { return *default_value_; } + + private: + const int number_; + mutable const ::pb::CppFeatures* default_value_ = nullptr; + mutable absl::once_flag once_; +}; + +#endif // PROTOBUF_FUTURE_EDITIONS } // namespace internal diff --git a/src/google/protobuf/feature_resolver.cc b/src/google/protobuf/feature_resolver.cc new file mode 100644 index 0000000000..9f57d9900e --- /dev/null +++ b/src/google/protobuf/feature_resolver.cc @@ -0,0 +1,279 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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. + +#include "google/protobuf/feature_resolver.h" + +#include +#include +#include +#include +#include +#include + +#include "absl/algorithm/container.h" +#include "absl/log/absl_check.h" +#include "absl/memory/memory.h" +#include "absl/status/status.h" +#include "absl/status/statusor.h" +#include "absl/strings/str_cat.h" +#include "absl/strings/str_split.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/dynamic_message.h" +#include "google/protobuf/message.h" +#include "google/protobuf/reflection_ops.h" +#include "google/protobuf/text_format.h" + +// Must be included last. +#include "google/protobuf/port_def.inc" + +#define RETURN_IF_ERROR(expr) \ + do { \ + const absl::Status _status = (expr); \ + if (PROTOBUF_PREDICT_FALSE(!_status.ok())) return _status; \ + } while (0) + +namespace google { +namespace protobuf { +namespace { + +template +absl::Status Error(Args... args) { + return absl::FailedPreconditionError(absl::StrCat(args...)); +} + +bool EditionsLessThan(absl::string_view a, absl::string_view b) { + std::vector as = absl::StrSplit(a, '.'); + std::vector bs = absl::StrSplit(b, '.'); + size_t min_size = std::min(as.size(), bs.size()); + for (size_t i = 0; i < min_size; ++i) { + if (as[i].size() != bs[i].size()) { + return as[i].size() < bs[i].size(); + } else if (as[i] != bs[i]) { + return as[i] < bs[i]; + } + } + // Both strings are equal up until an extra element, which makes that string + // more recent. + return as.size() < bs.size(); +} + +absl::Status ValidateDescriptor(absl::string_view edition, + const Descriptor& descriptor) { + if (descriptor.oneof_decl_count() > 0) { + return Error("Type ", descriptor.full_name(), + " contains unsupported oneof feature fields."); + } + for (int i = 0; i < descriptor.field_count(); ++i) { + const FieldDescriptor& field = *descriptor.field(i); + if (field.is_required()) { + return Error("Feature field ", field.full_name(), + " is an unsupported required field."); + } + if (field.is_repeated()) { + return Error("Feature field ", field.full_name(), + " is an unsupported repeated field."); + } + if (field.options().targets().empty()) { + return Error("Feature field ", field.full_name(), + " has no target specified."); + } + } + + return absl::OkStatus(); +} + +absl::Status FillDefaults(absl::string_view edition, Message& msg) { + const Descriptor& descriptor = *msg.GetDescriptor(); + + auto comparator = [](const FieldOptions::EditionDefault& a, + const FieldOptions::EditionDefault& b) { + return EditionsLessThan(a.edition(), b.edition()); + }; + FieldOptions::EditionDefault edition_lookup; + edition_lookup.set_edition(edition); + + for (int i = 0; i < descriptor.field_count(); ++i) { + const FieldDescriptor& field = *descriptor.field(i); + msg.GetReflection()->ClearField(&msg, &field); + ABSL_CHECK(!field.is_repeated()); + + std::vector defaults{ + field.options().edition_defaults().begin(), + field.options().edition_defaults().end()}; + absl::c_sort(defaults, comparator); + auto first_nonmatch = + absl::c_upper_bound(defaults, edition_lookup, comparator); + if (first_nonmatch == defaults.begin()) { + return Error("No valid default found for edition ", edition, + " in feature field ", field.full_name()); + } + + if (field.cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { + for (auto it = defaults.begin(); it != first_nonmatch; ++it) { + if (!TextFormat::MergeFromString( + it->value(), + msg.GetReflection()->MutableMessage(&msg, &field))) { + return Error("Parsing error in edition_defaults for feature field ", + field.full_name(), ". Could not parse: ", it->value()); + } + } + } else { + const std::string& def = std::prev(first_nonmatch)->value(); + if (!TextFormat::ParseFieldValueFromString(def, &field, &msg)) { + return Error("Parsing error in edition_defaults for feature field ", + field.full_name(), ". Could not parse: ", def); + } + } + } + + return absl::OkStatus(); +} + +absl::Status ValidateMergedFeatures(const Message& msg) { + const Descriptor& descriptor = *msg.GetDescriptor(); + const Reflection& reflection = *msg.GetReflection(); + for (int i = 0; i < descriptor.field_count(); ++i) { + const FieldDescriptor& field = *descriptor.field(i); + // Validate enum features. + if (field.enum_type() != nullptr) { + ABSL_DCHECK(reflection.HasField(msg, &field)); + int int_value = reflection.GetEnumValue(msg, &field); + const EnumValueDescriptor* value = + field.enum_type()->FindValueByNumber(int_value); + ABSL_DCHECK(value != nullptr); + if (value->number() == 0) { + return Error("Feature field ", field.full_name(), + " must resolve to a known value, found ", value->name()); + } + } + } + + return absl::OkStatus(); +} + +} // namespace + +absl::StatusOr FeatureResolver::Create( + absl::string_view edition, const Descriptor* descriptor) { + if (descriptor == nullptr) { + return Error( + "Unable to find definition of google.protobuf.FeatureSet in descriptor pool."); + } + + RETURN_IF_ERROR(ValidateDescriptor(edition, *descriptor)); + + auto message_factory = absl::make_unique(); + auto defaults = + absl::WrapUnique(message_factory->GetPrototype(descriptor)->New()); + + RETURN_IF_ERROR(FillDefaults(edition, *defaults)); + + return FeatureResolver(edition, *descriptor, std::move(message_factory), + std::move(defaults)); +} + +absl::Status FeatureResolver::RegisterExtension( + const FieldDescriptor& extension) { + if (!extension.is_extension() || + extension.containing_type() != &descriptor_ || + extensions_.contains(&extension)) { + // These are valid but irrelevant extensions, just return ok. + return absl::OkStatus(); + } + + ABSL_CHECK(descriptor_.IsExtensionNumber(extension.number())); + + if (extension.message_type() == nullptr) { + return Error("FeatureSet extension ", extension.full_name(), + " is not of message type. Feature extensions should " + "always use messages to allow for evolution."); + } + + if (extension.is_repeated()) { + return Error( + "Only singular features extensions are supported. Found " + "repeated extension ", + extension.full_name()); + } + + if (extension.message_type()->extension_count() > 0 || + extension.message_type()->extension_range_count() > 0) { + return Error("Nested extensions in feature extension ", + extension.full_name(), " are not supported."); + } + + RETURN_IF_ERROR(ValidateDescriptor(edition_, *extension.message_type())); + + Message* msg = + defaults_->GetReflection()->MutableMessage(defaults_.get(), &extension); + ABSL_CHECK(msg != nullptr); + RETURN_IF_ERROR(FillDefaults(edition_, *msg)); + + extensions_.insert(&extension); + return absl::OkStatus(); +} + +absl::Status FeatureResolver::RegisterExtensions(const FileDescriptor& file) { + for (int i = 0; i < file.extension_count(); ++i) { + RETURN_IF_ERROR(RegisterExtension(*file.extension(i))); + } + for (int i = 0; i < file.message_type_count(); ++i) { + RETURN_IF_ERROR(RegisterExtensions(*file.message_type(i))); + } + return absl::OkStatus(); +} + +absl::Status FeatureResolver::RegisterExtensions(const Descriptor& message) { + for (int i = 0; i < message.extension_count(); ++i) { + RETURN_IF_ERROR(RegisterExtension(*message.extension(i))); + } + for (int i = 0; i < message.nested_type_count(); ++i) { + RETURN_IF_ERROR(RegisterExtensions(*message.nested_type(i))); + } + return absl::OkStatus(); +} + +absl::StatusOr FeatureResolver::MergeFeatures( + const FeatureSet& merged_parent, const FeatureSet& unmerged_child) const { + FeatureSet merged; + ABSL_CHECK(merged.ParseFromString(defaults_->SerializeAsString())); + merged.MergeFrom(merged_parent); + merged.MergeFrom(unmerged_child); + + RETURN_IF_ERROR(ValidateMergedFeatures(merged)); + + return merged; +} + +} // namespace protobuf +} // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/feature_resolver.h b/src/google/protobuf/feature_resolver.h new file mode 100644 index 0000000000..013dc65e85 --- /dev/null +++ b/src/google/protobuf/feature_resolver.h @@ -0,0 +1,99 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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. + +#ifndef GOOGLE_PROTOBUF_FEATURE_RESOLVER_H__ +#define GOOGLE_PROTOBUF_FEATURE_RESOLVER_H__ + +#include +#include +#include + +#include "absl/container/flat_hash_set.h" +#include "absl/status/status.h" +#include "absl/strings/string_view.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/dynamic_message.h" + +// Must be included last. +#include "google/protobuf/port_def.inc" + +namespace google { +namespace protobuf { + +// These helpers implement the unique behaviors of edition features. For more +// details, see go/protobuf-editions-features. +class PROTOBUF_EXPORT FeatureResolver { + public: + FeatureResolver(FeatureResolver&&) = default; + FeatureResolver& operator=(FeatureResolver&&) = delete; + + // Creates a new FeatureResolver at a specific edition. This validates the + // built-in features for the given edition, and calculates the default feature + // set. + static absl::StatusOr Create(absl::string_view edition, + const Descriptor* descriptor); + + // Registers a potential extension of the FeatureSet proto. Any visible + // extensions will be used during merging. Returns an error if the extension + // is a feature extension but fails validation. + absl::Status RegisterExtensions(const FileDescriptor& file); + + // Creates a new feature set using inheritance and default behavior. This is + // designed to be called recursively, and the parent feature set is expected + // to be a fully merged one. + absl::StatusOr MergeFeatures( + const FeatureSet& merged_parent, const FeatureSet& unmerged_child) const; + + private: + FeatureResolver(absl::string_view edition, const Descriptor& descriptor, + std::unique_ptr message_factory, + std::unique_ptr defaults) + : edition_(edition), + descriptor_(descriptor), + message_factory_(std::move(message_factory)), + defaults_(std::move(defaults)) {} + + absl::Status RegisterExtensions(const Descriptor& message); + absl::Status RegisterExtension(const FieldDescriptor& extension); + + std::string edition_; + const Descriptor& descriptor_; + absl::flat_hash_set extensions_; + std::unique_ptr message_factory_; + std::unique_ptr defaults_; +}; + +} // namespace protobuf +} // namespace google + +#endif // GOOGLE_PROTOBUF_FEATURE_RESOLVER_H__ + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/feature_resolver_test.cc b/src/google/protobuf/feature_resolver_test.cc new file mode 100644 index 0000000000..8d1d7ce47b --- /dev/null +++ b/src/google/protobuf/feature_resolver_test.cc @@ -0,0 +1,857 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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. + +#include "google/protobuf/feature_resolver.h" + +#include + +#include +#include +#include "absl/memory/memory.h" +#include "absl/status/status.h" +#include "absl/status/statusor.h" +#include "google/protobuf/compiler/parser.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/io/tokenizer.h" +#include "google/protobuf/test_textproto.h" +#include "google/protobuf/text_format.h" +#include "google/protobuf/unittest_custom_options.pb.h" +#include "google/protobuf/unittest_features.pb.h" +#include "google/protobuf/stubs/status_macros.h" + +// Must be included last. +#include "google/protobuf/port_def.inc" + +namespace google { +namespace protobuf { +namespace { + +using ::testing::AllOf; +using ::testing::ExplainMatchResult; +using ::testing::HasSubstr; + +// TODO(b/234474291): Use the gtest versions once that's available in OSS. +absl::Status GetStatus(const absl::Status& s) { return s; } +template +absl::Status GetStatus(const absl::StatusOr& s) { + return s.status(); +} + +MATCHER_P(HasError, msg_matcher, "") { + return GetStatus(arg).code() == absl::StatusCode::kFailedPrecondition && + ExplainMatchResult(msg_matcher, GetStatus(arg).message(), + result_listener); +} + +MATCHER_P(StatusIs, status, + absl::StrCat(".status() is ", testing::PrintToString(status))) { + return GetStatus(arg).code() == status; +} +#define EXPECT_OK(x) EXPECT_THAT(x, StatusIs(absl::StatusCode::kOk)) +#define ASSERT_OK(x) ASSERT_THAT(x, StatusIs(absl::StatusCode::kOk)) + +template +const FileDescriptor& GetExtensionFile( + const ExtensionT& ext, + const Descriptor* descriptor = FeatureSet::descriptor()) { + return *DescriptorPool::generated_pool() + ->FindExtensionByNumber(descriptor, ext.number()) + ->file(); +} + +template +absl::StatusOr SetupFeatureResolver(absl::string_view edition, + Extensions... extensions) { + auto resolver = FeatureResolver::Create(edition, FeatureSet::descriptor()); + RETURN_IF_ERROR(resolver.status()); + std::vector results{ + resolver->RegisterExtensions(GetExtensionFile(extensions))...}; + for (absl::Status result : results) { + RETURN_IF_ERROR(result); + } + return resolver; +} + +template +absl::StatusOr GetDefaults(absl::string_view edition, + Extensions... extensions) { + absl::StatusOr resolver = + SetupFeatureResolver(edition, extensions...); + RETURN_IF_ERROR(resolver.status()); + FeatureSet parent, child; + return resolver->MergeFeatures(parent, child); +} + +TEST(FeatureResolverTest, DefaultsCore2023) { + absl::StatusOr merged = GetDefaults("2023"); + ASSERT_OK(merged); + + EXPECT_EQ(merged->field_presence(), FeatureSet::EXPLICIT); + EXPECT_EQ(merged->enum_type(), FeatureSet::OPEN); + EXPECT_EQ(merged->repeated_field_encoding(), FeatureSet::PACKED); + EXPECT_EQ(merged->string_field_validation(), FeatureSet::MANDATORY); + EXPECT_EQ(merged->message_encoding(), FeatureSet::LENGTH_PREFIXED); +} + +TEST(FeatureResolverTest, DefaultsTest2023) { + absl::StatusOr merged = GetDefaults("2023", pb::test); + ASSERT_OK(merged); + + EXPECT_EQ(merged->field_presence(), FeatureSet::EXPLICIT); + EXPECT_EQ(merged->enum_type(), FeatureSet::OPEN); + EXPECT_EQ(merged->repeated_field_encoding(), FeatureSet::PACKED); + EXPECT_EQ(merged->string_field_validation(), FeatureSet::MANDATORY); + EXPECT_EQ(merged->message_encoding(), FeatureSet::LENGTH_PREFIXED); + + const pb::TestFeatures& ext = merged->GetExtension(pb::test); + EXPECT_EQ(ext.int_file_feature(), 1); + EXPECT_EQ(ext.int_extension_range_feature(), 1); + EXPECT_EQ(ext.int_message_feature(), 1); + EXPECT_EQ(ext.int_field_feature(), 1); + EXPECT_EQ(ext.int_oneof_feature(), 1); + EXPECT_EQ(ext.int_enum_feature(), 1); + EXPECT_EQ(ext.int_enum_entry_feature(), 1); + EXPECT_EQ(ext.int_service_feature(), 1); + EXPECT_EQ(ext.int_method_feature(), 1); + EXPECT_EQ(ext.bool_field_feature(), false); + EXPECT_FLOAT_EQ(ext.float_field_feature(), 1.1); + EXPECT_THAT(ext.message_field_feature(), + EqualsProto("bool_field: true int_field: 1 float_field: 1.5 " + "string_field: '2023'")); + EXPECT_EQ(ext.enum_field_feature(), pb::TestFeatures::ENUM_VALUE1); +} + +TEST(FeatureResolverTest, DefaultsTestMessageExtension) { + absl::StatusOr merged = + GetDefaults("2023", pb::TestMessage::test_message); + ASSERT_OK(merged); + + EXPECT_EQ(merged->field_presence(), FeatureSet::EXPLICIT); + EXPECT_EQ(merged->enum_type(), FeatureSet::OPEN); + EXPECT_EQ(merged->repeated_field_encoding(), FeatureSet::PACKED); + EXPECT_EQ(merged->string_field_validation(), FeatureSet::MANDATORY); + EXPECT_EQ(merged->message_encoding(), FeatureSet::LENGTH_PREFIXED); + + const pb::TestFeatures& ext = merged->GetExtension(pb::test); + EXPECT_EQ(ext.int_file_feature(), 1); + EXPECT_EQ(ext.int_extension_range_feature(), 1); + EXPECT_EQ(ext.int_message_feature(), 1); + EXPECT_EQ(ext.int_field_feature(), 1); + EXPECT_EQ(ext.int_oneof_feature(), 1); + EXPECT_EQ(ext.int_enum_feature(), 1); + EXPECT_EQ(ext.int_enum_entry_feature(), 1); + EXPECT_EQ(ext.int_service_feature(), 1); + EXPECT_EQ(ext.int_method_feature(), 1); + EXPECT_EQ(ext.bool_field_feature(), false); + EXPECT_FLOAT_EQ(ext.float_field_feature(), 1.1); + EXPECT_THAT(ext.message_field_feature(), + EqualsProto("bool_field: true int_field: 1 float_field: 1.5 " + "string_field: '2023'")); + EXPECT_EQ(ext.enum_field_feature(), pb::TestFeatures::ENUM_VALUE1); +} + +TEST(FeatureResolverTest, DefaultsTestNestedExtension) { + absl::StatusOr merged = + GetDefaults("2023", pb::TestMessage::Nested::test_nested); + ASSERT_OK(merged); + + EXPECT_EQ(merged->field_presence(), FeatureSet::EXPLICIT); + EXPECT_EQ(merged->enum_type(), FeatureSet::OPEN); + EXPECT_EQ(merged->repeated_field_encoding(), FeatureSet::PACKED); + EXPECT_EQ(merged->string_field_validation(), FeatureSet::MANDATORY); + EXPECT_EQ(merged->message_encoding(), FeatureSet::LENGTH_PREFIXED); + + const pb::TestFeatures& ext = merged->GetExtension(pb::test); + EXPECT_EQ(ext.int_file_feature(), 1); + EXPECT_EQ(ext.int_extension_range_feature(), 1); + EXPECT_EQ(ext.int_message_feature(), 1); + EXPECT_EQ(ext.int_field_feature(), 1); + EXPECT_EQ(ext.int_oneof_feature(), 1); + EXPECT_EQ(ext.int_enum_feature(), 1); + EXPECT_EQ(ext.int_enum_entry_feature(), 1); + EXPECT_EQ(ext.int_service_feature(), 1); + EXPECT_EQ(ext.int_method_feature(), 1); + EXPECT_EQ(ext.bool_field_feature(), false); + EXPECT_FLOAT_EQ(ext.float_field_feature(), 1.1); + EXPECT_THAT(ext.message_field_feature(), + EqualsProto("bool_field: true int_field: 1 float_field: 1.5 " + "string_field: '2023'")); + EXPECT_EQ(ext.enum_field_feature(), pb::TestFeatures::ENUM_VALUE1); +} + +TEST(FeatureResolverTest, DefaultsTooEarly) { + absl::StatusOr merged = GetDefaults("2022", pb::test); + EXPECT_THAT(merged, HasError(AllOf(HasSubstr("No valid default found"), + HasSubstr("2022")))); +} + +TEST(FeatureResolverTest, DefaultsFarFuture) { + absl::StatusOr merged = GetDefaults("3456", pb::test); + ASSERT_OK(merged); + + pb::TestFeatures ext = merged->GetExtension(pb::test); + EXPECT_EQ(ext.int_file_feature(), 5); + EXPECT_THAT(ext.message_field_feature(), + EqualsProto("bool_field: true int_field: 4 float_field: 1.5 " + "string_field: '2025'")); + EXPECT_EQ(ext.enum_field_feature(), pb::TestFeatures::ENUM_VALUE5); +} + +TEST(FeatureResolverTest, DefaultsMiddleEdition) { + absl::StatusOr merged = GetDefaults("2024.1", pb::test); + ASSERT_OK(merged); + + pb::TestFeatures ext = merged->GetExtension(pb::test); + EXPECT_EQ(ext.int_file_feature(), 4); + EXPECT_EQ(ext.enum_field_feature(), pb::TestFeatures::ENUM_VALUE4); +} + +TEST(FeatureResolverTest, DefaultsDifferentDigitCount) { + absl::StatusOr merged = GetDefaults("2023.90", pb::test); + ASSERT_OK(merged); + + pb::TestFeatures ext = merged->GetExtension(pb::test); + EXPECT_EQ(ext.int_file_feature(), 3); + EXPECT_EQ(ext.enum_field_feature(), pb::TestFeatures::ENUM_VALUE3); +} + +TEST(FeatureResolverTest, DefaultsMessageMerge) { + { + absl::StatusOr merged = GetDefaults("2023", pb::test); + ASSERT_OK(merged); + pb::TestFeatures ext = merged->GetExtension(pb::test); + EXPECT_THAT(ext.message_field_feature(), + EqualsProto(R"pb(bool_field: true + int_field: 1 + float_field: 1.5 + string_field: '2023')pb")); + } + { + absl::StatusOr merged = GetDefaults("2023.1", pb::test); + ASSERT_OK(merged); + pb::TestFeatures ext = merged->GetExtension(pb::test); + EXPECT_THAT(ext.message_field_feature(), + EqualsProto(R"pb(bool_field: true + int_field: 2 + float_field: 1.5 + string_field: '2023')pb")); + } + { + absl::StatusOr merged = GetDefaults("2024", pb::test); + ASSERT_OK(merged); + pb::TestFeatures ext = merged->GetExtension(pb::test); + EXPECT_THAT(ext.message_field_feature(), + EqualsProto(R"pb(bool_field: true + int_field: 2 + float_field: 1.5 + string_field: '2024')pb")); + } +} + +TEST(FeatureResolverTest, InitializePoolMissingDescriptor) { + DescriptorPool pool; + EXPECT_THAT(FeatureResolver::Create("2023", nullptr), + HasError(HasSubstr("find definition of google.protobuf.FeatureSet"))); +} + +TEST(FeatureResolverTest, RegisterExtensionDifferentContainingType) { + auto resolver = FeatureResolver::Create("2023", FeatureSet::descriptor()); + ASSERT_OK(resolver); + + EXPECT_OK(resolver->RegisterExtensions( + GetExtensionFile(protobuf_unittest::file_opt1, FileOptions::descriptor()))); +} + +TEST(FeatureResolverTest, RegisterExtensionTwice) { + auto resolver = FeatureResolver::Create("2023", FeatureSet::descriptor()); + ASSERT_OK(resolver); + + EXPECT_OK(resolver->RegisterExtensions(GetExtensionFile(pb::test))); + EXPECT_OK(resolver->RegisterExtensions(GetExtensionFile(pb::test))); +} + +TEST(FeatureResolverTest, MergeFeaturesChildOverrideCore) { + absl::StatusOr resolver = SetupFeatureResolver("2023"); + ASSERT_OK(resolver); + FeatureSet child = ParseTextOrDie(R"pb( + field_presence: IMPLICIT + repeated_field_encoding: EXPANDED + )pb"); + absl::StatusOr merged = + resolver->MergeFeatures(FeatureSet(), child); + ASSERT_OK(merged); + + EXPECT_EQ(merged->field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(merged->enum_type(), FeatureSet::OPEN); + EXPECT_EQ(merged->repeated_field_encoding(), FeatureSet::EXPANDED); + EXPECT_EQ(merged->string_field_validation(), FeatureSet::MANDATORY); + EXPECT_EQ(merged->message_encoding(), FeatureSet::LENGTH_PREFIXED); +} + +TEST(FeatureResolverTest, MergeFeaturesChildOverrideComplex) { + absl::StatusOr resolver = + SetupFeatureResolver("2023", pb::test); + ASSERT_OK(resolver); + FeatureSet child = ParseTextOrDie(R"pb( + field_presence: IMPLICIT + repeated_field_encoding: EXPANDED + [pb.test] { + int_field_feature: 5 + enum_field_feature: ENUM_VALUE4 + message_field_feature { int_field: 10 } + } + )pb"); + absl::StatusOr merged = + resolver->MergeFeatures(FeatureSet(), child); + ASSERT_OK(merged); + + EXPECT_EQ(merged->field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(merged->enum_type(), FeatureSet::OPEN); + EXPECT_EQ(merged->repeated_field_encoding(), FeatureSet::EXPANDED); + EXPECT_EQ(merged->string_field_validation(), FeatureSet::MANDATORY); + EXPECT_EQ(merged->message_encoding(), FeatureSet::LENGTH_PREFIXED); + + pb::TestFeatures ext = merged->GetExtension(pb::test); + EXPECT_EQ(ext.int_file_feature(), 1); + EXPECT_EQ(ext.int_field_feature(), 5); + EXPECT_FLOAT_EQ(ext.float_field_feature(), 1.1); + EXPECT_THAT(ext.message_field_feature(), + EqualsProto("bool_field: true int_field: 10 float_field: 1.5 " + "string_field: '2023'")); + EXPECT_EQ(ext.enum_field_feature(), pb::TestFeatures::ENUM_VALUE4); +} + +TEST(FeatureResolverTest, MergeFeaturesParentOverrides) { + absl::StatusOr resolver = + SetupFeatureResolver("2023", pb::test); + ASSERT_OK(resolver); + FeatureSet parent = ParseTextOrDie(R"pb( + field_presence: IMPLICIT + repeated_field_encoding: EXPANDED + [pb.test] { + int_field_feature: 5 + enum_field_feature: ENUM_VALUE4 + message_field_feature { int_field: 10 string_field: "parent" } + } + )pb"); + FeatureSet child = ParseTextOrDie(R"pb( + string_field_validation: NONE + repeated_field_encoding: PACKED + [pb.test] { + int_field_feature: 9 + message_field_feature { bool_field: false int_field: 9 } + } + )pb"); + absl::StatusOr merged = resolver->MergeFeatures(parent, child); + ASSERT_OK(merged); + + EXPECT_EQ(merged->field_presence(), FeatureSet::IMPLICIT); + EXPECT_EQ(merged->enum_type(), FeatureSet::OPEN); + EXPECT_EQ(merged->repeated_field_encoding(), FeatureSet::PACKED); + EXPECT_EQ(merged->string_field_validation(), FeatureSet::NONE); + EXPECT_EQ(merged->message_encoding(), FeatureSet::LENGTH_PREFIXED); + + pb::TestFeatures ext = merged->GetExtension(pb::test); + EXPECT_EQ(ext.int_file_feature(), 1); + EXPECT_EQ(ext.int_extension_range_feature(), 1); + EXPECT_EQ(ext.int_message_feature(), 1); + EXPECT_EQ(ext.int_field_feature(), 9); + EXPECT_EQ(ext.int_oneof_feature(), 1); + EXPECT_EQ(ext.int_enum_feature(), 1); + EXPECT_EQ(ext.int_enum_entry_feature(), 1); + EXPECT_EQ(ext.int_service_feature(), 1); + EXPECT_EQ(ext.int_method_feature(), 1); + EXPECT_EQ(ext.bool_field_feature(), false); + EXPECT_FLOAT_EQ(ext.float_field_feature(), 1.1); + EXPECT_THAT(ext.message_field_feature(), + EqualsProto("bool_field: false int_field: 9 float_field: 1.5 " + "string_field: 'parent'")); + EXPECT_EQ(ext.enum_field_feature(), pb::TestFeatures::ENUM_VALUE4); +} + +TEST(FeatureResolverTest, MergeFeaturesFieldPresenceUnknown) { + absl::StatusOr resolver = SetupFeatureResolver("2023"); + ASSERT_OK(resolver); + FeatureSet child = ParseTextOrDie(R"pb( + field_presence: FIELD_PRESENCE_UNKNOWN + )pb"); + EXPECT_THAT( + resolver->MergeFeatures(FeatureSet(), child), + HasError(AllOf(HasSubstr("field google.protobuf.FeatureSet.field_presence"), + HasSubstr("FIELD_PRESENCE_UNKNOWN")))); +} + +TEST(FeatureResolverTest, MergeFeaturesEnumTypeUnknown) { + absl::StatusOr resolver = SetupFeatureResolver("2023"); + ASSERT_OK(resolver); + FeatureSet child = ParseTextOrDie(R"pb( + enum_type: ENUM_TYPE_UNKNOWN + )pb"); + EXPECT_THAT(resolver->MergeFeatures(FeatureSet(), child), + HasError(AllOf(HasSubstr("field google.protobuf.FeatureSet.enum_type"), + HasSubstr("ENUM_TYPE_UNKNOWN")))); +} + +TEST(FeatureResolverTest, MergeFeaturesRepeatedFieldEncodingUnknown) { + absl::StatusOr resolver = SetupFeatureResolver("2023"); + ASSERT_OK(resolver); + FeatureSet child = ParseTextOrDie(R"pb( + repeated_field_encoding: REPEATED_FIELD_ENCODING_UNKNOWN + )pb"); + EXPECT_THAT(resolver->MergeFeatures(FeatureSet(), child), + HasError(AllOf( + HasSubstr("field google.protobuf.FeatureSet.repeated_field_encoding"), + HasSubstr("REPEATED_FIELD_ENCODING_UNKNOWN")))); +} + +TEST(FeatureResolverTest, MergeFeaturesStringFieldValidationUnknown) { + absl::StatusOr resolver = SetupFeatureResolver("2023"); + ASSERT_OK(resolver); + FeatureSet child = ParseTextOrDie(R"pb( + string_field_validation: STRING_FIELD_VALIDATION_UNKNOWN + )pb"); + EXPECT_THAT(resolver->MergeFeatures(FeatureSet(), child), + HasError(AllOf( + HasSubstr("field google.protobuf.FeatureSet.string_field_validation"), + HasSubstr("STRING_FIELD_VALIDATION_UNKNOWN")))); +} + +TEST(FeatureResolverTest, MergeFeaturesMessageEncodingUnknown) { + absl::StatusOr resolver = SetupFeatureResolver("2023"); + ASSERT_OK(resolver); + FeatureSet child = ParseTextOrDie(R"pb( + message_encoding: MESSAGE_ENCODING_UNKNOWN + )pb"); + EXPECT_THAT( + resolver->MergeFeatures(FeatureSet(), child), + HasError(AllOf(HasSubstr("field google.protobuf.FeatureSet.message_encoding"), + HasSubstr("MESSAGE_ENCODING_UNKNOWN")))); +} + +TEST(FeatureResolverTest, MergeFeaturesExtensionEnumUnknown) { + absl::StatusOr resolver = + SetupFeatureResolver("2023", pb::test); + ASSERT_OK(resolver); + FeatureSet child = ParseTextOrDie(R"pb( + [pb.test] { enum_field_feature: TEST_ENUM_FEATURE_UNKNOWN } + )pb"); + absl::StatusOr merged = + resolver->MergeFeatures(FeatureSet(), child); + ASSERT_OK(merged); + EXPECT_EQ(merged->GetExtension(pb::test).enum_field_feature(), + pb::TestFeatures::TEST_ENUM_FEATURE_UNKNOWN); +} + +// TODO(b/273611177) Move the following tests to descriptor_unittest.cc once +// FeatureResolver is hooked up. These will all fail during the descriptor +// build, invalidating the test setup. +// +// Note: We should make sure to keep coverage over the custom DescriptorPool +// cases. These are the only tests covering issues there (the ones above use +// the generated descriptor pool). + +class FakeErrorCollector : public io::ErrorCollector { + public: + FakeErrorCollector() = default; + ~FakeErrorCollector() override = default; + void RecordWarning(int line, int column, absl::string_view message) override { + ABSL_LOG(WARNING) << line << ":" << column << ": " << message; + } + void RecordError(int line, int column, absl::string_view message) override { + ABSL_LOG(ERROR) << line << ":" << column << ": " << message; + } +}; + +class FeatureResolverPoolTest : public testing::Test { + protected: + void SetUp() override { + FileDescriptorProto file; + FileDescriptorProto::GetDescriptor()->file()->CopyTo(&file); + ASSERT_NE(pool_.BuildFile(file), nullptr); + } + + const FileDescriptor* ParseSchema(absl::string_view schema) { + FakeErrorCollector error_collector; + io::ArrayInputStream raw_input(schema.data(), schema.size()); + io::Tokenizer input(&raw_input, &error_collector); + compiler::Parser parser; + parser.RecordErrorsTo(&error_collector); + + FileDescriptorProto file; + + ABSL_CHECK(parser.Parse(&input, &file)); + file.set_name("foo.proto"); + return pool_.BuildFile(file); + } + + DescriptorPool pool_; + FileDescriptorProto file_proto_; +}; + +TEST_F(FeatureResolverPoolTest, RegisterExtensionNonMessage) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + message Foo {} + extend google.protobuf.FeatureSet { + optional string bar = 9999; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + + EXPECT_THAT(resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("test.bar"), + HasSubstr("is not of message type")))); +} + +TEST_F(FeatureResolverPoolTest, RegisterExtensionRepeated) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + message Foo {} + extend google.protobuf.FeatureSet { + repeated Foo bar = 9999; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + + EXPECT_THAT( + resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("test.bar"), HasSubstr("repeated extension")))); +} + +TEST_F(FeatureResolverPoolTest, RegisterExtensionWithExtensions) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + message Foo { + extensions 1; + } + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + extend Foo { + optional Foo bar2 = 1 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "" } + ]; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + + EXPECT_THAT( + resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("test.bar"), HasSubstr("Nested extensions")))); +} + +TEST_F(FeatureResolverPoolTest, RegisterExtensionWithOneof) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + message Foo { + oneof x { + int32 int_field = 1 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "1" } + ]; + string string_field = 2 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "'hello'" } + ]; + } + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + + EXPECT_THAT(resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("test.Foo"), + HasSubstr("oneof feature fields")))); +} + +TEST_F(FeatureResolverPoolTest, RegisterExtensionWithRequired) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + message Foo { + required int32 required_field = 1 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "" } + ]; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + + EXPECT_THAT(resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("test.Foo.required_field"), + HasSubstr("required field")))); +} + +TEST_F(FeatureResolverPoolTest, RegisterExtensionWithRepeated) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + message Foo { + repeated int32 repeated_field = 1 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "1" } + ]; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + + EXPECT_THAT(resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("test.Foo.repeated_field"), + HasSubstr("repeated field")))); +} + +TEST_F(FeatureResolverPoolTest, RegisterExtensionWithMissingTarget) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + message Foo { + optional int32 int_field = 1 [ + edition_defaults = { edition: "2023", value: "1" } + ]; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + + EXPECT_THAT(resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("test.Foo.int_field"), + HasSubstr("no target specified")))); +} + +TEST_F(FeatureResolverPoolTest, RegisterExtensionDefaultsMessageParsingError) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + message Foo { + message MessageFeature { + optional int32 int_field = 1; + } + optional MessageFeature message_field_feature = 12 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "9987" } + ]; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + EXPECT_THAT( + resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("in edition_defaults"), HasSubstr("9987")))); +} + +TEST_F(FeatureResolverPoolTest, + RegisterExtensionDefaultsMessageParsingErrorMerged) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + message Foo { + message MessageFeature { + optional int32 int_field = 1; + } + optional MessageFeature message_field_feature = 12 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2025", value: "int_field: 2" }, + edition_defaults = { edition: "2024", value: "int_field: 1" }, + edition_defaults = { edition: "2023", value: "9987" } + ]; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2024", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + EXPECT_THAT( + resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("in edition_defaults"), HasSubstr("9987")))); +} + +TEST_F(FeatureResolverPoolTest, + RegisterExtensionDefaultsMessageParsingErrorSkipped) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + message Foo { + message MessageFeature { + optional int32 int_field = 1; + } + optional MessageFeature message_field_feature = 12 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2024", value: "int_field: 2" }, + edition_defaults = { edition: "2023", value: "int_field: 1" }, + edition_defaults = { edition: "2025", value: "9987" } + ]; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2024", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + EXPECT_OK(resolver->RegisterExtensions(*file)); + FeatureSet parent, child; + EXPECT_OK(resolver->MergeFeatures(parent, child)); +} + +TEST_F(FeatureResolverPoolTest, RegisterExtensionDefaultsScalarParsingError) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + message Foo { + optional int32 int_field_feature = 12 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "1.23" } + ]; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + EXPECT_THAT( + resolver->RegisterExtensions(*file), + HasError(AllOf(HasSubstr("in edition_defaults"), HasSubstr("1.23")))); +} + +TEST_F(FeatureResolverPoolTest, + RegisterExtensionDefaultsScalarParsingErrorSkipped) { + const FileDescriptor* file = ParseSchema(R"schema( + syntax = "proto2"; + package test; + import "google/protobuf/descriptor.proto"; + + extend google.protobuf.FeatureSet { + optional Foo bar = 9999; + } + message Foo { + optional int32 int_field_feature = 12 [ + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2024", value: "1.5" }, + edition_defaults = { edition: "2023", value: "1" } + ]; + } + )schema"); + ASSERT_NE(file, nullptr); + + auto resolver = FeatureResolver::Create( + "2023", pool_.FindMessageTypeByName("google.protobuf.FeatureSet")); + ASSERT_OK(resolver); + EXPECT_OK(resolver->RegisterExtensions(*file)); + FeatureSet parent, child; + EXPECT_OK(resolver->MergeFeatures(parent, child)); +} + +} // namespace +} // namespace protobuf +} // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 4e96c5b9c3..8004570b4e 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -224,6 +224,10 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and static_assert(PROTOBUF_ABSL_MIN(20230125, 3), "Protobuf only supports Abseil version 20230125.3 and newer."); +// Enable editions infrastructure by default. This should be a no-op without +// the --experimental_editions protoc flag. +#define PROTOBUF_FUTURE_EDITIONS 1 + // Future versions of protobuf will include breaking changes to some APIs. // This macro can be set to enable these API changes ahead of time, so that // user code can be updated before upgrading versions of protobuf. @@ -242,10 +246,6 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), // Owner: ezb@ #define PROTOBUF_FUTURE_REMOVE_CONST_REPEATEDFIELD_GETARENA_API 1 -// Used to remove Protobuf editions feature. -// Owner: mkruskal@ -#define PROTOBUF_FUTURE_EDITIONS 1 - // Used to make ExtensionRange into a fully-fledged descriptor class. // Owner: mkruskal@ #define PROTOBUF_FUTURE_EXTENSION_RANGE_CLASS 1 diff --git a/src/google/protobuf/unittest_features.proto b/src/google/protobuf/unittest_features.proto new file mode 100644 index 0000000000..79ac22e951 --- /dev/null +++ b/src/google/protobuf/unittest_features.proto @@ -0,0 +1,167 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 pb; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.FeatureSet { + optional TestFeatures test = 9999; +} + +message TestMessage { + extend google.protobuf.FeatureSet { + optional TestFeatures test_message = 9998; + } + message Nested { + extend google.protobuf.FeatureSet { + optional TestFeatures test_nested = 9997; + } + } +} + +message TestFeatures { + optional int32 int_file_feature = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: "2025", value: "5" }, + edition_defaults = { edition: "2023.1.2", value: "3" }, + edition_defaults = { edition: "2023", value: "1" }, + edition_defaults = { edition: "2023.1", value: "2" }, + edition_defaults = { edition: "2024", value: "4" } + ]; + optional int32 int_extension_range_feature = 2 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_EXTENSION_RANGE, + edition_defaults = { edition: "2023", value: "1" } + ]; + optional int32 int_message_feature = 3 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_MESSAGE, + edition_defaults = { edition: "2023", value: "1" } + ]; + optional int32 int_field_feature = 4 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "1" } + ]; + optional int32 int_oneof_feature = 5 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ONEOF, + edition_defaults = { edition: "2023", value: "1" } + ]; + optional int32 int_enum_feature = 6 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM, + edition_defaults = { edition: "2023", value: "1" } + ]; + optional int32 int_enum_entry_feature = 7 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM_ENTRY, + edition_defaults = { edition: "2023", value: "1" } + ]; + optional int32 int_service_feature = 8 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_SERVICE, + edition_defaults = { edition: "2023", value: "1" } + ]; + optional int32 int_method_feature = 9 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_METHOD, + edition_defaults = { edition: "2023", value: "1" } + ]; + optional int32 int_multiple_feature = 10 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FILE, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_ENUM_ENTRY, + targets = TARGET_TYPE_SERVICE, + targets = TARGET_TYPE_METHOD, + targets = TARGET_TYPE_ONEOF, + targets = TARGET_TYPE_EXTENSION_RANGE, + edition_defaults = { edition: "2023", value: "1" } + ]; + + optional bool bool_field_feature = 11 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "false" }, + edition_defaults = { edition: "2023.1", value: "true" } + ]; + optional float float_field_feature = 12 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023", value: "1.1" }, + edition_defaults = { edition: "2023.1", value: "1.2" } + ]; + + message MessageFeature { + optional bool bool_field = 1; + optional int32 int_field = 2; + optional float float_field = 3; + optional string string_field = 4; + } + optional MessageFeature message_field_feature = 13 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023.1", value: "int_field: 2" }, + edition_defaults = { edition: "2024", value: "string_field: '2024'" }, + edition_defaults = { + edition: "2023", + value: "bool_field: true int_field: 1 float_field: 1.5 string_field: '2023'" + }, + edition_defaults = { + edition: "2025", + value: "int_field: 4 string_field: '2025'" + } + ]; + + enum EnumFeature { + TEST_ENUM_FEATURE_UNKNOWN = 0; + ENUM_VALUE1 = 1; + ENUM_VALUE2 = 2; + ENUM_VALUE3 = 3; + ENUM_VALUE4 = 4; + ENUM_VALUE5 = 5; + } + optional EnumFeature enum_field_feature = 14 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + edition_defaults = { edition: "2023.10", value: "ENUM_VALUE3" }, + edition_defaults = { edition: "2023.9", value: "ENUM_VALUE2" }, + edition_defaults = { edition: "2025", value: "ENUM_VALUE5" }, + edition_defaults = { edition: "2023", value: "ENUM_VALUE1" }, + edition_defaults = { edition: "2024", value: "ENUM_VALUE4" } + ]; +} diff --git a/src/google/protobuf/unittest_invalid_features.proto b/src/google/protobuf/unittest_invalid_features.proto new file mode 100644 index 0000000000..d19c8c4388 --- /dev/null +++ b/src/google/protobuf/unittest_invalid_features.proto @@ -0,0 +1,41 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 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 pb; + +import "google/protobuf/descriptor.proto"; + +message TestInvalid { + extend .google.protobuf.FeatureSet { + optional string scalar_extension = 9996; + } +} diff --git a/src/libprotobuf-lite.map b/src/libprotobuf-lite.map index a1853ca6cb..6f3a36e481 100644 --- a/src/libprotobuf-lite.map +++ b/src/libprotobuf-lite.map @@ -2,6 +2,7 @@ global: extern "C++" { *google*; + pb::*; }; scc_info_*; descriptor_table_*; diff --git a/src/libprotobuf.map b/src/libprotobuf.map index a1853ca6cb..6f3a36e481 100644 --- a/src/libprotobuf.map +++ b/src/libprotobuf.map @@ -2,6 +2,7 @@ global: extern "C++" { *google*; + pb::*; }; scc_info_*; descriptor_table_*; diff --git a/src/libprotoc.map b/src/libprotoc.map index a1853ca6cb..6f3a36e481 100644 --- a/src/libprotoc.map +++ b/src/libprotoc.map @@ -2,6 +2,7 @@ global: extern "C++" { *google*; + pb::*; }; scc_info_*; descriptor_table_*;