diff options
Diffstat (limited to 'objectivec/GPBDescriptor.h')
-rw-r--r-- | objectivec/GPBDescriptor.h | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/objectivec/GPBDescriptor.h b/objectivec/GPBDescriptor.h index aeac9029..360afe96 100644 --- a/objectivec/GPBDescriptor.h +++ b/objectivec/GPBDescriptor.h @@ -38,6 +38,8 @@ @class GPBFileDescriptor; @class GPBOneofDescriptor; +NS_ASSUME_NONNULL_BEGIN + typedef NS_ENUM(NSInteger, GPBFileSyntax) { GPBFileSyntaxUnknown = 0, GPBFileSyntaxProto2 = 2, @@ -53,20 +55,20 @@ typedef NS_ENUM(NSInteger, GPBFieldType) { @interface GPBDescriptor : NSObject<NSCopying> @property(nonatomic, readonly, copy) NSString *name; -@property(nonatomic, readonly, strong) NSArray *fields; -@property(nonatomic, readonly, strong) NSArray *oneofs; -@property(nonatomic, readonly, strong) NSArray *enums; -@property(nonatomic, readonly) const GPBExtensionRange *extensionRanges; +@property(nonatomic, readonly, strong, nullable) NSArray *fields; +@property(nonatomic, readonly, strong, nullable) NSArray *oneofs; +@property(nonatomic, readonly, strong, nullable) NSArray *enums; +@property(nonatomic, readonly, nullable) const GPBExtensionRange *extensionRanges; @property(nonatomic, readonly) NSUInteger extensionRangesCount; @property(nonatomic, readonly, assign) GPBFileDescriptor *file; @property(nonatomic, readonly, getter=isWireFormat) BOOL wireFormat; @property(nonatomic, readonly) Class messageClass; -- (GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber; -- (GPBFieldDescriptor *)fieldWithName:(NSString *)name; -- (GPBOneofDescriptor *)oneofWithName:(NSString *)name; -- (GPBEnumDescriptor *)enumWithName:(NSString *)name; +- (nullable GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber; +- (nullable GPBFieldDescriptor *)fieldWithName:(NSString *)name; +- (nullable GPBOneofDescriptor *)oneofWithName:(NSString *)name; +- (nullable GPBEnumDescriptor *)enumWithName:(NSString *)name; @end @@ -81,8 +83,8 @@ typedef NS_ENUM(NSInteger, GPBFieldType) { @property(nonatomic, readonly) NSString *name; @property(nonatomic, readonly) NSArray *fields; -- (GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber; -- (GPBFieldDescriptor *)fieldWithName:(NSString *)name; +- (nullable GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber; +- (nullable GPBFieldDescriptor *)fieldWithName:(NSString *)name; @end @interface GPBFieldDescriptor : NSObject @@ -99,21 +101,21 @@ typedef NS_ENUM(NSInteger, GPBFieldType) { @property(nonatomic, readonly) GPBDataType mapKeyDataType; @property(nonatomic, readonly, getter=isPackable) BOOL packable; -@property(nonatomic, readonly, assign) GPBOneofDescriptor *containingOneof; +@property(nonatomic, readonly, assign, nullable) GPBOneofDescriptor *containingOneof; -@property(nonatomic, readonly) GPBFieldOptions *fieldOptions; +@property(nonatomic, readonly, nullable) GPBFieldOptions *fieldOptions; // Message properties -@property(nonatomic, readonly, assign) Class msgClass; +@property(nonatomic, readonly, assign, nullable) Class msgClass; // Enum properties -@property(nonatomic, readonly, strong) GPBEnumDescriptor *enumDescriptor; +@property(nonatomic, readonly, strong, nullable) GPBEnumDescriptor *enumDescriptor; - (BOOL)isValidEnumValue:(int32_t)value; // For now, this will return nil if it doesn't know the name to use for // TextFormat. -- (NSString *)textFormatName; +- (nullable NSString *)textFormatName; @end @@ -122,10 +124,10 @@ typedef NS_ENUM(NSInteger, GPBFieldType) { @property(nonatomic, readonly, copy) NSString *name; @property(nonatomic, readonly) GPBEnumValidationFunc enumVerifier; -- (NSString *)enumNameForValue:(int32_t)number; -- (BOOL)getValue:(int32_t *)outValue forEnumName:(NSString *)name; +- (nullable NSString *)enumNameForValue:(int32_t)number; +- (BOOL)getValue:(nullable int32_t *)outValue forEnumName:(NSString *)name; -- (NSString *)textFormatNameForValue:(int32_t)number; +- (nullable NSString *)textFormatNameForValue:(int32_t)number; @end @@ -137,6 +139,8 @@ typedef NS_ENUM(NSInteger, GPBFieldType) { @property(nonatomic, readonly, getter=isPackable) BOOL packable; @property(nonatomic, readonly, assign) Class msgClass; @property(nonatomic, readonly) NSString *singletonName; -@property(nonatomic, readonly, strong) GPBEnumDescriptor *enumDescriptor; +@property(nonatomic, readonly, strong, nullable) GPBEnumDescriptor *enumDescriptor; @property(nonatomic, readonly) id defaultValue; @end + +NS_ASSUME_NONNULL_END |