protobuf/objectivec/GPBDescriptor.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 #import <Foundation/Foundation.h>
32 
33 #import "GPBRuntimeTypes.h"
34 
35 @class GPBEnumDescriptor;
36 @class GPBFieldDescriptor;
37 @class GPBFileDescriptor;
38 @class GPBOneofDescriptor;
39 
40 NS_ASSUME_NONNULL_BEGIN
41 
43 typedef NS_ENUM(uint8_t, GPBFileSyntax) {
45  GPBFileSyntaxUnknown = 0,
47  GPBFileSyntaxProto2 = 2,
49  GPBFileSyntaxProto3 = 3,
50 };
51 
53 typedef NS_ENUM(uint8_t, GPBFieldType) {
55  GPBFieldTypeSingle,
57  GPBFieldTypeRepeated,
59  GPBFieldTypeMap,
60 };
61 
65 @interface GPBDescriptor : NSObject<NSCopying>
66 
68 @property(nonatomic, readonly, copy) NSString *name;
70 @property(nonatomic, readonly, strong, nullable) NSArray<GPBFieldDescriptor*> *fields;
72 @property(nonatomic, readonly, strong, nullable) NSArray<GPBOneofDescriptor*> *oneofs;
74 @property(nonatomic, readonly, nullable) const GPBExtensionRange *extensionRanges;
76 @property(nonatomic, readonly) uint32_t extensionRangesCount;
78 @property(nonatomic, readonly) GPBFileDescriptor *file;
79 
81 @property(nonatomic, readonly, getter=isWireFormat) BOOL wireFormat;
83 @property(nonatomic, readonly) Class messageClass;
85 @property(readonly, nullable) GPBDescriptor *containingType;
90 @property(readonly, nullable) NSString *fullName;
91 
99 - (nullable GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber;
100 
108 - (nullable GPBFieldDescriptor *)fieldWithName:(NSString *)name;
109 
117 - (nullable GPBOneofDescriptor *)oneofWithName:(NSString *)name;
118 
119 @end
120 
124 @interface GPBFileDescriptor : NSObject
125 
127 @property(nonatomic, readonly, copy) NSString *package;
129 @property(nonatomic, readonly, copy, nullable) NSString *objcPrefix;
131 @property(nonatomic, readonly) GPBFileSyntax syntax;
132 
133 @end
134 
138 @interface GPBOneofDescriptor : NSObject
140 @property(nonatomic, readonly) NSString *name;
142 @property(nonatomic, readonly) NSArray<GPBFieldDescriptor*> *fields;
143 
151 - (nullable GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber;
152 
160 - (nullable GPBFieldDescriptor *)fieldWithName:(NSString *)name;
161 
162 @end
163 
167 @interface GPBFieldDescriptor : NSObject
168 
170 @property(nonatomic, readonly, copy) NSString *name;
172 @property(nonatomic, readonly) uint32_t number;
174 @property(nonatomic, readonly) GPBDataType dataType;
176 @property(nonatomic, readonly) BOOL hasDefaultValue;
178 @property(nonatomic, readonly) GPBGenericValue defaultValue;
180 @property(nonatomic, readonly, getter=isRequired) BOOL required;
182 @property(nonatomic, readonly, getter=isOptional) BOOL optional;
184 @property(nonatomic, readonly) GPBFieldType fieldType;
186 @property(nonatomic, readonly) GPBDataType mapKeyDataType;
188 @property(nonatomic, readonly, getter=isPackable) BOOL packable;
189 
191 @property(nonatomic, readonly, nullable) GPBOneofDescriptor *containingOneof;
192 
194 @property(nonatomic, readonly, nullable) Class msgClass;
195 
197 @property(nonatomic, readonly, strong, nullable) GPBEnumDescriptor *enumDescriptor;
198 
206 - (BOOL)isValidEnumValue:(int32_t)value;
207 
209 - (nullable NSString *)textFormatName;
210 
211 @end
212 
216 @interface GPBEnumDescriptor : NSObject
217 
219 @property(nonatomic, readonly, copy) NSString *name;
221 @property(nonatomic, readonly) GPBEnumValidationFunc enumVerifier;
222 
233 - (nullable NSString *)enumNameForValue:(int32_t)number;
234 
243 - (BOOL)getValue:(nullable int32_t *)outValue forEnumName:(NSString *)name;
244 
252 - (nullable NSString *)textFormatNameForValue:(int32_t)number;
253 
262 - (BOOL)getValue:(nullable int32_t *)outValue forEnumTextFormatName:(NSString *)textFormatName;
263 
269 @property(nonatomic, readonly) uint32_t enumNameCount;
270 
279 - (nullable NSString *)getEnumNameForIndex:(uint32_t)index;
280 
289 - (nullable NSString *)getEnumTextFormatNameForIndex:(uint32_t)index;
290 
291 @end
292 
296 @interface GPBExtensionDescriptor : NSObject<NSCopying>
298 @property(nonatomic, readonly) uint32_t fieldNumber;
300 @property(nonatomic, readonly) Class containingMessageClass;
302 @property(nonatomic, readonly) GPBDataType dataType;
304 @property(nonatomic, readonly, getter=isRepeated) BOOL repeated;
306 @property(nonatomic, readonly, getter=isPackable) BOOL packable;
308 @property(nonatomic, readonly) Class msgClass;
310 @property(nonatomic, readonly) NSString *singletonName;
312 @property(nonatomic, readonly, strong, nullable) GPBEnumDescriptor *enumDescriptor;
314 @property(nonatomic, readonly, nullable) id defaultValue;
315 
316 @end
317 
318 NS_ASSUME_NONNULL_END
GPBDescriptor::oneofs
NSArray< GPBOneofDescriptor * > * oneofs
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:72
GPBOneofDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:138
GPBFileDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:124
copy
static int copy(grpc_slice_buffer *input, grpc_slice_buffer *output)
Definition: message_compress.cc:145
GPBRuntimeTypes.h
file
Definition: bloaty/third_party/zlib/examples/gzappend.c:170
GPBDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:65
GPBDescriptor::fields
NSArray< GPBFieldDescriptor * > * fields
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:70
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
GPBDescriptor::extensionRangesCount
uint32_t extensionRangesCount
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:76
GPBDescriptor::name
NSString * name
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:68
GPBDescriptor::extensionRanges
const GPBExtensionRange * extensionRanges
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:74
BOOL
int BOOL
Definition: undname.c:46
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
benchmark.syntax
syntax
Definition: benchmark.py:90
number
int32_t number
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:850
performance.bq_upload_result.required
required
Definition: bq_upload_result.py:299
GPBExtensionRange
Definition: bloaty/third_party/protobuf/objectivec/GPBRuntimeTypes.h:139
GPBDescriptor::messageClass
Class messageClass
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:83
GPBFieldDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:167
NS_ENUM
NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(uint8_t, GPBFileSyntax)
Definition: protobuf/objectivec/GPBDescriptor.h:43
GPBExtensionDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:296
GPBEnumValidationFunc
BOOL(* GPBEnumValidationFunc)(int32_t)
Definition: bloaty/third_party/protobuf/objectivec/GPBRuntimeTypes.h:42
GPBDescriptor::wireFormat
BOOL wireFormat
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:81
GPBDescriptor::containingType
GPBDescriptor * containingType
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:85
GPBDescriptor::fullName
NSString * fullName
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:90
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
GPBGenericValue
Definition: bloaty/third_party/protobuf/objectivec/GPBRuntimeTypes.h:61
repeated
static grpc_slice repeated(char c, size_t length)
Definition: message_compress_test.cc:109
GPBEnumDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:216


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:45