Instance Methods | List of all members
GPBExtensionRegistry Class Reference

#import <GPBExtensionRegistry.h>

Inheritance diagram for GPBExtensionRegistry:
Inheritance graph
[legend]

Instance Methods

(void) - addExtension:
 
(void) - addExtension:
 
(void) - addExtensions:
 
(void) - addExtensions:
 
(nullable GPBExtensionDescriptor *) - extensionForDescriptor:fieldNumber:
 
(nullable GPBExtensionDescriptor *) - extensionForDescriptor:fieldNumber:
 

Detailed Description

A table of known extensions, searchable by name or field number. When parsing a protocol message that might have extensions, you must provide a GPBExtensionRegistry in which you have registered any extensions that you want to be able to parse. Otherwise, those extensions will just be treated like unknown fields.

The Root classes provide +extensionRegistry for the extensions defined in a given file *and all files it imports. You can also create a GPBExtensionRegistry, and merge those registries to handle parsing extensions defined from non overlapping files.

GPBExtensionRegistry *registry = [[MyProtoFileRoot extensionRegistry] copy];
[registry addExtension:[OtherMessage neededExtension]]; // Not in MyProtoFile
NSError *parseError;
MyMessage *msg = [MyMessage parseData:data extensionRegistry:registry error:&parseError];

Definition at line 57 of file bloaty/third_party/protobuf/objectivec/GPBExtensionRegistry.h.

Method Documentation

◆ addExtension: [1/2]

- (void) addExtension: (GPBExtensionDescriptor *)  extension

Adds the given GPBExtensionDescriptor to this registry.

Parameters
extensionThe extension description to add.

◆ addExtension: [2/2]

- (void) addExtension: (GPBExtensionDescriptor *)  extension

Adds the given GPBExtensionDescriptor to this registry.

Parameters
extensionThe extension description to add.

◆ addExtensions: [1/2]

- (void) addExtensions: (GPBExtensionRegistry *)  registry

Adds all the extensions from another registry to this registry.

Parameters
registryThe registry to merge into this registry.

◆ addExtensions: [2/2]

- (void) addExtensions: (GPBExtensionRegistry *)  registry

Adds all the extensions from another registry to this registry.

Parameters
registryThe registry to merge into this registry.

◆ extensionForDescriptor:fieldNumber: [1/2]

- (nullable GPBExtensionDescriptor *) extensionForDescriptor: (GPBDescriptor *)  descriptor
fieldNumber: (NSInteger)  fieldNumber 

Looks for the extension registered for the given field number on a given GPBDescriptor.

Parameters
descriptorThe descriptor to look for a registered extension on.
fieldNumberThe field number of the extension to look for.
Returns
The registered GPBExtensionDescriptor or nil if none was found.

◆ extensionForDescriptor:fieldNumber: [2/2]

- (nullable GPBExtensionDescriptor *) extensionForDescriptor: (GPBDescriptor *)  descriptor
fieldNumber: (NSInteger)  fieldNumber 

Looks for the extension registered for the given field number on a given GPBDescriptor.

Parameters
descriptorThe descriptor to look for a registered extension on.
fieldNumberThe field number of the extension to look for.
Returns
The registered GPBExtensionDescriptor or nil if none was found.

The documentation for this class was generated from the following file:
GPBExtensionRegistry
Definition: bloaty/third_party/protobuf/objectivec/GPBExtensionRegistry.h:57
copy
static int copy(grpc_slice_buffer *input, grpc_slice_buffer *output)
Definition: message_compress.cc:145
error
grpc_error_handle error
Definition: retry_filter.cc:499
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:45