#import <GPBCodedInputStream.h>
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.
◆ 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
-
NSParseErrorException | If the value does not match the last tag. |
- Parameters
-
expected | The 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
-
NSParseErrorException | If the value does not match the last tag. |
- Parameters
-
expected | The tag that was expected. |
◆ initWithData: [1/2]
- (instancetype) initWithData: |
|
(NSData *) |
data |
|
Initializes a stream wrapping some data.
- Parameters
-
data | The 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
-
data | The data to wrap inside the stream. |
- Returns
- A newly initialized GPBCodedInputStream.
◆ isAtEnd [1/2]
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]
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
-
oldLimit | The 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
-
oldLimit | The number of bytes to move the current limit. Usually this is the value returned by the pushLimit: method. |
◆ position [1/2]
- Returns
- The offset into the stream.
◆ position [2/2]
- 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
-
GPBCodedInputStreamException | If the requested bytes exceeed the current limit. |
- Parameters
-
byteLimit | The 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
-
GPBCodedInputStreamException | If the requested bytes exceeed the current limit. |
- Parameters
-
byteLimit | The number of bytes to move the limit, offset to the current location. |
- Returns
- The limit offset before moving the new limit.
◆ readBool [1/2]
- Returns
- A boolean read from the stream.
◆ readBool [2/2]
- Returns
- A boolean read from the stream.
◆ readBytes [1/2]
- Returns
- Data read from the stream.
◆ readBytes [2/2]
- Returns
- Data read from the stream.
◆ readDouble [1/2]
- Returns
- A double read from the stream.
◆ readDouble [2/2]
- Returns
- A double read from the stream.
◆ readEnum [1/2]
- Returns
- An enum read from the stream.
◆ readEnum [2/2]
- Returns
- An enum read from the stream.
◆ readFixed32 [1/2]
- Returns
- A fixed32 read from the stream.
◆ readFixed32 [2/2]
- Returns
- A fixed32 read from the stream.
◆ readFixed64 [1/2]
- Returns
- A fixed64 read from the stream.
◆ readFixed64 [2/2]
- Returns
- A fixed64 read from the stream.
◆ readFloat [1/2]
- Returns
- A float read from the stream.
◆ readFloat [2/2]
- Returns
- A float read from the stream.
◆ readGroup:message:extensionRegistry: [1/2]
◆ readGroup:message:extensionRegistry: [2/2]
◆ readInt32 [1/2]
- Returns
- An int32 read from the stream.
◆ readInt32 [2/2]
- Returns
- An int32 read from the stream.
◆ readInt64 [1/2]
- Returns
- An int64 read from the stream.
◆ readInt64 [2/2]
- Returns
- An int64 read from the stream.
◆ readMapEntry:extensionRegistry:field:parentMessage: [1/2]
◆ readMapEntry:extensionRegistry:field:parentMessage: [2/2]
◆ readMessage:extensionRegistry: [1/2]
Read an embedded message field value from the stream.
- Parameters
-
message | The message to set fields on as they are read. |
extensionRegistry | An optional extension registry to use to lookup extensions for message. |
◆ readMessage:extensionRegistry: [2/2]
Read an embedded message field value from the stream.
- Parameters
-
message | The message to set fields on as they are read. |
extensionRegistry | An optional extension registry to use to lookup extensions for message. |
◆ readSFixed32 [1/2]
- Returns
- A sfixed32 read from the stream.
◆ readSFixed32 [2/2]
- Returns
- A sfixed32 read from the stream.
◆ readSFixed64 [1/2]
- Returns
- A fixed64 read from the stream.
◆ readSFixed64 [2/2]
- Returns
- A fixed64 read from the stream.
◆ readSInt32 [1/2]
- Returns
- A sint32 read from the stream.
◆ readSInt32 [2/2]
- Returns
- A sint32 read from the stream.
◆ readSInt64 [1/2]
- Returns
- A sint64 read from the stream.
◆ readSInt64 [2/2]
- 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]
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]
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]
- Returns
- A uint32 read from the stream.
◆ readUInt32 [2/2]
- Returns
- A uint32 read from the stream.
◆ readUInt64 [1/2]
- Returns
- A uint64 read from the stream.
◆ readUInt64 [2/2]
- Returns
- A uint64 read from the stream.
◆ readUnknownGroup:message: [1/2]
◆ readUnknownGroup:message: [2/2]
◆ skipField: [1/2]
Reads and discards a single field, given its tag value.
- Parameters
-
tag | The 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]
Reads and discards a single field, given its tag value.
- Parameters
-
tag | The 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]
Reads and discards an entire message. This will read either until EOF or until an endgroup tag, whichever comes first.
◆ skipMessage [2/2]
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
-
data | The 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
-
data | The data to wrap inside the stream. |
- Returns
- A newly instanced GPBCodedInputStream.
◆ buffer_
◆ state_
The documentation for this class was generated from the following file: