Update to winrt headers

PiperOrigin-RevId: 395381851
This commit is contained in:
jfcarroll
2021-09-07 19:31:14 -07:00
committed by Copybara-Service
parent 84821862b5
commit 7cf55178be
1366 changed files with 6164 additions and 50786 deletions
@@ -1,7 +1,8 @@
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.210505.3
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.210825.3
#define CPPWINRT_VERSION "2.0.210505.3"
#define CPPWINRT_VERSION "2.0.210825.3"
#pragma once
#ifndef WINRT_BASE_H
#define WINRT_BASE_H
@@ -137,7 +138,7 @@ namespace winrt::impl
};
template <typename T>
constexpr uint8_t hex_to_uint(T const c) noexcept
constexpr uint8_t hex_to_uint(T const c)
{
if (c >= '0' && c <= '9')
{
@@ -153,22 +154,22 @@ namespace winrt::impl
}
else
{
abort();
throw std::invalid_argument("Character is not a hexadecimal digit");
}
}
template <typename T>
constexpr uint8_t hex_to_uint8(T const a, T const b) noexcept
constexpr uint8_t hex_to_uint8(T const a, T const b)
{
return (hex_to_uint(a) << 4) | hex_to_uint(b);
}
constexpr uint16_t uint8_to_uint16(uint8_t a, uint8_t b) noexcept
constexpr uint16_t uint8_to_uint16(uint8_t a, uint8_t b)
{
return (static_cast<uint16_t>(a) << 8) | static_cast<uint16_t>(b);
}
constexpr uint32_t uint8_to_uint32(uint8_t a, uint8_t b, uint8_t c, uint8_t d) noexcept
constexpr uint32_t uint8_to_uint32(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
{
return (static_cast<uint32_t>(uint8_to_uint16(a, b)) << 16) |
static_cast<uint32_t>(uint8_to_uint16(c, d));
@@ -202,11 +203,11 @@ WINRT_EXPORT namespace winrt
private:
template <typename TStringView>
static constexpr guid parse(TStringView const value) noexcept
static constexpr guid parse(TStringView const value)
{
if (value.size() != 36 || value[8] != '-' || value[13] != '-' || value[18] != '-' || value[23] != '-')
{
abort();
throw std::invalid_argument("value is not a valid GUID string");
}
return
@@ -296,7 +297,7 @@ WINRT_EXPORT namespace winrt
{
return !(left == right);
}
inline bool operator<(guid const& left, guid const& right) noexcept
{
return memcmp(&left, &right, sizeof(left)) < 0;
@@ -527,7 +528,7 @@ WINRT_IMPL_LINK(CloseThreadpool, 4)
WINRT_EXPORT namespace winrt
{
void check_hresult(hresult const result);
hresult check_hresult(hresult const result);
hresult to_hresult() noexcept;
template <typename D, typename I>
@@ -1478,7 +1479,7 @@ WINRT_EXPORT namespace winrt
{
}
handle_type& operator=(handle_type&& other) & noexcept
handle_type& operator=(handle_type&& other) noexcept
{
if (this != &other)
{
@@ -1514,7 +1515,7 @@ WINRT_EXPORT namespace winrt
type* put() noexcept
{
WINRT_ASSERT(m_value == T::invalid());
close();
return &m_value;
}
@@ -1846,6 +1847,11 @@ namespace winrt::impl
virtual int32_t __stdcall Buffer(uint8_t** value) noexcept = 0;
};
struct __declspec(novtable) IMemoryBufferByteAccess : unknown_abi
{
virtual int32_t __stdcall GetBuffer(uint8_t** value, uint32_t* capacity) noexcept = 0;
};
template <> struct abi<Windows::Foundation::TimeSpan>
{
using type = int64_t;
@@ -1874,6 +1880,7 @@ namespace winrt::impl
template <> inline constexpr guid guid_v<IContextCallback>{ 0x000001da, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } };
template <> inline constexpr guid guid_v<IServerSecurity>{ 0x0000013E, 0x0000, 0x0000, { 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 } };
template <> inline constexpr guid guid_v<IBufferByteAccess>{ 0x905a0fef, 0xbc53, 0x11df, { 0x8c,0x49,0x00,0x1e,0x4f,0xc6,0x86,0xda } };
template <> inline constexpr guid guid_v<IMemoryBufferByteAccess>{ 0x5b0d3235, 0x4dba, 0x4d44, { 0x86,0x5e,0x8f,0x1d,0x0e,0x4f,0xd0,0x4d } };
}
namespace winrt::impl
@@ -2038,7 +2045,7 @@ WINRT_EXPORT namespace winrt::Windows::Foundation
release_ref();
}
IUnknown& operator=(IUnknown const& other) & noexcept
IUnknown& operator=(IUnknown const& other) noexcept
{
if (this != &other)
{
@@ -2050,7 +2057,7 @@ WINRT_EXPORT namespace winrt::Windows::Foundation
return*this;
}
IUnknown& operator=(IUnknown&& other) & noexcept
IUnknown& operator=(IUnknown&& other) noexcept
{
if (this != &other)
{
@@ -2066,7 +2073,7 @@ WINRT_EXPORT namespace winrt::Windows::Foundation
return nullptr != m_ptr;
}
IUnknown& operator=(std::nullptr_t) & noexcept
IUnknown& operator=(std::nullptr_t) noexcept
{
release_ref();
return*this;
@@ -2302,10 +2309,6 @@ WINRT_EXPORT namespace winrt::Windows::Foundation
{
IInspectable(std::nullptr_t = nullptr) noexcept {}
IInspectable(void* ptr, take_ownership_from_abi_t) noexcept : IUnknown(ptr, take_ownership_from_abi) {}
IInspectable(IInspectable const&) noexcept = default;
IInspectable(IInspectable&&) noexcept = default;
IInspectable& operator=(IInspectable const&) & noexcept = default;
IInspectable& operator=(IInspectable&&) & noexcept = default;
};
}
@@ -2367,13 +2370,13 @@ WINRT_EXPORT namespace winrt
release_ref();
}
com_ptr& operator=(com_ptr const& other) & noexcept
com_ptr& operator=(com_ptr const& other) noexcept
{
copy_ref(other.m_ptr);
return*this;
}
com_ptr& operator=(com_ptr&& other) & noexcept
com_ptr& operator=(com_ptr&& other) noexcept
{
if (this != &other)
{
@@ -2385,14 +2388,14 @@ WINRT_EXPORT namespace winrt
}
template <typename U>
com_ptr& operator=(com_ptr<U> const& other) & noexcept
com_ptr& operator=(com_ptr<U> const& other) noexcept
{
copy_ref(other.m_ptr);
return*this;
}
template <typename U>
com_ptr& operator=(com_ptr<U>&& other) & noexcept
com_ptr& operator=(com_ptr<U>&& other) noexcept
{
release_ref();
m_ptr = std::exchange(other.m_ptr, {});
@@ -2421,7 +2424,7 @@ WINRT_EXPORT namespace winrt
type** put() noexcept
{
WINRT_ASSERT(m_ptr == nullptr);
release_ref();
return &m_ptr;
}
@@ -2843,16 +2846,16 @@ WINRT_EXPORT namespace winrt
m_handle(impl::duplicate_hstring(value.m_handle.get()))
{}
hstring& operator=(hstring const& value) &
hstring& operator=(hstring const& value)
{
m_handle.attach(impl::duplicate_hstring(value.m_handle.get()));
return*this;
}
hstring(hstring&&) noexcept = default;
hstring& operator=(hstring&&) & = default;
hstring& operator=(hstring&&) = default;
hstring(std::nullptr_t) = delete;
hstring& operator=(std::nullptr_t) & = delete;
hstring& operator=(std::nullptr_t) = delete;
hstring(std::initializer_list<wchar_t> value) :
hstring(value.begin(), static_cast<uint32_t>(value.size()))
@@ -2870,17 +2873,17 @@ WINRT_EXPORT namespace winrt
hstring(value.data(), static_cast<size_type>(value.size()))
{}
hstring& operator=(std::wstring_view const& value) &
hstring& operator=(std::wstring_view const& value)
{
return *this = hstring{ value };
}
hstring& operator=(wchar_t const* const value) &
hstring& operator=(wchar_t const* const value)
{
return *this = hstring{ value };
}
hstring& operator=(std::initializer_list<wchar_t> value) &
hstring& operator=(std::initializer_list<wchar_t> value)
{
return *this = hstring{ value };
}
@@ -2990,7 +2993,39 @@ WINRT_EXPORT namespace winrt
{
return rend();
}
#if __cpp_lib_starts_ends_with
bool starts_with(wchar_t const value) const noexcept
{
return operator std::wstring_view().starts_with(value);
}
bool starts_with(std::wstring_view const another) const noexcept
{
return operator std::wstring_view().starts_with(another);
}
bool starts_with(const wchar_t* const pointer) const noexcept
{
return operator std::wstring_view().starts_with(pointer);
}
bool ends_with(wchar_t const value) const noexcept
{
return operator std::wstring_view().ends_with(value);
}
bool ends_with(std::wstring_view const another) const noexcept
{
return operator std::wstring_view().ends_with(another);
}
bool ends_with(const wchar_t* const pointer) const noexcept
{
return operator std::wstring_view().ends_with(pointer);
}
#endif
bool empty() const noexcept
{
return !m_handle;
@@ -3831,7 +3866,7 @@ WINRT_EXPORT namespace winrt
other.m_size = 0;
}
com_array& operator=(com_array&& other) & noexcept
com_array& operator=(com_array&& other) noexcept
{
clear();
this->m_data = other.m_data;
@@ -4128,6 +4163,8 @@ WINRT_EXPORT namespace winrt
com_ptr<impl::IWeakReference> m_ref;
};
template<typename T> weak_ref(T const&)->weak_ref<impl::wrapped_type_t<T>>;
template<typename T>
struct impl::abi<weak_ref<T>> : impl::abi<com_ptr<impl::IWeakReference>>
{
@@ -4386,8 +4423,10 @@ WINRT_EXPORT namespace winrt
com_ptr<impl::IAgileReference> m_ref;
};
template<typename T> agile_ref(T const&)->agile_ref<impl::wrapped_type_t<T>>;
template <typename T>
agile_ref<T> make_agile(T const& object)
agile_ref<impl::wrapped_type_t<T>> make_agile(T const& object)
{
return object;
}
@@ -4970,12 +5009,13 @@ WINRT_EXPORT namespace winrt
throw_hresult(impl::hresult_from_win32(WINRT_IMPL_GetLastError()));
}
inline void check_hresult(hresult const result)
inline hresult check_hresult(hresult const result)
{
if (result < 0)
{
throw_hresult(result);
}
return result;
}
template<typename T>
@@ -5322,11 +5362,11 @@ namespace winrt::impl
{}
template <typename F> delegate_base(F* handler) :
delegate_base([=](auto&& ... args) { handler(args...); })
delegate_base([=](auto&& ... args) { return handler(args...); })
{}
template <typename O, typename M> delegate_base(O* object, M method) :
delegate_base([=](auto&& ... args) { ((*object).*(method))(args...); })
delegate_base([=](auto&& ... args) { return ((*object).*(method))(args...); })
{}
template <typename O, typename M> delegate_base(com_ptr<O>&& object, M method) :
@@ -5403,7 +5443,7 @@ WINRT_EXPORT namespace winrt
event_revoker& operator=(event_revoker const&) = delete;
event_revoker(event_revoker&&) noexcept = default;
event_revoker& operator=(event_revoker&& other) & noexcept
event_revoker& operator=(event_revoker&& other) noexcept
{
if (this != &other)
{
@@ -5458,7 +5498,7 @@ WINRT_EXPORT namespace winrt
factory_event_revoker& operator=(factory_event_revoker const&) = delete;
factory_event_revoker(factory_event_revoker&&) noexcept = default;
factory_event_revoker& operator=(factory_event_revoker&& other) & noexcept
factory_event_revoker& operator=(factory_event_revoker&& other) noexcept
{
if (this != &other)
{
@@ -5514,7 +5554,7 @@ namespace winrt::impl
event_revoker& operator=(event_revoker const&) = delete;
event_revoker(event_revoker&&) noexcept = default;
event_revoker& operator=(event_revoker&& other) & noexcept
event_revoker& operator=(event_revoker&& other) noexcept
{
event_revoker(std::move(other)).swap(*this);
return *this;
@@ -6401,10 +6441,6 @@ WINRT_EXPORT namespace winrt
{
IActivationFactory(std::nullptr_t = nullptr) noexcept {}
IActivationFactory(void* ptr, take_ownership_from_abi_t) noexcept : IInspectable(ptr, take_ownership_from_abi) {}
IActivationFactory(IActivationFactory const&) noexcept = default;
IActivationFactory(IActivationFactory&&) noexcept = default;
IActivationFactory& operator=(IActivationFactory const&) & noexcept = default;
IActivationFactory& operator=(IActivationFactory&&) & noexcept = default;
template <typename T>
T ActivateInstance() const
@@ -7866,6 +7902,7 @@ WINRT_EXPORT namespace winrt
hstring GetRuntimeClassName() const override
{
static_assert(std::is_base_of_v<implements_type, D>, "Class must derive from implements<> or ClassT<> where the first template parameter is the derived class name, e.g. struct D : implements<D, ...>");
return impl::runtime_class_name<typename impl::implements_default_interface<D>::type>::get();
}
@@ -8282,7 +8319,7 @@ WINRT_EXPORT namespace winrt
access_token() = default;
access_token(access_token&& other) = default;
access_token& operator=(access_token&& other) & = default;
access_token& operator=(access_token&& other) = default;
access_token impersonate() const
{