diff options
author | crupest <crupest@outlook.com> | 2019-06-27 17:02:58 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-06-27 17:02:58 +0800 |
commit | b53527fbe50a953ad0e3225cc812eb76b8a1f82d (patch) | |
tree | eb81cd14d0a165c47f841ad94835f8987109de7e /src/win/graph/direct/exception.cpp | |
parent | 8c5b05bcfce96495b4ffc4209ab8feda12597729 (diff) | |
download | cru-b53527fbe50a953ad0e3225cc812eb76b8a1f82d.tar.gz cru-b53527fbe50a953ad0e3225cc812eb76b8a1f82d.tar.bz2 cru-b53527fbe50a953ad0e3225cc812eb76b8a1f82d.zip |
...
Diffstat (limited to 'src/win/graph/direct/exception.cpp')
-rw-r--r-- | src/win/graph/direct/exception.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/win/graph/direct/exception.cpp b/src/win/graph/direct/exception.cpp deleted file mode 100644 index 23c267c1..00000000 --- a/src/win/graph/direct/exception.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "cru/win/graph/direct/exception.hpp" - -#include "cru/common/format.hpp" - -namespace cru::platform::graph::win::direct { -using util::Format; - -inline std::string HResultMakeMessage(HRESULT h_result, - const std::string_view* message) { - char buffer[10]; - sprintf_s(buffer, "%#08x", h_result); - - if (message) - return Format( - "An HResultError is thrown. HRESULT: {}.\nAdditional message: {}\n", - buffer, *message); - else - return Format("An HResultError is thrown. HRESULT: {}.\n", buffer); -} - -HResultError::HResultError(HRESULT h_result) - : PlatformException(HResultMakeMessage(h_result, nullptr)), - h_result_(h_result) {} - -HResultError::HResultError(HRESULT h_result, - const std::string_view& additional_message) - : PlatformException(HResultMakeMessage(h_result, &additional_message)), - h_result_(h_result) {} -} // namespace cru::platform::graph::win::direct |