addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. NSURLRequest? connection_willSendRequest_redirectResponse_(
    1. NSURLConnection,
    2. NSURLRequest,
    3. NSURLResponse?
    )?,
  3. void connection_didReceiveResponse_(
    1. NSURLConnection,
    2. NSURLResponse
    )?,
  4. void connection_didReceiveData_(
    1. NSURLConnection,
    2. NSData
    )?,
  5. NSInputStream? connection_needNewBodyStream_(
    1. NSURLConnection,
    2. NSURLRequest
    )?,
  6. void connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite_(
    1. NSURLConnection,
    2. DartNSInteger,
    3. DartNSInteger,
    4. DartNSInteger,
    )?,
  7. NSCachedURLResponse? connection_willCacheResponse_(
    1. NSURLConnection,
    2. NSCachedURLResponse
    )?,
  8. void connectionDidFinishLoading_(
    1. NSURLConnection
    )?,
  9. void connection_didFailWithError_(
    1. NSURLConnection,
    2. NSError
    )?,
  10. bool connectionShouldUseCredentialStorage_(
    1. NSURLConnection
    )?,
  11. void connection_willSendRequestForAuthenticationChallenge_(
    1. NSURLConnection,
    2. NSURLAuthenticationChallenge
    )?,
  12. bool connection_canAuthenticateAgainstProtectionSpace_(
    1. NSURLConnection,
    2. NSURLProtectionSpace
    )?,
  13. void connection_didReceiveAuthenticationChallenge_(
    1. NSURLConnection,
    2. NSURLAuthenticationChallenge
    )?,
  14. void connection_didCancelAuthenticationChallenge_(
    1. NSURLConnection,
    2. NSURLAuthenticationChallenge
    )?,
  15. bool $keepIsolateAlive = true,
})
override

Adds the implementation of the NSURLConnectionDataDelegate protocol to an existing objc.ObjCProtocolBuilder.

Note: You cannot call this method after you have called builder.build.

Implementation

static void addToBuilder(
  objc.ObjCProtocolBuilder builder, {
  NSURLRequest? Function(NSURLConnection, NSURLRequest, NSURLResponse?)?
  connection_willSendRequest_redirectResponse_,
  void Function(NSURLConnection, NSURLResponse)?
  connection_didReceiveResponse_,
  void Function(NSURLConnection, objc.NSData)? connection_didReceiveData_,
  objc.NSInputStream? Function(NSURLConnection, NSURLRequest)?
  connection_needNewBodyStream_,
  void Function(NSURLConnection, DartNSInteger, DartNSInteger, DartNSInteger)?
  connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite_,
  NSCachedURLResponse? Function(NSURLConnection, NSCachedURLResponse)?
  connection_willCacheResponse_,
  void Function(NSURLConnection)? connectionDidFinishLoading_,
  void Function(NSURLConnection, objc.NSError)? connection_didFailWithError_,
  bool Function(NSURLConnection)? connectionShouldUseCredentialStorage_,
  void Function(NSURLConnection, NSURLAuthenticationChallenge)?
  connection_willSendRequestForAuthenticationChallenge_,
  bool Function(NSURLConnection, NSURLProtectionSpace)?
  connection_canAuthenticateAgainstProtectionSpace_,
  void Function(NSURLConnection, NSURLAuthenticationChallenge)?
  connection_didReceiveAuthenticationChallenge_,
  void Function(NSURLConnection, NSURLAuthenticationChallenge)?
  connection_didCancelAuthenticationChallenge_,
  bool $keepIsolateAlive = true,
}) {
  NSURLConnectionDataDelegate.connection_willSendRequest_redirectResponse_
      .implement(builder, connection_willSendRequest_redirectResponse_);
  NSURLConnectionDataDelegate.connection_didReceiveResponse_.implement(
    builder,
    connection_didReceiveResponse_,
  );
  NSURLConnectionDataDelegate.connection_didReceiveData_.implement(
    builder,
    connection_didReceiveData_,
  );
  NSURLConnectionDataDelegate.connection_needNewBodyStream_.implement(
    builder,
    connection_needNewBodyStream_,
  );
  NSURLConnectionDataDelegate
      .connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite_
      .implement(
        builder,
        connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite_,
      );
  NSURLConnectionDataDelegate.connection_willCacheResponse_.implement(
    builder,
    connection_willCacheResponse_,
  );
  NSURLConnectionDataDelegate.connectionDidFinishLoading_.implement(
    builder,
    connectionDidFinishLoading_,
  );
  NSURLConnectionDataDelegate.connection_didFailWithError_.implement(
    builder,
    connection_didFailWithError_,
  );
  NSURLConnectionDataDelegate.connectionShouldUseCredentialStorage_.implement(
    builder,
    connectionShouldUseCredentialStorage_,
  );
  NSURLConnectionDataDelegate
      .connection_willSendRequestForAuthenticationChallenge_
      .implement(
        builder,
        connection_willSendRequestForAuthenticationChallenge_,
      );
  NSURLConnectionDataDelegate
      .connection_canAuthenticateAgainstProtectionSpace_
      .implement(builder, connection_canAuthenticateAgainstProtectionSpace_);
  NSURLConnectionDataDelegate.connection_didReceiveAuthenticationChallenge_
      .implement(builder, connection_didReceiveAuthenticationChallenge_);
  NSURLConnectionDataDelegate.connection_didCancelAuthenticationChallenge_
      .implement(builder, connection_didCancelAuthenticationChallenge_);
  builder.addProtocol($protocol);
}