webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Instance Methods | Class Methods | Protected Attributes | List of all members
GPBCodedInputStream Class Reference

#import <GPBCodedInputStream.h>

Inheritance diagram for GPBCodedInputStream:
NSObject

Instance Methods

(instancetype) - initWithData:
 Initializes a stream wrapping some data. More...
 
(int32_t- readTag
 
(double) - readDouble
 Read and return a double. More...
 
(float) - readFloat
 Read and return a float. More...
 
(uint64_t- readUInt64
 Read and return a uint64. More...
 
(uint32_t- readUInt32
 Read and return a uint32. More...
 
(int64_t- readInt64
 Read and return an int64. More...
 
(int32_t- readInt32
 Read and return an int32. More...
 
(uint64_t- readFixed64
 Read and return a fixed64. More...
 
(uint32_t- readFixed32
 Read and return a fixed32. More...
 
(int32_t- readEnum
 Read and return an enum (int). More...
 
(int32_t- readSFixed32
 Read and return a sfixed32. More...
 
(int64_t- readSFixed64
 Read and return a sfixed64. More...
 
(int32_t- readSInt32
 Read and return a sint32. More...
 
(int64_t- readSInt64
 Read and return a sint64. More...
 
(BOOL- readBool
 Read and return a boolean. More...
 
(NSString *) - readString
 Read and return a string. More...
 
(NSData *) - readBytes
 Read and return length delimited data. More...
 
(void- readMessage:extensionRegistry:
 
(BOOL- skipField:
 
(void- skipMessage
 
(BOOL- isAtEnd
 
(size_t- position
 The offset into the stream. More...
 
(void- checkLastTagWas:
 
(void- readGroup:message:extensionRegistry: [implementation]
 
(void- readUnknownGroup:message: [implementation]
 
(void- readMapEntry:extensionRegistry:field:parentMessage: [implementation]
 

Class Methods

(instancetype) + streamWithData:
 Creates a new stream wrapping some data. More...
 

Protected Attributes

package struct GPBCodedInputStreamState state_
 
NSDatabuffer_
 

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.

Method Documentation

◆ checkLastTagWas:()

- (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. Throws NSParseErrorException if value does not match the last tag.

Parameters
expectedThe tag that was expected.

◆ initWithData:()

- (instancetype) initWithData: (NSData *)  data

Initializes a stream wrapping some data.

◆ isAtEnd()

- (BOOL) isAtEnd

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

This can return NO when there is no more data, but the current parsing expected more data.

◆ position()

The offset into the stream.

◆ readBool()

- (BOOL) readBool

Read and return a boolean.

◆ readBytes()

- (NSData *) readBytes

Read and return length delimited data.

◆ readDouble()

- (double) readDouble

Read and return a double.

◆ readEnum()

- (int32_t) readEnum

Read and return an enum (int).

◆ readFixed32()

- (uint32_t) readFixed32

Read and return a fixed32.

◆ readFixed64()

- (uint64_t) readFixed64

Read and return a fixed64.

◆ readFloat()

- (float) readFloat

Read and return a float.

◆ readGroup:message:extensionRegistry:()

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

◆ readInt32()

- (int32_t) readInt32

Read and return an int32.

◆ readInt64()

- (int64_t) readInt64

Read and return an int64.

◆ readMapEntry:extensionRegistry:field:parentMessage:()

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

◆ readMessage:extensionRegistry:()

- (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 .

◆ readSFixed32()

- (int32_t) readSFixed32

Read and return a sfixed32.

◆ readSFixed64()

- (int64_t) readSFixed64

Read and return a sfixed64.

◆ readSInt32()

- (int32_t) readSInt32

Read and return a sint32.

◆ readSInt64()

- (int64_t) readSInt64

Read and return a sint64.

◆ readString()

- (NSString *) readString

Read and return a string.

◆ readTag()

- (int32_t) readTag

Attempt 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.

◆ readUInt32()

- (uint32_t) readUInt32

Read and return a uint32.

◆ readUInt64()

- (uint64_t) readUInt64

Read and return a uint64.

◆ readUnknownGroup:message:()

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

◆ skipField:()

- (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()

- (void) skipMessage

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

◆ streamWithData:()

+ (instancetype) streamWithData: (NSData *)  data

Creates a new stream wrapping some data.

Member Data Documentation

◆ buffer_

- (NSData*) buffer_
protected

◆ state_

- (package struct GPBCodedInputStreamState) state_
protected

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