From 5221dcbe479ed765d8103ed7601c69b6d8d6ca4f Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Fri, 29 Jan 2016 13:51:05 -0800 Subject: Integrate from google internal. Java files are moved to un-do the hack in the prevous commit, which moved the java files to the original position for integration. --- objectivec/google/protobuf/Descriptor.pbobjc.h | 52 +++++++++ objectivec/google/protobuf/Descriptor.pbobjc.m | 149 +++++++++++++++++++++++++ 2 files changed, 201 insertions(+) (limited to 'objectivec/google') diff --git a/objectivec/google/protobuf/Descriptor.pbobjc.h b/objectivec/google/protobuf/Descriptor.pbobjc.h index f04616c3..9c43cfd2 100644 --- a/objectivec/google/protobuf/Descriptor.pbobjc.h +++ b/objectivec/google/protobuf/Descriptor.pbobjc.h @@ -1153,6 +1153,58 @@ typedef GPB_ENUM(GPBSourceCodeInfo_Location_FieldNumber) { @end +#pragma mark - GPBGeneratedCodeInfo + +typedef GPB_ENUM(GPBGeneratedCodeInfo_FieldNumber) { + GPBGeneratedCodeInfo_FieldNumber_AnnotationArray = 1, +}; + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +@interface GPBGeneratedCodeInfo : GPBMessage + +// An Annotation connects some span of text in generated code to an element +// of its generating .proto file. +// |annotationArray| contains |GPBGeneratedCodeInfo_Annotation| +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *annotationArray; +@property(nonatomic, readonly) NSUInteger annotationArray_Count; + +@end + +#pragma mark - GPBGeneratedCodeInfo_Annotation + +typedef GPB_ENUM(GPBGeneratedCodeInfo_Annotation_FieldNumber) { + GPBGeneratedCodeInfo_Annotation_FieldNumber_PathArray = 1, + GPBGeneratedCodeInfo_Annotation_FieldNumber_SourceFile = 2, + GPBGeneratedCodeInfo_Annotation_FieldNumber_Begin = 3, + GPBGeneratedCodeInfo_Annotation_FieldNumber_End = 4, +}; + +@interface GPBGeneratedCodeInfo_Annotation : GPBMessage + +// Identifies the element in the original source .proto file. This field +// is formatted the same as SourceCodeInfo.Location.path. +@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *pathArray; +@property(nonatomic, readonly) NSUInteger pathArray_Count; + +// Identifies the filesystem path to the original source .proto. +@property(nonatomic, readwrite) BOOL hasSourceFile; +@property(nonatomic, readwrite, copy, null_resettable) NSString *sourceFile; + +// Identifies the starting offset in bytes in the generated code +// that relates to the identified object. +@property(nonatomic, readwrite) BOOL hasBegin; +@property(nonatomic, readwrite) int32_t begin; + +// Identifies the ending offset in bytes in the generated code that +// relates to the identified offset. The end offset should be one past +// the last relevant byte (so the length of the text = end - begin). +@property(nonatomic, readwrite) BOOL hasEnd; +@property(nonatomic, readwrite) int32_t end; + +@end + NS_ASSUME_NONNULL_END CF_EXTERN_C_END diff --git a/objectivec/google/protobuf/Descriptor.pbobjc.m b/objectivec/google/protobuf/Descriptor.pbobjc.m index e3e44c48..40309893 100644 --- a/objectivec/google/protobuf/Descriptor.pbobjc.m +++ b/objectivec/google/protobuf/Descriptor.pbobjc.m @@ -1434,7 +1434,11 @@ typedef struct GPBFileOptions__storage_ { .offset = offsetof(GPBFileOptions__storage_, javananoUseDeprecatedPackage), .defaultValue.valueBool = NO, .dataTypeSpecific.className = NULL, + #if GPBOBJC_INCLUDE_FIELD_OPTIONS + .fieldOptions = "\000\000\000\002\030\001", + #else .fieldOptions = NULL, + #endif // GPBOBJC_INCLUDE_FIELD_OPTIONS }, { .name = "uninterpretedOptionArray", @@ -2441,5 +2445,150 @@ typedef struct GPBSourceCodeInfo_Location__storage_ { @end +#pragma mark - GPBGeneratedCodeInfo + +@implementation GPBGeneratedCodeInfo + +@dynamic annotationArray, annotationArray_Count; + +typedef struct GPBGeneratedCodeInfo__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *annotationArray; +} GPBGeneratedCodeInfo__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "annotationArray", + .number = GPBGeneratedCodeInfo_FieldNumber_AnnotationArray, + .hasIndex = GPBNoHasBit, + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + .offset = offsetof(GPBGeneratedCodeInfo__storage_, annotationArray), + .defaultValue.valueMessage = nil, + .dataTypeSpecific.className = GPBStringifySymbol(GPBGeneratedCodeInfo_Annotation), + .fieldOptions = NULL, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBGeneratedCodeInfo class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBGeneratedCodeInfo__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBGeneratedCodeInfo_Annotation + +@implementation GPBGeneratedCodeInfo_Annotation + +@dynamic pathArray, pathArray_Count; +@dynamic hasSourceFile, sourceFile; +@dynamic hasBegin, begin; +@dynamic hasEnd, end; + +typedef struct GPBGeneratedCodeInfo_Annotation__storage_ { + uint32_t _has_storage_[1]; + int32_t begin; + int32_t end; + GPBInt32Array *pathArray; + NSString *sourceFile; +} GPBGeneratedCodeInfo_Annotation__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "pathArray", + .number = GPBGeneratedCodeInfo_Annotation_FieldNumber_PathArray, + .hasIndex = GPBNoHasBit, + .flags = GPBFieldRepeated | GPBFieldPacked, + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBGeneratedCodeInfo_Annotation__storage_, pathArray), + .defaultValue.valueMessage = nil, + .dataTypeSpecific.className = NULL, + #if GPBOBJC_INCLUDE_FIELD_OPTIONS + .fieldOptions = "\000\000\000\002\020\001", + #else + .fieldOptions = NULL, + #endif // GPBOBJC_INCLUDE_FIELD_OPTIONS + }, + { + .name = "sourceFile", + .number = GPBGeneratedCodeInfo_Annotation_FieldNumber_SourceFile, + .hasIndex = 1, + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + .offset = offsetof(GPBGeneratedCodeInfo_Annotation__storage_, sourceFile), + .defaultValue.valueString = nil, + .dataTypeSpecific.className = NULL, + .fieldOptions = NULL, + }, + { + .name = "begin", + .number = GPBGeneratedCodeInfo_Annotation_FieldNumber_Begin, + .hasIndex = 2, + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBGeneratedCodeInfo_Annotation__storage_, begin), + .defaultValue.valueInt32 = 0, + .dataTypeSpecific.className = NULL, + .fieldOptions = NULL, + }, + { + .name = "end", + .number = GPBGeneratedCodeInfo_Annotation_FieldNumber_End, + .hasIndex = 3, + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + .offset = offsetof(GPBGeneratedCodeInfo_Annotation__storage_, end), + .defaultValue.valueInt32 = 0, + .dataTypeSpecific.className = NULL, + .fieldOptions = NULL, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBGeneratedCodeInfo_Annotation class] + rootClass:[GPBDescriptorRoot class] + file:GPBDescriptorRoot_FileDescriptor() + fields:fields + fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) + oneofs:NULL + oneofCount:0 + enums:NULL + enumCount:0 + ranges:NULL + rangeCount:0 + storageSize:sizeof(GPBGeneratedCodeInfo_Annotation__storage_) + wireFormat:NO]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + // @@protoc_insertion_point(global_scope) -- cgit v1.2.3