123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- #import <Foundation/Foundation.h>
- @class GPBMessage;
- @class GPBExtensionRegistry;
- NS_ASSUME_NONNULL_BEGIN
- CF_EXTERN_C_BEGIN
- extern NSString *const GPBCodedInputStreamException;
- extern NSString *const GPBCodedInputStreamUnderlyingErrorKey;
- extern NSString *const GPBCodedInputStreamErrorDomain;
- typedef NS_ENUM(NSInteger, GPBCodedInputStreamErrorCode) {
-
- GPBCodedInputStreamErrorInvalidSize = -100,
-
- GPBCodedInputStreamErrorSubsectionLimitReached = -101,
-
- GPBCodedInputStreamErrorInvalidSubsectionLimit = -102,
-
- GPBCodedInputStreamErrorInvalidTag = -103,
-
- GPBCodedInputStreamErrorInvalidUTF8 = -104,
-
- GPBCodedInputStreamErrorInvalidVarInt = -105,
-
- GPBCodedInputStreamErrorRecursionDepthExceeded = -106,
- };
- CF_EXTERN_C_END
- @interface GPBCodedInputStream : NSObject
- + (instancetype)streamWithData:(NSData *)data;
- - (instancetype)initWithData:(NSData *)data;
- - (int32_t)readTag;
- - (double)readDouble;
- - (float)readFloat;
- - (uint64_t)readUInt64;
- - (uint32_t)readUInt32;
- - (int64_t)readInt64;
- - (int32_t)readInt32;
- - (uint64_t)readFixed64;
- - (uint32_t)readFixed32;
- - (int32_t)readEnum;
- - (int32_t)readSFixed32;
- - (int64_t)readSFixed64;
- - (int32_t)readSInt32;
- - (int64_t)readSInt64;
- - (BOOL)readBool;
- - (NSString *)readString;
- - (NSData *)readBytes;
- - (void)readMessage:(GPBMessage *)message
- extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry;
- - (BOOL)skipField:(int32_t)tag;
- - (void)skipMessage;
- - (BOOL)isAtEnd;
- - (size_t)position;
- - (size_t)pushLimit:(size_t)byteLimit;
- - (void)popLimit:(size_t)oldLimit;
- - (void)checkLastTagWas:(int32_t)expected;
- @end
- NS_ASSUME_NONNULL_END
|