stringWithContentsOfURL static method

NSMutableString? stringWithContentsOfURL(
  1. NSURL url, {
  2. required int encoding,
})
override

stringWithContentsOfURL:encoding:error:

Implementation

static NSMutableString? stringWithContentsOfURL(
  NSURL url, {
  required int encoding,
}) {
  final $err = pkg_ffi.calloc<ffi.Pointer<objc.ObjCObjectImpl>>();
  try {
    final $ret = _objc_msgSend_1nomli1(
      _class_NSMutableString,
      _sel_stringWithContentsOfURL_encoding_error_,
      url.ref.pointer,
      encoding,
      $err,
    );
    objc.NSErrorException.checkErrorPointer($err.value);
    return $ret.address == 0
        ? null
        : NSMutableString.fromPointer($ret, retain: true, release: true);
  } finally {
    pkg_ffi.calloc.free($err);
  }
}