blob: 7aef3b7f7c82b99981a9c7146988c32a23ebb41c (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
 |