// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Storage_Compression_H #define WINRT_Windows_Storage_Compression_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/Windows.Storage.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.Storage.Compression.2.h" namespace winrt::impl { template auto consume_Windows_Storage_Compression_ICompressor::FinishAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Storage::Compression::ICompressor)->FinishAsync(&operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Storage_Compression_ICompressor::DetachStream() const { void* stream{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Storage::Compression::ICompressor)->DetachStream(&stream)); return winrt::Windows::Storage::Streams::IOutputStream{ stream, take_ownership_from_abi }; } template auto consume_Windows_Storage_Compression_ICompressorFactory::CreateCompressor(winrt::Windows::Storage::Streams::IOutputStream const& underlyingStream) const { void* createdCompressor{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Storage::Compression::ICompressorFactory)->CreateCompressor(*(void**)(&underlyingStream), &createdCompressor)); return winrt::Windows::Storage::Compression::Compressor{ createdCompressor, take_ownership_from_abi }; } template auto consume_Windows_Storage_Compression_ICompressorFactory::CreateCompressorEx(winrt::Windows::Storage::Streams::IOutputStream const& underlyingStream, winrt::Windows::Storage::Compression::CompressAlgorithm const& algorithm, uint32_t blockSize) const { void* createdCompressor{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Storage::Compression::ICompressorFactory)->CreateCompressorEx(*(void**)(&underlyingStream), static_cast(algorithm), blockSize, &createdCompressor)); return winrt::Windows::Storage::Compression::Compressor{ createdCompressor, take_ownership_from_abi }; } template auto consume_Windows_Storage_Compression_IDecompressor::DetachStream() const { void* stream{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Storage::Compression::IDecompressor)->DetachStream(&stream)); return winrt::Windows::Storage::Streams::IInputStream{ stream, take_ownership_from_abi }; } template auto consume_Windows_Storage_Compression_IDecompressorFactory::CreateDecompressor(winrt::Windows::Storage::Streams::IInputStream const& underlyingStream) const { void* createdDecompressor{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Storage::Compression::IDecompressorFactory)->CreateDecompressor(*(void**)(&underlyingStream), &createdDecompressor)); return winrt::Windows::Storage::Compression::Decompressor{ createdDecompressor, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall FinishAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().FinishAsync()); 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(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateCompressor(void* underlyingStream, void** createdCompressor) noexcept final try { clear_abi(createdCompressor); typename D::abi_guard guard(this->shim()); *createdCompressor = detach_from(this->shim().CreateCompressor(*reinterpret_cast(&underlyingStream))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateCompressorEx(void* underlyingStream, int32_t algorithm, uint32_t blockSize, void** createdCompressor) noexcept final try { clear_abi(createdCompressor); typename D::abi_guard guard(this->shim()); *createdCompressor = detach_from(this->shim().CreateCompressorEx(*reinterpret_cast(&underlyingStream), *reinterpret_cast(&algorithm), blockSize)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { 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(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateDecompressor(void* underlyingStream, void** createdDecompressor) noexcept final try { clear_abi(createdDecompressor); typename D::abi_guard guard(this->shim()); *createdDecompressor = detach_from(this->shim().CreateDecompressor(*reinterpret_cast(&underlyingStream))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Storage::Compression { inline Compressor::Compressor(winrt::Windows::Storage::Streams::IOutputStream const& underlyingStream) : Compressor(impl::call_factory([&](ICompressorFactory const& f) { return f.CreateCompressor(underlyingStream); })) { } inline Compressor::Compressor(winrt::Windows::Storage::Streams::IOutputStream const& underlyingStream, winrt::Windows::Storage::Compression::CompressAlgorithm const& algorithm, uint32_t blockSize) : Compressor(impl::call_factory([&](ICompressorFactory const& f) { return f.CreateCompressorEx(underlyingStream, algorithm, blockSize); })) { } inline Decompressor::Decompressor(winrt::Windows::Storage::Streams::IInputStream const& underlyingStream) : Decompressor(impl::call_factory([&](IDecompressorFactory const& f) { return f.CreateDecompressor(underlyingStream); })) { } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif