DBusArray constructor

DBusArray(
  1. DBusSignature childSignature, [
  2. Iterable<DBusValue> children = const []
])

Creates a new empty D-Bus array containing children.

childSignature must contain a single type. An exception will be thrown if a DBusValue in children doesn't have a signature matching childSignature.

Implementation

DBusArray(this.childSignature, [Iterable<DBusValue> children = const []])
    : children = children.toList() {
  if (!childSignature.isSingleCompleteType) {
    throw ArgumentError.value(childSignature, 'childSignature',
        'Array value type must be a single complete type');
  }

  for (var child in children) {
    if (child.signature.value != childSignature.value) {
      throw ArgumentError.value(children, 'children',
          "Provided children don't match array signature ${childSignature.value}");
    }
  }
}