diff options
author | crupest <crupest@outlook.com> | 2021-09-14 22:10:02 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-09-14 22:10:02 +0800 |
commit | 46d4838ac8ff1bd8658b57cf4ebb4438e396fce8 (patch) | |
tree | f1e04c19630c7f42ad57618e9a2d7cf5ea4d31c1 /include/cru/platform/Check.hpp | |
parent | 9bc202a2e1664df3e3c148abfe90a90501bc1650 (diff) | |
download | cru-46d4838ac8ff1bd8658b57cf4ebb4438e396fce8.tar.gz cru-46d4838ac8ff1bd8658b57cf4ebb4438e396fce8.tar.bz2 cru-46d4838ac8ff1bd8658b57cf4ebb4438e396fce8.zip |
...
Diffstat (limited to 'include/cru/platform/Check.hpp')
-rw-r--r-- | include/cru/platform/Check.hpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/include/cru/platform/Check.hpp b/include/cru/platform/Check.hpp index 9ecd2d1d..5d99aa9c 100644 --- a/include/cru/platform/Check.hpp +++ b/include/cru/platform/Check.hpp @@ -2,9 +2,8 @@ #include "Exception.hpp" #include "Resource.hpp" -#include "cru/common/StringUtil.hpp" +#include "cru/common/String.hpp" -#include <fmt/format.h> #include <memory> #include <type_traits> @@ -15,10 +14,10 @@ TTarget* CheckPlatform(IPlatformResource* resource, Expects(resource); const auto result = dynamic_cast<TTarget*>(resource); if (result == nullptr) { - throw UnsupportPlatformException(String::FromUtf8(fmt::format( - "Try to convert resource to target platform failed. Platform id of " + throw UnsupportPlatformException(Format( + u"Try to convert resource to target platform failed. Platform id of " "resource to convert: {} . Target platform id: {} .", - resource->GetPlatformId().ToUtf8(), target_platform.ToUtf8()))); + resource->GetPlatformId(), target_platform)); } return result; } @@ -31,10 +30,10 @@ std::shared_ptr<TTarget> CheckPlatform(const std::shared_ptr<TSource>& resource, Expects(resource); const auto result = std::dynamic_pointer_cast<TTarget>(resource); if (result == nullptr) { - throw UnsupportPlatformException(String::FromUtf8(fmt::format( - "Try to convert resource to target platform failed. Platform id of " + throw UnsupportPlatformException(Format( + u"Try to convert resource to target platform failed. Platform id of " "resource to convert: {} . Target platform id: {} .", - resource->GetPlatformId().ToUtf8(), target_platform.ToUtf8()))); + resource->GetPlatformId(), target_platform)); } return result; } |