// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Storage_Streams_H #define WINRT_Windows_Storage_Streams_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.250303.1" #include "winrt/Windows.Storage.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Storage.2.h" #include "winrt/impl/Windows.System.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" namespace winrt::impl { template auto consume_Windows_Storage_Streams_IBuffer::Capacity() const { uint32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Capacity(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Capacity(&value)); } return value; } template auto consume_Windows_Storage_Streams_IBuffer::Length() const { uint32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Length(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Length(&value)); } return value; } template auto consume_Windows_Storage_Streams_IBuffer::Length(uint32_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_Length(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Length(value)); } } template auto consume_Windows_Storage_Streams_IBufferFactory::Create(uint32_t capacity) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->Create(capacity, &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Create(capacity, &value)); } return winrt::Windows::Storage::Streams::Buffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IBufferStatics::CreateCopyFromMemoryBuffer(winrt::Windows::Foundation::IMemoryBuffer const& input) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateCopyFromMemoryBuffer(*(void**)(&input), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateCopyFromMemoryBuffer(*(void**)(&input), &value)); } return winrt::Windows::Storage::Streams::Buffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IBufferStatics::CreateMemoryBufferOverIBuffer(winrt::Windows::Storage::Streams::IBuffer const& input) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateMemoryBufferOverIBuffer(*(void**)(&input), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateMemoryBufferOverIBuffer(*(void**)(&input), &value)); } return winrt::Windows::Foundation::MemoryBuffer{ value, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IContentTypeProvider::ContentType() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ContentType(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ContentType(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataReader::UnconsumedBufferLength() const { uint32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UnconsumedBufferLength(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UnconsumedBufferLength(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::UnicodeEncoding() const { winrt::Windows::Storage::Streams::UnicodeEncoding value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UnicodeEncoding(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UnicodeEncoding(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::UnicodeEncoding(winrt::Windows::Storage::Streams::UnicodeEncoding const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_UnicodeEncoding(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_UnicodeEncoding(static_cast(value))); } } template auto consume_Windows_Storage_Streams_IDataReader::ByteOrder() const { winrt::Windows::Storage::Streams::ByteOrder value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ByteOrder(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ByteOrder(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ByteOrder(winrt::Windows::Storage::Streams::ByteOrder const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_ByteOrder(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_ByteOrder(static_cast(value))); } } template auto consume_Windows_Storage_Streams_IDataReader::InputStreamOptions() const { winrt::Windows::Storage::Streams::InputStreamOptions value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_InputStreamOptions(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_InputStreamOptions(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::InputStreamOptions(winrt::Windows::Storage::Streams::InputStreamOptions const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_InputStreamOptions(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_InputStreamOptions(static_cast(value))); } } template auto consume_Windows_Storage_Streams_IDataReader::ReadByte() const { uint8_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadByte(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadByte(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadBytes(array_view value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadBytes(value.size(), put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadBytes(value.size(), put_abi(value))); } } template auto consume_Windows_Storage_Streams_IDataReader::ReadBuffer(uint32_t length) const { void* buffer{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadBuffer(length, &buffer)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadBuffer(length, &buffer)); } return winrt::Windows::Storage::Streams::IBuffer{ buffer, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataReader::ReadBoolean() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadBoolean(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadBoolean(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadGuid() const { winrt::guid value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadGuid(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadGuid(put_abi(value))); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadInt16() const { int16_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadInt16(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadInt16(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadInt32() const { int32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadInt32(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadInt32(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadInt64() const { int64_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadInt64(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadInt64(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadUInt16() const { uint16_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadUInt16(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadUInt16(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadUInt32() const { uint32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadUInt32(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadUInt32(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadUInt64() const { uint64_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadUInt64(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadUInt64(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadSingle() const { float value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadSingle(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadSingle(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadDouble() const { double value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadDouble(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadDouble(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadString(uint32_t codeUnitCount) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadString(codeUnitCount, &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadString(codeUnitCount, &value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataReader::ReadDateTime() const { winrt::Windows::Foundation::DateTime value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadDateTime(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadDateTime(put_abi(value))); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::ReadTimeSpan() const { winrt::Windows::Foundation::TimeSpan value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadTimeSpan(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadTimeSpan(put_abi(value))); } return value; } template auto consume_Windows_Storage_Streams_IDataReader::LoadAsync(uint32_t count) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->LoadAsync(count, &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->LoadAsync(count, &operation)); } return winrt::Windows::Storage::Streams::DataReaderLoadOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataReader::DetachBuffer() const { void* buffer{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->DetachBuffer(&buffer)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->DetachBuffer(&buffer)); } return winrt::Windows::Storage::Streams::IBuffer{ buffer, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataReader::DetachStream() const { void* stream{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->DetachStream(&stream)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->DetachStream(&stream)); } return winrt::Windows::Storage::Streams::IInputStream{ stream, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataReaderFactory::CreateDataReader(winrt::Windows::Storage::Streams::IInputStream const& inputStream) const { void* dataReader{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateDataReader(*(void**)(&inputStream), &dataReader)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateDataReader(*(void**)(&inputStream), &dataReader)); } return winrt::Windows::Storage::Streams::DataReader{ dataReader, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataReaderStatics::FromBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer) const { void* dataReader{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->FromBuffer(*(void**)(&buffer), &dataReader)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FromBuffer(*(void**)(&buffer), &dataReader)); } return winrt::Windows::Storage::Streams::DataReader{ dataReader, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataWriter::UnstoredBufferLength() const { uint32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UnstoredBufferLength(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UnstoredBufferLength(&value)); } return value; } template auto consume_Windows_Storage_Streams_IDataWriter::UnicodeEncoding() const { winrt::Windows::Storage::Streams::UnicodeEncoding value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UnicodeEncoding(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UnicodeEncoding(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Storage_Streams_IDataWriter::UnicodeEncoding(winrt::Windows::Storage::Streams::UnicodeEncoding const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_UnicodeEncoding(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_UnicodeEncoding(static_cast(value))); } } template auto consume_Windows_Storage_Streams_IDataWriter::ByteOrder() const { winrt::Windows::Storage::Streams::ByteOrder value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ByteOrder(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ByteOrder(reinterpret_cast(&value))); } return value; } template auto consume_Windows_Storage_Streams_IDataWriter::ByteOrder(winrt::Windows::Storage::Streams::ByteOrder const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_ByteOrder(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_ByteOrder(static_cast(value))); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteByte(uint8_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteByte(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteByte(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteBytes(array_view value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteBytes(value.size(), get_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteBytes(value.size(), get_abi(value))); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteBuffer(*(void**)(&buffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteBuffer(*(void**)(&buffer))); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer, uint32_t start, uint32_t count) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteBufferRange(*(void**)(&buffer), start, count)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteBufferRange(*(void**)(&buffer), start, count)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteBoolean(bool value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteBoolean(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteBoolean(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteGuid(winrt::guid const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteGuid(impl::bind_in(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteGuid(impl::bind_in(value))); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteInt16(int16_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteInt16(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteInt16(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteInt32(int32_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteInt32(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteInt32(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteInt64(int64_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteInt64(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteInt64(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteUInt16(uint16_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteUInt16(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteUInt16(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteUInt32(uint32_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteUInt32(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteUInt32(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteUInt64(uint64_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteUInt64(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteUInt64(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteSingle(float value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteSingle(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteSingle(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteDouble(double value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteDouble(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteDouble(value)); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteDateTime(winrt::Windows::Foundation::DateTime const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteDateTime(impl::bind_in(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteDateTime(impl::bind_in(value))); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteTimeSpan(winrt::Windows::Foundation::TimeSpan const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteTimeSpan(impl::bind_in(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteTimeSpan(impl::bind_in(value))); } } template auto consume_Windows_Storage_Streams_IDataWriter::WriteString(param::hstring const& value) const { uint32_t codeUnitCount{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteString(*(void**)(&value), &codeUnitCount)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteString(*(void**)(&value), &codeUnitCount)); } return codeUnitCount; } template auto consume_Windows_Storage_Streams_IDataWriter::MeasureString(param::hstring const& value) const { uint32_t codeUnitCount{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->MeasureString(*(void**)(&value), &codeUnitCount)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->MeasureString(*(void**)(&value), &codeUnitCount)); } return codeUnitCount; } template auto consume_Windows_Storage_Streams_IDataWriter::StoreAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->StoreAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->StoreAsync(&operation)); } return winrt::Windows::Storage::Streams::DataWriterStoreOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataWriter::FlushAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->FlushAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FlushAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataWriter::DetachBuffer() const { void* buffer{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->DetachBuffer(&buffer)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->DetachBuffer(&buffer)); } return winrt::Windows::Storage::Streams::IBuffer{ buffer, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataWriter::DetachStream() const { void* outputStream{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->DetachStream(&outputStream)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->DetachStream(&outputStream)); } return winrt::Windows::Storage::Streams::IOutputStream{ outputStream, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IDataWriterFactory::CreateDataWriter(winrt::Windows::Storage::Streams::IOutputStream const& outputStream) const { void* dataWriter{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateDataWriter(*(void**)(&outputStream), &dataWriter)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateDataWriter(*(void**)(&outputStream), &dataWriter)); } return winrt::Windows::Storage::Streams::DataWriter{ dataWriter, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenAsync(param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenAsync(*(void**)(&filePath), static_cast(accessMode), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenAsync(*(void**)(&filePath), static_cast(accessMode), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenAsync(param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode, winrt::Windows::Storage::StorageOpenOptions const& sharingOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenWithOptionsAsync(*(void**)(&filePath), static_cast(accessMode), static_cast(sharingOptions), static_cast(openDisposition), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenWithOptionsAsync(*(void**)(&filePath), static_cast(accessMode), static_cast(sharingOptions), static_cast(openDisposition), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenTransactedWriteAsync(param::hstring const& filePath) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenTransactedWriteAsync(*(void**)(&filePath), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenTransactedWriteAsync(*(void**)(&filePath), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenTransactedWriteAsync(param::hstring const& filePath, winrt::Windows::Storage::StorageOpenOptions const& openOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenTransactedWriteWithOptionsAsync(*(void**)(&filePath), static_cast(openOptions), static_cast(openDisposition), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenTransactedWriteWithOptionsAsync(*(void**)(&filePath), static_cast(openOptions), static_cast(openDisposition), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenForUserAsync(*(void**)(&user), *(void**)(&filePath), static_cast(accessMode), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenForUserAsync(*(void**)(&user), *(void**)(&filePath), static_cast(accessMode), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode, winrt::Windows::Storage::StorageOpenOptions const& sharingOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenForUserWithOptionsAsync(*(void**)(&user), *(void**)(&filePath), static_cast(accessMode), static_cast(sharingOptions), static_cast(openDisposition), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenForUserWithOptionsAsync(*(void**)(&user), *(void**)(&filePath), static_cast(accessMode), static_cast(sharingOptions), static_cast(openDisposition), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenTransactedWriteForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenTransactedWriteForUserAsync(*(void**)(&user), *(void**)(&filePath), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenTransactedWriteForUserAsync(*(void**)(&user), *(void**)(&filePath), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IFileRandomAccessStreamStatics::OpenTransactedWriteForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::StorageOpenOptions const& openOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenTransactedWriteForUserWithOptionsAsync(*(void**)(&user), *(void**)(&filePath), static_cast(openOptions), static_cast(openDisposition), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenTransactedWriteForUserWithOptionsAsync(*(void**)(&user), *(void**)(&filePath), static_cast(openOptions), static_cast(openDisposition), &operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IInputStream::ReadAsync(winrt::Windows::Storage::Streams::IBuffer const& buffer, uint32_t count, winrt::Windows::Storage::Streams::InputStreamOptions const& options) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ReadAsync(*(void**)(&buffer), count, static_cast(options), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ReadAsync(*(void**)(&buffer), count, static_cast(options), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IInputStreamReference::OpenSequentialReadAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenSequentialReadAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenSequentialReadAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IOutputStream::WriteAsync(winrt::Windows::Storage::Streams::IBuffer const& buffer) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->WriteAsync(*(void**)(&buffer), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->WriteAsync(*(void**)(&buffer), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IOutputStream::FlushAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->FlushAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->FlushAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IPropertySetSerializer::Serialize(winrt::Windows::Foundation::Collections::IPropertySet const& propertySet) const { void* result{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->Serialize(*(void**)(&propertySet), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Serialize(*(void**)(&propertySet), &result)); } return winrt::Windows::Storage::Streams::IBuffer{ result, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IPropertySetSerializer::Deserialize(winrt::Windows::Foundation::Collections::IPropertySet const& propertySet, winrt::Windows::Storage::Streams::IBuffer const& buffer) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->Deserialize(*(void**)(&propertySet), *(void**)(&buffer))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Deserialize(*(void**)(&propertySet), *(void**)(&buffer))); } } template auto consume_Windows_Storage_Streams_IRandomAccessStream::Size() const { uint64_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Size(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Size(&value)); } return value; } template auto consume_Windows_Storage_Streams_IRandomAccessStream::Size(uint64_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_Size(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Size(value)); } } template auto consume_Windows_Storage_Streams_IRandomAccessStream::GetInputStreamAt(uint64_t position) const { void* stream{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetInputStreamAt(position, &stream)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetInputStreamAt(position, &stream)); } return winrt::Windows::Storage::Streams::IInputStream{ stream, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IRandomAccessStream::GetOutputStreamAt(uint64_t position) const { void* stream{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetOutputStreamAt(position, &stream)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetOutputStreamAt(position, &stream)); } return winrt::Windows::Storage::Streams::IOutputStream{ stream, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IRandomAccessStream::Position() const { uint64_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Position(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Position(&value)); } return value; } template auto consume_Windows_Storage_Streams_IRandomAccessStream::Seek(uint64_t position) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->Seek(position)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Seek(position)); } } template auto consume_Windows_Storage_Streams_IRandomAccessStream::CloneStream() const { void* stream{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CloneStream(&stream)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CloneStream(&stream)); } return winrt::Windows::Storage::Streams::IRandomAccessStream{ stream, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IRandomAccessStream::CanRead() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_CanRead(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_CanRead(&value)); } return value; } template auto consume_Windows_Storage_Streams_IRandomAccessStream::CanWrite() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_CanWrite(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_CanWrite(&value)); } return value; } template auto consume_Windows_Storage_Streams_IRandomAccessStreamReference::OpenReadAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->OpenReadAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->OpenReadAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IRandomAccessStreamReferenceStatics::CreateFromFile(winrt::Windows::Storage::IStorageFile const& file) const { void* streamReference{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateFromFile(*(void**)(&file), &streamReference)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateFromFile(*(void**)(&file), &streamReference)); } return winrt::Windows::Storage::Streams::RandomAccessStreamReference{ streamReference, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IRandomAccessStreamReferenceStatics::CreateFromUri(winrt::Windows::Foundation::Uri const& uri) const { void* streamReference{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateFromUri(*(void**)(&uri), &streamReference)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateFromUri(*(void**)(&uri), &streamReference)); } return winrt::Windows::Storage::Streams::RandomAccessStreamReference{ streamReference, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IRandomAccessStreamReferenceStatics::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream) const { void* streamReference{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateFromStream(*(void**)(&stream), &streamReference)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateFromStream(*(void**)(&stream), &streamReference)); } return winrt::Windows::Storage::Streams::RandomAccessStreamReference{ streamReference, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IRandomAccessStreamStatics::CopyAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CopyAsync(*(void**)(&source), *(void**)(&destination), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CopyAsync(*(void**)(&source), *(void**)(&destination), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IRandomAccessStreamStatics::CopyAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination, uint64_t bytesToCopy) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CopySizeAsync(*(void**)(&source), *(void**)(&destination), bytesToCopy, &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CopySizeAsync(*(void**)(&source), *(void**)(&destination), bytesToCopy, &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Streams_IRandomAccessStreamStatics::CopyAndCloseAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CopyAndCloseAsync(*(void**)(&source), *(void**)(&destination), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CopyAndCloseAsync(*(void**)(&source), *(void**)(&destination), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; } template struct produce : produce_base { int32_t __stdcall get_Capacity(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Capacity()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Length(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Length()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Length(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Length(value); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall Create(uint32_t capacity, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Create(capacity)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateCopyFromMemoryBuffer(void* input, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CreateCopyFromMemoryBuffer(*reinterpret_cast(&input))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateMemoryBufferOverIBuffer(void* input, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CreateMemoryBufferOverIBuffer(*reinterpret_cast(&input))); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall get_ContentType(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ContentType()); return 0; } catch (...) { return to_hresult(); } }; template struct produce : produce_base { int32_t __stdcall get_UnconsumedBufferLength(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UnconsumedBufferLength()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UnicodeEncoding(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UnicodeEncoding()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_UnicodeEncoding(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().UnicodeEncoding(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ByteOrder(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ByteOrder()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ByteOrder(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ByteOrder(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_InputStreamOptions(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().InputStreamOptions()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_InputStreamOptions(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().InputStreamOptions(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadByte(uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadByte()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadBytes(uint32_t __valueSize, uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadBytes(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadBuffer(uint32_t length, void** buffer) noexcept final try { clear_abi(buffer); typename D::abi_guard guard(this->shim()); *buffer = detach_from(this->shim().ReadBuffer(length)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadBoolean(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadBoolean()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadGuid(winrt::guid* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadGuid()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadInt16(int16_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadInt16()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadInt32(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadInt32()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadInt64(int64_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadInt64()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadUInt16(uint16_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadUInt16()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadUInt32(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadUInt32()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadUInt64(uint64_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadUInt64()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadSingle(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadSingle()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadDouble(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadDouble()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadString(uint32_t codeUnitCount, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadString(codeUnitCount)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadDateTime(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadDateTime()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ReadTimeSpan(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ReadTimeSpan()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall LoadAsync(uint32_t count, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().LoadAsync(count)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall DetachBuffer(void** buffer) noexcept final try { clear_abi(buffer); typename D::abi_guard guard(this->shim()); *buffer = detach_from(this->shim().DetachBuffer()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall DetachStream(void** stream) noexcept final try { clear_abi(stream); typename D::abi_guard guard(this->shim()); *stream = detach_from(this->shim().DetachStream()); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateDataReader(void* inputStream, void** dataReader) noexcept final try { clear_abi(dataReader); typename D::abi_guard guard(this->shim()); *dataReader = detach_from(this->shim().CreateDataReader(*reinterpret_cast(&inputStream))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall FromBuffer(void* buffer, void** dataReader) noexcept final try { clear_abi(dataReader); typename D::abi_guard guard(this->shim()); *dataReader = detach_from(this->shim().FromBuffer(*reinterpret_cast(&buffer))); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall get_UnstoredBufferLength(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UnstoredBufferLength()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UnicodeEncoding(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UnicodeEncoding()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_UnicodeEncoding(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().UnicodeEncoding(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ByteOrder(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ByteOrder()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ByteOrder(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ByteOrder(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteByte(uint8_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteByte(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteBytes(uint32_t __valueSize, uint8_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteBytes(array_view(reinterpret_cast(value), reinterpret_cast(value) + __valueSize)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteBuffer(void* buffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteBuffer(*reinterpret_cast(&buffer)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteBufferRange(void* buffer, uint32_t start, uint32_t count) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteBuffer(*reinterpret_cast(&buffer), start, count); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteBoolean(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteBoolean(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteGuid(winrt::guid value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteGuid(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteInt16(int16_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteInt16(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteInt32(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteInt32(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteInt64(int64_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteInt64(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteUInt16(uint16_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteUInt16(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteUInt32(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteUInt32(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteUInt64(uint64_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteUInt64(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteSingle(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteSingle(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteDouble(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteDouble(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteDateTime(int64_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteDateTime(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteTimeSpan(int64_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().WriteTimeSpan(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall WriteString(void* value, uint32_t* codeUnitCount) noexcept final try { typename D::abi_guard guard(this->shim()); *codeUnitCount = detach_from(this->shim().WriteString(*reinterpret_cast(&value))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall MeasureString(void* value, uint32_t* codeUnitCount) noexcept final try { typename D::abi_guard guard(this->shim()); *codeUnitCount = detach_from(this->shim().MeasureString(*reinterpret_cast(&value))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall StoreAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().StoreAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FlushAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().FlushAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall DetachBuffer(void** buffer) noexcept final try { clear_abi(buffer); typename D::abi_guard guard(this->shim()); *buffer = detach_from(this->shim().DetachBuffer()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall DetachStream(void** outputStream) noexcept final try { clear_abi(outputStream); typename D::abi_guard guard(this->shim()); *outputStream = detach_from(this->shim().DetachStream()); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateDataWriter(void* outputStream, void** dataWriter) noexcept final try { clear_abi(dataWriter); typename D::abi_guard guard(this->shim()); *dataWriter = detach_from(this->shim().CreateDataWriter(*reinterpret_cast(&outputStream))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall OpenAsync(void* filePath, int32_t accessMode, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenAsync(*reinterpret_cast(&filePath), *reinterpret_cast(&accessMode))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenWithOptionsAsync(void* filePath, int32_t accessMode, uint32_t sharingOptions, int32_t openDisposition, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenAsync(*reinterpret_cast(&filePath), *reinterpret_cast(&accessMode), *reinterpret_cast(&sharingOptions), *reinterpret_cast(&openDisposition))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenTransactedWriteAsync(void* filePath, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenTransactedWriteAsync(*reinterpret_cast(&filePath))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenTransactedWriteWithOptionsAsync(void* filePath, uint32_t openOptions, int32_t openDisposition, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenTransactedWriteAsync(*reinterpret_cast(&filePath), *reinterpret_cast(&openOptions), *reinterpret_cast(&openDisposition))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenForUserAsync(void* user, void* filePath, int32_t accessMode, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&filePath), *reinterpret_cast(&accessMode))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenForUserWithOptionsAsync(void* user, void* filePath, int32_t accessMode, uint32_t sharingOptions, int32_t openDisposition, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&filePath), *reinterpret_cast(&accessMode), *reinterpret_cast(&sharingOptions), *reinterpret_cast(&openDisposition))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenTransactedWriteForUserAsync(void* user, void* filePath, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenTransactedWriteForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&filePath))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall OpenTransactedWriteForUserWithOptionsAsync(void* user, void* filePath, uint32_t openOptions, int32_t openDisposition, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenTransactedWriteForUserAsync(*reinterpret_cast(&user), *reinterpret_cast(&filePath), *reinterpret_cast(&openOptions), *reinterpret_cast(&openDisposition))); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { int32_t __stdcall ReadAsync(void* buffer, uint32_t count, uint32_t options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().ReadAsync(*reinterpret_cast(&buffer), count, *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } }; template struct produce : produce_base { int32_t __stdcall OpenSequentialReadAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenSequentialReadAsync()); return 0; } catch (...) { return to_hresult(); } }; template struct produce : produce_base { int32_t __stdcall WriteAsync(void* buffer, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().WriteAsync(*reinterpret_cast(&buffer))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FlushAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().FlushAsync()); return 0; } catch (...) { return to_hresult(); } }; template struct produce : produce_base { int32_t __stdcall Serialize(void* propertySet, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().Serialize(*reinterpret_cast(&propertySet))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Deserialize(void* propertySet, void* buffer) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Deserialize(*reinterpret_cast(&propertySet), *reinterpret_cast(&buffer)); return 0; } catch (...) { return to_hresult(); } }; template struct produce : produce_base { int32_t __stdcall get_Size(uint64_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Size()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Size(uint64_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Size(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetInputStreamAt(uint64_t position, void** stream) noexcept final try { clear_abi(stream); typename D::abi_guard guard(this->shim()); *stream = detach_from(this->shim().GetInputStreamAt(position)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetOutputStreamAt(uint64_t position, void** stream) noexcept final try { clear_abi(stream); typename D::abi_guard guard(this->shim()); *stream = detach_from(this->shim().GetOutputStreamAt(position)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Position(uint64_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Position()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Seek(uint64_t position) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Seek(position); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CloneStream(void** stream) noexcept final try { clear_abi(stream); typename D::abi_guard guard(this->shim()); *stream = detach_from(this->shim().CloneStream()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_CanRead(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CanRead()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_CanWrite(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CanWrite()); return 0; } catch (...) { return to_hresult(); } }; template struct produce : produce_base { int32_t __stdcall OpenReadAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().OpenReadAsync()); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateFromFile(void* file, void** streamReference) noexcept final try { clear_abi(streamReference); typename D::abi_guard guard(this->shim()); *streamReference = detach_from(this->shim().CreateFromFile(*reinterpret_cast(&file))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateFromUri(void* uri, void** streamReference) noexcept final try { clear_abi(streamReference); typename D::abi_guard guard(this->shim()); *streamReference = detach_from(this->shim().CreateFromUri(*reinterpret_cast(&uri))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateFromStream(void* stream, void** streamReference) noexcept final try { clear_abi(streamReference); typename D::abi_guard guard(this->shim()); *streamReference = detach_from(this->shim().CreateFromStream(*reinterpret_cast(&stream))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CopyAsync(void* source, void* destination, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().CopyAsync(*reinterpret_cast(&source), *reinterpret_cast(&destination))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CopySizeAsync(void* source, void* destination, uint64_t bytesToCopy, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().CopyAsync(*reinterpret_cast(&source), *reinterpret_cast(&destination), bytesToCopy)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CopyAndCloseAsync(void* source, void* destination, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().CopyAndCloseAsync(*reinterpret_cast(&source), *reinterpret_cast(&destination))); return 0; } catch (...) { return to_hresult(); } }; #endif template struct produce : produce_base { }; } WINRT_EXPORT namespace winrt::Windows::Storage::Streams { constexpr auto operator|(InputStreamOptions const left, InputStreamOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(InputStreamOptions& left, InputStreamOptions const right) noexcept { left = left | right; return left; } constexpr auto operator&(InputStreamOptions const left, InputStreamOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(InputStreamOptions& left, InputStreamOptions const right) noexcept { left = left & right; return left; } constexpr auto operator~(InputStreamOptions const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(InputStreamOptions const left, InputStreamOptions const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(InputStreamOptions& left, InputStreamOptions const right) noexcept { left = left ^ right; return left; } inline Buffer::Buffer(uint32_t capacity) : Buffer(impl::call_factory([&](IBufferFactory const& f) { return f.Create(capacity); })) { } inline auto Buffer::CreateCopyFromMemoryBuffer(winrt::Windows::Foundation::IMemoryBuffer const& input) { return impl::call_factory([&](IBufferStatics const& f) { return f.CreateCopyFromMemoryBuffer(input); }); } inline auto Buffer::CreateMemoryBufferOverIBuffer(winrt::Windows::Storage::Streams::IBuffer const& input) { return impl::call_factory([&](IBufferStatics const& f) { return f.CreateMemoryBufferOverIBuffer(input); }); } inline DataReader::DataReader(winrt::Windows::Storage::Streams::IInputStream const& inputStream) : DataReader(impl::call_factory([&](IDataReaderFactory const& f) { return f.CreateDataReader(inputStream); })) { } inline auto DataReader::FromBuffer(winrt::Windows::Storage::Streams::IBuffer const& buffer) { return impl::call_factory([&](IDataReaderStatics const& f) { return f.FromBuffer(buffer); }); } inline DataWriter::DataWriter() : DataWriter(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline DataWriter::DataWriter(winrt::Windows::Storage::Streams::IOutputStream const& outputStream) : DataWriter(impl::call_factory([&](IDataWriterFactory const& f) { return f.CreateDataWriter(outputStream); })) { } inline auto FileRandomAccessStream::OpenAsync(param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode) { return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenAsync(filePath, accessMode); }); } inline auto FileRandomAccessStream::OpenAsync(param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode, winrt::Windows::Storage::StorageOpenOptions const& sharingOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) { return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenAsync(filePath, accessMode, sharingOptions, openDisposition); }); } inline auto FileRandomAccessStream::OpenTransactedWriteAsync(param::hstring const& filePath) { return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenTransactedWriteAsync(filePath); }); } inline auto FileRandomAccessStream::OpenTransactedWriteAsync(param::hstring const& filePath, winrt::Windows::Storage::StorageOpenOptions const& openOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) { return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenTransactedWriteAsync(filePath, openOptions, openDisposition); }); } inline auto FileRandomAccessStream::OpenForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode) { return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenForUserAsync(user, filePath, accessMode); }); } inline auto FileRandomAccessStream::OpenForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::FileAccessMode const& accessMode, winrt::Windows::Storage::StorageOpenOptions const& sharingOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) { return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenForUserAsync(user, filePath, accessMode, sharingOptions, openDisposition); }); } inline auto FileRandomAccessStream::OpenTransactedWriteForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath) { return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenTransactedWriteForUserAsync(user, filePath); }); } inline auto FileRandomAccessStream::OpenTransactedWriteForUserAsync(winrt::Windows::System::User const& user, param::hstring const& filePath, winrt::Windows::Storage::StorageOpenOptions const& openOptions, winrt::Windows::Storage::Streams::FileOpenDisposition const& openDisposition) { return impl::call_factory([&](IFileRandomAccessStreamStatics const& f) { return f.OpenTransactedWriteForUserAsync(user, filePath, openOptions, openDisposition); }); } inline InMemoryRandomAccessStream::InMemoryRandomAccessStream() : InMemoryRandomAccessStream(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline auto RandomAccessStream::CopyAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination) { return impl::call_factory([&](IRandomAccessStreamStatics const& f) { return f.CopyAsync(source, destination); }); } inline auto RandomAccessStream::CopyAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination, uint64_t bytesToCopy) { return impl::call_factory([&](IRandomAccessStreamStatics const& f) { return f.CopyAsync(source, destination, bytesToCopy); }); } inline auto RandomAccessStream::CopyAndCloseAsync(winrt::Windows::Storage::Streams::IInputStream const& source, winrt::Windows::Storage::Streams::IOutputStream const& destination) { return impl::call_factory([&](IRandomAccessStreamStatics const& f) { return f.CopyAndCloseAsync(source, destination); }); } inline auto RandomAccessStreamReference::CreateFromFile(winrt::Windows::Storage::IStorageFile const& file) { return impl::call_factory([&](IRandomAccessStreamReferenceStatics const& f) { return f.CreateFromFile(file); }); } inline auto RandomAccessStreamReference::CreateFromUri(winrt::Windows::Foundation::Uri const& uri) { return impl::call_factory([&](IRandomAccessStreamReferenceStatics const& f) { return f.CreateFromUri(uri); }); } inline auto RandomAccessStreamReference::CreateFromStream(winrt::Windows::Storage::Streams::IRandomAccessStream const& stream) { return impl::call_factory([&](IRandomAccessStreamReferenceStatics const& f) { return f.CreateFromStream(stream); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif