// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Foundation_Metadata_H #define WINRT_Windows_Foundation_Metadata_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.Foundation.h" #include "winrt/impl/Windows.Foundation.Metadata.2.h" namespace winrt::impl { template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsTypePresent(param::hstring const& typeName) const { bool 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->IsTypePresent(*(void**)(&typeName), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsTypePresent(*(void**)(&typeName), &result)); } return result; } template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsMethodPresent(param::hstring const& typeName, param::hstring const& methodName) const { bool 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->IsMethodPresent(*(void**)(&typeName), *(void**)(&methodName), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsMethodPresent(*(void**)(&typeName), *(void**)(&methodName), &result)); } return result; } template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsMethodPresent(param::hstring const& typeName, param::hstring const& methodName, uint32_t inputParameterCount) const { bool 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->IsMethodPresentWithArity(*(void**)(&typeName), *(void**)(&methodName), inputParameterCount, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsMethodPresentWithArity(*(void**)(&typeName), *(void**)(&methodName), inputParameterCount, &result)); } return result; } template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsEventPresent(param::hstring const& typeName, param::hstring const& eventName) const { bool 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->IsEventPresent(*(void**)(&typeName), *(void**)(&eventName), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsEventPresent(*(void**)(&typeName), *(void**)(&eventName), &result)); } return result; } template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsPropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) const { bool 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->IsPropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsPropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); } return result; } template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsReadOnlyPropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) const { bool 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->IsReadOnlyPropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsReadOnlyPropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); } return result; } template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsWriteablePropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) const { bool 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->IsWriteablePropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsWriteablePropertyPresent(*(void**)(&typeName), *(void**)(&propertyName), &result)); } return result; } template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsEnumNamedValuePresent(param::hstring const& enumTypeName, param::hstring const& valueName) const { bool 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->IsEnumNamedValuePresent(*(void**)(&enumTypeName), *(void**)(&valueName), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsEnumNamedValuePresent(*(void**)(&enumTypeName), *(void**)(&valueName), &result)); } return result; } template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsApiContractPresent(param::hstring const& contractName, uint16_t majorVersion) const { bool 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->IsApiContractPresentByMajor(*(void**)(&contractName), majorVersion, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsApiContractPresentByMajor(*(void**)(&contractName), majorVersion, &result)); } return result; } template auto consume_Windows_Foundation_Metadata_IApiInformationStatics::IsApiContractPresent(param::hstring const& contractName, uint16_t majorVersion, uint16_t minorVersion) const { bool 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->IsApiContractPresentByMajorAndMinor(*(void**)(&contractName), majorVersion, minorVersion, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsApiContractPresentByMajorAndMinor(*(void**)(&contractName), majorVersion, minorVersion, &result)); } return result; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall IsTypePresent(void* typeName, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsTypePresent(*reinterpret_cast(&typeName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsMethodPresent(void* typeName, void* methodName, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsMethodPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&methodName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsMethodPresentWithArity(void* typeName, void* methodName, uint32_t inputParameterCount, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsMethodPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&methodName), inputParameterCount)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsEventPresent(void* typeName, void* eventName, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsEventPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&eventName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsPropertyPresent(void* typeName, void* propertyName, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsPropertyPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&propertyName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsReadOnlyPropertyPresent(void* typeName, void* propertyName, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsReadOnlyPropertyPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&propertyName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsWriteablePropertyPresent(void* typeName, void* propertyName, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsWriteablePropertyPresent(*reinterpret_cast(&typeName), *reinterpret_cast(&propertyName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsEnumNamedValuePresent(void* enumTypeName, void* valueName, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsEnumNamedValuePresent(*reinterpret_cast(&enumTypeName), *reinterpret_cast(&valueName))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsApiContractPresentByMajor(void* contractName, uint16_t majorVersion, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsApiContractPresent(*reinterpret_cast(&contractName), majorVersion)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsApiContractPresentByMajorAndMinor(void* contractName, uint16_t majorVersion, uint16_t minorVersion, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsApiContractPresent(*reinterpret_cast(&contractName), majorVersion, minorVersion)); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Foundation::Metadata { constexpr auto operator|(AttributeTargets const left, AttributeTargets const right) noexcept { return static_cast(impl::to_underlying_type(left) | impl::to_underlying_type(right)); } constexpr auto operator|=(AttributeTargets& left, AttributeTargets const right) noexcept { left = left | right; return left; } constexpr auto operator&(AttributeTargets const left, AttributeTargets const right) noexcept { return static_cast(impl::to_underlying_type(left) & impl::to_underlying_type(right)); } constexpr auto operator&=(AttributeTargets& left, AttributeTargets const right) noexcept { left = left & right; return left; } constexpr auto operator~(AttributeTargets const value) noexcept { return static_cast(~impl::to_underlying_type(value)); } constexpr auto operator^(AttributeTargets const left, AttributeTargets const right) noexcept { return static_cast(impl::to_underlying_type(left) ^ impl::to_underlying_type(right)); } constexpr auto operator^=(AttributeTargets& left, AttributeTargets const right) noexcept { left = left ^ right; return left; } inline auto ApiInformation::IsTypePresent(param::hstring const& typeName) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsTypePresent(typeName); }); } inline auto ApiInformation::IsMethodPresent(param::hstring const& typeName, param::hstring const& methodName) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsMethodPresent(typeName, methodName); }); } inline auto ApiInformation::IsMethodPresent(param::hstring const& typeName, param::hstring const& methodName, uint32_t inputParameterCount) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsMethodPresent(typeName, methodName, inputParameterCount); }); } inline auto ApiInformation::IsEventPresent(param::hstring const& typeName, param::hstring const& eventName) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsEventPresent(typeName, eventName); }); } inline auto ApiInformation::IsPropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsPropertyPresent(typeName, propertyName); }); } inline auto ApiInformation::IsReadOnlyPropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsReadOnlyPropertyPresent(typeName, propertyName); }); } inline auto ApiInformation::IsWriteablePropertyPresent(param::hstring const& typeName, param::hstring const& propertyName) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsWriteablePropertyPresent(typeName, propertyName); }); } inline auto ApiInformation::IsEnumNamedValuePresent(param::hstring const& enumTypeName, param::hstring const& valueName) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsEnumNamedValuePresent(enumTypeName, valueName); }); } inline auto ApiInformation::IsApiContractPresent(param::hstring const& contractName, uint16_t majorVersion) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsApiContractPresent(contractName, majorVersion); }); } inline auto ApiInformation::IsApiContractPresent(param::hstring const& contractName, uint16_t majorVersion, uint16_t minorVersion) { return impl::call_factory([&](IApiInformationStatics const& f) { return f.IsApiContractPresent(contractName, majorVersion, minorVersion); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif