swift-uwp/Sources/UWP/Generated/Windows.Web.Http+Impl.swift
2024-02-15 17:14:48 -08:00

75 lines
3.7 KiB
Swift

// WARNING: Please don't edit this file. It was generated by Swift/WinRT v0.0.1
// swiftlint:disable all
import Foundation
@_spi(WinRTInternal) @_spi(WinRTImplements) import WindowsFoundation
import CWinRT
public enum __IMPL_Windows_Web_Http {
public enum IHttpContentBridge : AbiInterfaceBridge {
public typealias CABI = __x_ABI_CWindows_CWeb_CHttp_CIHttpContent
public typealias SwiftABI = __ABI_Windows_Web_Http.IHttpContent
public typealias SwiftProjection = AnyIHttpContent
public static func from(abi: ComPtr<CABI>?) -> SwiftProjection? {
guard let abi = abi else { return nil }
return IHttpContentImpl(abi)
}
public static func makeAbi() -> CABI {
let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_Web_Http.IHttpContentVTable) { $0 }
return .init(lpVtbl: vtblPtr)
}
}
fileprivate class IHttpContentImpl: IHttpContent, WinRTAbiImpl {
fileprivate typealias Bridge = IHttpContentBridge
fileprivate let _default: Bridge.SwiftABI
fileprivate var thisPtr: WindowsFoundation.IInspectable { _default }
fileprivate init(_ fromAbi: ComPtr<Bridge.CABI>) {
_default = Bridge.SwiftABI(fromAbi)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.web.http.ihttpcontent.bufferallasync)
fileprivate func bufferAllAsync() throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt64, UInt64>! {
try _default.BufferAllAsyncImpl()
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.web.http.ihttpcontent.readasbufferasync)
fileprivate func readAsBufferAsync() throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UWP.AnyIBuffer?, UInt64>! {
try _default.ReadAsBufferAsyncImpl()
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.web.http.ihttpcontent.readasinputstreamasync)
fileprivate func readAsInputStreamAsync() throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UWP.AnyIInputStream?, UInt64>! {
try _default.ReadAsInputStreamAsyncImpl()
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.web.http.ihttpcontent.readasstringasync)
fileprivate func readAsStringAsync() throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<String, UInt64>! {
try _default.ReadAsStringAsyncImpl()
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.web.http.ihttpcontent.trycomputelength)
fileprivate func tryComputeLength(_ length: inout UInt64) throws -> Bool {
try _default.TryComputeLengthImpl(&length)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.web.http.ihttpcontent.writetostreamasync)
fileprivate func writeToStreamAsync(_ outputStream: UWP.AnyIOutputStream!) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt64, UInt64>! {
try _default.WriteToStreamAsyncImpl(outputStream)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.web.http.ihttpcontent.headers)
fileprivate var headers : UWP.HttpContentHeaderCollection! {
get { try! _default.get_HeadersImpl() }
}
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.web.http.ihttpcontent.close)
fileprivate func close() throws {
try _IClosable.CloseImpl()
}
}
}