// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Microsoft_Windows_Storage_H #define WINRT_Microsoft_Windows_Storage_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/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/Microsoft.Windows.Storage.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_Storage_IApplicationData::IsMachinePathSupported() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_IsMachinePathSupported(&value)); return value; } template auto consume_Microsoft_Windows_Storage_IApplicationData::LocalCachePath() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_LocalCachePath(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::LocalPath() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_LocalPath(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::MachinePath() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_MachinePath(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::SharedLocalPath() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_SharedLocalPath(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::TemporaryPath() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_TemporaryPath(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::LocalCacheFolder() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_LocalCacheFolder(&value)); return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::LocalFolder() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_LocalFolder(&value)); return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::MachineFolder() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_MachineFolder(&value)); return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::SharedLocalFolder() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_SharedLocalFolder(&value)); return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::TemporaryFolder() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_TemporaryFolder(&value)); return winrt::Windows::Storage::StorageFolder{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::LocalSettings() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->get_LocalSettings(&value)); return winrt::Microsoft::Windows::Storage::ApplicationDataContainer{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::ClearAsync(winrt::Microsoft::Windows::Storage::ApplicationDataLocality const& locality) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->ClearAsync(static_cast(locality), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::ClearPublisherCacheFolderAsync(param::hstring const& folderName) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->ClearPublisherCacheFolderAsync(*(void**)(&folderName), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::GetPublisherCachePath(param::hstring const& folderName) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->GetPublisherCachePath(*(void**)(&folderName), &result)); return hstring{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationData::GetPublisherCacheFolder(param::hstring const& folderName) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationData)->GetPublisherCacheFolder(*(void**)(&folderName), &result)); return winrt::Windows::Storage::StorageFolder{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationDataContainer::Containers() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationDataContainer)->get_Containers(&value)); return winrt::Windows::Foundation::Collections::IMap{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationDataContainer::Name() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationDataContainer)->get_Name(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationDataContainer::Locality() const { winrt::Microsoft::Windows::Storage::ApplicationDataLocality value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationDataContainer)->get_Locality(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_Storage_IApplicationDataContainer::Values() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationDataContainer)->get_Values(&value)); return winrt::Windows::Foundation::Collections::IPropertySet{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationDataContainer::CreateContainer(param::hstring const& name, winrt::Microsoft::Windows::Storage::ApplicationDataCreateDisposition const& disposition) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationDataContainer)->CreateContainer(*(void**)(&name), static_cast(disposition), &result)); return winrt::Microsoft::Windows::Storage::ApplicationDataContainer{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationDataContainer::DeleteContainer(param::hstring const& name) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationDataContainer)->DeleteContainer(*(void**)(&name))); } template auto consume_Microsoft_Windows_Storage_IApplicationDataStatics::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationDataStatics)->GetDefault(&result)); return winrt::Microsoft::Windows::Storage::ApplicationData{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationDataStatics::GetForUser(winrt::Windows::System::User const& user) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationDataStatics)->GetForUser(*(void**)(&user), &result)); return winrt::Microsoft::Windows::Storage::ApplicationData{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_Storage_IApplicationDataStatics::GetForPackageFamily(param::hstring const& packageFamilyName) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::Storage::IApplicationDataStatics)->GetForPackageFamily(*(void**)(&packageFamilyName), &result)); return winrt::Microsoft::Windows::Storage::ApplicationData{ result, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_IsMachinePathSupported(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsMachinePathSupported()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LocalCachePath(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LocalCachePath()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LocalPath(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LocalPath()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MachinePath(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MachinePath()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SharedLocalPath(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SharedLocalPath()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_TemporaryPath(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().TemporaryPath()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LocalCacheFolder(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LocalCacheFolder()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LocalFolder(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LocalFolder()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MachineFolder(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MachineFolder()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SharedLocalFolder(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SharedLocalFolder()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_TemporaryFolder(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().TemporaryFolder()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LocalSettings(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LocalSettings()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ClearAsync(int32_t locality, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ClearAsync(*reinterpret_cast(&locality))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ClearPublisherCacheFolderAsync(void* folderName, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ClearPublisherCacheFolderAsync(*reinterpret_cast(&folderName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetPublisherCachePath(void* folderName, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetPublisherCachePath(*reinterpret_cast(&folderName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetPublisherCacheFolder(void* folderName, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetPublisherCacheFolder(*reinterpret_cast(&folderName))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Containers(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Containers()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Name(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Name()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Locality(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Locality()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Values(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Values()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateContainer(void* name, int32_t disposition, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().CreateContainer(*reinterpret_cast(&name), *reinterpret_cast(&disposition))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall DeleteContainer(void* name) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().DeleteContainer(*reinterpret_cast(&name)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetForUser(void* user, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetForUser(*reinterpret_cast(&user))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetForPackageFamily(void* packageFamilyName, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetForPackageFamily(*reinterpret_cast(&packageFamilyName))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Microsoft::Windows::Storage { inline auto ApplicationData::GetDefault() { return impl::call_factory_cast([](IApplicationDataStatics const& f) { return f.GetDefault(); }); } inline auto ApplicationData::GetForUser(winrt::Windows::System::User const& user) { return impl::call_factory([&](IApplicationDataStatics const& f) { return f.GetForUser(user); }); } inline auto ApplicationData::GetForPackageFamily(param::hstring const& packageFamilyName) { return impl::call_factory([&](IApplicationDataStatics const& f) { return f.GetForPackageFamily(packageFamilyName); }); } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif