DBusSignature class
D-Bus value that indicates a set of D-Bus types.
A signature may be empty (''), contain a single type (e.g. 's'), or contain multiple types (e.g. 'asbo').
The following patterns map to classes:
y
→ DBusByteb
→ DBusBooleann
→ DBusInt16q
→ DBusUint16i
→ DBusInt32u
→ DBusUint32x
→ DBusInt64t
→ DBusUint64d
→ DBusDoubles
→ DBusStringo
→ DBusObjectPathg
→ DBusSignaturev
→ DBusVariantm
→ DBusMaybe- 'h' → DBusUnixFd
(xyz...)
→ DBusStruct (x
,y
,z
represent the child value signatures).av
→ DBusArray (v represents the array value signature).a{kv}
→ DBusDict (k
andv
represent the key and value signatures).
Constructors
- DBusSignature(String value)
- Create a new D-Bus signature with the given value.
- DBusSignature.array(DBusSignature type)
-
Create a new D-Bus signature of an array of the given
type
(DBusArray).factory - DBusSignature.dict(DBusSignature key, DBusSignature value)
-
Create a new D-Bus signature of a dictionary of the given
key
andvalue
types (DBusDict).factory - DBusSignature.maybe(DBusSignature type)
-
Create a new D-Bus signature of a value that contains a D-Bus type or null (DBusMaybe).
factory
-
DBusSignature.struct(Iterable<
DBusSignature> types) -
Create a new D-Bus signature of a struct of the given
types
(DBusStruct).factory - DBusSignature.unchecked(String value)
-
Create a new D-Bus signature with the given value.
const
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- isBasic → bool
-
True if this signature is for a basic type (byte, boolean, int16, uint16, int32, uint32, int64, uint64, double, unix_fd).
no setter
- isSingleCompleteType → bool
-
True if this signature is for a single complete type, i.e. represents a single dbus value.
If False, then use split to get the types this signature contains.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signature → DBusSignature
-
Gets the signature for this value.
no setteroverride
- value → String
-
A D-Bus signature string.
final
Methods
-
asArray(
) → List< DBusValue> -
Extracts the array inside this value. Only works if signature is an array type, e.g 'as'.
inherited
-
asBoolean(
) → bool -
Converts this value to the native Dart representation of a boolean. Only works if signature is 'b'.
inherited
-
asBooleanArray(
) → Iterable< bool> -
Extracts the boolean values inside this array. Only works if signature is 'ab'.
inherited
-
asByte(
) → int -
Converts this value to the native Dart representation of a byte. Only works if signature is 'y'.
inherited
-
asByteArray(
) → Iterable< int> -
Extracts the bytes inside this array. Only works if signature is 'ay'.
inherited
-
asDict(
) → Map< DBusValue, DBusValue> -
Extracts the dictionary inside this vlaue. Only works if signature is a dictionary type, e.g 'a{os}'.
inherited
-
asDouble(
) → double -
Converts this value to the native Dart representation of a 64 bit floating point number. Only works if signature is 'd'.
inherited
-
asDoubleArray(
) → Iterable< double> -
Extracts the 64 bit floating point numbers inside this array. Only works if signature is 'ad'.
inherited
-
asInt16(
) → int -
Converts this value to the native Dart representation of a 16 bit signed integer. Only works if signature is 'n'.
inherited
-
asInt16Array(
) → Iterable< int> -
Extracts the 16 bit signed integers inside this array. Only works if signature is 'an'.
inherited
-
asInt32(
) → int -
Converts this value to the native Dart representation of a 32 bit signed integer. Only works if signature is 'i'.
inherited
-
asInt32Array(
) → Iterable< int> -
Extracts the 32 bit signed integers inside this array. Only works if signature is 'ai'.
inherited
-
asInt64(
) → int -
Converts this value to the native Dart representation of a 64 bit signed integer. Only works if signature is 'x'.
inherited
-
asInt64Array(
) → Iterable< int> -
Extracts the 64 bit signed integers inside this array. Only works if signature is 'ax'.
inherited
-
asMaybe(
) → DBusValue? -
Extracts the maybe type inside this value. Only works if signature is a maybe type, e.g. 'mi'.
inherited
-
asObjectPath(
) → DBusObjectPath -
Extracts the object path inside this value. Only works if signature is 'o'.
inherited
-
asObjectPathArray(
) → Iterable< DBusObjectPath> -
Extracts the object paths inside this array. Only works if signature is 'ao'.
inherited
-
asSignature(
) → DBusSignature -
Extracts the signature inside this value. Only works if signature is 'g'.
inherited
-
asSignatureArray(
) → Iterable< DBusSignature> -
Extracts the signatures inside this array. Only works if signature is 'ag'.
inherited
-
asString(
) → String -
Converts this value to the native Dart representation of a string. Only works if signature is 's'.
inherited
-
asStringArray(
) → Iterable< String> -
Extracts the strings inside this array. Only works if signature is 'as'.
inherited
-
asStringVariantDict(
) → Map< String, DBusValue> -
Extracts the string to variant dictionary inside this value. Only works if signature is 'a{sv}'.
inherited
-
asStruct(
) → List< DBusValue> -
Extracts this child values inside this struct. Only works if signature is a struct type, e.g '(si)'.
inherited
-
asUint16(
) → int -
Converts this value to the native Dart representation of a 16 bit unsigned integer. Only works if signature is 'q'.
inherited
-
asUint16Array(
) → Iterable< int> -
Extracts the 16 bit unsigned integers inside this array. Only works if signature is 'aq'.
inherited
-
asUint32(
) → int -
Converts this value to the native Dart representation of a 32 bit unsigned integer. Only works if signature is 'u'.
inherited
-
asUint32Array(
) → Iterable< int> -
Extracts the 32 bit unsigned integers inside this array. Only works if signature is 'au'.
inherited
-
asUint64(
) → int -
Converts this value to the native Dart representation of a 64 bit unsigned integer. Only works if signature is 't'.
inherited
-
asUint64Array(
) → Iterable< int> -
Extracts the 64 bit unsigned integers inside this array. Only works if signature is 'at'.
inherited
-
asUnixFd(
) → ResourceHandle -
Extracts the ResourceHandle inside this unix file descriptor D-Bus value. Only works if signature is 'h'.
inherited
-
asUnixFdArray(
) → Iterable< ResourceHandle> -
Extracts the resource handles inside this array of unix file descriptors. Only works if signature is 'ah'.
inherited
-
asVariant(
) → DBusValue -
Extracts the value stored inside this variant. Only works if signature is 'v'.
inherited
-
asVariantArray(
) → Iterable< DBusValue> -
Extracts the values inside this variant array. Only works if signature is 'av'.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
split(
) → List< DBusSignature> -
Splits this signature into a list of signatures with single complete types, e.g. 'asbo' ->
'as', 'b', 'o'
-
toNative(
) → dynamic -
Converts this value to a native Dart representation.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator +(
DBusSignature other) → DBusSignature -
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- boolean → const DBusSignature
- D-Bus signature of a boolean value (DBusBoolean).
- byte → const DBusSignature
- D-Bus signature of an unsigned 8 bit value (DBusByte).
- double → const DBusSignature
- D-Bus signature of a 64 bit floating point value (DBusDouble).
- empty → const DBusSignature
- Empty "void" signature.
- int16 → const DBusSignature
- D-Bus signature of a signed 16 bit integer (DBusInt16).
- int32 → const DBusSignature
- D-Bus signature of a signed 32 bit integer (DBusInt32).
- int64 → const DBusSignature
- D-Bus signature of a signed 64 bit integer (DBusInt64).
- objectPath → const DBusSignature
- D-Bus signature of an object path (DBusObjectPath).
- string → const DBusSignature
- D-Bus signature of a Unicode text string (DBusString).
- uint16 → const DBusSignature
- D-Bus signature of an unsigned 16 bit integer (DBusUint16).
- uint32 → const DBusSignature
- D-Bus signature of an unsigned 32 bit integer (DBusUint32).
- uint64 → const DBusSignature
- D-Bus signature of an unsigned 64 bit integer (DBusUint64).
- unixFd → const DBusSignature
- D-Bus signature of a Unix file descriptor (DBusUnixFd).
- variant → const DBusSignature
- Create a new D-Bus signature of a variant that contains any D-Bus type (DBusVariant).