42 GPBFieldRequired = 1 << 0,
43 GPBFieldRepeated = 1 << 1,
44 GPBFieldPacked = 1 << 2,
45 GPBFieldOptional = 1 << 3,
46 GPBFieldHasDefaultValue = 1 << 4,
51 GPBFieldClearHasIvarOnZero = 1 << 5,
54 GPBFieldTextFormatNameCustom = 1 << 6,
56 GPBFieldHasEnumDescriptor = 1 << 7,
63 GPBFieldMapKeyMask = 0xF << 8,
64 GPBFieldMapKeyInt32 = 1 << 8,
65 GPBFieldMapKeyInt64 = 2 << 8,
66 GPBFieldMapKeyUInt32 = 3 << 8,
67 GPBFieldMapKeyUInt64 = 4 << 8,
68 GPBFieldMapKeySInt32 = 5 << 8,
69 GPBFieldMapKeySInt64 = 6 << 8,
70 GPBFieldMapKeyFixed32 = 7 << 8,
71 GPBFieldMapKeyFixed64 = 8 << 8,
72 GPBFieldMapKeySFixed32 = 9 << 8,
73 GPBFieldMapKeySFixed64 = 10 << 8,
74 GPBFieldMapKeyBool = 11 << 8,
75 GPBFieldMapKeyString = 12 << 8,
123 GPBExtensionNone = 0,
125 GPBExtensionRepeated = 1 << 0,
126 GPBExtensionPacked = 1 << 1,
127 GPBExtensionSetWireFormat = 1 << 2,
164 GPBDescriptorInitializationFlag_None = 0,
165 GPBDescriptorInitializationFlag_FieldsWithDefault = 1 << 0,
166 GPBDescriptorInitializationFlag_WireFormat = 1 << 1,
171 GPBDescriptorInitializationFlag_UsesClassRefs = 1 << 2,
177 GPBDescriptorInitializationFlag_Proto3OptionalKnown = 1 << 3,
189 allocDescriptorForClass:(Class)messageClass
190 rootClass:(Class)rootClass
192 fields:(
void *)fieldDescriptions
195 flags:(GPBDescriptorInitializationFlags)flags;
197 - (instancetype)initWithClass:(Class)messageClass
199 fields:(NSArray *)fields
201 wireFormat:(
BOOL)wireFormat;
206 - (void)setupOneofs:(
const char **)oneofNames
208 firstHasIndex:(
int32_t)firstHasIndex;
209 - (void)setupExtraTextInfo:(
const char *)extraTextFormatInfo;
211 - (void)setupContainingMessageClass:(Class)msgClass;
212 - (void)setupMessageClassNameSuffix:(NSString *)suffix;
215 - (void)setupContainingMessageClassName:(
const char *)msgClassName;
221 objcPrefix:(NSString *)objcPrefix
222 syntax:(GPBFileSyntax)syntax;
224 syntax:(GPBFileSyntax)syntax;
234 - (instancetype)initWithName:(
const char *)name fields:(NSArray *)fields;
239 GPBMessageFieldDescription *description_;
250 - (instancetype)initWithFieldDescription:(
void *)description
251 includesDefault:(
BOOL)includesDefault
252 usesClassRefs:(
BOOL)usesClassRefs
253 proto3OptionalKnown:(
BOOL)proto3OptionalKnown
254 syntax:(GPBFileSyntax)syntax;
262 allocDescriptorForName:(NSString *)name
263 valueNames:(
const char *)valueNames
268 allocDescriptorForName:(NSString *)name
269 valueNames:(
const char *)valueNames
273 extraTextFormatInfo:(
const char *)extraTextFormatInfo;
275 - (instancetype)initWithName:(NSString *)name
276 valueNames:(
const char *)valueNames
284 GPBExtensionDescription *description_;
292 @property(nonatomic, readonly)
GPBWireFormat alternateWireType;
296 usesClassRefs:(
BOOL)usesClassRefs;
308 #pragma clang diagnostic push
309 #pragma clang diagnostic ignored "-Wdirect-ivar-access"
312 return (
field->description_->flags &
313 (GPBFieldRepeated | GPBFieldMapKeyMask)) != 0;
317 return field->description_->dataType;
321 return field->description_->hasIndex;
325 return field->description_->number;
328 #pragma clang diagnostic pop
339 return syntax == GPBFileSyntaxProto3;
343 return (
description->options & GPBExtensionRepeated) != 0;
347 return (
description->options & GPBExtensionPacked) != 0;
351 return (
description->options & GPBExtensionSetWireFormat) != 0;
355 #ifndef GPBInternalCompileAssert
356 #if __has_feature(c_static_assert) || __has_extension(c_static_assert)
357 #define GPBInternalCompileAssert(test, msg) _Static_assert((test), #msg)
360 #define GPBInternalCompileAssertSymbolInner(line, msg) GPBInternalCompileAssert ## line ## __ ## msg
361 #define GPBInternalCompileAssertSymbol(line, msg) GPBInternalCompileAssertSymbolInner(line, msg)
362 #define GPBInternalCompileAssert(test, msg) \
363 typedef char GPBInternalCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ]
364 #endif // __has_feature(c_static_assert) || __has_extension(c_static_assert)
365 #endif // GPBInternalCompileAssert
372 DescriptionsWithDefault_different_size_than_expected);