takeString function
Take an owned C string result; free it; throw AimuxException on null.
Implementation
String takeString(Pointer<Utf8> ptr, Pointer<AimuxCError> err) {
if (ptr == nullptr) throw AimuxException.fromC(err.ref);
try {
return ptr.toDartString();
} finally {
aimuxFreeString(ptr);
}
}