Routines for demarshaling data. More...
#include <demarshaling.h>
Public Member Functions | |
Demarshaling () | |
Demarshaling (const uint8_t *data, uint32_t dataLen, Endianess endian) | |
Create a new Demarshaling class that operates on the given C array of data, with the given endianess. More... | |
~Demarshaling () | |
void | set_data (const uint8_t *data, uint32_t dataLen) |
Set the data C array to marshal/demarshal. More... | |
void | set_endianess (Endianess endian) |
void | set_data_offset (uint32_t offset) |
Set the offset in the data to demarshal. More... | |
void | align (int alignment) |
uint32_t | current_offset () const |
uint8_t | demarshal_uint8_t () |
bool | demarshal_boolean () |
int16_t | demarshal_int16_t () |
uint16_t | demarshal_uint16_t () |
int32_t | demarshal_int32_t () |
uint32_t | demarshal_uint32_t () |
int64_t | demarshal_int64_t () |
uint64_t | demarshal_uint64_t () |
double | demarshal_double () |
std::string | demarshal_string () |
Path | demarshal_path () |
Signature | demarshal_signature () |
Variant | demarshal_variant () |
Private Member Functions | |
void | is_valid (uint32_t numBytesWanted) |
Checks to make sure that we're not overruing any array via an assertion. More... | |
int16_t | demarshalShortBig () |
int16_t | demarshalShortLittle () |
int32_t | demarshalIntBig () |
int32_t | demarshalIntLittle () |
int64_t | demarshalLongBig () |
int64_t | demarshalLongLittle () |
DBUS_CXX_PROPAGATE_CONST (std::unique_ptr< priv_data >) m_priv | |
Routines for demarshaling data.
All demarshal*() methods will advance the internal data pointer the correct number of bytes to read the next piece of data.
Demarshaling::Demarshaling | ( | ) |
Demarshaling::Demarshaling | ( | const uint8_t * | data, |
uint32_t | dataLen, | ||
Endianess | endian | ||
) |
Create a new Demarshaling class that operates on the given C array of data, with the given endianess.
Demarshaling::~Demarshaling | ( | ) |
void Demarshaling::align | ( | int | alignment | ) |
uint32_t Demarshaling::current_offset | ( | ) | const |
Referenced by DBus::Message::create_from_data().
|
private |
bool Demarshaling::demarshal_boolean | ( | ) |
References demarshal_int32_t().
Referenced by demarshal_variant().
double Demarshaling::demarshal_double | ( | ) |
References demarshalLongBig(), demarshalLongLittle(), and DBus::Little.
Referenced by demarshal_variant().
int16_t Demarshaling::demarshal_int16_t | ( | ) |
References demarshalShortBig(), demarshalShortLittle(), and DBus::Little.
Referenced by demarshal_variant().
int32_t Demarshaling::demarshal_int32_t | ( | ) |
References demarshalIntBig(), demarshalIntLittle(), and DBus::Little.
Referenced by demarshal_boolean(), and demarshal_variant().
int64_t Demarshaling::demarshal_int64_t | ( | ) |
References demarshalLongBig(), demarshalLongLittle(), and DBus::Little.
Referenced by demarshal_variant().
DBus::Path Demarshaling::demarshal_path | ( | ) |
References demarshal_string().
Referenced by demarshal_variant().
DBus::Signature Demarshaling::demarshal_signature | ( | ) |
References demarshal_uint8_t().
Referenced by demarshal_variant().
std::string Demarshaling::demarshal_string | ( | ) |
References demarshal_uint32_t(), and is_valid().
Referenced by demarshal_path(), and demarshal_variant().
uint16_t Demarshaling::demarshal_uint16_t | ( | ) |
References demarshalShortBig(), demarshalShortLittle(), and DBus::Little.
Referenced by demarshal_variant().
uint32_t Demarshaling::demarshal_uint32_t | ( | ) |
References demarshalIntBig(), demarshalIntLittle(), and DBus::Little.
Referenced by DBus::Message::create_from_data(), demarshal_string(), demarshal_variant(), and DBus::priv::SimpleTransport::readMessage().
uint64_t Demarshaling::demarshal_uint64_t | ( | ) |
References demarshalLongBig(), demarshalLongLittle(), and DBus::Little.
Referenced by demarshal_variant().
uint8_t Demarshaling::demarshal_uint8_t | ( | ) |
References is_valid().
Referenced by DBus::Message::create_from_data(), demarshal_signature(), demarshal_variant(), and DBus::priv::SimpleTransport::readMessage().
DBus::Variant Demarshaling::demarshal_variant | ( | ) |
References DBus::ARRAY, DBus::Signature::begin(), DBus::BOOLEAN, DBus::BYTE, demarshal_boolean(), demarshal_double(), demarshal_int16_t(), demarshal_int32_t(), demarshal_int64_t(), demarshal_path(), demarshal_signature(), demarshal_string(), demarshal_uint16_t(), demarshal_uint32_t(), demarshal_uint64_t(), demarshal_uint8_t(), DBus::DICT_ENTRY, DBus::DOUBLE, DBus::INT16, DBus::INT32, DBus::INT64, DBus::INVALID, DBus::OBJECT_PATH, DBus::SIGNATURE, DBus::STRING, DBus::STRUCT, DBus::SignatureIterator::type(), DBus::UINT16, DBus::UINT32, DBus::UINT64, DBus::UNIX_FD, and DBus::VARIANT.
Referenced by DBus::Message::create_from_data().
|
private |
References align(), and is_valid().
Referenced by demarshal_int32_t(), and demarshal_uint32_t().
|
private |
References align(), and is_valid().
Referenced by demarshal_int32_t(), and demarshal_uint32_t().
|
private |
References align(), and is_valid().
Referenced by demarshal_double(), demarshal_int64_t(), and demarshal_uint64_t().
|
private |
References align(), and is_valid().
Referenced by demarshal_double(), demarshal_int64_t(), and demarshal_uint64_t().
|
private |
References align(), and is_valid().
Referenced by demarshal_int16_t(), and demarshal_uint16_t().
|
private |
References align(), and is_valid().
Referenced by demarshal_int16_t(), and demarshal_uint16_t().
|
private |
Checks to make sure that we're not overruing any array via an assertion.
numBytesWanted | The number of bytes that we want to pull out of the array. |
Referenced by demarshal_string(), demarshal_uint8_t(), demarshalIntBig(), demarshalIntLittle(), demarshalLongBig(), demarshalLongLittle(), demarshalShortBig(), and demarshalShortLittle().
void DBus::Demarshaling::set_data | ( | const uint8_t * | data, |
uint32_t | dataLen | ||
) |
Set the data C array to marshal/demarshal.
This also has the side effect of resetting the data offset to 0, in cases where you are demarshaling data.
data |
void Demarshaling::set_data_offset | ( | uint32_t | offset | ) |
Set the offset in the data to demarshal.
offset |
Referenced by DBus::priv::SimpleTransport::readMessage().
void Demarshaling::set_endianess | ( | Endianess | endian | ) |
Referenced by DBus::Message::create_from_data(), and DBus::priv::SimpleTransport::readMessage().