aboutsummaryrefslogtreecommitdiff
path: root/src/platform/Base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/Base.cpp')
-rw-r--r--src/platform/Base.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/platform/Base.cpp b/src/platform/Base.cpp
index c660ad13..fd1dec4e 100644
--- a/src/platform/Base.cpp
+++ b/src/platform/Base.cpp
@@ -1,5 +1,35 @@
#include "cru/platform/Base.h"
+#include <format>
+#include <optional>
+#include <string_view>
+
namespace cru::platform {
std::string IPlatformResource::GetDebugString() { return {}; }
+
+PlatformNotMatchException::PlatformNotMatchException(
+ std::string resource_platform, std::string target_platform,
+ std::optional<std::string_view> additional_message)
+ : PlatformException(std::format(
+ "Resource platform '{}' does not match target platform '{}'.",
+ resource_platform_, target_platform_)),
+ resource_platform_(std::move(resource_platform)),
+ target_platform_(std::move(target_platform)) {
+ AppendMessage(additional_message);
+}
+
+PlatformNotMatchException::~PlatformNotMatchException() {}
+
+PlatformUnsupportedException::PlatformUnsupportedException(
+ std::string platform, std::string operation,
+ std::optional<std::string_view> additional_message)
+ : PlatformException(
+ std::format("Operation '{}' is not supported on platform '{}'.",
+ operation, platform)),
+ platform_(std::move(platform)),
+ operation_(std::move(operation)) {
+ AppendMessage(additional_message);
+}
+
+PlatformUnsupportedException::~PlatformUnsupportedException() {}
} // namespace cru::platform