1536 lines
77 KiB
Swift
1536 lines
77 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
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.byteorder)
|
|
public typealias ByteOrder = __x_ABI_CWindows_CStorage_CStreams_CByteOrder
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.fileopendisposition)
|
|
public typealias FileOpenDisposition = __x_ABI_CWindows_CStorage_CStreams_CFileOpenDisposition
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inputstreamoptions)
|
|
public typealias InputStreamOptions = __x_ABI_CWindows_CStorage_CStreams_CInputStreamOptions
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.unicodeencoding)
|
|
public typealias UnicodeEncoding = __x_ABI_CWindows_CStorage_CStreams_CUnicodeEncoding
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.buffer)
|
|
public final class Buffer : WinRTClass, IBufferByteAccess, IBuffer {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IBuffer
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIBuffer
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIBuffer>?) -> Buffer? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
private static let _IBufferFactory: __ABI_Windows_Storage_Streams.IBufferFactory = try! RoGetActivationFactory(HString("Windows.Storage.Streams.Buffer"))
|
|
public init(_ capacity: UInt32) {
|
|
super.init(try! Self._IBufferFactory.CreateImpl(capacity))
|
|
}
|
|
|
|
private static let _IBufferStatics: __ABI_Windows_Storage_Streams.IBufferStatics = try! RoGetActivationFactory(HString("Windows.Storage.Streams.Buffer"))
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.buffer.createcopyfrommemorybuffer)
|
|
public static func createCopyFromMemoryBuffer(_ input: WindowsFoundation.AnyIMemoryBuffer!) -> Buffer! {
|
|
return try! _IBufferStatics.CreateCopyFromMemoryBufferImpl(input)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.buffer.creatememorybufferoveribuffer)
|
|
public static func createMemoryBufferOverIBuffer(_ input: AnyIBuffer!) -> WindowsFoundation.MemoryBuffer! {
|
|
return try! _IBufferStatics.CreateMemoryBufferOverIBufferImpl(input)
|
|
}
|
|
|
|
private lazy var _IBufferByteAccess: __ABI_.IBufferByteAccess! = getInterfaceForCaching()
|
|
public var buffer: UnsafeMutablePointer<UInt8>? {
|
|
get throws {
|
|
let bufferByteAccess: WindowsFoundation.__ABI_.IBufferByteAccess = try _IBufferByteAccess.QueryInterface()
|
|
return try bufferByteAccess.Buffer()
|
|
}
|
|
}
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.buffer.capacity)
|
|
public var capacity : UInt32 {
|
|
get { try! _default.get_CapacityImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.buffer.length)
|
|
public var length : UInt32 {
|
|
get { try! _default.get_LengthImpl() }
|
|
set { try! _default.put_LengthImpl(newValue) }
|
|
}
|
|
|
|
deinit {
|
|
_IBufferByteAccess = nil
|
|
_default = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader)
|
|
public final class DataReader : WinRTClass, IDataReader, WindowsFoundation.IClosable {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IDataReader
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIDataReader
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIDataReader>?) -> DataReader? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
private static let _IDataReaderFactory: __ABI_Windows_Storage_Streams.IDataReaderFactory = try! RoGetActivationFactory(HString("Windows.Storage.Streams.DataReader"))
|
|
public init(_ inputStream: AnyIInputStream!) {
|
|
super.init(try! Self._IDataReaderFactory.CreateDataReaderImpl(inputStream))
|
|
}
|
|
|
|
private static let _IDataReaderStatics: __ABI_Windows_Storage_Streams.IDataReaderStatics = try! RoGetActivationFactory(HString("Windows.Storage.Streams.DataReader"))
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.frombuffer)
|
|
public static func fromBuffer(_ buffer: AnyIBuffer!) -> DataReader! {
|
|
return try! _IDataReaderStatics.FromBufferImpl(buffer)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readbyte)
|
|
public func readByte() throws -> UInt8 {
|
|
try _default.ReadByteImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readbuffer)
|
|
public func readBuffer(_ length: UInt32) throws -> AnyIBuffer! {
|
|
try _default.ReadBufferImpl(length)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readboolean)
|
|
public func readBoolean() throws -> Bool {
|
|
try _default.ReadBooleanImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readguid)
|
|
public func readGuid() throws -> Foundation.UUID {
|
|
try _default.ReadGuidImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readint16)
|
|
public func readInt16() throws -> Int16 {
|
|
try _default.ReadInt16Impl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readint32)
|
|
public func readInt32() throws -> Int32 {
|
|
try _default.ReadInt32Impl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readint64)
|
|
public func readInt64() throws -> Int64 {
|
|
try _default.ReadInt64Impl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readuint16)
|
|
public func readUInt16() throws -> UInt16 {
|
|
try _default.ReadUInt16Impl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readuint32)
|
|
public func readUInt32() throws -> UInt32 {
|
|
try _default.ReadUInt32Impl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readuint64)
|
|
public func readUInt64() throws -> UInt64 {
|
|
try _default.ReadUInt64Impl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readsingle)
|
|
public func readSingle() throws -> Float {
|
|
try _default.ReadSingleImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readdouble)
|
|
public func readDouble() throws -> Double {
|
|
try _default.ReadDoubleImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readstring)
|
|
public func readString(_ codeUnitCount: UInt32) throws -> String {
|
|
try _default.ReadStringImpl(codeUnitCount)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readdatetime)
|
|
public func readDateTime() throws -> WindowsFoundation.DateTime {
|
|
try _default.ReadDateTimeImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.readtimespan)
|
|
public func readTimeSpan() throws -> WindowsFoundation.TimeSpan {
|
|
try _default.ReadTimeSpanImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.loadasync)
|
|
public func loadAsync(_ count: UInt32) throws -> DataReaderLoadOperation! {
|
|
try _default.LoadAsyncImpl(count)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.detachbuffer)
|
|
public func detachBuffer() throws -> AnyIBuffer! {
|
|
try _default.DetachBufferImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.detachstream)
|
|
public func detachStream() throws -> AnyIInputStream! {
|
|
try _default.DetachStreamImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.byteorder)
|
|
public var byteOrder : ByteOrder {
|
|
get { try! _default.get_ByteOrderImpl() }
|
|
set { try! _default.put_ByteOrderImpl(newValue) }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.inputstreamoptions)
|
|
public var inputStreamOptions : InputStreamOptions {
|
|
get { try! _default.get_InputStreamOptionsImpl() }
|
|
set { try! _default.put_InputStreamOptionsImpl(newValue) }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.unconsumedbufferlength)
|
|
public var unconsumedBufferLength : UInt32 {
|
|
get { try! _default.get_UnconsumedBufferLengthImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.unicodeencoding)
|
|
public var unicodeEncoding : UnicodeEncoding {
|
|
get { try! _default.get_UnicodeEncodingImpl() }
|
|
set { try! _default.put_UnicodeEncodingImpl(newValue) }
|
|
}
|
|
|
|
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareader.close)
|
|
public func close() throws {
|
|
try _IClosable.CloseImpl()
|
|
}
|
|
|
|
deinit {
|
|
_default = nil
|
|
_IClosable = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareaderloadoperation)
|
|
public final class DataReaderLoadOperation : WinRTClass, IAsyncOperation, WindowsFoundation.IAsyncInfo {
|
|
public typealias TResult = UInt32
|
|
private typealias SwiftABI = UWP.IAsyncOperationUInt32
|
|
private typealias CABI = __x_ABI_C__FIAsyncOperation_1_UINT32
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_C__FIAsyncOperation_1_UINT32>?) -> DataReaderLoadOperation? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareaderloadoperation.getresults)
|
|
public func getResults() throws -> UInt32 {
|
|
try _default.GetResultsImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareaderloadoperation.completed)
|
|
public var completed : AsyncOperationCompletedHandler<UInt32>? {
|
|
get { try! _default.get_CompletedImpl() }
|
|
set { try! _default.put_CompletedImpl(newValue) }
|
|
}
|
|
|
|
private lazy var _IAsyncInfo: __ABI_Windows_Foundation.IAsyncInfo! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareaderloadoperation.cancel)
|
|
public func cancel() throws {
|
|
try _IAsyncInfo.CancelImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareaderloadoperation.close)
|
|
public func close() throws {
|
|
try _IAsyncInfo.CloseImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareaderloadoperation.errorcode)
|
|
public var errorCode : HRESULT {
|
|
get { try! _IAsyncInfo.get_ErrorCodeImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareaderloadoperation.id)
|
|
public var id : UInt32 {
|
|
get { try! _IAsyncInfo.get_IdImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datareaderloadoperation.status)
|
|
public var status : WindowsFoundation.AsyncStatus {
|
|
get { try! _IAsyncInfo.get_StatusImpl() }
|
|
}
|
|
|
|
deinit {
|
|
_default = nil
|
|
_IAsyncInfo = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter)
|
|
public final class DataWriter : WinRTClass, IDataWriter, WindowsFoundation.IClosable {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IDataWriter
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIDataWriter
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIDataWriter>?) -> DataWriter? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
override public init() {
|
|
super.init(try! RoActivateInstance(HString("Windows.Storage.Streams.DataWriter")))
|
|
}
|
|
|
|
private static let _IDataWriterFactory: __ABI_Windows_Storage_Streams.IDataWriterFactory = try! RoGetActivationFactory(HString("Windows.Storage.Streams.DataWriter"))
|
|
public init(_ outputStream: AnyIOutputStream!) {
|
|
super.init(try! Self._IDataWriterFactory.CreateDataWriterImpl(outputStream))
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writebyte)
|
|
public func writeByte(_ value: UInt8) throws {
|
|
try _default.WriteByteImpl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writebuffer)
|
|
public func writeBuffer(_ buffer: AnyIBuffer!) throws {
|
|
try _default.WriteBufferImpl(buffer)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writebuffer)
|
|
public func writeBuffer(_ buffer: AnyIBuffer!, _ start: UInt32, _ count: UInt32) throws {
|
|
try _default.WriteBufferRangeImpl(buffer, start, count)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writeboolean)
|
|
public func writeBoolean(_ value: Bool) throws {
|
|
try _default.WriteBooleanImpl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writeguid)
|
|
public func writeGuid(_ value: Foundation.UUID) throws {
|
|
try _default.WriteGuidImpl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writeint16)
|
|
public func writeInt16(_ value: Int16) throws {
|
|
try _default.WriteInt16Impl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writeint32)
|
|
public func writeInt32(_ value: Int32) throws {
|
|
try _default.WriteInt32Impl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writeint64)
|
|
public func writeInt64(_ value: Int64) throws {
|
|
try _default.WriteInt64Impl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writeuint16)
|
|
public func writeUInt16(_ value: UInt16) throws {
|
|
try _default.WriteUInt16Impl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writeuint32)
|
|
public func writeUInt32(_ value: UInt32) throws {
|
|
try _default.WriteUInt32Impl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writeuint64)
|
|
public func writeUInt64(_ value: UInt64) throws {
|
|
try _default.WriteUInt64Impl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writesingle)
|
|
public func writeSingle(_ value: Float) throws {
|
|
try _default.WriteSingleImpl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writedouble)
|
|
public func writeDouble(_ value: Double) throws {
|
|
try _default.WriteDoubleImpl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writedatetime)
|
|
public func writeDateTime(_ value: WindowsFoundation.DateTime) throws {
|
|
try _default.WriteDateTimeImpl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writetimespan)
|
|
public func writeTimeSpan(_ value: WindowsFoundation.TimeSpan) throws {
|
|
try _default.WriteTimeSpanImpl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.writestring)
|
|
public func writeString(_ value: String) throws -> UInt32 {
|
|
try _default.WriteStringImpl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.measurestring)
|
|
public func measureString(_ value: String) throws -> UInt32 {
|
|
try _default.MeasureStringImpl(value)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.storeasync)
|
|
public func storeAsync() throws -> DataWriterStoreOperation! {
|
|
try _default.StoreAsyncImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.flushasync)
|
|
public func flushAsync() throws -> WindowsFoundation.AnyIAsyncOperation<Bool>! {
|
|
try _default.FlushAsyncImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.detachbuffer)
|
|
public func detachBuffer() throws -> AnyIBuffer! {
|
|
try _default.DetachBufferImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.detachstream)
|
|
public func detachStream() throws -> AnyIOutputStream! {
|
|
try _default.DetachStreamImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.byteorder)
|
|
public var byteOrder : ByteOrder {
|
|
get { try! _default.get_ByteOrderImpl() }
|
|
set { try! _default.put_ByteOrderImpl(newValue) }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.unicodeencoding)
|
|
public var unicodeEncoding : UnicodeEncoding {
|
|
get { try! _default.get_UnicodeEncodingImpl() }
|
|
set { try! _default.put_UnicodeEncodingImpl(newValue) }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.unstoredbufferlength)
|
|
public var unstoredBufferLength : UInt32 {
|
|
get { try! _default.get_UnstoredBufferLengthImpl() }
|
|
}
|
|
|
|
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriter.close)
|
|
public func close() throws {
|
|
try _IClosable.CloseImpl()
|
|
}
|
|
|
|
deinit {
|
|
_default = nil
|
|
_IClosable = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriterstoreoperation)
|
|
public final class DataWriterStoreOperation : WinRTClass, IAsyncOperation, WindowsFoundation.IAsyncInfo {
|
|
public typealias TResult = UInt32
|
|
private typealias SwiftABI = UWP.IAsyncOperationUInt32
|
|
private typealias CABI = __x_ABI_C__FIAsyncOperation_1_UINT32
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_C__FIAsyncOperation_1_UINT32>?) -> DataWriterStoreOperation? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriterstoreoperation.getresults)
|
|
public func getResults() throws -> UInt32 {
|
|
try _default.GetResultsImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriterstoreoperation.completed)
|
|
public var completed : AsyncOperationCompletedHandler<UInt32>? {
|
|
get { try! _default.get_CompletedImpl() }
|
|
set { try! _default.put_CompletedImpl(newValue) }
|
|
}
|
|
|
|
private lazy var _IAsyncInfo: __ABI_Windows_Foundation.IAsyncInfo! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriterstoreoperation.cancel)
|
|
public func cancel() throws {
|
|
try _IAsyncInfo.CancelImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriterstoreoperation.close)
|
|
public func close() throws {
|
|
try _IAsyncInfo.CloseImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriterstoreoperation.errorcode)
|
|
public var errorCode : HRESULT {
|
|
get { try! _IAsyncInfo.get_ErrorCodeImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriterstoreoperation.id)
|
|
public var id : UInt32 {
|
|
get { try! _IAsyncInfo.get_IdImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.datawriterstoreoperation.status)
|
|
public var status : WindowsFoundation.AsyncStatus {
|
|
get { try! _IAsyncInfo.get_StatusImpl() }
|
|
}
|
|
|
|
deinit {
|
|
_default = nil
|
|
_IAsyncInfo = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.fileinputstream)
|
|
public final class FileInputStream : WinRTClass, WindowsFoundation.IClosable, IInputStream {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IInputStream
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIInputStream
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIInputStream>?) -> FileInputStream? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.fileinputstream.close)
|
|
public func close() throws {
|
|
try _IClosable.CloseImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.fileinputstream.readasync)
|
|
public func readAsync(_ buffer: AnyIBuffer!, _ count: UInt32, _ options: InputStreamOptions) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<AnyIBuffer?, UInt32>! {
|
|
try _default.ReadAsyncImpl(buffer, count, options)
|
|
}
|
|
|
|
deinit {
|
|
_IClosable = nil
|
|
_default = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.fileoutputstream)
|
|
public final class FileOutputStream : WinRTClass, WindowsFoundation.IClosable, IOutputStream {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IOutputStream
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIOutputStream
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIOutputStream>?) -> FileOutputStream? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.fileoutputstream.close)
|
|
public func close() throws {
|
|
try _IClosable.CloseImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.fileoutputstream.writeasync)
|
|
public func writeAsync(_ buffer: AnyIBuffer!) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt32, UInt32>! {
|
|
try _default.WriteAsyncImpl(buffer)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.fileoutputstream.flushasync)
|
|
public func flushAsync() throws -> WindowsFoundation.AnyIAsyncOperation<Bool>! {
|
|
try _default.FlushAsyncImpl()
|
|
}
|
|
|
|
deinit {
|
|
_IClosable = nil
|
|
_default = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream)
|
|
public final class FileRandomAccessStream : WinRTClass, WindowsFoundation.IClosable, IInputStream, IOutputStream, IRandomAccessStream {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IRandomAccessStream
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStream
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStream>?) -> FileRandomAccessStream? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
private static let _IFileRandomAccessStreamStatics: __ABI_Windows_Storage_Streams.IFileRandomAccessStreamStatics = try! RoGetActivationFactory(HString("Windows.Storage.Streams.FileRandomAccessStream"))
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.openasync)
|
|
public static func openAsync(_ filePath: String, _ accessMode: UWP.FileAccessMode) -> WindowsFoundation.AnyIAsyncOperation<AnyIRandomAccessStream?>! {
|
|
return try! _IFileRandomAccessStreamStatics.OpenAsyncImpl(filePath, accessMode)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.openasync)
|
|
public static func openAsync(_ filePath: String, _ accessMode: UWP.FileAccessMode, _ sharingOptions: UWP.StorageOpenOptions, _ openDisposition: FileOpenDisposition) -> WindowsFoundation.AnyIAsyncOperation<AnyIRandomAccessStream?>! {
|
|
return try! _IFileRandomAccessStreamStatics.OpenWithOptionsAsyncImpl(filePath, accessMode, sharingOptions, openDisposition)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.opentransactedwriteasync)
|
|
public static func openTransactedWriteAsync(_ filePath: String) -> WindowsFoundation.AnyIAsyncOperation<UWP.StorageStreamTransaction?>! {
|
|
return try! _IFileRandomAccessStreamStatics.OpenTransactedWriteAsyncImpl(filePath)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.opentransactedwriteasync)
|
|
public static func openTransactedWriteAsync(_ filePath: String, _ openOptions: UWP.StorageOpenOptions, _ openDisposition: FileOpenDisposition) -> WindowsFoundation.AnyIAsyncOperation<UWP.StorageStreamTransaction?>! {
|
|
return try! _IFileRandomAccessStreamStatics.OpenTransactedWriteWithOptionsAsyncImpl(filePath, openOptions, openDisposition)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.openforuserasync)
|
|
public static func openForUserAsync(_ user: UWP.User!, _ filePath: String, _ accessMode: UWP.FileAccessMode) -> WindowsFoundation.AnyIAsyncOperation<AnyIRandomAccessStream?>! {
|
|
return try! _IFileRandomAccessStreamStatics.OpenForUserAsyncImpl(user, filePath, accessMode)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.openforuserasync)
|
|
public static func openForUserAsync(_ user: UWP.User!, _ filePath: String, _ accessMode: UWP.FileAccessMode, _ sharingOptions: UWP.StorageOpenOptions, _ openDisposition: FileOpenDisposition) -> WindowsFoundation.AnyIAsyncOperation<AnyIRandomAccessStream?>! {
|
|
return try! _IFileRandomAccessStreamStatics.OpenForUserWithOptionsAsyncImpl(user, filePath, accessMode, sharingOptions, openDisposition)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.opentransactedwriteforuserasync)
|
|
public static func openTransactedWriteForUserAsync(_ user: UWP.User!, _ filePath: String) -> WindowsFoundation.AnyIAsyncOperation<UWP.StorageStreamTransaction?>! {
|
|
return try! _IFileRandomAccessStreamStatics.OpenTransactedWriteForUserAsyncImpl(user, filePath)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.opentransactedwriteforuserasync)
|
|
public static func openTransactedWriteForUserAsync(_ user: UWP.User!, _ filePath: String, _ openOptions: UWP.StorageOpenOptions, _ openDisposition: FileOpenDisposition) -> WindowsFoundation.AnyIAsyncOperation<UWP.StorageStreamTransaction?>! {
|
|
return try! _IFileRandomAccessStreamStatics.OpenTransactedWriteForUserWithOptionsAsyncImpl(user, filePath, openOptions, openDisposition)
|
|
}
|
|
|
|
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.close)
|
|
public func close() throws {
|
|
try _IClosable.CloseImpl()
|
|
}
|
|
|
|
private lazy var _IInputStream: __ABI_Windows_Storage_Streams.IInputStream! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.readasync)
|
|
public func readAsync(_ buffer: AnyIBuffer!, _ count: UInt32, _ options: InputStreamOptions) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<AnyIBuffer?, UInt32>! {
|
|
try _IInputStream.ReadAsyncImpl(buffer, count, options)
|
|
}
|
|
|
|
private lazy var _IOutputStream: __ABI_Windows_Storage_Streams.IOutputStream! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.writeasync)
|
|
public func writeAsync(_ buffer: AnyIBuffer!) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt32, UInt32>! {
|
|
try _IOutputStream.WriteAsyncImpl(buffer)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.flushasync)
|
|
public func flushAsync() throws -> WindowsFoundation.AnyIAsyncOperation<Bool>! {
|
|
try _IOutputStream.FlushAsyncImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.getinputstreamat)
|
|
public func getInputStreamAt(_ position: UInt64) throws -> AnyIInputStream! {
|
|
try _default.GetInputStreamAtImpl(position)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.getoutputstreamat)
|
|
public func getOutputStreamAt(_ position: UInt64) throws -> AnyIOutputStream! {
|
|
try _default.GetOutputStreamAtImpl(position)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.seek)
|
|
public func seek(_ position: UInt64) throws {
|
|
try _default.SeekImpl(position)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.clonestream)
|
|
public func cloneStream() throws -> AnyIRandomAccessStream! {
|
|
try _default.CloneStreamImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.canread)
|
|
public var canRead : Bool {
|
|
get { try! _default.get_CanReadImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.canwrite)
|
|
public var canWrite : Bool {
|
|
get { try! _default.get_CanWriteImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.position)
|
|
public var position : UInt64 {
|
|
get { try! _default.get_PositionImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.filerandomaccessstream.size)
|
|
public var size : UInt64 {
|
|
get { try! _default.get_SizeImpl() }
|
|
set { try! _default.put_SizeImpl(newValue) }
|
|
}
|
|
|
|
deinit {
|
|
_IClosable = nil
|
|
_IInputStream = nil
|
|
_IOutputStream = nil
|
|
_default = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream)
|
|
public final class InMemoryRandomAccessStream : WinRTClass, WindowsFoundation.IClosable, IInputStream, IOutputStream, IRandomAccessStream {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IRandomAccessStream
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStream
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStream>?) -> InMemoryRandomAccessStream? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
override public init() {
|
|
super.init(try! RoActivateInstance(HString("Windows.Storage.Streams.InMemoryRandomAccessStream")))
|
|
}
|
|
|
|
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.close)
|
|
public func close() throws {
|
|
try _IClosable.CloseImpl()
|
|
}
|
|
|
|
private lazy var _IInputStream: __ABI_Windows_Storage_Streams.IInputStream! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.readasync)
|
|
public func readAsync(_ buffer: AnyIBuffer!, _ count: UInt32, _ options: InputStreamOptions) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<AnyIBuffer?, UInt32>! {
|
|
try _IInputStream.ReadAsyncImpl(buffer, count, options)
|
|
}
|
|
|
|
private lazy var _IOutputStream: __ABI_Windows_Storage_Streams.IOutputStream! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.writeasync)
|
|
public func writeAsync(_ buffer: AnyIBuffer!) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt32, UInt32>! {
|
|
try _IOutputStream.WriteAsyncImpl(buffer)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.flushasync)
|
|
public func flushAsync() throws -> WindowsFoundation.AnyIAsyncOperation<Bool>! {
|
|
try _IOutputStream.FlushAsyncImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.getinputstreamat)
|
|
public func getInputStreamAt(_ position: UInt64) throws -> AnyIInputStream! {
|
|
try _default.GetInputStreamAtImpl(position)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.getoutputstreamat)
|
|
public func getOutputStreamAt(_ position: UInt64) throws -> AnyIOutputStream! {
|
|
try _default.GetOutputStreamAtImpl(position)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.seek)
|
|
public func seek(_ position: UInt64) throws {
|
|
try _default.SeekImpl(position)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.clonestream)
|
|
public func cloneStream() throws -> AnyIRandomAccessStream! {
|
|
try _default.CloneStreamImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.canread)
|
|
public var canRead : Bool {
|
|
get { try! _default.get_CanReadImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.canwrite)
|
|
public var canWrite : Bool {
|
|
get { try! _default.get_CanWriteImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.position)
|
|
public var position : UInt64 {
|
|
get { try! _default.get_PositionImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inmemoryrandomaccessstream.size)
|
|
public var size : UInt64 {
|
|
get { try! _default.get_SizeImpl() }
|
|
set { try! _default.put_SizeImpl(newValue) }
|
|
}
|
|
|
|
deinit {
|
|
_IClosable = nil
|
|
_IInputStream = nil
|
|
_IOutputStream = nil
|
|
_default = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inputstreamoverstream)
|
|
public final class InputStreamOverStream : WinRTClass, WindowsFoundation.IClosable, IInputStream {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IInputStream
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIInputStream
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIInputStream>?) -> InputStreamOverStream? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inputstreamoverstream.close)
|
|
public func close() throws {
|
|
try _IClosable.CloseImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.inputstreamoverstream.readasync)
|
|
public func readAsync(_ buffer: AnyIBuffer!, _ count: UInt32, _ options: InputStreamOptions) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<AnyIBuffer?, UInt32>! {
|
|
try _default.ReadAsyncImpl(buffer, count, options)
|
|
}
|
|
|
|
deinit {
|
|
_IClosable = nil
|
|
_default = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.outputstreamoverstream)
|
|
public final class OutputStreamOverStream : WinRTClass, WindowsFoundation.IClosable, IOutputStream {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IOutputStream
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIOutputStream
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIOutputStream>?) -> OutputStreamOverStream? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.outputstreamoverstream.close)
|
|
public func close() throws {
|
|
try _IClosable.CloseImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.outputstreamoverstream.writeasync)
|
|
public func writeAsync(_ buffer: AnyIBuffer!) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt32, UInt32>! {
|
|
try _default.WriteAsyncImpl(buffer)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.outputstreamoverstream.flushasync)
|
|
public func flushAsync() throws -> WindowsFoundation.AnyIAsyncOperation<Bool>! {
|
|
try _default.FlushAsyncImpl()
|
|
}
|
|
|
|
deinit {
|
|
_IClosable = nil
|
|
_default = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstream)
|
|
public final class RandomAccessStream {
|
|
private static let _IRandomAccessStreamStatics: __ABI_Windows_Storage_Streams.IRandomAccessStreamStatics = try! RoGetActivationFactory(HString("Windows.Storage.Streams.RandomAccessStream"))
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstream.copyasync)
|
|
public static func copyAsync(_ source: AnyIInputStream!, _ destination: AnyIOutputStream!) -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt64, UInt64>! {
|
|
return try! _IRandomAccessStreamStatics.CopyAsyncImpl(source, destination)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstream.copyasync)
|
|
public static func copyAsync(_ source: AnyIInputStream!, _ destination: AnyIOutputStream!, _ bytesToCopy: UInt64) -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt64, UInt64>! {
|
|
return try! _IRandomAccessStreamStatics.CopySizeAsyncImpl(source, destination, bytesToCopy)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstream.copyandcloseasync)
|
|
public static func copyAndCloseAsync(_ source: AnyIInputStream!, _ destination: AnyIOutputStream!) -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt64, UInt64>! {
|
|
return try! _IRandomAccessStreamStatics.CopyAndCloseAsyncImpl(source, destination)
|
|
}
|
|
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream)
|
|
public final class RandomAccessStreamOverStream : WinRTClass, WindowsFoundation.IClosable, IInputStream, IOutputStream, IRandomAccessStream {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IRandomAccessStream
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStream
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStream>?) -> RandomAccessStreamOverStream? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
private lazy var _IClosable: __ABI_Windows_Foundation.IClosable! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.close)
|
|
public func close() throws {
|
|
try _IClosable.CloseImpl()
|
|
}
|
|
|
|
private lazy var _IInputStream: __ABI_Windows_Storage_Streams.IInputStream! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.readasync)
|
|
public func readAsync(_ buffer: AnyIBuffer!, _ count: UInt32, _ options: InputStreamOptions) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<AnyIBuffer?, UInt32>! {
|
|
try _IInputStream.ReadAsyncImpl(buffer, count, options)
|
|
}
|
|
|
|
private lazy var _IOutputStream: __ABI_Windows_Storage_Streams.IOutputStream! = getInterfaceForCaching()
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.writeasync)
|
|
public func writeAsync(_ buffer: AnyIBuffer!) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt32, UInt32>! {
|
|
try _IOutputStream.WriteAsyncImpl(buffer)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.flushasync)
|
|
public func flushAsync() throws -> WindowsFoundation.AnyIAsyncOperation<Bool>! {
|
|
try _IOutputStream.FlushAsyncImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.getinputstreamat)
|
|
public func getInputStreamAt(_ position: UInt64) throws -> AnyIInputStream! {
|
|
try _default.GetInputStreamAtImpl(position)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.getoutputstreamat)
|
|
public func getOutputStreamAt(_ position: UInt64) throws -> AnyIOutputStream! {
|
|
try _default.GetOutputStreamAtImpl(position)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.seek)
|
|
public func seek(_ position: UInt64) throws {
|
|
try _default.SeekImpl(position)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.clonestream)
|
|
public func cloneStream() throws -> AnyIRandomAccessStream! {
|
|
try _default.CloneStreamImpl()
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.canread)
|
|
public var canRead : Bool {
|
|
get { try! _default.get_CanReadImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.canwrite)
|
|
public var canWrite : Bool {
|
|
get { try! _default.get_CanWriteImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.position)
|
|
public var position : UInt64 {
|
|
get { try! _default.get_PositionImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamoverstream.size)
|
|
public var size : UInt64 {
|
|
get { try! _default.get_SizeImpl() }
|
|
set { try! _default.put_SizeImpl(newValue) }
|
|
}
|
|
|
|
deinit {
|
|
_IClosable = nil
|
|
_IInputStream = nil
|
|
_IOutputStream = nil
|
|
_default = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamreference)
|
|
public final class RandomAccessStreamReference : WinRTClass, IRandomAccessStreamReference {
|
|
private typealias SwiftABI = __ABI_Windows_Storage_Streams.IRandomAccessStreamReference
|
|
private typealias CABI = __x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStreamReference
|
|
private lazy var _default: SwiftABI! = getInterfaceForCaching()
|
|
@_spi(WinRTInternal)
|
|
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
|
|
if T.self == CABI.self {
|
|
return RawPointer(_default)
|
|
}
|
|
return super._getABI()
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStreamReference>?) -> RandomAccessStreamReference? {
|
|
guard let abi = abi else { return nil }
|
|
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
|
|
}
|
|
|
|
@_spi(WinRTInternal)
|
|
public init(fromAbi: WindowsFoundation.IInspectable) {
|
|
super.init(fromAbi)
|
|
}
|
|
|
|
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
return super.queryInterface(iid)
|
|
}
|
|
private static let _IRandomAccessStreamReferenceStatics: __ABI_Windows_Storage_Streams.IRandomAccessStreamReferenceStatics = try! RoGetActivationFactory(HString("Windows.Storage.Streams.RandomAccessStreamReference"))
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamreference.createfromfile)
|
|
public static func createFromFile(_ file: UWP.AnyIStorageFile!) -> RandomAccessStreamReference! {
|
|
return try! _IRandomAccessStreamReferenceStatics.CreateFromFileImpl(file)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamreference.createfromuri)
|
|
public static func createFromUri(_ uri: WindowsFoundation.Uri!) -> RandomAccessStreamReference! {
|
|
return try! _IRandomAccessStreamReferenceStatics.CreateFromUriImpl(uri)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamreference.createfromstream)
|
|
public static func createFromStream(_ stream: AnyIRandomAccessStream!) -> RandomAccessStreamReference! {
|
|
return try! _IRandomAccessStreamReferenceStatics.CreateFromStreamImpl(stream)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.randomaccessstreamreference.openreadasync)
|
|
public func openReadAsync() throws -> WindowsFoundation.AnyIAsyncOperation<AnyIRandomAccessStreamWithContentType?>! {
|
|
try _default.OpenReadAsyncImpl()
|
|
}
|
|
|
|
deinit {
|
|
_default = nil
|
|
}
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.ibuffer)
|
|
public protocol IBuffer : IBufferByteAccess {
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.ibuffer.capacity)
|
|
var capacity: UInt32 { get }
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.ibuffer.length)
|
|
var length: UInt32 { get set }
|
|
}
|
|
|
|
extension IBuffer {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IBufferWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IBufferWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_.IBufferByteAccessWrapper.IID:
|
|
let wrapper = __ABI_.IBufferByteAccessWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
extension IBuffer {
|
|
public var data: Data {
|
|
guard let buffer = try? buffer else { return Data() }
|
|
return Data(bytesNoCopy: buffer, count: Int(length), deallocator: .none)
|
|
}
|
|
}
|
|
public typealias AnyIBuffer = any IBuffer
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.icontenttypeprovider)
|
|
public protocol IContentTypeProvider : WinRTInterface {
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.icontenttypeprovider.contenttype)
|
|
var contentType: String { get }
|
|
}
|
|
|
|
extension IContentTypeProvider {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IContentTypeProviderWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IContentTypeProviderWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
public typealias AnyIContentTypeProvider = any IContentTypeProvider
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader)
|
|
public protocol IDataReader : WinRTInterface {
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readbyte)
|
|
func readByte() throws -> UInt8
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readbuffer)
|
|
func readBuffer(_ length: UInt32) throws -> UWP.AnyIBuffer!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readboolean)
|
|
func readBoolean() throws -> Bool
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readguid)
|
|
func readGuid() throws -> Foundation.UUID
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readint16)
|
|
func readInt16() throws -> Int16
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readint32)
|
|
func readInt32() throws -> Int32
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readint64)
|
|
func readInt64() throws -> Int64
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readuint16)
|
|
func readUInt16() throws -> UInt16
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readuint32)
|
|
func readUInt32() throws -> UInt32
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readuint64)
|
|
func readUInt64() throws -> UInt64
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readsingle)
|
|
func readSingle() throws -> Float
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readdouble)
|
|
func readDouble() throws -> Double
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readstring)
|
|
func readString(_ codeUnitCount: UInt32) throws -> String
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readdatetime)
|
|
func readDateTime() throws -> WindowsFoundation.DateTime
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.readtimespan)
|
|
func readTimeSpan() throws -> WindowsFoundation.TimeSpan
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.loadasync)
|
|
func loadAsync(_ count: UInt32) throws -> UWP.DataReaderLoadOperation!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.detachbuffer)
|
|
func detachBuffer() throws -> UWP.AnyIBuffer!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.detachstream)
|
|
func detachStream() throws -> UWP.AnyIInputStream!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.byteorder)
|
|
var byteOrder: UWP.ByteOrder { get set }
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.inputstreamoptions)
|
|
var inputStreamOptions: UWP.InputStreamOptions { get set }
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.unconsumedbufferlength)
|
|
var unconsumedBufferLength: UInt32 { get }
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatareader.unicodeencoding)
|
|
var unicodeEncoding: UWP.UnicodeEncoding { get set }
|
|
}
|
|
|
|
extension IDataReader {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IDataReaderWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IDataReaderWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
public typealias AnyIDataReader = any IDataReader
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter)
|
|
public protocol IDataWriter : WinRTInterface {
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writebyte)
|
|
func writeByte(_ value: UInt8) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writebuffer)
|
|
func writeBuffer(_ buffer: UWP.AnyIBuffer!) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writebuffer)
|
|
func writeBuffer(_ buffer: UWP.AnyIBuffer!, _ start: UInt32, _ count: UInt32) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writeboolean)
|
|
func writeBoolean(_ value: Bool) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writeguid)
|
|
func writeGuid(_ value: Foundation.UUID) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writeint16)
|
|
func writeInt16(_ value: Int16) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writeint32)
|
|
func writeInt32(_ value: Int32) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writeint64)
|
|
func writeInt64(_ value: Int64) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writeuint16)
|
|
func writeUInt16(_ value: UInt16) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writeuint32)
|
|
func writeUInt32(_ value: UInt32) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writeuint64)
|
|
func writeUInt64(_ value: UInt64) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writesingle)
|
|
func writeSingle(_ value: Float) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writedouble)
|
|
func writeDouble(_ value: Double) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writedatetime)
|
|
func writeDateTime(_ value: WindowsFoundation.DateTime) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writetimespan)
|
|
func writeTimeSpan(_ value: WindowsFoundation.TimeSpan) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.writestring)
|
|
func writeString(_ value: String) throws -> UInt32
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.measurestring)
|
|
func measureString(_ value: String) throws -> UInt32
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.storeasync)
|
|
func storeAsync() throws -> UWP.DataWriterStoreOperation!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.flushasync)
|
|
func flushAsync() throws -> WindowsFoundation.AnyIAsyncOperation<Bool>!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.detachbuffer)
|
|
func detachBuffer() throws -> UWP.AnyIBuffer!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.detachstream)
|
|
func detachStream() throws -> UWP.AnyIOutputStream!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.byteorder)
|
|
var byteOrder: UWP.ByteOrder { get set }
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.unicodeencoding)
|
|
var unicodeEncoding: UWP.UnicodeEncoding { get set }
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.idatawriter.unstoredbufferlength)
|
|
var unstoredBufferLength: UInt32 { get }
|
|
}
|
|
|
|
extension IDataWriter {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IDataWriterWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IDataWriterWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
public typealias AnyIDataWriter = any IDataWriter
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.iinputstream)
|
|
public protocol IInputStream : WindowsFoundation.IClosable {
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.iinputstream.readasync)
|
|
func readAsync(_ buffer: UWP.AnyIBuffer!, _ count: UInt32, _ options: UWP.InputStreamOptions) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UWP.AnyIBuffer?, UInt32>!
|
|
}
|
|
|
|
extension IInputStream {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IInputStreamWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IInputStreamWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Foundation.IClosableWrapper.IID:
|
|
let wrapper = __ABI_Windows_Foundation.IClosableWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
public typealias AnyIInputStream = any IInputStream
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.iinputstreamreference)
|
|
public protocol IInputStreamReference : WinRTInterface {
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.iinputstreamreference.opensequentialreadasync)
|
|
func openSequentialReadAsync() throws -> WindowsFoundation.AnyIAsyncOperation<UWP.AnyIInputStream?>!
|
|
}
|
|
|
|
extension IInputStreamReference {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IInputStreamReferenceWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IInputStreamReferenceWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
public typealias AnyIInputStreamReference = any IInputStreamReference
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.ioutputstream)
|
|
public protocol IOutputStream : WindowsFoundation.IClosable {
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.ioutputstream.writeasync)
|
|
func writeAsync(_ buffer: UWP.AnyIBuffer!) throws -> WindowsFoundation.AnyIAsyncOperationWithProgress<UInt32, UInt32>!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.ioutputstream.flushasync)
|
|
func flushAsync() throws -> WindowsFoundation.AnyIAsyncOperation<Bool>!
|
|
}
|
|
|
|
extension IOutputStream {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IOutputStreamWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IOutputStreamWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Foundation.IClosableWrapper.IID:
|
|
let wrapper = __ABI_Windows_Foundation.IClosableWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
public typealias AnyIOutputStream = any IOutputStream
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstream)
|
|
public protocol IRandomAccessStream : WindowsFoundation.IClosable, IInputStream, IOutputStream {
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstream.getinputstreamat)
|
|
func getInputStreamAt(_ position: UInt64) throws -> UWP.AnyIInputStream!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstream.getoutputstreamat)
|
|
func getOutputStreamAt(_ position: UInt64) throws -> UWP.AnyIOutputStream!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstream.seek)
|
|
func seek(_ position: UInt64) throws
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstream.clonestream)
|
|
func cloneStream() throws -> UWP.AnyIRandomAccessStream!
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstream.canread)
|
|
var canRead: Bool { get }
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstream.canwrite)
|
|
var canWrite: Bool { get }
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstream.position)
|
|
var position: UInt64 { get }
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstream.size)
|
|
var size: UInt64 { get set }
|
|
}
|
|
|
|
extension IRandomAccessStream {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IRandomAccessStreamWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IRandomAccessStreamWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Foundation.IClosableWrapper.IID:
|
|
let wrapper = __ABI_Windows_Foundation.IClosableWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Storage_Streams.IInputStreamWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IInputStreamWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Storage_Streams.IOutputStreamWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IOutputStreamWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
public typealias AnyIRandomAccessStream = any IRandomAccessStream
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstreamreference)
|
|
public protocol IRandomAccessStreamReference : WinRTInterface {
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstreamreference.openreadasync)
|
|
func openReadAsync() throws -> WindowsFoundation.AnyIAsyncOperation<UWP.AnyIRandomAccessStreamWithContentType?>!
|
|
}
|
|
|
|
extension IRandomAccessStreamReference {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IRandomAccessStreamReferenceWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IRandomAccessStreamReferenceWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
public typealias AnyIRandomAccessStreamReference = any IRandomAccessStreamReference
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streams.irandomaccessstreamwithcontenttype)
|
|
public protocol IRandomAccessStreamWithContentType : WindowsFoundation.IClosable, IInputStream, IOutputStream, IRandomAccessStream, IContentTypeProvider {
|
|
}
|
|
|
|
extension IRandomAccessStreamWithContentType {
|
|
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
|
|
switch iid {
|
|
case __ABI_Windows_Storage_Streams.IRandomAccessStreamWithContentTypeWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IRandomAccessStreamWithContentTypeWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Foundation.IClosableWrapper.IID:
|
|
let wrapper = __ABI_Windows_Foundation.IClosableWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Storage_Streams.IInputStreamWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IInputStreamWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Storage_Streams.IOutputStreamWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IOutputStreamWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Storage_Streams.IRandomAccessStreamWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IRandomAccessStreamWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
case __ABI_Windows_Storage_Streams.IContentTypeProviderWrapper.IID:
|
|
let wrapper = __ABI_Windows_Storage_Streams.IContentTypeProviderWrapper(self)
|
|
return wrapper!.queryInterface(iid)
|
|
default: return nil
|
|
}
|
|
}
|
|
}
|
|
public typealias AnyIRandomAccessStreamWithContentType = any IRandomAccessStreamWithContentType
|
|
|
|
extension UWP.ByteOrder {
|
|
public static var littleEndian : UWP.ByteOrder {
|
|
__x_ABI_CWindows_CStorage_CStreams_CByteOrder_LittleEndian
|
|
}
|
|
public static var bigEndian : UWP.ByteOrder {
|
|
__x_ABI_CWindows_CStorage_CStreams_CByteOrder_BigEndian
|
|
}
|
|
}
|
|
extension UWP.ByteOrder: @retroactive Hashable, @retroactive Codable {}
|
|
|
|
extension UWP.FileOpenDisposition {
|
|
public static var openExisting : UWP.FileOpenDisposition {
|
|
__x_ABI_CWindows_CStorage_CStreams_CFileOpenDisposition_OpenExisting
|
|
}
|
|
public static var openAlways : UWP.FileOpenDisposition {
|
|
__x_ABI_CWindows_CStorage_CStreams_CFileOpenDisposition_OpenAlways
|
|
}
|
|
public static var createNew : UWP.FileOpenDisposition {
|
|
__x_ABI_CWindows_CStorage_CStreams_CFileOpenDisposition_CreateNew
|
|
}
|
|
public static var createAlways : UWP.FileOpenDisposition {
|
|
__x_ABI_CWindows_CStorage_CStreams_CFileOpenDisposition_CreateAlways
|
|
}
|
|
public static var truncateExisting : UWP.FileOpenDisposition {
|
|
__x_ABI_CWindows_CStorage_CStreams_CFileOpenDisposition_TruncateExisting
|
|
}
|
|
}
|
|
extension UWP.FileOpenDisposition: @retroactive Hashable, @retroactive Codable {}
|
|
|
|
extension UWP.InputStreamOptions {
|
|
public static var none : UWP.InputStreamOptions {
|
|
__x_ABI_CWindows_CStorage_CStreams_CInputStreamOptions_None
|
|
}
|
|
public static var partial : UWP.InputStreamOptions {
|
|
__x_ABI_CWindows_CStorage_CStreams_CInputStreamOptions_Partial
|
|
}
|
|
public static var readAhead : UWP.InputStreamOptions {
|
|
__x_ABI_CWindows_CStorage_CStreams_CInputStreamOptions_ReadAhead
|
|
}
|
|
}
|
|
extension UWP.InputStreamOptions: @retroactive Hashable, @retroactive Codable {}
|
|
|
|
extension UWP.UnicodeEncoding {
|
|
public static var utf8 : UWP.UnicodeEncoding {
|
|
__x_ABI_CWindows_CStorage_CStreams_CUnicodeEncoding_Utf8
|
|
}
|
|
public static var utf16LE : UWP.UnicodeEncoding {
|
|
__x_ABI_CWindows_CStorage_CStreams_CUnicodeEncoding_Utf16LE
|
|
}
|
|
public static var utf16BE : UWP.UnicodeEncoding {
|
|
__x_ABI_CWindows_CStorage_CStreams_CUnicodeEncoding_Utf16BE
|
|
}
|
|
}
|
|
extension UWP.UnicodeEncoding: @retroactive Hashable, @retroactive Codable {}
|
|
|