toString method

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.

Implementation

String toString() {
  var tmp0 = 0;
  tmp0 = _box.borrow();
  final tmp1 = _api._roomIdToString(
    tmp0,
  );
  final tmp3 = tmp1.arg0;
  final tmp4 = tmp1.arg1;
  final tmp5 = tmp1.arg2;
  if (tmp4 == 0) {
    print("returning empty string");
    return "";
  }
  final ffi.Pointer<ffi.Uint8> tmp3_ptr = ffi.Pointer.fromAddress(tmp3);
  List<int> tmp3_buf = [];
  final tmp3_precast = tmp3_ptr.cast<ffi.Uint8>();
  for (int i = 0; i < tmp4; i++) {
    int char = tmp3_precast.elementAt(i).value;
    tmp3_buf.add(char);
  }
  final tmp2 = utf8.decode(tmp3_buf, allowMalformed: true);
  if (tmp5 > 0) {
    final ffi.Pointer<ffi.Void> tmp3_0;
    tmp3_0 = ffi.Pointer.fromAddress(tmp3);
    _api.__deallocate(tmp3_0, tmp5 * 1, 1);
  }
  return tmp2;
}