From bd3fe0cac583739bc0d7c4b5c8f301bb350abca0 Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Fri, 30 Aug 2019 00:19:31 -0400 Subject: Renamed lib to deps so github will ignore it for language stats --- lib/sol2/include/sol/stack_check_qualified.hpp | 87 -------------------------- 1 file changed, 87 deletions(-) delete mode 100644 lib/sol2/include/sol/stack_check_qualified.hpp (limited to 'lib/sol2/include/sol/stack_check_qualified.hpp') diff --git a/lib/sol2/include/sol/stack_check_qualified.hpp b/lib/sol2/include/sol/stack_check_qualified.hpp deleted file mode 100644 index 0e16153..0000000 --- a/lib/sol2/include/sol/stack_check_qualified.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// sol3 - -// The MIT License (MIT) - -// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors - -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#ifndef SOL_STACK_CHECK_QUALIFIED_HPP -#define SOL_STACK_CHECK_QUALIFIED_HPP - -#include "stack_check_unqualified.hpp" - -namespace sol { -namespace stack { - - template - struct qualified_checker { - template - static bool check(lua_State* L, int index, Handler&& handler, record& tracking) { - if constexpr (!std::is_reference_v && is_unique_usertype_v) { - using u_traits = unique_usertype_traits>; - using T = typename u_traits::type; - if constexpr (is_base_rebindable_non_void_v) { - using rebind_t = typename u_traits::template rebind_base; - // we have a unique pointer type that can be - // rebound to a base/derived type - const type indextype = type_of(L, index); - tracking.use(1); - if (indextype != type::userdata) { - handler(L, index, type::userdata, indextype, "value is not a userdata"); - return false; - } - void* memory = lua_touserdata(L, index); - memory = detail::align_usertype_unique_destructor(memory); - detail::unique_destructor& pdx = *static_cast(memory); - if (&detail::usertype_unique_alloc_destroy == pdx) { - return true; - } - if constexpr (derive::value) { - memory = detail::align_usertype_unique_tag(memory); - detail::unique_tag& ic = *reinterpret_cast(memory); - string_view ti = usertype_traits::qualified_name(); - string_view rebind_ti = usertype_traits::qualified_name(); - if (ic(nullptr, nullptr, ti, rebind_ti) != 0) { - return true; - } - } - handler(L, index, type::userdata, indextype, "value is a userdata but is not the correct unique usertype"); - return false; - } - else { - return stack::unqualified_check(L, index, std::forward(handler), tracking); - } - } - else if constexpr (!std::is_reference_v && is_container_v) { - if (type_of(L, index) == type::userdata) { - return stack::unqualified_check(L, index, std::forward(handler), tracking); - } - else { - return stack::unqualified_check>(L, index, std::forward(handler), tracking); - } - } - else { - return stack::unqualified_check(L, index, std::forward(handler), tracking); - } - } - }; -} -} // namespace sol::stack - -#endif // SOL_STACK_CHECK_HPP -- cgit v1.2.3