class MessageDecoder
Defined at line 123 of file ../../src/lib/fidl_codec/message_decoder.h
Helper to decode a message (request or response). It generates a Value.
Public Methods
uint64_t absolute_offset ()
Defined at line 130 of file ../../src/lib/fidl_codec/message_decoder.h
uint64_t num_bytes ()
Defined at line 132 of file ../../src/lib/fidl_codec/message_decoder.h
const zx_handle_disposition_t * handle_pos ()
Defined at line 134 of file ../../src/lib/fidl_codec/message_decoder.h
uint64_t next_object_offset ()
Defined at line 136 of file ../../src/lib/fidl_codec/message_decoder.h
WireVersion version ()
Defined at line 138 of file ../../src/lib/fidl_codec/message_decoder.h
bool HasError ()
Defined at line 140 of file ../../src/lib/fidl_codec/message_decoder.h
std::ostream & AddError ()
Add an error.
Defined at line 143 of file ../../src/lib/fidl_codec/message_decoder.h
size_t GetRemainingHandles ()
Defined at line 148 of file ../../src/lib/fidl_codec/message_decoder.h
const uint8_t * GetAddress (uint64_t offset, uint64_t size)
Gets the address of some data of |size| at |offset|. If there is not enough
data, returns null.
Defined at line 157 of file ../../src/lib/fidl_codec/message_decoder.h
void MessageDecoder (const uint8_t * bytes, uint64_t num_bytes, const zx_handle_disposition_t * handles, size_t num_handles, std::ostream & error_stream)
Defined at line 167 of file ../../src/lib/fidl_codec/message_decoder.cc
void SkipObject (uint64_t size)
Sets the next object offset. The current object (which is at the previous value of next object
offset) is not decoded yet. It will be decoded just after this call.
The new offset is 8 byte aligned.
Defined at line 170 of file ../../src/lib/fidl_codec/message_decoder.h
void MessageDecoder (MessageDecoder * container, uint64_t offset, uint64_t num_bytes_remaining, uint64_t num_handles_remaining)
Defined at line 178 of file ../../src/lib/fidl_codec/message_decoder.cc
zx_handle_disposition_t GetNextHandle ()
Consumes a handle. Returns FIDL_HANDLE_ABSENT if there is no handle
available.
Defined at line 183 of file ../../src/lib/fidl_codec/message_decoder.h
template <typename T>
bool GetValueAt (uint64_t offset, T * value)
Used by numeric types to retrieve a numeric value. If there is not enough
data, returns false and value is set to its zero-initialized value.
Defined at line 250 of file ../../src/lib/fidl_codec/message_decoder.h
std::unique_ptr<Value> DecodeMessage (const Type * payload_type)
Decodes a whole message (request or response), skipping over the header.
The |payload_type| must be EmptyPayloadType, StructType, TableType, or UnionType.
Returns an EmptyPayloadValue, StructValue, TableValue, or UnionValue respectively.
Defined at line 190 of file ../../src/lib/fidl_codec/message_decoder.cc
bool DecodeNullableHeader (uint64_t offset, uint64_t size, bool * is_null, uint64_t * nullable_offset)
Decodes the header for a value which can be null.
Defined at line 230 of file ../../src/lib/fidl_codec/message_decoder.cc
std::unique_ptr<Value> DecodeEnvelope (uint64_t offset, const Type * type)
Decodes a value in an envelope.
Defined at line 254 of file ../../src/lib/fidl_codec/message_decoder.cc
bool CheckNullEnvelope (uint64_t offset)
Checks that we have a null envelope encoded.
Defined at line 297 of file ../../src/lib/fidl_codec/message_decoder.cc
void SkipEnvelope (uint64_t offset)
Skips an unknown envelope content.
Defined at line 333 of file ../../src/lib/fidl_codec/message_decoder.cc