diff options
Diffstat (limited to 'src/platform')
-rw-r--r-- | src/platform/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/platform/Exception.cpp | 44 | ||||
-rw-r--r-- | src/platform/graphics/SvgGeometry.cpp | 6 |
3 files changed, 51 insertions, 0 deletions
diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index 3f85adbc..4779bb57 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -1,6 +1,7 @@ add_library(CruPlatformBase ForDllExport.cpp Color.cpp + Exception.cpp GraphicsBase.cpp ) target_link_libraries(CruPlatformBase PUBLIC CruBase) diff --git a/src/platform/Exception.cpp b/src/platform/Exception.cpp new file mode 100644 index 00000000..7aef3b7f --- /dev/null +++ b/src/platform/Exception.cpp @@ -0,0 +1,44 @@ +#include "cru/platform/Exception.h" +#include "cru/common/Format.h" + +#include <optional> + +namespace cru::platform { +PlatformNotMatchException::PlatformNotMatchException( + String resource_platform, String target_platform, + std::optional<StringView> additional_message) + : resource_platform_(std::move(resource_platform)), + target_platform_(std::move(target_platform)) { + SetMessage( + Format(u"Resource platform '{}' does not match target platform '{}'.", + resource_platform_, target_platform_)); + + AppendMessage(additional_message); +} + +PlatformNotMatchException::~PlatformNotMatchException() {} + +String PlatformNotMatchException::GetResourcePlatform() const { + return resource_platform_; +} + +String PlatformNotMatchException::GetTargetPlatform() const { + return target_platform_; +} + +PlatformUnsupportedException::PlatformUnsupportedException( + String platform, String operation, + std::optional<StringView> additional_message) + : platform_(std::move(platform)), operation_(std::move(operation)) { + SetMessage(Format(u"Operation '{}' is not supported on platform '{}'.", + operation_, platform_)); + AppendMessage(additional_message); +} + +PlatformUnsupportedException::~PlatformUnsupportedException() {} + +String PlatformUnsupportedException::GetPlatform() const { return platform_; } + +String PlatformUnsupportedException::GetOperation() const { return operation_; } + +} // namespace cru::platform diff --git a/src/platform/graphics/SvgGeometry.cpp b/src/platform/graphics/SvgGeometry.cpp index 149c4bb6..b757c520 100644 --- a/src/platform/graphics/SvgGeometry.cpp +++ b/src/platform/graphics/SvgGeometry.cpp @@ -1 +1,7 @@ #include "cru/platform/graphics/SvgGeometry.h" + +namespace cru::platform::graphics { +SvgGeometryBuilder::SvgGeometryBuilder() {} + +SvgGeometryBuilder::~SvgGeometryBuilder() {} +} // namespace cru::platform::graphics |