DBusUtilities

Various utility routines related to D-Bus.

Members

Static functions

addressGetForBusSync
string addressGetForBusSync(GBusType busType, Cancellable cancellable)

Synchronously looks up the D-Bus address for the well-known message bus instance specified by bus_type. This may involve using various platform specific mechanisms. Since 2.26

addressGetStream
void addressGetStream(string address, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

Asynchronously connects to an endpoint specified by address and sets up the connection so it is in a state to run the client-side of the D-Bus authentication conversation. When the operation is finished, callback will be invoked. You can then call g_dbus_address_get_stream_finish() to get the result of the operation. This is an asynchronous failable function. See g_dbus_address_get_stream_sync() for the synchronous version. Since 2.26

addressGetStreamFinish
IOStream addressGetStreamFinish(AsyncResultIF res, string outGuid)

Finishes an operation started with g_dbus_address_get_stream(). Since 2.26

addressGetStreamSync
IOStream addressGetStreamSync(string address, string outGuid, Cancellable cancellable)

Synchronously connects to an endpoint specified by address and sets up the connection so it is in a state to run the client-side of the D-Bus authentication conversation. This is a synchronous failable function. See g_dbus_address_get_stream() for the asynchronous version. Since 2.26

generateGuid
string generateGuid()

Generate a D-Bus GUID that can be used with e.g. g_dbus_connection_new(). See the D-Bus specification regarding what strings are valid D-Bus GUID (for example, D-Bus GUIDs are not RFC-4122 compliant). Since 2.26

gvalueToGvariant
Variant gvalueToGvariant(Value gvalue, VariantType type)

Converts a GValue to a GVariant of the type indicated by the type parameter. Since 2.30

gvariantToGvalue
void gvariantToGvalue(Variant value, Value outGvalue)

Converts a GVariant to a GValue. If value is floating, it is consumed. The rules specified in the g_dbus_gvalue_to_gvariant() function are used - this function is essentially its reverse form. The conversion never fails - a valid GValue is always returned in out_gvalue. Since 2.30

isAddress
int isAddress(string string)

Checks if string is a D-Bus address. This doesn't check if string is actually supported by GDBusServer or GDBusConnection - use g_dbus_is_supported_address() to do more checks. Since 2.26

isGuid
int isGuid(string string)

Checks if string is a D-Bus GUID. See the D-Bus specification regarding what strings are valid D-Bus GUID (for example, D-Bus GUIDs are not RFC-4122 compliant). Since 2.26

isInterfaceName
int isInterfaceName(string string)

Checks if string is a valid D-Bus interface name. Since 2.26

isMemberName
int isMemberName(string string)

Checks if string is a valid D-Bus member (e.g. signal or method) name. Since 2.26

isName
int isName(string string)

Checks if string is a valid D-Bus bus name (either unique or well-known). Since 2.26

isSupportedAddress
int isSupportedAddress(string string)

Like g_dbus_is_address() but also checks if the library suppors the transports in string and that key/value pairs for each transport are valid. Since 2.26

isUniqueName
int isUniqueName(string string)

Checks if string is a valid D-Bus unique bus name. Since 2.26

Meta