diff options
Diffstat (limited to 'objectivec/GPBExtensionRegistry.h')
-rw-r--r-- | objectivec/GPBExtensionRegistry.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/objectivec/GPBExtensionRegistry.h b/objectivec/GPBExtensionRegistry.h index ce1f8fab..e382971c 100644 --- a/objectivec/GPBExtensionRegistry.h +++ b/objectivec/GPBExtensionRegistry.h @@ -38,7 +38,24 @@ // ExtensionRegistry 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. -@interface GPBExtensionRegistry : NSObject +// +// 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] autorelease]; +// [registry addExtension:[OtherMessage neededExtension]; // Not in MyProtoFile +// NSError *parseError = nil; +// MyMessage *msg = [MyMessage parseData:data +// extensionRegistry:registry +// error:&parseError]; +// +@interface GPBExtensionRegistry : NSObject<NSCopying> + +- (void)addExtension:(GPBExtensionField *)extension; +- (void)addExtensions:(GPBExtensionRegistry *)registry; - (GPBExtensionField *)getExtension:(GPBDescriptor *)containingType fieldNumber:(NSInteger)fieldNumber; |