17 #include "wvstringlist.h"
21 struct DBusMessageIter;
36 WvDBusMsg(WvStringParm busname, WvStringParm objectname,
37 WvStringParm ifc, WvStringParm method);
52 operator DBusMessage* ()
const;
88 uint32_t get_serial()
const;
89 uint32_t get_replyserial()
const;
90 bool is_reply()
const;
179 DBusMessageIter *
const first, *
const it;
185 Iter(
const DBusMessageIter &_first);
223 {
next();
return *
this; }
251 operator int64_t()
const {
return get_int(); }
252 operator int32_t()
const {
return get_int(); }
253 operator int16_t()
const {
return get_int(); }
254 operator int8_t()
const {
return get_int(); }
255 operator bool()
const {
return get_int() != 0; }
262 operator uint64_t()
const {
return get_uint(); }
263 operator uint32_t()
const {
return get_uint(); }
264 operator uint16_t()
const {
return get_uint(); }
265 operator uint8_t()
const {
return get_uint(); }
272 operator double()
const {
return get_double(); }
273 operator float()
const {
return get_double(); }
286 mutable DBusMessage *msg;
301 DBusMessage *setup1(
WvDBusMsg &in_reply_to,
302 WvStringParm errname, WvStringParm message);
306 WvStringParm errname, WvStringParm message)
307 :
WvDBusMsg(setup1(in_reply_to, errname, message))
313 WvStringParm errname, WVSTRING_FORMAT_DECL)
321 #endif // __WVDBUSMSG_H
void send(WvDBusConn &conn)
A shortcut for sending this message on the given connection.
static WvDBusMsg * demarshal(WvBuf &buf)
Demarshals a new WvDBusMsg from a buffer containing its binary DBus protocol representation.
bool cur() const
Returns: true if the current link is valid.
bool iserror() const
Return true if this message is an error response.
bool next()
Moves the iterator along the list to point to the next element.
WvDBusMsg & array_start(WvStringParm element_type)
Start an array.
Iter & getnext()
Same as next(), but returns *this instead so you can convert the new item to the right value type.
WvDBusMsg & append(const char *s)
The following methods are designed to allow appending various arguments to the message.
WvDBusMsg reply()
Generate a message that will be a reply to this one.
void rewind()
Rewinds the iterator to make it point to an imaginary element preceeding the first element of the lis...
WvDBusMsg & array_end()
End an array started with array_start().
void marshal(WvBuf &buf)
Locks this message, encodes it in DBus binary protocol format, and adds it to the given buffer.
WvString is an implementation of a simple and efficient printable-string class.
WvString * ptr() const
Returns a pointer to the WvString at the iterator's current location.
WvDBusMsg & varray_end()
End an array started with array_start().
uint64_t get_uint() const
Get the current element as a uint64_t (possible for all integer types)
int64_t get_int() const
Get the current element as an int64_t (possible for all integer types)
Specialization of WvBufBase for unsigned char type buffers intended for use with raw memory buffers.
WvDBusMsg & struct_end()
End a struct started with struct_start().
WvString get_all()
Return a WvString representation of all elements in a single string.
WvDBusMsg & variant_end()
End a variant.
WvDBusMsg(WvStringParm busname, WvStringParm objectname, WvStringParm ifc, WvStringParm method)
Constructs a new WvDBus message.
WvDBusMsg & varray_start(WvStringParm element_type)
Start a variant-array.
Iter open() const
Returns a sub-iterator for walking through recursive types, such as arrays, structs,...
WvDBusMsg & struct_start(WvStringParm element_type)
Start a struct.
WvDBusMsg & variant_start(WvStringParm element_type)
Start a variant.
double get_double() const
Get the current element as a double (possible for all integer and floating point types)
WvString get_str() const
Get the current element as a string (possible for all types).
This is a WvList of WvStrings, and is a really handy way to parse strings.
int type() const
Returns the data type of the current element.
static size_t demarshal_bytes_needed(WvBuf &buf)
Given a buffer containing what might be the header of a DBus message, checks how many bytes need to b...