Instance Methods | Class Methods | Protected Attributes | List of all members
GPBCodedInputStream Class Reference

#import <GPBCodedInputStream.h>

Inheritance diagram for GPBCodedInputStream:
Inheritance graph
[legend]

Instance Methods

(void) - checkLastTagWas:
 
(void) - checkLastTagWas:
 
(instancetype) - initWithData:
 
(instancetype) - initWithData:
 
(BOOL- isAtEnd
 
(BOOL- isAtEnd
 
(void) - popLimit:
 
(void) - popLimit:
 
(size_t) - position
 
(size_t) - position
 
(size_t) - pushLimit:
 
(size_t) - pushLimit:
 
(BOOL- readBool
 
(BOOL- readBool
 
(NSData *) - readBytes
 
(NSData *) - readBytes
 
(double) - readDouble
 
(double) - readDouble
 
(int32_t- readEnum
 
(int32_t- readEnum
 
(uint32_t- readFixed32
 
(uint32_t- readFixed32
 
(uint64_t- readFixed64
 
(uint64_t- readFixed64
 
(float) - readFloat
 
(float) - readFloat
 
(void) - readGroup:message:extensionRegistry: [implementation]
 
(void) - readGroup:message:extensionRegistry: [implementation]
 
(int32_t- readInt32
 
(int32_t- readInt32
 
(int64_t- readInt64
 
(int64_t- readInt64
 
(void) - readMapEntry:extensionRegistry:field:parentMessage: [implementation]
 
(void) - readMapEntry:extensionRegistry:field:parentMessage: [implementation]
 
(void) - readMessage:extensionRegistry:
 
(void) - readMessage:extensionRegistry:
 
(int32_t- readSFixed32
 
(int32_t- readSFixed32
 
(int64_t- readSFixed64
 
(int64_t- readSFixed64
 
(int32_t- readSInt32
 
(int32_t- readSInt32
 
(int64_t- readSInt64
 
(int64_t- readSInt64
 
(NSString *) - readString
 
(NSString *) - readString
 
(int32_t- readTag
 
(int32_t- readTag
 
(uint32_t- readUInt32
 
(uint32_t- readUInt32
 
(uint64_t- readUInt64
 
(uint64_t- readUInt64
 
(void) - readUnknownGroup:message: [implementation]
 
(void) - readUnknownGroup:message: [implementation]
 
(BOOL- skipField:
 
(BOOL- skipField:
 
(void) - skipMessage
 
(void) - skipMessage
 

Class Methods

(instancetype) + streamWithData:
 
(instancetype) + streamWithData:
 

Protected Attributes

NSData * buffer_
 
package struct GPBCodedInputStreamState state_
 

Detailed Description

Reads and decodes protocol message fields.

The common uses of protocol buffers shouldn't need to use this class. GPBMessage's provide a +parseFromData:error: and +parseFromData:extensionRegistry:error: method that will decode a message for you.

Note
Subclassing of GPBCodedInputStream is NOT supported.

Definition at line 85 of file bloaty/third_party/protobuf/objectivec/GPBCodedInputStream.h.

Method Documentation

◆ checkLastTagWas: [1/2]

- (void) checkLastTagWas: (int32_t expected

Verifies that the last call to -readTag returned the given tag value. This is used to verify that a nested group ended with the correct end tag.

Exceptions
NSParseErrorExceptionIf the value does not match the last tag.
Parameters
expectedThe tag that was expected.

◆ checkLastTagWas: [2/2]

- (void) checkLastTagWas: (int32_t expected

Verifies that the last call to -readTag returned the given tag value. This is used to verify that a nested group ended with the correct end tag.

Exceptions
NSParseErrorExceptionIf the value does not match the last tag.
Parameters
expectedThe tag that was expected.

◆ initWithData: [1/2]

- (instancetype) initWithData: (NSData *)  data

Initializes a stream wrapping some data.

Parameters
dataThe data to wrap inside the stream.
Returns
A newly initialized GPBCodedInputStream.

◆ initWithData: [2/2]

- (instancetype) initWithData: (NSData *)  data

Initializes a stream wrapping some data.

Parameters
dataThe data to wrap inside the stream.
Returns
A newly initialized GPBCodedInputStream.

◆ isAtEnd [1/2]

- (BOOL) isAtEnd

Check to see if the logical end of the stream has been reached.

Note
This can return NO when there is no more data, but the current parsing expected more data.
Returns
YES if the logical end of the stream has been reached, NO otherwise.

◆ isAtEnd [2/2]

- (BOOL) isAtEnd

Check to see if the logical end of the stream has been reached.

Note
This can return NO when there is no more data, but the current parsing expected more data.
Returns
YES if the logical end of the stream has been reached, NO otherwise.

◆ popLimit: [1/2]

- (void) popLimit: (size_t)  oldLimit

Moves the limit back to the offset as it was before calling pushLimit:.

Parameters
oldLimitThe number of bytes to move the current limit. Usually this is the value returned by the pushLimit: method.

◆ popLimit: [2/2]

- (void) popLimit: (size_t)  oldLimit

Moves the limit back to the offset as it was before calling pushLimit:.

Parameters
oldLimitThe number of bytes to move the current limit. Usually this is the value returned by the pushLimit: method.

◆ position [1/2]

- (size_t) position
Returns
The offset into the stream.

◆ position [2/2]

- (size_t) position
Returns
The offset into the stream.

◆ pushLimit: [1/2]

- (size_t) pushLimit: (size_t)  byteLimit

Moves the limit to the given byte offset starting at the current location.

Exceptions
GPBCodedInputStreamExceptionIf the requested bytes exceeed the current limit.
Parameters
byteLimitThe number of bytes to move the limit, offset to the current location.
Returns
The limit offset before moving the new limit.

◆ pushLimit: [2/2]

- (size_t) pushLimit: (size_t)  byteLimit

Moves the limit to the given byte offset starting at the current location.

Exceptions
GPBCodedInputStreamExceptionIf the requested bytes exceeed the current limit.
Parameters
byteLimitThe number of bytes to move the limit, offset to the current location.
Returns
The limit offset before moving the new limit.

◆ readBool [1/2]

- (BOOL) readBool
Returns
A boolean read from the stream.

◆ readBool [2/2]

- (BOOL) readBool
Returns
A boolean read from the stream.

◆ readBytes [1/2]

- (NSData *) readBytes
Returns
Data read from the stream.

◆ readBytes [2/2]

- (NSData *) readBytes
Returns
Data read from the stream.

◆ readDouble [1/2]

- (double) readDouble
Returns
A double read from the stream.

◆ readDouble [2/2]

- (double) readDouble
Returns
A double read from the stream.

◆ readEnum [1/2]

- (int32_t) readEnum
Returns
An enum read from the stream.

◆ readEnum [2/2]

- (int32_t) readEnum
Returns
An enum read from the stream.

◆ readFixed32 [1/2]

- (uint32_t) readFixed32
Returns
A fixed32 read from the stream.

◆ readFixed32 [2/2]

- (uint32_t) readFixed32
Returns
A fixed32 read from the stream.

◆ readFixed64 [1/2]

- (uint64_t) readFixed64
Returns
A fixed64 read from the stream.

◆ readFixed64 [2/2]

- (uint64_t) readFixed64
Returns
A fixed64 read from the stream.

◆ readFloat [1/2]

- (float) readFloat
Returns
A float read from the stream.

◆ readFloat [2/2]

- (float) readFloat
Returns
A float read from the stream.

◆ readGroup:message:extensionRegistry: [1/2]

- (void) readGroup: (int32_t fieldNumber
message: (GPBMessage *)  message
extensionRegistry: (GPBExtensionRegistry *)  extensionRegistry 
implementation

◆ readGroup:message:extensionRegistry: [2/2]

- (void) readGroup: (int32_t fieldNumber
message: (GPBMessage *)  message
extensionRegistry: (GPBExtensionRegistry *)  extensionRegistry 
implementation

◆ readInt32 [1/2]

- (int32_t) readInt32
Returns
An int32 read from the stream.

◆ readInt32 [2/2]

- (int32_t) readInt32
Returns
An int32 read from the stream.

◆ readInt64 [1/2]

- (int64_t) readInt64
Returns
An int64 read from the stream.

◆ readInt64 [2/2]

- (int64_t) readInt64
Returns
An int64 read from the stream.

◆ readMapEntry:extensionRegistry:field:parentMessage: [1/2]

- (void) readMapEntry: (id mapDictionary
extensionRegistry: (GPBExtensionRegistry *)  extensionRegistry
field: (GPBFieldDescriptor *)  field
parentMessage: (GPBMessage *)  parentMessage 
implementation

◆ readMapEntry:extensionRegistry:field:parentMessage: [2/2]

- (void) readMapEntry: (id mapDictionary
extensionRegistry: (GPBExtensionRegistry *)  extensionRegistry
field: (GPBFieldDescriptor *)  field
parentMessage: (GPBMessage *)  parentMessage 
implementation

◆ readMessage:extensionRegistry: [1/2]

- (void) readMessage: (GPBMessage *)  message
extensionRegistry: (nullable GPBExtensionRegistry *)  extensionRegistry 

Read an embedded message field value from the stream.

Parameters
messageThe message to set fields on as they are read.
extensionRegistryAn optional extension registry to use to lookup extensions for message.

◆ readMessage:extensionRegistry: [2/2]

- (void) readMessage: (GPBMessage *)  message
extensionRegistry: (nullable GPBExtensionRegistry *)  extensionRegistry 

Read an embedded message field value from the stream.

Parameters
messageThe message to set fields on as they are read.
extensionRegistryAn optional extension registry to use to lookup extensions for message.

◆ readSFixed32 [1/2]

- (int32_t) readSFixed32
Returns
A sfixed32 read from the stream.

◆ readSFixed32 [2/2]

- (int32_t) readSFixed32
Returns
A sfixed32 read from the stream.

◆ readSFixed64 [1/2]

- (int64_t) readSFixed64
Returns
A fixed64 read from the stream.

◆ readSFixed64 [2/2]

- (int64_t) readSFixed64
Returns
A fixed64 read from the stream.

◆ readSInt32 [1/2]

- (int32_t) readSInt32
Returns
A sint32 read from the stream.

◆ readSInt32 [2/2]

- (int32_t) readSInt32
Returns
A sint32 read from the stream.

◆ readSInt64 [1/2]

- (int64_t) readSInt64
Returns
A sint64 read from the stream.

◆ readSInt64 [2/2]

- (int64_t) readSInt64
Returns
A sint64 read from the stream.

◆ readString [1/2]

- (NSString *) readString
Returns
A string read from the stream.

◆ readString [2/2]

- (NSString *) readString
Returns
A string read from the stream.

◆ readTag [1/2]

- (int32_t) readTag

Attempts to read a field tag, returning zero if we have reached EOF. Protocol message parsers use this to read tags, since a protocol message may legally end wherever a tag occurs, and zero is not a valid tag number.

Returns
The field tag, or zero if EOF was reached.

◆ readTag [2/2]

- (int32_t) readTag

Attempts to read a field tag, returning zero if we have reached EOF. Protocol message parsers use this to read tags, since a protocol message may legally end wherever a tag occurs, and zero is not a valid tag number.

Returns
The field tag, or zero if EOF was reached.

◆ readUInt32 [1/2]

- (uint32_t) readUInt32
Returns
A uint32 read from the stream.

◆ readUInt32 [2/2]

- (uint32_t) readUInt32
Returns
A uint32 read from the stream.

◆ readUInt64 [1/2]

- (uint64_t) readUInt64
Returns
A uint64 read from the stream.

◆ readUInt64 [2/2]

- (uint64_t) readUInt64
Returns
A uint64 read from the stream.

◆ readUnknownGroup:message: [1/2]

- (void) readUnknownGroup: (int32_t fieldNumber
message: (GPBUnknownFieldSet *)  message 
implementation

◆ readUnknownGroup:message: [2/2]

- (void) readUnknownGroup: (int32_t fieldNumber
message: (GPBUnknownFieldSet *)  message 
implementation

◆ skipField: [1/2]

- (BOOL) skipField: (int32_t tag

Reads and discards a single field, given its tag value.

Parameters
tagThe tag number of the field to skip.
Returns
NO if the tag is an endgroup tag (in which case nothing is skipped), YES in all other cases.

◆ skipField: [2/2]

- (BOOL) skipField: (int32_t tag

Reads and discards a single field, given its tag value.

Parameters
tagThe tag number of the field to skip.
Returns
NO if the tag is an endgroup tag (in which case nothing is skipped), YES in all other cases.

◆ skipMessage [1/2]

- (void) skipMessage

Reads and discards an entire message. This will read either until EOF or until an endgroup tag, whichever comes first.

◆ skipMessage [2/2]

- (void) skipMessage

Reads and discards an entire message. This will read either until EOF or until an endgroup tag, whichever comes first.

◆ streamWithData: [1/2]

+ (instancetype) streamWithData: (NSData *)  data

Creates a new stream wrapping some data.

Parameters
dataThe data to wrap inside the stream.
Returns
A newly instanced GPBCodedInputStream.

◆ streamWithData: [2/2]

+ (instancetype) streamWithData: (NSData *)  data

Creates a new stream wrapping some data.

Parameters
dataThe data to wrap inside the stream.
Returns
A newly instanced GPBCodedInputStream.

Member Data Documentation

◆ buffer_

- (NSData *) buffer_
protected

◆ state_

- (package struct GPBCodedInputStreamState) state_
protected

The documentation for this class was generated from the following file:


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