Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/google/protobuf/cpp_features.proto is written in an unsupported language. File is not indexed.

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2023 Google Inc.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 syntax = "proto2";
0009 
0010 package pb;
0011 
0012 import "google/protobuf/descriptor.proto";
0013 
0014 extend google.protobuf.FeatureSet {
0015   optional CppFeatures cpp = 1000;
0016 }
0017 
0018 message CppFeatures {
0019   // Whether or not to treat an enum field as closed.  This option is only
0020   // applicable to enum fields, and will be removed in the future.  It is
0021   // consistent with the legacy behavior of using proto3 enum types for proto2
0022   // fields.
0023   optional bool legacy_closed_enum = 1 [
0024     retention = RETENTION_RUNTIME,
0025     targets = TARGET_TYPE_FIELD,
0026     targets = TARGET_TYPE_FILE,
0027     feature_support = {
0028       edition_introduced: EDITION_2023,
0029       edition_deprecated: EDITION_2023,
0030       deprecation_warning: "The legacy closed enum treatment in C++ is "
0031                            "deprecated and is scheduled to be removed in "
0032                            "edition 2025.  Mark enum type on the enum "
0033                            "definitions themselves rather than on fields.",
0034     },
0035     edition_defaults = { edition: EDITION_LEGACY, value: "true" },
0036     edition_defaults = { edition: EDITION_PROTO3, value: "false" }
0037   ];
0038 
0039   enum StringType {
0040     STRING_TYPE_UNKNOWN = 0;
0041     VIEW = 1;
0042     CORD = 2;
0043     STRING = 3;
0044   }
0045 
0046   optional StringType string_type = 2 [
0047     retention = RETENTION_RUNTIME,
0048     targets = TARGET_TYPE_FIELD,
0049     targets = TARGET_TYPE_FILE,
0050     feature_support = {
0051       edition_introduced: EDITION_2023,
0052     },
0053     edition_defaults = { edition: EDITION_LEGACY, value: "STRING" },
0054     edition_defaults = { edition: EDITION_2024, value: "VIEW" }
0055   ];
0056 }