2 * Worldvisions Weaver Software:
3 * Copyright (C) 2004-2006 Net Integration Technologies, Inc.
5 * Wrapper code for marshalling/demarshalling WvDBusMsg objects. This is
6 * in a separate file from WvDBusMsg in case you want to use a WvDBusMsg
7 * but not our special/gross marshalling code from wvdbusmarshal_c.c.
10 #include "wvdbusmsg.h"
11 #undef interface // windows
12 #include <dbus/dbus.h>
14 WvDBusMsg
*WvDBusMsg::demarshal(WvBuf
&buf
)
17 DBusMessage
*_msg
= wvdbus_demarshal(buf
.peek(0, buf
.used()), buf
.used(),
22 WvDBusMsg
*msg
= new WvDBusMsg(_msg
);
23 dbus_message_unref(_msg
);
31 size_t WvDBusMsg::demarshal_bytes_needed(WvBuf
&buf
)
33 size_t used
= buf
.used();
34 return wvdbus_message_length(buf
.peek(0, used
), used
);
38 void WvDBusMsg::marshal(WvBuf
&buf
)
43 if (wvdbus_marshal(*this, &cbuf
, &len
))