Provide a protocol for GPBExtensionRegistry's lookup support.

This allows some to use an alternative registry if they have a different
implementation.

This is really just wiring though the change to use the GPBExtensionRegistry
protocol vs the concrete GPBExtensionRegistry through the other apis.
pull/10620/head
Thomas Van Lenten 2 years ago
parent e18aa2eda7
commit f191ab0f35
  1. 4
      objectivec/GPBCodedInputStream.h
  2. 6
      objectivec/GPBCodedInputStream.m
  3. 4
      objectivec/GPBCodedInputStream_PackagePrivate.h
  4. 4
      objectivec/GPBDictionary.m
  5. 4
      objectivec/GPBDictionary_PackagePrivate.h
  6. 4
      objectivec/GPBExtensionInternals.h
  7. 6
      objectivec/GPBExtensionInternals.m
  8. 32
      objectivec/GPBExtensionRegistry.h
  9. 14
      objectivec/GPBMessage.h
  10. 24
      objectivec/GPBMessage.m
  11. 4
      objectivec/GPBMessage_PackagePrivate.h

@ -31,7 +31,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class GPBMessage; @class GPBMessage;
@class GPBExtensionRegistry; @protocol GPBExtensionRegistry;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -184,7 +184,7 @@ CF_EXTERN_C_END
* extensions for message. * extensions for message.
**/ **/
- (void)readMessage:(GPBMessage *)message - (void)readMessage:(GPBMessage *)message
extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry; extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry;
/** /**
* Reads and discards a single field, given its tag value. * Reads and discards a single field, given its tag value.

@ -434,7 +434,7 @@ void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state,
- (void)readGroup:(int32_t)fieldNumber - (void)readGroup:(int32_t)fieldNumber
message:(GPBMessage *)message message:(GPBMessage *)message
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry {
CheckRecursionLimit(&state_); CheckRecursionLimit(&state_);
++state_.recursionDepth; ++state_.recursionDepth;
[message mergeFromCodedInputStream:self extensionRegistry:extensionRegistry]; [message mergeFromCodedInputStream:self extensionRegistry:extensionRegistry];
@ -454,7 +454,7 @@ void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state,
} }
- (void)readMessage:(GPBMessage *)message - (void)readMessage:(GPBMessage *)message
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry {
CheckRecursionLimit(&state_); CheckRecursionLimit(&state_);
int32_t length = ReadRawVarint32(&state_); int32_t length = ReadRawVarint32(&state_);
size_t oldLimit = GPBCodedInputStreamPushLimit(&state_, length); size_t oldLimit = GPBCodedInputStreamPushLimit(&state_, length);
@ -466,7 +466,7 @@ void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state,
} }
- (void)readMapEntry:(id)mapDictionary - (void)readMapEntry:(id)mapDictionary
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry
field:(GPBFieldDescriptor *)field field:(GPBFieldDescriptor *)field
parentMessage:(GPBMessage *)parentMessage { parentMessage:(GPBMessage *)parentMessage {
CheckRecursionLimit(&state_); CheckRecursionLimit(&state_);

@ -61,7 +61,7 @@ typedef struct GPBCodedInputStreamState {
// support for older data. // support for older data.
- (void)readGroup:(int32_t)fieldNumber - (void)readGroup:(int32_t)fieldNumber
message:(GPBMessage *)message message:(GPBMessage *)message
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry; extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry;
// Reads a group field value from the stream and merges it into the given // Reads a group field value from the stream and merges it into the given
// UnknownFieldSet. // UnknownFieldSet.
@ -70,7 +70,7 @@ typedef struct GPBCodedInputStreamState {
// Reads a map entry. // Reads a map entry.
- (void)readMapEntry:(id)mapDictionary - (void)readMapEntry:(id)mapDictionary
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry
field:(GPBFieldDescriptor *)field field:(GPBFieldDescriptor *)field
parentMessage:(GPBMessage *)parentMessage; parentMessage:(GPBMessage *)parentMessage;
@end @end

@ -386,7 +386,7 @@ BOOL GPBDictionaryIsInitializedInternalHelper(NSDictionary *dict, GPBFieldDescri
static void ReadValue(GPBCodedInputStream *stream, static void ReadValue(GPBCodedInputStream *stream,
GPBGenericValue *valueToFill, GPBGenericValue *valueToFill,
GPBDataType type, GPBDataType type,
GPBExtensionRegistry *registry, id<GPBExtensionRegistry>registry,
GPBFieldDescriptor *field) { GPBFieldDescriptor *field) {
switch (type) { switch (type) {
case GPBDataTypeBool: case GPBDataTypeBool:
@ -454,7 +454,7 @@ static void ReadValue(GPBCodedInputStream *stream,
void GPBDictionaryReadEntry(id mapDictionary, void GPBDictionaryReadEntry(id mapDictionary,
GPBCodedInputStream *stream, GPBCodedInputStream *stream,
GPBExtensionRegistry *registry, id<GPBExtensionRegistry>registry,
GPBFieldDescriptor *field, GPBFieldDescriptor *field,
GPBMessage *parentMessage) { GPBMessage *parentMessage) {
GPBDataType keyDataType = field.mapKeyDataType; GPBDataType keyDataType = field.mapKeyDataType;

@ -34,7 +34,7 @@
@class GPBCodedInputStream; @class GPBCodedInputStream;
@class GPBCodedOutputStream; @class GPBCodedOutputStream;
@class GPBExtensionRegistry; @protocol GPBExtensionRegistry;
@class GPBFieldDescriptor; @class GPBFieldDescriptor;
@protocol GPBDictionaryInternalsProtocol @protocol GPBDictionaryInternalsProtocol
@ -493,7 +493,7 @@ BOOL GPBDictionaryIsInitializedInternalHelper(NSDictionary *dict,
// Helper to read a map instead. // Helper to read a map instead.
void GPBDictionaryReadEntry(id mapDictionary, GPBCodedInputStream *stream, void GPBDictionaryReadEntry(id mapDictionary, GPBCodedInputStream *stream,
GPBExtensionRegistry *registry, id<GPBExtensionRegistry>registry,
GPBFieldDescriptor *field, GPBFieldDescriptor *field,
GPBMessage *parentMessage); GPBMessage *parentMessage);

@ -34,12 +34,12 @@
@class GPBCodedInputStream; @class GPBCodedInputStream;
@class GPBCodedOutputStream; @class GPBCodedOutputStream;
@class GPBExtensionRegistry; @protocol GPBExtensionRegistry;
void GPBExtensionMergeFromInputStream(GPBExtensionDescriptor *extension, void GPBExtensionMergeFromInputStream(GPBExtensionDescriptor *extension,
BOOL isPackedOnStream, BOOL isPackedOnStream,
GPBCodedInputStream *input, GPBCodedInputStream *input,
GPBExtensionRegistry *extensionRegistry, id<GPBExtensionRegistry>extensionRegistry,
GPBMessage *message); GPBMessage *message);
size_t GPBComputeExtensionSerializedSizeIncludingTag( size_t GPBComputeExtensionSerializedSizeIncludingTag(

@ -40,7 +40,7 @@
static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension, static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension,
GPBCodedInputStream *input, GPBCodedInputStream *input,
GPBExtensionRegistry *extensionRegistry, id<GPBExtensionRegistry>extensionRegistry,
GPBMessage *existingValue) GPBMessage *existingValue)
__attribute__((ns_returns_retained)); __attribute__((ns_returns_retained));
@ -273,7 +273,7 @@ static void WriteArrayIncludingTagsToCodedOutputStream(
void GPBExtensionMergeFromInputStream(GPBExtensionDescriptor *extension, void GPBExtensionMergeFromInputStream(GPBExtensionDescriptor *extension,
BOOL isPackedOnStream, BOOL isPackedOnStream,
GPBCodedInputStream *input, GPBCodedInputStream *input,
GPBExtensionRegistry *extensionRegistry, id<GPBExtensionRegistry>extensionRegistry,
GPBMessage *message) { GPBMessage *message) {
GPBExtensionDescription *description = extension->description_; GPBExtensionDescription *description = extension->description_;
GPBCodedInputStreamState *state = &input->state_; GPBCodedInputStreamState *state = &input->state_;
@ -334,7 +334,7 @@ size_t GPBComputeExtensionSerializedSizeIncludingTag(
// Note that this returns a retained value intentionally. // Note that this returns a retained value intentionally.
static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension, static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension,
GPBCodedInputStream *input, GPBCodedInputStream *input,
GPBExtensionRegistry *extensionRegistry, id<GPBExtensionRegistry>extensionRegistry,
GPBMessage *existingValue) { GPBMessage *existingValue) {
GPBExtensionDescription *description = extension->description_; GPBExtensionDescription *description = extension->description_;
GPBCodedInputStreamState *state = &input->state_; GPBCodedInputStreamState *state = &input->state_;

@ -41,6 +41,24 @@ NS_ASSUME_NONNULL_BEGIN
* GPBExtensionRegistry in which you have registered any extensions that you * GPBExtensionRegistry in which you have registered any extensions that you
* want to be able to parse. Otherwise, those extensions will just be treated * want to be able to parse. Otherwise, those extensions will just be treated
* like unknown fields. * like unknown fields.
**/
@protocol GPBExtensionRegistry <NSObject>
/**
* Looks for the extension registered for the given field number on a given
* GPBDescriptor.
*
* @param descriptor The descriptor to look for a registered extension on.
* @param fieldNumber The field number of the extension to look for.
*
* @return The registered GPBExtensionDescriptor or nil if none was found.
**/
- (nullable GPBExtensionDescriptor *)extensionForDescriptor:(GPBDescriptor *)descriptor
fieldNumber:(NSInteger)fieldNumber;
@end
/**
* A concrete implementation of `GPBExtensionRegistry`.
* *
* The *Root classes provide `+extensionRegistry` for the extensions defined * The *Root classes provide `+extensionRegistry` for the extensions defined
* in a given file *and* all files it imports. You can also create a * in a given file *and* all files it imports. You can also create a
@ -54,7 +72,7 @@ NS_ASSUME_NONNULL_BEGIN
* MyMessage *msg = [MyMessage parseData:data extensionRegistry:registry error:&parseError]; * MyMessage *msg = [MyMessage parseData:data extensionRegistry:registry error:&parseError];
* ``` * ```
**/ **/
@interface GPBExtensionRegistry : NSObject<NSCopying> @interface GPBExtensionRegistry : NSObject<NSCopying, GPBExtensionRegistry>
/** /**
* Adds the given GPBExtensionDescriptor to this registry. * Adds the given GPBExtensionDescriptor to this registry.
@ -70,18 +88,6 @@ NS_ASSUME_NONNULL_BEGIN
**/ **/
- (void)addExtensions:(GPBExtensionRegistry *)registry; - (void)addExtensions:(GPBExtensionRegistry *)registry;
/**
* Looks for the extension registered for the given field number on a given
* GPBDescriptor.
*
* @param descriptor The descriptor to look for a registered extension on.
* @param fieldNumber The field number of the extension to look for.
*
* @return The registered GPBExtensionDescriptor or nil if none was found.
**/
- (nullable GPBExtensionDescriptor *)extensionForDescriptor:(GPBDescriptor *)descriptor
fieldNumber:(NSInteger)fieldNumber;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -36,7 +36,7 @@
@class GPBCodedInputStream; @class GPBCodedInputStream;
@class GPBCodedOutputStream; @class GPBCodedOutputStream;
@class GPBExtensionDescriptor; @class GPBExtensionDescriptor;
@class GPBExtensionRegistry; @protocol GPBExtensionRegistry;
@class GPBFieldDescriptor; @class GPBFieldDescriptor;
@class GPBUnknownFieldSet; @class GPBUnknownFieldSet;
@ -147,7 +147,7 @@ CF_EXTERN_C_END
* @return A new instance of the generated class. * @return A new instance of the generated class.
**/ **/
+ (nullable instancetype)parseFromData:(NSData *)data + (nullable instancetype)parseFromData:(NSData *)data
extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr; error:(NSError **)errorPtr;
/** /**
@ -171,7 +171,7 @@ CF_EXTERN_C_END
**/ **/
+ (nullable instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input + (nullable instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry: extensionRegistry:
(nullable GPBExtensionRegistry *)extensionRegistry (nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr; error:(NSError **)errorPtr;
/** /**
@ -196,7 +196,7 @@ CF_EXTERN_C_END
**/ **/
+ (nullable instancetype)parseDelimitedFromCodedInputStream:(GPBCodedInputStream *)input + (nullable instancetype)parseDelimitedFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry: extensionRegistry:
(nullable GPBExtensionRegistry *)extensionRegistry (nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr; error:(NSError **)errorPtr;
/** /**
@ -239,7 +239,7 @@ CF_EXTERN_C_END
* @return An initialized instance of the generated class. * @return An initialized instance of the generated class.
**/ **/
- (nullable instancetype)initWithData:(NSData *)data - (nullable instancetype)initWithData:(NSData *)data
extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr; error:(NSError **)errorPtr;
/** /**
@ -264,7 +264,7 @@ CF_EXTERN_C_END
**/ **/
- (nullable instancetype)initWithCodedInputStream:(GPBCodedInputStream *)input - (nullable instancetype)initWithCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry: extensionRegistry:
(nullable GPBExtensionRegistry *)extensionRegistry (nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr; error:(NSError **)errorPtr;
/** /**
@ -278,7 +278,7 @@ CF_EXTERN_C_END
* unsuccessful. * unsuccessful.
**/ **/
- (void)mergeFromData:(NSData *)data - (void)mergeFromData:(NSData *)data
extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry; extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry;
/** /**
* Merges the fields from another message (of the same type) into this * Merges the fields from another message (of the same type) into this

@ -881,7 +881,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
} }
- (instancetype)initWithData:(NSData *)data - (instancetype)initWithData:(NSData *)data
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr { error:(NSError **)errorPtr {
if ((self = [self init])) { if ((self = [self init])) {
@try { @try {
@ -912,7 +912,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
- (instancetype)initWithCodedInputStream:(GPBCodedInputStream *)input - (instancetype)initWithCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry: extensionRegistry:
(GPBExtensionRegistry *)extensionRegistry (id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr { error:(NSError **)errorPtr {
if ((self = [self init])) { if ((self = [self init])) {
@try { @try {
@ -1973,7 +1973,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
#pragma mark - mergeFrom #pragma mark - mergeFrom
- (void)mergeFromData:(NSData *)data - (void)mergeFromData:(NSData *)data
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry {
GPBCodedInputStream *input = [[GPBCodedInputStream alloc] initWithData:data]; GPBCodedInputStream *input = [[GPBCodedInputStream alloc] initWithData:data];
[self mergeFromCodedInputStream:input extensionRegistry:extensionRegistry]; [self mergeFromCodedInputStream:input extensionRegistry:extensionRegistry];
[input checkLastTagWas:0]; [input checkLastTagWas:0];
@ -1983,7 +1983,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
#pragma mark - mergeDelimitedFrom #pragma mark - mergeDelimitedFrom
- (void)mergeDelimitedFromCodedInputStream:(GPBCodedInputStream *)input - (void)mergeDelimitedFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry {
GPBCodedInputStreamState *state = &input->state_; GPBCodedInputStreamState *state = &input->state_;
if (GPBCodedInputStreamIsAtEnd(state)) { if (GPBCodedInputStreamIsAtEnd(state)) {
return; return;
@ -2003,7 +2003,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
} }
+ (instancetype)parseFromData:(NSData *)data + (instancetype)parseFromData:(NSData *)data
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr { error:(NSError **)errorPtr {
return [[[self alloc] initWithData:data return [[[self alloc] initWithData:data
extensionRegistry:extensionRegistry extensionRegistry:extensionRegistry
@ -2011,7 +2011,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
} }
+ (instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input + (instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr { error:(NSError **)errorPtr {
return return
[[[self alloc] initWithCodedInputStream:input [[[self alloc] initWithCodedInputStream:input
@ -2023,7 +2023,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
+ (instancetype)parseDelimitedFromCodedInputStream:(GPBCodedInputStream *)input + (instancetype)parseDelimitedFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry: extensionRegistry:
(GPBExtensionRegistry *)extensionRegistry (id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr { error:(NSError **)errorPtr {
GPBMessage *message = [[[self alloc] init] autorelease]; GPBMessage *message = [[[self alloc] init] autorelease];
@try { @try {
@ -2065,7 +2065,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
} }
- (void)parseMessageSet:(GPBCodedInputStream *)input - (void)parseMessageSet:(GPBCodedInputStream *)input
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry {
uint32_t typeId = 0; uint32_t typeId = 0;
NSData *rawBytes = nil; NSData *rawBytes = nil;
GPBExtensionDescriptor *extension = nil; GPBExtensionDescriptor *extension = nil;
@ -2117,7 +2117,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
} }
- (BOOL)parseUnknownField:(GPBCodedInputStream *)input - (BOOL)parseUnknownField:(GPBCodedInputStream *)input
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry
tag:(uint32_t)tag { tag:(uint32_t)tag {
GPBWireFormat wireType = GPBWireFormatGetTagWireType(tag); GPBWireFormat wireType = GPBWireFormatGetTagWireType(tag);
int32_t fieldNumber = GPBWireFormatGetTagFieldNumber(tag); int32_t fieldNumber = GPBWireFormatGetTagFieldNumber(tag);
@ -2170,7 +2170,7 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) {
static void MergeSingleFieldFromCodedInputStream( static void MergeSingleFieldFromCodedInputStream(
GPBMessage *self, GPBFieldDescriptor *field, GPBFileSyntax syntax, GPBMessage *self, GPBFieldDescriptor *field, GPBFileSyntax syntax,
GPBCodedInputStream *input, GPBExtensionRegistry *extensionRegistry) { GPBCodedInputStream *input, id<GPBExtensionRegistry>extensionRegistry) {
GPBDataType fieldDataType = GPBGetFieldDataType(field); GPBDataType fieldDataType = GPBGetFieldDataType(field);
switch (fieldDataType) { switch (fieldDataType) {
#define CASE_SINGLE_POD(NAME, TYPE, FUNC_TYPE) \ #define CASE_SINGLE_POD(NAME, TYPE, FUNC_TYPE) \
@ -2306,7 +2306,7 @@ static void MergeRepeatedPackedFieldFromCodedInputStream(
static void MergeRepeatedNotPackedFieldFromCodedInputStream( static void MergeRepeatedNotPackedFieldFromCodedInputStream(
GPBMessage *self, GPBFieldDescriptor *field, GPBFileSyntax syntax, GPBMessage *self, GPBFieldDescriptor *field, GPBFileSyntax syntax,
GPBCodedInputStream *input, GPBExtensionRegistry *extensionRegistry) { GPBCodedInputStream *input, id<GPBExtensionRegistry>extensionRegistry) {
GPBCodedInputStreamState *state = &input->state_; GPBCodedInputStreamState *state = &input->state_;
id genericArray = GetOrCreateArrayIvarWithField(self, field); id genericArray = GetOrCreateArrayIvarWithField(self, field);
switch (GPBGetFieldDataType(field)) { switch (GPBGetFieldDataType(field)) {
@ -2371,7 +2371,7 @@ static void MergeRepeatedNotPackedFieldFromCodedInputStream(
} }
- (void)mergeFromCodedInputStream:(GPBCodedInputStream *)input - (void)mergeFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry {
GPBDescriptor *descriptor = [self descriptor]; GPBDescriptor *descriptor = [self descriptor];
GPBFileSyntax syntax = descriptor.file.syntax; GPBFileSyntax syntax = descriptor.file.syntax;
GPBCodedInputStreamState *state = &input->state_; GPBCodedInputStreamState *state = &input->state_;

@ -78,13 +78,13 @@ typedef struct GPBMessage_Storage *GPBMessage_StoragePtr;
// or zero for EOF. // or zero for EOF.
// NOTE: This will throw if there is an error while parsing. // NOTE: This will throw if there is an error while parsing.
- (void)mergeFromCodedInputStream:(GPBCodedInputStream *)input - (void)mergeFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry:(GPBExtensionRegistry *)extensionRegistry; extensionRegistry:(id<GPBExtensionRegistry>)extensionRegistry;
// Parses the next delimited message of this type from the input and merges it // Parses the next delimited message of this type from the input and merges it
// with this message. // with this message.
- (void)mergeDelimitedFromCodedInputStream:(GPBCodedInputStream *)input - (void)mergeDelimitedFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry: extensionRegistry:
(GPBExtensionRegistry *)extensionRegistry; (id<GPBExtensionRegistry>)extensionRegistry;
- (void)addUnknownMapEntry:(int32_t)fieldNum value:(NSData *)data; - (void)addUnknownMapEntry:(int32_t)fieldNum value:(NSData *)data;

Loading…
Cancel
Save