Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:12:01

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 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 #ifndef GOOGLE_PROTOBUF_COMPILER_RETENTION_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_RETENTION_H__
0010 
0011 #include "google/protobuf/descriptor.h"
0012 #include "google/protobuf/descriptor.pb.h"
0013 
0014 // Must appear last
0015 #include "google/protobuf/port_def.inc"
0016 
0017 namespace google {
0018 namespace protobuf {
0019 namespace compiler {
0020 
0021 // Returns a FileDescriptorProto for this file, with all RETENTION_SOURCE
0022 // options stripped out. If include_source_code_info is true, this function
0023 // will also populate the source code info but strip out the parts of it
0024 // corresponding to source-retention options.
0025 PROTOC_EXPORT FileDescriptorProto StripSourceRetentionOptions(
0026     const FileDescriptor& file, bool include_source_code_info = false);
0027 PROTOC_EXPORT void StripSourceRetentionOptions(const DescriptorPool& pool,
0028                                                FileDescriptorProto& file_proto);
0029 PROTOC_EXPORT DescriptorProto
0030 StripSourceRetentionOptions(const Descriptor& message);
0031 PROTOC_EXPORT DescriptorProto::ExtensionRange StripSourceRetentionOptions(
0032     const Descriptor& message, const Descriptor::ExtensionRange& range);
0033 PROTOC_EXPORT EnumDescriptorProto
0034 StripSourceRetentionOptions(const EnumDescriptor& enm);
0035 PROTOC_EXPORT FieldDescriptorProto
0036 StripSourceRetentionOptions(const FieldDescriptor& field);
0037 PROTOC_EXPORT OneofDescriptorProto
0038 StripSourceRetentionOptions(const OneofDescriptor& oneof);
0039 
0040 // The following functions take a descriptor and strip all source-retention
0041 // options from just the local entity (e.g. message, enum, field). Most code
0042 // generators should not need these functions, but they are sometimes useful if
0043 // you need to strip the options on a single entity rather than handling the
0044 // entire file at once.
0045 PROTOC_EXPORT EnumOptions
0046 StripLocalSourceRetentionOptions(const EnumDescriptor& descriptor);
0047 PROTOC_EXPORT EnumValueOptions
0048 StripLocalSourceRetentionOptions(const EnumValueDescriptor& descriptor);
0049 PROTOC_EXPORT FieldOptions
0050 StripLocalSourceRetentionOptions(const FieldDescriptor& descriptor);
0051 PROTOC_EXPORT FileOptions
0052 StripLocalSourceRetentionOptions(const FileDescriptor& descriptor);
0053 PROTOC_EXPORT MessageOptions
0054 StripLocalSourceRetentionOptions(const Descriptor& descriptor);
0055 PROTOC_EXPORT ExtensionRangeOptions StripLocalSourceRetentionOptions(
0056     const Descriptor& descriptor, const Descriptor::ExtensionRange& range);
0057 PROTOC_EXPORT MethodOptions
0058 StripLocalSourceRetentionOptions(const MethodDescriptor& descriptor);
0059 PROTOC_EXPORT OneofOptions
0060 StripLocalSourceRetentionOptions(const OneofDescriptor& descriptor);
0061 PROTOC_EXPORT ServiceOptions
0062 StripLocalSourceRetentionOptions(const ServiceDescriptor& descriptor);
0063 
0064 }  // namespace compiler
0065 }  // namespace protobuf
0066 }  // namespace google
0067 
0068 #include "google/protobuf/port_undef.inc"
0069 
0070 #endif  // GOOGLE_PROTOBUF_COMPILER_RETENTION_H__