forked from PoomSmart/YouTubeHeader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GPBMessage.h
66 lines (57 loc) · 3.54 KB
/
GPBMessage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#import <Foundation/Foundation.h>
#import "GPBBootstrap.h"
#import "GPBCodedInputStream.h"
#import "GPBCodedOutputStream.h"
#import "GPBDescriptor.h"
#import "GPBExtensionRegistry.h"
#import "GPBUnknownFieldSet.h"
#import "GPBUnknownFields.h"
@class GPBCodedInputStream;
@class GPBCodedOutputStream;
@class GPBUnknownFieldSet;
@class GPBUnknownFields;
NS_ASSUME_NONNULL_BEGIN
CF_EXTERN_C_BEGIN
extern NSString *const GPBMessageErrorDomain;
typedef NS_ENUM(NSInteger, GPBMessageErrorCode) {
GPBMessageErrorCodeOther = -100,
GPBMessageErrorCodeMissingRequiredField = -101,
};
extern NSString *const GPBErrorReasonKey;
extern NSString *const GPBMessageExceptionMessageTooLarge;
CF_EXTERN_C_END
@interface GPBMessage : NSObject <NSSecureCoding, NSCopying>
@property(nonatomic, copy, nullable) GPBUnknownFieldSet *unknownFields __attribute__((deprecated("Use GPBUnknownFields and the -initFromMessage: initializer and " "mergeUnknownFields:extensionRegistry:error: to add the data back to a message.")));
@property(nonatomic, readonly, getter=isInitialized) BOOL initialized;
+ (instancetype)message;
+ (nullable instancetype)parseFromData:(NSData *)data error:(NSError **)errorPtr;
+ (nullable instancetype)parseFromData:(NSData *)data extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry error:(NSError **)errorPtr;
+ (nullable instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input extensionRegistry: (nullable id<GPBExtensionRegistry>)extensionRegistry error:(NSError **)errorPtr;
+ (nullable instancetype)parseDelimitedFromCodedInputStream:(GPBCodedInputStream *)input extensionRegistry: (nullable id<GPBExtensionRegistry>)extensionRegistry error:(NSError **)errorPtr;
- (nullable instancetype)initWithData:(NSData *)data error:(NSError **)errorPtr;
- (nullable instancetype)initWithData:(NSData *)data extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry error:(NSError **)errorPtr;
- (nullable instancetype)initWithCodedInputStream:(GPBCodedInputStream *)input extensionRegistry: (nullable id<GPBExtensionRegistry>)extensionRegistry error:(NSError **)errorPtr;
- (void)mergeFromData:(NSData *)data extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry __attribute__((deprecated("Use -mergeFromData:extensionRegistry:error: instead, especaily if calling from Swift.")));
- (BOOL)mergeFromData:(NSData *)data extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry error:(NSError **)errorPtr;
- (void)mergeFrom:(GPBMessage *)other;
- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)output;
- (void)writeToOutputStream:(NSOutputStream *)output;
- (void)writeDelimitedToCodedOutputStream:(GPBCodedOutputStream *)output;
- (void)writeDelimitedToOutputStream:(NSOutputStream *)output;
- (nullable NSData *)data;
- (NSData *)delimitedData;
- (size_t)serializedSize;
+ (GPBDescriptor *)descriptor;
- (GPBDescriptor *)descriptor;
- (NSArray *)extensionsCurrentlySet;
- (BOOL)hasExtension:(GPBExtensionDescriptor *)extension;
- (nullable id)getExtension:(GPBExtensionDescriptor *)extension;
- (void)setExtension:(GPBExtensionDescriptor *)extension value:(nullable id)value;
- (void)addExtension:(GPBExtensionDescriptor *)extension value:(id)value;
- (void)setExtension:(GPBExtensionDescriptor *)extension index:(NSUInteger)index value:(id)value;
- (void)clearExtension:(GPBExtensionDescriptor *)extension;
- (void)clear;
- (void)clearUnknownFields;
- (BOOL)mergeUnknownFields:(GPBUnknownFields *)unknownFields extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry error:(NSError **)errorPtr;
@end
NS_ASSUME_NONNULL_END