-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Expand file tree
/
Copy pathcpp_features.proto
More file actions
87 lines (77 loc) · 2.75 KB
/
cpp_features.proto
File metadata and controls
87 lines (77 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Protocol Buffers - Google's data interchange format
// Copyright 2023 Google LLC. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
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,
feature_support = {
edition_introduced: EDITION_2023,
edition_deprecated: EDITION_2023,
deprecation_warning: "The legacy closed enum behavior in C++ is "
"deprecated and is scheduled to be removed in "
"edition 2025. See http://protobuf.dev/programming-guides/enum/#cpp for "
"more information",
},
edition_defaults = { edition: EDITION_LEGACY, value: "true" },
edition_defaults = { edition: EDITION_PROTO3, value: "false" }
];
enum StringType {
STRING_TYPE_UNKNOWN = 0;
VIEW = 1;
CORD = 2;
STRING = 3;
}
optional StringType string_type = 2 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
feature_support = {
edition_introduced: EDITION_2023,
},
edition_defaults = { edition: EDITION_LEGACY, value: "STRING" },
edition_defaults = { edition: EDITION_2024, value: "VIEW" }
];
optional bool enum_name_uses_string_view = 3 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE,
feature_support = {
edition_introduced: EDITION_2024,
},
edition_defaults = { edition: EDITION_LEGACY, value: "false" },
edition_defaults = { edition: EDITION_2024, value: "true" }
];
enum RepeatedType {
REPEATED_TYPE_UNKNOWN = 0;
// The repeated field will be backed by proto2::Repeated(Ptr)Field, and
// accessors will return a reference/pointer to this type.
LEGACY = 1;
// The repeated field has an opaque backing type, and accessors will return
// a RepeatedFieldProxy.
PROXY = 2;
}
optional RepeatedType repeated_type = 4 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
feature_support = {
edition_introduced: EDITION_UNSTABLE,
},
edition_defaults = { edition: EDITION_LEGACY, value: "LEGACY" }
];
}