DBus::Demarshaling Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Demarshaling() [1/2]

Demarshaling::Demarshaling ( )

◆ Demarshaling() [2/2]

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::~Demarshaling ( )

Member Function Documentation

◆ align()

◆ current_offset()

uint32_t Demarshaling::current_offset ( ) const

◆ DBUS_CXX_PROPAGATE_CONST()

DBus::Demarshaling::DBUS_CXX_PROPAGATE_CONST ( std::unique_ptr< priv_data >  )
private

◆ demarshal_boolean()

bool Demarshaling::demarshal_boolean ( )

References demarshal_int32_t().

Referenced by demarshal_variant().

◆ demarshal_double()

double Demarshaling::demarshal_double ( )

◆ demarshal_int16_t()

int16_t Demarshaling::demarshal_int16_t ( )

◆ demarshal_int32_t()

int32_t Demarshaling::demarshal_int32_t ( )

◆ demarshal_int64_t()

int64_t Demarshaling::demarshal_int64_t ( )

◆ demarshal_path()

DBus::Path Demarshaling::demarshal_path ( )

References demarshal_string().

Referenced by demarshal_variant().

◆ demarshal_signature()

DBus::Signature Demarshaling::demarshal_signature ( )

References demarshal_uint8_t().

Referenced by demarshal_variant().

◆ demarshal_string()

std::string Demarshaling::demarshal_string ( )

◆ demarshal_uint16_t()

uint16_t Demarshaling::demarshal_uint16_t ( )

◆ demarshal_uint32_t()

◆ demarshal_uint64_t()

uint64_t Demarshaling::demarshal_uint64_t ( )

◆ demarshal_uint8_t()

uint8_t Demarshaling::demarshal_uint8_t ( )

◆ demarshal_variant()

◆ demarshalIntBig()

int32_t Demarshaling::demarshalIntBig ( )
private

References align(), and is_valid().

Referenced by demarshal_int32_t(), and demarshal_uint32_t().

◆ demarshalIntLittle()

int32_t Demarshaling::demarshalIntLittle ( )
private

References align(), and is_valid().

Referenced by demarshal_int32_t(), and demarshal_uint32_t().

◆ demarshalLongBig()

int64_t Demarshaling::demarshalLongBig ( )
private

◆ demarshalLongLittle()

int64_t Demarshaling::demarshalLongLittle ( )
private

◆ demarshalShortBig()

int16_t Demarshaling::demarshalShortBig ( )
private

References align(), and is_valid().

Referenced by demarshal_int16_t(), and demarshal_uint16_t().

◆ demarshalShortLittle()

int16_t Demarshaling::demarshalShortLittle ( )
private

References align(), and is_valid().

Referenced by demarshal_int16_t(), and demarshal_uint16_t().

◆ is_valid()

void Demarshaling::is_valid ( uint32_t  numBytesWanted)
private

Checks to make sure that we're not overruing any array via an assertion.

Parameters
numBytesWantedThe 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().

◆ set_data()

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.

Parameters
data

◆ set_data_offset()

void Demarshaling::set_data_offset ( uint32_t  offset)

Set the offset in the data to demarshal.

Parameters
offset

Referenced by DBus::priv::SimpleTransport::readMessage().

◆ set_endianess()

void Demarshaling::set_endianess ( Endianess  endian)

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