Skip to content

Commit a85eda6

Browse files
mkruskal-googlecopybara-github
authored andcommitted
Provide proto3 optional APIs in visibility-scoped wrapper.
These will be made private in a later change. PiperOrigin-RevId: 516402763
1 parent f9af05b commit a85eda6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/google/protobuf/descriptor_legacy.h

+20
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,26 @@ class PROTOBUF_EXPORT FileDescriptorLegacy {
8484
const FileDescriptor* desc_;
8585
};
8686

87+
class PROTOBUF_EXPORT FieldDescriptorLegacy {
88+
public:
89+
explicit FieldDescriptorLegacy(const FieldDescriptor* desc) : desc_(desc) {}
90+
91+
bool has_optional_keyword() const { return desc_->has_optional_keyword(); }
92+
93+
private:
94+
const FieldDescriptor* desc_;
95+
};
96+
97+
class PROTOBUF_EXPORT OneofDescriptorLegacy {
98+
public:
99+
explicit OneofDescriptorLegacy(const OneofDescriptor* desc) : desc_(desc) {}
100+
101+
bool is_synthetic() const { return desc_->is_synthetic(); }
102+
103+
private:
104+
const OneofDescriptor* desc_;
105+
};
106+
87107
} // namespace protobuf
88108
} // namespace google
89109

0 commit comments

Comments
 (0)