IDataReader is a helper class to read data from an input stream [1]. IDataReaderFactory is the interface to use to get the constructor of the "Windows.Storage.Streams.DataReader" class [2] with RoGetActivationFactory().
IInputStream is an interface used to read asynchronously data [3]. IRandomAccessStream is an interface that can be used to seek in input streams [4]. IRandomAccessStreamReference is an interface that can be used to open a StorageFile asynchronously [5]. IRandomAccessStreamWithContentType is the interface you get when opening a file asynchronously [6]. [1] https://docs.microsoft.com/en-us/uwp/api/windows.storage.streams.idatareader [2] https://docs.microsoft.com/en-us/uwp/api/windows.storage.streams.datareader [3] https://docs.microsoft.com/en-us/uwp/api/windows.storage.streams.iinputstream [4] https://docs.microsoft.com/en-us/uwp/api/windows.storage.streams.irandomaccessstream [5] https://docs.microsoft.com/en-us/uwp/api/windows.storage.streams.irandomaccessstreamreference [6] https://docs.microsoft.com/en-us/uwp/api/windows.storage.streams.irandomaccessstreamwithcontenttype --- .../include/windows.storage.streams.idl | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/mingw-w64-headers/include/windows.storage.streams.idl b/mingw-w64-headers/include/windows.storage.streams.idl index cc56e73d9..f26e2e516 100644 --- a/mingw-w64-headers/include/windows.storage.streams.idl +++ b/mingw-w64-headers/include/windows.storage.streams.idl @@ -9,21 +9,59 @@ #endif import "inspectable.idl"; +import "windows.foundation.idl"; namespace Windows { namespace Storage { namespace Streams { interface IBufferFactory; interface IBuffer; + interface IDataReader; + interface IDataReaderFactory; + interface IInputStream; interface IOutputStream; + interface IRandomAccessStream; interface IRandomAccessStreamReference; + interface IRandomAccessStreamWithContentType; + + runtimeclass DataReader; + + typedef enum InputStreamOptions InputStreamOptions; + typedef enum ByteOrder ByteOrder; + typedef enum UnicodeEncoding UnicodeEncoding; } } } +namespace Windows { + namespace Foundation { + declare { + interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStreamWithContentType*>; + interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.IRandomAccessStreamWithContentType*>; + } + } +} + namespace Windows { namespace Storage { namespace Streams { + enum InputStreamOptions { + None = 0x0, + Partial = 0x1, + ReadAhead = 0x2 + }; + + enum ByteOrder { + LittleEndian, + BigEndian + }; + + enum UnicodeEncoding { + Utf8, + Utf16LE, + Utf16BE + }; + [uuid(905A0FE0-BC53-11DF-8C49-001E4FC686DA)] interface IBuffer : IInspectable { [propget] HRESULT Capacity(UINT32* value); @@ -35,6 +73,106 @@ namespace Windows { interface IBufferFactory : IInspectable { HRESULT Create(UINT32 capacity, IBuffer** value); } + + [ + contract(Windows.Foundation.FoundationContract, 1.0), + uuid(cc254827-4b3d-438f-9232-10c76bc7e038) + ] + interface IRandomAccessStreamWithContentType : IInspectable + // also IDisposable IContentTypeProvider IInputStream IOutputStream IRandomAccessStream + { + } + + [ + contract(Windows.Foundation.FoundationContract, 1.0), + uuid(33ee3134-1dd6-4e3a-8067-d1c162e8642b) + ] + interface IRandomAccessStreamReference : IInspectable + { + HRESULT OpenReadAsync(Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStreamWithContentType*>** operation); + } + + [ + contract(Windows.Foundation.FoundationContract, 1.0), + uuid(905a0fe2-bc53-11df-8c49-001e4fc686da) + ] + interface IInputStream : IInspectable + // also IClosable + { + void Dispose(); + HRESULT ReadAsync(IBuffer* buffer, UINT32 count, InputStreamOptions options, /*IAsyncOperationWithProgress<IBuffer*, UINT32>*/ IInspectable** operation); + } + + [ + contract(Windows.Foundation.FoundationContract, 1.0), + uuid(905a0fe1-bc53-11df-8c49-001e4fc686da) + ] + interface IRandomAccessStream : IInspectable + // also IClosable, IInputStream, IOutputStream + { + [propget] HRESULT Size(UINT64* value); + [propput] HRESULT Size(UINT64 value); + HRESULT GetInputStreamAt(UINT64 position, IInputStream** stream); + HRESULT GetOutputStreamAt(UINT64 position, IOutputStream** stream); + [propget] HRESULT Position(UINT64* value); + HRESULT Seek(UINT64 position); + HRESULT CloneStream(IRandomAccessStream** stream); + [propget] HRESULT CanRead(boolean* value); + [propget] HRESULT CanWrite(boolean* value); + } + + [ + marshaling_behavior(agile) + // activatable(Windows.Storage.Streams.IDataReaderFactory, Windows.Foundation.UniversalApiContract, 1.0), + ] + runtimeclass DataReader + { + [default] interface IDataReader; + //interface Windows.Foundation.IClosable; + } + + [ + contract(Windows.Foundation.FoundationContract, 1.0), + uuid(E2B50029-B4C1-4314-A4B8-FB813A2F275E) + ] + interface IDataReader : IInspectable + { + [propget] HRESULT UnconsumedBufferLength(UINT32* value); + [propget] HRESULT UnicodeEncoding(UnicodeEncoding* value); + [propput] HRESULT UnicodeEncoding(UnicodeEncoding value); + [propget] HRESULT ByteOrder(ByteOrder* value); + [propput] HRESULT ByteOrder(ByteOrder value); + [propget] HRESULT InputStreamOptions(InputStreamOptions* value); + [propput] HRESULT InputStreamOptions(InputStreamOptions value); + HRESULT ReadByte(BYTE* value); + HRESULT ReadBytes(UINT32 valueSize, BYTE* value); + HRESULT ReadBuffer(UINT32 length, IBuffer** buffer); + HRESULT ReadBoolean(boolean* value); + HRESULT ReadGuid(GUID* value); + HRESULT ReadInt16(INT16* value); + HRESULT ReadInt32(INT32* value); + HRESULT ReadInt64(INT64* value); + HRESULT ReadUInt16(UINT16* value); + HRESULT ReadUInt32(UINT32* value); + HRESULT ReadUInt64(UINT64* value); + HRESULT ReadSingle(FLOAT* value); + HRESULT ReadDouble(DOUBLE* value); + HRESULT ReadString(UINT32 codeUnitCount, HSTRING* value); + HRESULT ReadDateTime(/*DateTime* */ UINT64* value); + HRESULT ReadTimeSpan(/*TimeSpan* */ UINT64* value); + HRESULT LoadAsync(UINT32 count, Windows.Foundation.IAsyncOperation<UINT32>** operation); + HRESULT DetachBuffer(IBuffer** buffer); + HRESULT DetachStream(IInputStream** stream); + } + + [ + contract(Windows.Foundation.FoundationContract, 1.0), + uuid(D7527847-57DA-4E15-914C-06806699A098) + ] + interface IDataReaderFactory : IInspectable + { + HRESULT CreateDataReader(IInputStream* inputStream, IDataReader** dataReader); + } } } } -- 2.29.2 _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
