Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::platform::DBus::Reader Class Reference

Reads basic + container values out of an incoming message's argument list. More...

#include <dbus.hpp>

Public Member Functions

 Reader ()=default
 Default-constructed inert Reader — every read returns false.
bool read_string (std::string &out)
 Read a string ('s') or object-path ('o') at the cursor into out and advance.
bool read_int32 (int &out)
bool read_uint32 (unsigned &out)
bool read_double (double &out)
bool read_byte (unsigned char &out)
 Read a byte ('y') at the cursor into out and advance.
int arg_type () const
 Current argument's D-Bus type code, or 0 ('\0') when exhausted.
bool next ()
 Advance to the next argument. Returns false when there is no next.
bool recurse (Reader &out_sub)
 Descend into the container (struct / array / variant / dict-entry) at the cursor, returning a sub-Reader over its elements.

Friends

class DBus

Detailed Description

Reads basic + container values out of an incoming message's argument list.

The cursor advances on each successful read.

Constructor & Destructor Documentation

◆ Reader()

pulp::platform::DBus::Reader::Reader ( )
default

Default-constructed inert Reader — every read returns false.

Useful as the out-parameter passed to recurse().

Member Function Documentation

◆ arg_type()

int pulp::platform::DBus::Reader::arg_type ( ) const

Current argument's D-Bus type code, or 0 ('\0') when exhausted.

◆ next()

bool pulp::platform::DBus::Reader::next ( )

Advance to the next argument. Returns false when there is no next.

◆ read_byte()

bool pulp::platform::DBus::Reader::read_byte ( unsigned char & out)

Read a byte ('y') at the cursor into out and advance.

Needed to walk an 'ay' byte array such as BlueZ GattCharacteristic1.Value.

◆ read_double()

bool pulp::platform::DBus::Reader::read_double ( double & out)

◆ read_int32()

bool pulp::platform::DBus::Reader::read_int32 ( int & out)

◆ read_string()

bool pulp::platform::DBus::Reader::read_string ( std::string & out)

Read a string ('s') or object-path ('o') at the cursor into out and advance.

Returns false (leaving the cursor put) on type mismatch / end.

◆ read_uint32()

bool pulp::platform::DBus::Reader::read_uint32 ( unsigned & out)

◆ recurse()

bool pulp::platform::DBus::Reader::recurse ( Reader & out_sub)

Descend into the container (struct / array / variant / dict-entry) at the cursor, returning a sub-Reader over its elements.

The cursor is NOT advanced — call next() afterwards to step past the container. out_sub receives the sub-Reader; returns false if the cursor is not on a container (or at end). The sub-Reader is valid only while this Reader and the underlying message live.

◆ DBus

friend class DBus
friend

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/platform/include/pulp/platform/dbus.hpp