2015-05-21 21:14:52 +00:00
|
|
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
|
|
// source: google/protobuf/type.proto
|
|
|
|
|
2016-05-09 17:53:20 +00:00
|
|
|
// This CPP symbol can be defined to use imports that match up to the framework
|
|
|
|
// imports needed when using CocoaPods.
|
|
|
|
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
|
|
|
|
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
|
2020-01-22 20:50:52 +00:00
|
|
|
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
|
2016-05-09 17:53:20 +00:00
|
|
|
#else
|
|
|
|
#import "GPBProtocolBuffers_RuntimeSupport.h"
|
|
|
|
#endif
|
|
|
|
|
2018-01-23 18:38:28 +00:00
|
|
|
#import <stdatomic.h>
|
|
|
|
|
2016-05-09 17:53:20 +00:00
|
|
|
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
|
2020-01-22 20:50:52 +00:00
|
|
|
#import <Protobuf/GPBType.pbobjc.h>
|
|
|
|
#import <Protobuf/GPBAny.pbobjc.h>
|
|
|
|
#import <Protobuf/GPBSourceContext.pbobjc.h>
|
2016-05-09 17:53:20 +00:00
|
|
|
#else
|
2020-01-22 20:50:52 +00:00
|
|
|
#import "GPBType.pbobjc.h"
|
|
|
|
#import "GPBAny.pbobjc.h"
|
|
|
|
#import "GPBSourceContext.pbobjc.h"
|
2016-05-09 17:53:20 +00:00
|
|
|
#endif
|
2015-05-21 21:14:52 +00:00
|
|
|
// @@protoc_insertion_point(imports)
|
|
|
|
|
2016-04-19 17:13:04 +00:00
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
2019-12-18 01:32:09 +00:00
|
|
|
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
|
|
|
|
|
2020-01-20 01:46:35 +00:00
|
|
|
#pragma mark - Objective C Class declarations
|
|
|
|
// Forward declarations of Objective C classes that we can use as
|
|
|
|
// static values in struct initializers.
|
|
|
|
// We don't use [Foo class] because it is not a static value.
|
|
|
|
GPBObjCClassDeclaration(GPBAny);
|
|
|
|
GPBObjCClassDeclaration(GPBEnumValue);
|
|
|
|
GPBObjCClassDeclaration(GPBField);
|
|
|
|
GPBObjCClassDeclaration(GPBOption);
|
|
|
|
GPBObjCClassDeclaration(GPBSourceContext);
|
2016-04-19 17:13:04 +00:00
|
|
|
|
2015-05-21 21:14:52 +00:00
|
|
|
#pragma mark - GPBTypeRoot
|
|
|
|
|
|
|
|
@implementation GPBTypeRoot
|
|
|
|
|
2016-09-01 15:45:50 +00:00
|
|
|
// No extensions in the file and none of the imports (direct or indirect)
|
|
|
|
// defined extensions, so no need to generate +extensionRegistry.
|
2015-05-21 21:14:52 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2015-06-08 20:24:57 +00:00
|
|
|
#pragma mark - GPBTypeRoot_FileDescriptor
|
|
|
|
|
2015-05-21 21:14:52 +00:00
|
|
|
static GPBFileDescriptor *GPBTypeRoot_FileDescriptor(void) {
|
|
|
|
// This is called by +initialize so there is no need to worry
|
|
|
|
// about thread safety of the singleton.
|
|
|
|
static GPBFileDescriptor *descriptor = NULL;
|
|
|
|
if (!descriptor) {
|
2016-09-15 17:27:17 +00:00
|
|
|
GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
|
2015-05-21 21:14:52 +00:00
|
|
|
descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf"
|
2016-08-16 15:26:49 +00:00
|
|
|
objcPrefix:@"GPB"
|
2015-05-21 21:14:52 +00:00
|
|
|
syntax:GPBFileSyntaxProto3];
|
|
|
|
}
|
|
|
|
return descriptor;
|
|
|
|
}
|
|
|
|
|
2015-08-26 21:02:44 +00:00
|
|
|
#pragma mark - Enum GPBSyntax
|
|
|
|
|
|
|
|
GPBEnumDescriptor *GPBSyntax_EnumDescriptor(void) {
|
2018-01-31 18:58:11 +00:00
|
|
|
static _Atomic(GPBEnumDescriptor*) descriptor = nil;
|
2015-08-26 21:02:44 +00:00
|
|
|
if (!descriptor) {
|
2016-03-17 14:04:21 +00:00
|
|
|
static const char *valueNames =
|
|
|
|
"SyntaxProto2\000SyntaxProto3\000";
|
|
|
|
static const int32_t values[] = {
|
|
|
|
GPBSyntax_SyntaxProto2,
|
|
|
|
GPBSyntax_SyntaxProto3,
|
2015-08-26 21:02:44 +00:00
|
|
|
};
|
2016-03-17 14:04:21 +00:00
|
|
|
GPBEnumDescriptor *worker =
|
|
|
|
[GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBSyntax)
|
|
|
|
valueNames:valueNames
|
|
|
|
values:values
|
|
|
|
count:(uint32_t)(sizeof(values) / sizeof(int32_t))
|
|
|
|
enumVerifier:GPBSyntax_IsValidValue];
|
2018-01-22 21:26:39 +00:00
|
|
|
GPBEnumDescriptor *expected = nil;
|
|
|
|
if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
|
2016-03-17 14:04:21 +00:00
|
|
|
[worker release];
|
|
|
|
}
|
2015-08-26 21:02:44 +00:00
|
|
|
}
|
|
|
|
return descriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL GPBSyntax_IsValidValue(int32_t value__) {
|
|
|
|
switch (value__) {
|
|
|
|
case GPBSyntax_SyntaxProto2:
|
|
|
|
case GPBSyntax_SyntaxProto3:
|
|
|
|
return YES;
|
|
|
|
default:
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-21 21:14:52 +00:00
|
|
|
#pragma mark - GPBType
|
|
|
|
|
|
|
|
@implementation GPBType
|
|
|
|
|
|
|
|
@dynamic name;
|
2015-06-08 20:24:57 +00:00
|
|
|
@dynamic fieldsArray, fieldsArray_Count;
|
|
|
|
@dynamic oneofsArray, oneofsArray_Count;
|
|
|
|
@dynamic optionsArray, optionsArray_Count;
|
2015-05-21 21:14:52 +00:00
|
|
|
@dynamic hasSourceContext, sourceContext;
|
2015-08-26 21:02:44 +00:00
|
|
|
@dynamic syntax;
|
2015-05-21 21:14:52 +00:00
|
|
|
|
2015-06-08 20:24:57 +00:00
|
|
|
typedef struct GPBType__storage_ {
|
2015-05-21 21:14:52 +00:00
|
|
|
uint32_t _has_storage_[1];
|
2015-08-26 21:02:44 +00:00
|
|
|
GPBSyntax syntax;
|
2015-05-21 21:14:52 +00:00
|
|
|
NSString *name;
|
|
|
|
NSMutableArray *fieldsArray;
|
|
|
|
NSMutableArray *oneofsArray;
|
|
|
|
NSMutableArray *optionsArray;
|
|
|
|
GPBSourceContext *sourceContext;
|
2015-06-08 20:24:57 +00:00
|
|
|
} GPBType__storage_;
|
2015-05-21 21:14:52 +00:00
|
|
|
|
|
|
|
// This method is threadsafe because it is initially called
|
|
|
|
// in +initialize for each subclass.
|
|
|
|
+ (GPBDescriptor *)descriptor {
|
2015-06-08 20:24:57 +00:00
|
|
|
static GPBDescriptor *descriptor = nil;
|
2015-05-21 21:14:52 +00:00
|
|
|
if (!descriptor) {
|
|
|
|
static GPBMessageFieldDescription fields[] = {
|
|
|
|
{
|
|
|
|
.name = "name",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBType_FieldNumber_Name,
|
|
|
|
.hasIndex = 0,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBType__storage_, name),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeString,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "fieldsArray",
|
2020-01-20 01:46:35 +00:00
|
|
|
.dataTypeSpecific.clazz = GPBObjCClass(GPBField),
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBType_FieldNumber_FieldsArray,
|
|
|
|
.hasIndex = GPBNoHasBit,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBType__storage_, fieldsArray),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldRepeated,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeMessage,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "oneofsArray",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBType_FieldNumber_OneofsArray,
|
|
|
|
.hasIndex = GPBNoHasBit,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBType__storage_, oneofsArray),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldRepeated,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeString,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "optionsArray",
|
2020-01-20 01:46:35 +00:00
|
|
|
.dataTypeSpecific.clazz = GPBObjCClass(GPBOption),
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBType_FieldNumber_OptionsArray,
|
|
|
|
.hasIndex = GPBNoHasBit,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBType__storage_, optionsArray),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldRepeated,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeMessage,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "sourceContext",
|
2020-01-20 01:46:35 +00:00
|
|
|
.dataTypeSpecific.clazz = GPBObjCClass(GPBSourceContext),
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBType_FieldNumber_SourceContext,
|
2016-03-17 14:04:21 +00:00
|
|
|
.hasIndex = 1,
|
|
|
|
.offset = (uint32_t)offsetof(GPBType__storage_, sourceContext),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldOptional,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeMessage,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
2015-08-26 21:02:44 +00:00
|
|
|
{
|
|
|
|
.name = "syntax",
|
2016-03-17 14:04:21 +00:00
|
|
|
.dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor,
|
2015-08-26 21:02:44 +00:00
|
|
|
.number = GPBType_FieldNumber_Syntax,
|
2016-03-17 14:04:21 +00:00
|
|
|
.hasIndex = 2,
|
|
|
|
.offset = (uint32_t)offsetof(GPBType__storage_, syntax),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
|
2015-08-26 21:02:44 +00:00
|
|
|
.dataType = GPBDataTypeEnum,
|
|
|
|
},
|
2015-05-21 21:14:52 +00:00
|
|
|
};
|
2015-06-08 20:24:57 +00:00
|
|
|
GPBDescriptor *localDescriptor =
|
|
|
|
[GPBDescriptor allocDescriptorForClass:[GPBType class]
|
|
|
|
rootClass:[GPBTypeRoot class]
|
|
|
|
file:GPBTypeRoot_FileDescriptor()
|
|
|
|
fields:fields
|
2016-03-17 14:04:21 +00:00
|
|
|
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
|
2015-06-08 20:24:57 +00:00
|
|
|
storageSize:sizeof(GPBType__storage_)
|
2020-04-13 17:36:56 +00:00
|
|
|
flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
|
2018-12-12 00:32:48 +00:00
|
|
|
#if defined(DEBUG) && DEBUG
|
|
|
|
NSAssert(descriptor == nil, @"Startup recursed!");
|
|
|
|
#endif // DEBUG
|
2015-06-08 20:24:57 +00:00
|
|
|
descriptor = localDescriptor;
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
return descriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2015-08-26 21:02:44 +00:00
|
|
|
int32_t GPBType_Syntax_RawValue(GPBType *message) {
|
|
|
|
GPBDescriptor *descriptor = [GPBType descriptor];
|
|
|
|
GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBType_FieldNumber_Syntax];
|
2020-04-13 17:36:56 +00:00
|
|
|
return GPBGetMessageRawEnumField(message, field);
|
2015-08-26 21:02:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SetGPBType_Syntax_RawValue(GPBType *message, int32_t value) {
|
|
|
|
GPBDescriptor *descriptor = [GPBType descriptor];
|
|
|
|
GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBType_FieldNumber_Syntax];
|
2020-04-13 17:36:56 +00:00
|
|
|
GPBSetMessageRawEnumField(message, field, value);
|
2015-08-26 21:02:44 +00:00
|
|
|
}
|
|
|
|
|
2015-05-21 21:14:52 +00:00
|
|
|
#pragma mark - GPBField
|
|
|
|
|
|
|
|
@implementation GPBField
|
|
|
|
|
|
|
|
@dynamic kind;
|
|
|
|
@dynamic cardinality;
|
|
|
|
@dynamic number;
|
|
|
|
@dynamic name;
|
|
|
|
@dynamic typeURL;
|
|
|
|
@dynamic oneofIndex;
|
|
|
|
@dynamic packed;
|
2015-06-08 20:24:57 +00:00
|
|
|
@dynamic optionsArray, optionsArray_Count;
|
2015-08-26 21:02:44 +00:00
|
|
|
@dynamic jsonName;
|
2016-01-05 20:23:50 +00:00
|
|
|
@dynamic defaultValue;
|
2015-05-21 21:14:52 +00:00
|
|
|
|
2015-06-08 20:24:57 +00:00
|
|
|
typedef struct GPBField__storage_ {
|
2015-05-21 21:14:52 +00:00
|
|
|
uint32_t _has_storage_[1];
|
|
|
|
GPBField_Kind kind;
|
|
|
|
GPBField_Cardinality cardinality;
|
|
|
|
int32_t number;
|
|
|
|
int32_t oneofIndex;
|
|
|
|
NSString *name;
|
|
|
|
NSString *typeURL;
|
|
|
|
NSMutableArray *optionsArray;
|
2015-08-26 21:02:44 +00:00
|
|
|
NSString *jsonName;
|
2016-01-05 20:23:50 +00:00
|
|
|
NSString *defaultValue;
|
2015-06-08 20:24:57 +00:00
|
|
|
} GPBField__storage_;
|
2015-05-21 21:14:52 +00:00
|
|
|
|
|
|
|
// This method is threadsafe because it is initially called
|
|
|
|
// in +initialize for each subclass.
|
|
|
|
+ (GPBDescriptor *)descriptor {
|
2015-06-08 20:24:57 +00:00
|
|
|
static GPBDescriptor *descriptor = nil;
|
2015-05-21 21:14:52 +00:00
|
|
|
if (!descriptor) {
|
|
|
|
static GPBMessageFieldDescription fields[] = {
|
|
|
|
{
|
|
|
|
.name = "kind",
|
2016-03-17 14:04:21 +00:00
|
|
|
.dataTypeSpecific.enumDescFunc = GPBField_Kind_EnumDescriptor,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBField_FieldNumber_Kind,
|
|
|
|
.hasIndex = 0,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBField__storage_, kind),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeEnum,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "cardinality",
|
2016-03-17 14:04:21 +00:00
|
|
|
.dataTypeSpecific.enumDescFunc = GPBField_Cardinality_EnumDescriptor,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBField_FieldNumber_Cardinality,
|
|
|
|
.hasIndex = 1,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBField__storage_, cardinality),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeEnum,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "number",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBField_FieldNumber_Number,
|
|
|
|
.hasIndex = 2,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBField__storage_, number),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeInt32,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "name",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBField_FieldNumber_Name,
|
|
|
|
.hasIndex = 3,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBField__storage_, name),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeString,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "typeURL",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBField_FieldNumber_TypeURL,
|
|
|
|
.hasIndex = 4,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBField__storage_, typeURL),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeString,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "oneofIndex",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBField_FieldNumber_OneofIndex,
|
|
|
|
.hasIndex = 5,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBField__storage_, oneofIndex),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeInt32,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "packed",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBField_FieldNumber_Packed,
|
|
|
|
.hasIndex = 6,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = 7, // Stored in _has_storage_ to save space.
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeBool,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "optionsArray",
|
2020-01-20 01:46:35 +00:00
|
|
|
.dataTypeSpecific.clazz = GPBObjCClass(GPBOption),
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBField_FieldNumber_OptionsArray,
|
|
|
|
.hasIndex = GPBNoHasBit,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBField__storage_, optionsArray),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldRepeated,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeMessage,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
2015-08-26 21:02:44 +00:00
|
|
|
{
|
|
|
|
.name = "jsonName",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-08-26 21:02:44 +00:00
|
|
|
.number = GPBField_FieldNumber_JsonName,
|
|
|
|
.hasIndex = 8,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBField__storage_, jsonName),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-08-26 21:02:44 +00:00
|
|
|
.dataType = GPBDataTypeString,
|
|
|
|
},
|
2016-01-05 20:23:50 +00:00
|
|
|
{
|
|
|
|
.name = "defaultValue",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2016-01-05 20:23:50 +00:00
|
|
|
.number = GPBField_FieldNumber_DefaultValue,
|
|
|
|
.hasIndex = 9,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBField__storage_, defaultValue),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2016-01-05 20:23:50 +00:00
|
|
|
.dataType = GPBDataTypeString,
|
|
|
|
},
|
2015-05-21 21:14:52 +00:00
|
|
|
};
|
2015-06-08 20:24:57 +00:00
|
|
|
GPBDescriptor *localDescriptor =
|
|
|
|
[GPBDescriptor allocDescriptorForClass:[GPBField class]
|
|
|
|
rootClass:[GPBTypeRoot class]
|
|
|
|
file:GPBTypeRoot_FileDescriptor()
|
|
|
|
fields:fields
|
2016-03-17 14:04:21 +00:00
|
|
|
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
|
2015-06-08 20:24:57 +00:00
|
|
|
storageSize:sizeof(GPBField__storage_)
|
2020-04-13 17:36:56 +00:00
|
|
|
flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
|
2016-03-17 14:04:21 +00:00
|
|
|
#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
|
|
|
|
static const char *extraTextFormatInfo =
|
|
|
|
"\001\006\004\241!!\000";
|
|
|
|
[localDescriptor setupExtraTextInfo:extraTextFormatInfo];
|
|
|
|
#endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
|
2018-12-12 00:32:48 +00:00
|
|
|
#if defined(DEBUG) && DEBUG
|
|
|
|
NSAssert(descriptor == nil, @"Startup recursed!");
|
|
|
|
#endif // DEBUG
|
2015-06-08 20:24:57 +00:00
|
|
|
descriptor = localDescriptor;
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
return descriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
int32_t GPBField_Kind_RawValue(GPBField *message) {
|
|
|
|
GPBDescriptor *descriptor = [GPBField descriptor];
|
|
|
|
GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Kind];
|
2020-04-13 17:36:56 +00:00
|
|
|
return GPBGetMessageRawEnumField(message, field);
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SetGPBField_Kind_RawValue(GPBField *message, int32_t value) {
|
|
|
|
GPBDescriptor *descriptor = [GPBField descriptor];
|
|
|
|
GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Kind];
|
2020-04-13 17:36:56 +00:00
|
|
|
GPBSetMessageRawEnumField(message, field, value);
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int32_t GPBField_Cardinality_RawValue(GPBField *message) {
|
|
|
|
GPBDescriptor *descriptor = [GPBField descriptor];
|
|
|
|
GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Cardinality];
|
2020-04-13 17:36:56 +00:00
|
|
|
return GPBGetMessageRawEnumField(message, field);
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SetGPBField_Cardinality_RawValue(GPBField *message, int32_t value) {
|
|
|
|
GPBDescriptor *descriptor = [GPBField descriptor];
|
|
|
|
GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Cardinality];
|
2020-04-13 17:36:56 +00:00
|
|
|
GPBSetMessageRawEnumField(message, field, value);
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark - Enum GPBField_Kind
|
|
|
|
|
|
|
|
GPBEnumDescriptor *GPBField_Kind_EnumDescriptor(void) {
|
2018-01-31 18:58:11 +00:00
|
|
|
static _Atomic(GPBEnumDescriptor*) descriptor = nil;
|
2015-05-21 21:14:52 +00:00
|
|
|
if (!descriptor) {
|
2016-03-17 14:04:21 +00:00
|
|
|
static const char *valueNames =
|
|
|
|
"TypeUnknown\000TypeDouble\000TypeFloat\000TypeInt"
|
|
|
|
"64\000TypeUint64\000TypeInt32\000TypeFixed64\000Type"
|
|
|
|
"Fixed32\000TypeBool\000TypeString\000TypeGroup\000Ty"
|
|
|
|
"peMessage\000TypeBytes\000TypeUint32\000TypeEnum\000"
|
|
|
|
"TypeSfixed32\000TypeSfixed64\000TypeSint32\000Typ"
|
|
|
|
"eSint64\000";
|
|
|
|
static const int32_t values[] = {
|
|
|
|
GPBField_Kind_TypeUnknown,
|
|
|
|
GPBField_Kind_TypeDouble,
|
|
|
|
GPBField_Kind_TypeFloat,
|
|
|
|
GPBField_Kind_TypeInt64,
|
|
|
|
GPBField_Kind_TypeUint64,
|
|
|
|
GPBField_Kind_TypeInt32,
|
|
|
|
GPBField_Kind_TypeFixed64,
|
|
|
|
GPBField_Kind_TypeFixed32,
|
|
|
|
GPBField_Kind_TypeBool,
|
|
|
|
GPBField_Kind_TypeString,
|
|
|
|
GPBField_Kind_TypeGroup,
|
|
|
|
GPBField_Kind_TypeMessage,
|
|
|
|
GPBField_Kind_TypeBytes,
|
|
|
|
GPBField_Kind_TypeUint32,
|
|
|
|
GPBField_Kind_TypeEnum,
|
|
|
|
GPBField_Kind_TypeSfixed32,
|
|
|
|
GPBField_Kind_TypeSfixed64,
|
|
|
|
GPBField_Kind_TypeSint32,
|
|
|
|
GPBField_Kind_TypeSint64,
|
2015-05-21 21:14:52 +00:00
|
|
|
};
|
2016-03-17 14:04:21 +00:00
|
|
|
GPBEnumDescriptor *worker =
|
|
|
|
[GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBField_Kind)
|
|
|
|
valueNames:valueNames
|
|
|
|
values:values
|
|
|
|
count:(uint32_t)(sizeof(values) / sizeof(int32_t))
|
|
|
|
enumVerifier:GPBField_Kind_IsValidValue];
|
2018-01-22 21:26:39 +00:00
|
|
|
GPBEnumDescriptor *expected = nil;
|
|
|
|
if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
|
2016-03-17 14:04:21 +00:00
|
|
|
[worker release];
|
|
|
|
}
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
return descriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL GPBField_Kind_IsValidValue(int32_t value__) {
|
|
|
|
switch (value__) {
|
|
|
|
case GPBField_Kind_TypeUnknown:
|
|
|
|
case GPBField_Kind_TypeDouble:
|
|
|
|
case GPBField_Kind_TypeFloat:
|
|
|
|
case GPBField_Kind_TypeInt64:
|
|
|
|
case GPBField_Kind_TypeUint64:
|
|
|
|
case GPBField_Kind_TypeInt32:
|
|
|
|
case GPBField_Kind_TypeFixed64:
|
|
|
|
case GPBField_Kind_TypeFixed32:
|
|
|
|
case GPBField_Kind_TypeBool:
|
|
|
|
case GPBField_Kind_TypeString:
|
2015-08-26 21:02:44 +00:00
|
|
|
case GPBField_Kind_TypeGroup:
|
2015-05-21 21:14:52 +00:00
|
|
|
case GPBField_Kind_TypeMessage:
|
|
|
|
case GPBField_Kind_TypeBytes:
|
|
|
|
case GPBField_Kind_TypeUint32:
|
|
|
|
case GPBField_Kind_TypeEnum:
|
|
|
|
case GPBField_Kind_TypeSfixed32:
|
|
|
|
case GPBField_Kind_TypeSfixed64:
|
|
|
|
case GPBField_Kind_TypeSint32:
|
|
|
|
case GPBField_Kind_TypeSint64:
|
|
|
|
return YES;
|
|
|
|
default:
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark - Enum GPBField_Cardinality
|
|
|
|
|
|
|
|
GPBEnumDescriptor *GPBField_Cardinality_EnumDescriptor(void) {
|
2018-01-31 18:58:11 +00:00
|
|
|
static _Atomic(GPBEnumDescriptor*) descriptor = nil;
|
2015-05-21 21:14:52 +00:00
|
|
|
if (!descriptor) {
|
2016-03-17 14:04:21 +00:00
|
|
|
static const char *valueNames =
|
|
|
|
"CardinalityUnknown\000CardinalityOptional\000C"
|
|
|
|
"ardinalityRequired\000CardinalityRepeated\000";
|
|
|
|
static const int32_t values[] = {
|
|
|
|
GPBField_Cardinality_CardinalityUnknown,
|
|
|
|
GPBField_Cardinality_CardinalityOptional,
|
|
|
|
GPBField_Cardinality_CardinalityRequired,
|
|
|
|
GPBField_Cardinality_CardinalityRepeated,
|
2015-05-21 21:14:52 +00:00
|
|
|
};
|
2016-03-17 14:04:21 +00:00
|
|
|
GPBEnumDescriptor *worker =
|
|
|
|
[GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBField_Cardinality)
|
|
|
|
valueNames:valueNames
|
|
|
|
values:values
|
|
|
|
count:(uint32_t)(sizeof(values) / sizeof(int32_t))
|
|
|
|
enumVerifier:GPBField_Cardinality_IsValidValue];
|
2018-01-22 21:26:39 +00:00
|
|
|
GPBEnumDescriptor *expected = nil;
|
|
|
|
if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
|
2016-03-17 14:04:21 +00:00
|
|
|
[worker release];
|
|
|
|
}
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
return descriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL GPBField_Cardinality_IsValidValue(int32_t value__) {
|
|
|
|
switch (value__) {
|
|
|
|
case GPBField_Cardinality_CardinalityUnknown:
|
|
|
|
case GPBField_Cardinality_CardinalityOptional:
|
|
|
|
case GPBField_Cardinality_CardinalityRequired:
|
|
|
|
case GPBField_Cardinality_CardinalityRepeated:
|
|
|
|
return YES;
|
|
|
|
default:
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark - GPBEnum
|
|
|
|
|
|
|
|
@implementation GPBEnum
|
|
|
|
|
|
|
|
@dynamic name;
|
2015-06-08 20:24:57 +00:00
|
|
|
@dynamic enumvalueArray, enumvalueArray_Count;
|
|
|
|
@dynamic optionsArray, optionsArray_Count;
|
2015-05-21 21:14:52 +00:00
|
|
|
@dynamic hasSourceContext, sourceContext;
|
2015-08-26 21:02:44 +00:00
|
|
|
@dynamic syntax;
|
2015-05-21 21:14:52 +00:00
|
|
|
|
2015-06-08 20:24:57 +00:00
|
|
|
typedef struct GPBEnum__storage_ {
|
2015-05-21 21:14:52 +00:00
|
|
|
uint32_t _has_storage_[1];
|
2015-08-26 21:02:44 +00:00
|
|
|
GPBSyntax syntax;
|
2015-05-21 21:14:52 +00:00
|
|
|
NSString *name;
|
|
|
|
NSMutableArray *enumvalueArray;
|
|
|
|
NSMutableArray *optionsArray;
|
|
|
|
GPBSourceContext *sourceContext;
|
2015-06-08 20:24:57 +00:00
|
|
|
} GPBEnum__storage_;
|
2015-05-21 21:14:52 +00:00
|
|
|
|
|
|
|
// This method is threadsafe because it is initially called
|
|
|
|
// in +initialize for each subclass.
|
|
|
|
+ (GPBDescriptor *)descriptor {
|
2015-06-08 20:24:57 +00:00
|
|
|
static GPBDescriptor *descriptor = nil;
|
2015-05-21 21:14:52 +00:00
|
|
|
if (!descriptor) {
|
|
|
|
static GPBMessageFieldDescription fields[] = {
|
|
|
|
{
|
|
|
|
.name = "name",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBEnum_FieldNumber_Name,
|
|
|
|
.hasIndex = 0,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBEnum__storage_, name),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeString,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "enumvalueArray",
|
2020-01-20 01:46:35 +00:00
|
|
|
.dataTypeSpecific.clazz = GPBObjCClass(GPBEnumValue),
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBEnum_FieldNumber_EnumvalueArray,
|
|
|
|
.hasIndex = GPBNoHasBit,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBEnum__storage_, enumvalueArray),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldRepeated,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeMessage,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "optionsArray",
|
2020-01-20 01:46:35 +00:00
|
|
|
.dataTypeSpecific.clazz = GPBObjCClass(GPBOption),
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBEnum_FieldNumber_OptionsArray,
|
|
|
|
.hasIndex = GPBNoHasBit,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBEnum__storage_, optionsArray),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldRepeated,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeMessage,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "sourceContext",
|
2020-01-20 01:46:35 +00:00
|
|
|
.dataTypeSpecific.clazz = GPBObjCClass(GPBSourceContext),
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBEnum_FieldNumber_SourceContext,
|
2016-03-17 14:04:21 +00:00
|
|
|
.hasIndex = 1,
|
|
|
|
.offset = (uint32_t)offsetof(GPBEnum__storage_, sourceContext),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldOptional,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeMessage,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
2015-08-26 21:02:44 +00:00
|
|
|
{
|
|
|
|
.name = "syntax",
|
2016-03-17 14:04:21 +00:00
|
|
|
.dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor,
|
2015-08-26 21:02:44 +00:00
|
|
|
.number = GPBEnum_FieldNumber_Syntax,
|
2016-03-17 14:04:21 +00:00
|
|
|
.hasIndex = 2,
|
|
|
|
.offset = (uint32_t)offsetof(GPBEnum__storage_, syntax),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
|
2015-08-26 21:02:44 +00:00
|
|
|
.dataType = GPBDataTypeEnum,
|
|
|
|
},
|
2015-05-21 21:14:52 +00:00
|
|
|
};
|
2015-06-08 20:24:57 +00:00
|
|
|
GPBDescriptor *localDescriptor =
|
|
|
|
[GPBDescriptor allocDescriptorForClass:[GPBEnum class]
|
|
|
|
rootClass:[GPBTypeRoot class]
|
|
|
|
file:GPBTypeRoot_FileDescriptor()
|
|
|
|
fields:fields
|
2016-03-17 14:04:21 +00:00
|
|
|
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
|
2015-06-08 20:24:57 +00:00
|
|
|
storageSize:sizeof(GPBEnum__storage_)
|
2020-04-13 17:36:56 +00:00
|
|
|
flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
|
2018-12-12 00:32:48 +00:00
|
|
|
#if defined(DEBUG) && DEBUG
|
|
|
|
NSAssert(descriptor == nil, @"Startup recursed!");
|
|
|
|
#endif // DEBUG
|
2015-06-08 20:24:57 +00:00
|
|
|
descriptor = localDescriptor;
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
return descriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2015-08-26 21:02:44 +00:00
|
|
|
int32_t GPBEnum_Syntax_RawValue(GPBEnum *message) {
|
|
|
|
GPBDescriptor *descriptor = [GPBEnum descriptor];
|
|
|
|
GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBEnum_FieldNumber_Syntax];
|
2020-04-13 17:36:56 +00:00
|
|
|
return GPBGetMessageRawEnumField(message, field);
|
2015-08-26 21:02:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SetGPBEnum_Syntax_RawValue(GPBEnum *message, int32_t value) {
|
|
|
|
GPBDescriptor *descriptor = [GPBEnum descriptor];
|
|
|
|
GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBEnum_FieldNumber_Syntax];
|
2020-04-13 17:36:56 +00:00
|
|
|
GPBSetMessageRawEnumField(message, field, value);
|
2015-08-26 21:02:44 +00:00
|
|
|
}
|
|
|
|
|
2015-05-21 21:14:52 +00:00
|
|
|
#pragma mark - GPBEnumValue
|
|
|
|
|
|
|
|
@implementation GPBEnumValue
|
|
|
|
|
|
|
|
@dynamic name;
|
|
|
|
@dynamic number;
|
2015-06-08 20:24:57 +00:00
|
|
|
@dynamic optionsArray, optionsArray_Count;
|
2015-05-21 21:14:52 +00:00
|
|
|
|
2015-06-08 20:24:57 +00:00
|
|
|
typedef struct GPBEnumValue__storage_ {
|
2015-05-21 21:14:52 +00:00
|
|
|
uint32_t _has_storage_[1];
|
|
|
|
int32_t number;
|
|
|
|
NSString *name;
|
|
|
|
NSMutableArray *optionsArray;
|
2015-06-08 20:24:57 +00:00
|
|
|
} GPBEnumValue__storage_;
|
2015-05-21 21:14:52 +00:00
|
|
|
|
|
|
|
// This method is threadsafe because it is initially called
|
|
|
|
// in +initialize for each subclass.
|
|
|
|
+ (GPBDescriptor *)descriptor {
|
2015-06-08 20:24:57 +00:00
|
|
|
static GPBDescriptor *descriptor = nil;
|
2015-05-21 21:14:52 +00:00
|
|
|
if (!descriptor) {
|
|
|
|
static GPBMessageFieldDescription fields[] = {
|
|
|
|
{
|
|
|
|
.name = "name",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBEnumValue_FieldNumber_Name,
|
|
|
|
.hasIndex = 0,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBEnumValue__storage_, name),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeString,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "number",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBEnumValue_FieldNumber_Number,
|
|
|
|
.hasIndex = 1,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBEnumValue__storage_, number),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeInt32,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "optionsArray",
|
2020-01-20 01:46:35 +00:00
|
|
|
.dataTypeSpecific.clazz = GPBObjCClass(GPBOption),
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBEnumValue_FieldNumber_OptionsArray,
|
|
|
|
.hasIndex = GPBNoHasBit,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBEnumValue__storage_, optionsArray),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldRepeated,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeMessage,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
};
|
2015-06-08 20:24:57 +00:00
|
|
|
GPBDescriptor *localDescriptor =
|
|
|
|
[GPBDescriptor allocDescriptorForClass:[GPBEnumValue class]
|
|
|
|
rootClass:[GPBTypeRoot class]
|
|
|
|
file:GPBTypeRoot_FileDescriptor()
|
|
|
|
fields:fields
|
2016-03-17 14:04:21 +00:00
|
|
|
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
|
2015-06-08 20:24:57 +00:00
|
|
|
storageSize:sizeof(GPBEnumValue__storage_)
|
2020-04-13 17:36:56 +00:00
|
|
|
flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
|
2018-12-12 00:32:48 +00:00
|
|
|
#if defined(DEBUG) && DEBUG
|
|
|
|
NSAssert(descriptor == nil, @"Startup recursed!");
|
|
|
|
#endif // DEBUG
|
2015-06-08 20:24:57 +00:00
|
|
|
descriptor = localDescriptor;
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
return descriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#pragma mark - GPBOption
|
|
|
|
|
|
|
|
@implementation GPBOption
|
|
|
|
|
|
|
|
@dynamic name;
|
|
|
|
@dynamic hasValue, value;
|
|
|
|
|
2015-06-08 20:24:57 +00:00
|
|
|
typedef struct GPBOption__storage_ {
|
2015-05-21 21:14:52 +00:00
|
|
|
uint32_t _has_storage_[1];
|
|
|
|
NSString *name;
|
|
|
|
GPBAny *value;
|
2015-06-08 20:24:57 +00:00
|
|
|
} GPBOption__storage_;
|
2015-05-21 21:14:52 +00:00
|
|
|
|
|
|
|
// This method is threadsafe because it is initially called
|
|
|
|
// in +initialize for each subclass.
|
|
|
|
+ (GPBDescriptor *)descriptor {
|
2015-06-08 20:24:57 +00:00
|
|
|
static GPBDescriptor *descriptor = nil;
|
2015-05-21 21:14:52 +00:00
|
|
|
if (!descriptor) {
|
|
|
|
static GPBMessageFieldDescription fields[] = {
|
|
|
|
{
|
|
|
|
.name = "name",
|
2019-12-18 01:32:09 +00:00
|
|
|
.dataTypeSpecific.clazz = Nil,
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBOption_FieldNumber_Name,
|
|
|
|
.hasIndex = 0,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBOption__storage_, name),
|
2020-04-13 17:36:56 +00:00
|
|
|
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeString,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "value",
|
2020-01-20 01:46:35 +00:00
|
|
|
.dataTypeSpecific.clazz = GPBObjCClass(GPBAny),
|
2015-05-21 21:14:52 +00:00
|
|
|
.number = GPBOption_FieldNumber_Value,
|
|
|
|
.hasIndex = 1,
|
2016-03-17 14:04:21 +00:00
|
|
|
.offset = (uint32_t)offsetof(GPBOption__storage_, value),
|
2015-05-21 21:14:52 +00:00
|
|
|
.flags = GPBFieldOptional,
|
2015-06-08 20:24:57 +00:00
|
|
|
.dataType = GPBDataTypeMessage,
|
2015-05-21 21:14:52 +00:00
|
|
|
},
|
|
|
|
};
|
2015-06-08 20:24:57 +00:00
|
|
|
GPBDescriptor *localDescriptor =
|
|
|
|
[GPBDescriptor allocDescriptorForClass:[GPBOption class]
|
|
|
|
rootClass:[GPBTypeRoot class]
|
|
|
|
file:GPBTypeRoot_FileDescriptor()
|
|
|
|
fields:fields
|
2016-03-17 14:04:21 +00:00
|
|
|
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
|
2015-06-08 20:24:57 +00:00
|
|
|
storageSize:sizeof(GPBOption__storage_)
|
2020-04-13 17:36:56 +00:00
|
|
|
flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
|
2018-12-12 00:32:48 +00:00
|
|
|
#if defined(DEBUG) && DEBUG
|
|
|
|
NSAssert(descriptor == nil, @"Startup recursed!");
|
|
|
|
#endif // DEBUG
|
2015-06-08 20:24:57 +00:00
|
|
|
descriptor = localDescriptor;
|
2015-05-21 21:14:52 +00:00
|
|
|
}
|
|
|
|
return descriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
2016-04-19 17:13:04 +00:00
|
|
|
#pragma clang diagnostic pop
|
|
|
|
|
2015-05-21 21:14:52 +00:00
|
|
|
// @@protoc_insertion_point(global_scope)
|