class PacketReader
Defined at line 13 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
Reads values from a binary packet buffer.
Public Methods
void PacketReader (std::vector<uint8_t> packet)
Constructs a packet reader.
Defined at line 12 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
void ~PacketReader ()
Defined at line 15 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
bool GetBytes (size_t count, void * dest)
Consumes |count| bytes from the packet and copies them to |dest| if at
least |count| bytes remain in the packet. If less than |count| bytes remain
in the packet, this method returns false and |healthy| returns false
thereafter.
Defined at line 17 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
bool healthy ()
Determines whether this |PacketReader| has been successful so far.
Defined at line 21 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
void MarkUnhealthy ()
Marks the deserializer unhealthy.
Defined at line 24 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
size_t bytes_consumed ()
Returns the number of bytes consumed so far.
Defined at line 27 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
size_t bytes_remaining ()
Returns the number of bytes remaining to be consumed.
Defined at line 30 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
const uint8_t * Bytes (size_t count)
Consumes |count| bytes from the packet and returns a pointer to them if
at least |count| bytes remain in the packet. If less than |count| bytes
remain in the packet, this method returns nullptr and |healthy| returns
false thereafter.
Defined at line 32 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
bool complete ()
Determines whether this |PacketReader| has successfully consumed the entire
packet.
Defined at line 34 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
bool SetBytesConsumed (size_t bytes_consumed)
Changes the read position (i.e. bytes consumed) to the specified value.
If the value is out of range, |healthy| returns false thereafter. Returns
the resulting value of |healthy()|.
Defined at line 43 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
bool SetBytesRemaining (size_t bytes_remaining)
Changes the number of bytes remaining to the specified value. If the value
is out of range for the packet supplied in the constructor, |healthy|
returns false thereafter. Returns the resulting value of |healthy()|.
Defined at line 53 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
PacketReader & operator>> (bool & value)
Defined at line 63 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
PacketReader & operator>> (uint8_t & value)
Defined at line 68 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
PacketReader & operator>> (uint16_t & value)
Defined at line 73 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
void PacketReader (const PacketReader & )
Disallow copy, assign and move.
Defined at line 76 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
void PacketReader (PacketReader && )
Defined at line 77 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
PacketReader & operator= (const PacketReader & )
Defined at line 78 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
PacketReader & operator= (PacketReader && )
Defined at line 79 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.h
PacketReader & operator>> (uint32_t & value)
Defined at line 79 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
PacketReader & operator>> (uint64_t & value)
Defined at line 85 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
PacketReader & operator>> (int8_t & value)
Defined at line 91 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
PacketReader & operator>> (int16_t & value)
Defined at line 96 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
PacketReader & operator>> (int32_t & value)
Defined at line 102 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc
PacketReader & operator>> (int64_t & value)
Defined at line 108 of file ../../src/connectivity/network/mdns/service/encoding/packet_reader.cc