From 3c8d5c8f732239a8b50418be27464e30b9dddeae Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 17 Oct 2025 08:37:30 +0800 Subject: Exception remove string. --- include/cru/platform/Check.h | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'include/cru/platform/Check.h') diff --git a/include/cru/platform/Check.h b/include/cru/platform/Check.h index 202ee86e..b36b7fc1 100644 --- a/include/cru/platform/Check.h +++ b/include/cru/platform/Check.h @@ -2,40 +2,10 @@ #include "Exception.h" #include "Resource.h" -#include "cru/base/String.h" - #include #include namespace cru::platform { -template -TTarget* CheckPlatform(IPlatformResource* resource, - const String& target_platform) { - if (resource == nullptr) return nullptr; - const auto result = dynamic_cast(resource); - if (result == nullptr) { - throw PlatformNotMatchException( - resource->GetPlatformId(), target_platform, - u"Try to convert resource to target platform failed."); - } - return result; -} - -template -std::shared_ptr CheckPlatform(const std::shared_ptr& resource, - const String& target_platform) { - if (resource == nullptr) return nullptr; - static_assert(std::is_base_of_v, - "TSource must be a subclass of INativeResource."); - const auto result = std::dynamic_pointer_cast(resource); - if (result == nullptr) { - throw PlatformNotMatchException( - resource->GetPlatformId(), target_platform, - u"Try to convert resource to target platform failed."); - } - return result; -} - template TTarget* CheckPlatform(IPlatformResource* resource, std::string target_platform) { -- cgit v1.2.3