SA_Logger
Sapphire's Suite's C++ Logger.
Loading...
Searching...
No Matches
Exception_Equals.hpp
Go to the documentation of this file.
1// Copyright (c) 2023 Sapphire's Suite. All Rights Reserved.
2
3#pragma once
4
5#ifndef SAPPHIRE_LOGGER_EXCEPTION_EQUALS_GUARD
6#define SAPPHIRE_LOGGER_EXCEPTION_EQUALS_GUARD
7
9
20namespace SA
21{
24 {
25 public:
38 template <typename T>
40 BaseInfo _info,
41 const T& _lhs,
42 const T& _rhs,
43 std::wstring _predStr = L"pred"
44 ) noexcept :
45 Exception(std::move(_info),
46 _lhs == _rhs,
47 std::move(_predStr) + L" => { " + ToWString(_lhs) + L" == " + ToWString(_rhs)+ L" }: Values must be equal.")
48 {
49 }
50
51
63 BaseInfo _info,
64 float _lhs,
65 float _rhs,
66 std::wstring _predStr = L"pred"
67 ) noexcept;
68
69
81 BaseInfo _info,
82 double _lhs,
83 double _rhs,
84 std::wstring _predStr = L"pred"
85 ) noexcept;
86 };
87
88
90
92 #define __SA_CREATE_EXCEPTION_Equals(_baseInfo, _lhs, _rhs) SA::Exception_Equals(\
93 _baseInfo,\
94 _lhs,\
95 _rhs,\
96 L"\'" SA_WSTR(_lhs) L"\' == \'" SA_WSTR(_rhs) L"\'"\
97 )
98
100}
101
110#endif // GUARD
Default Exception type implementation.
std::wstring ToWString(const Log &_log)
ToWString implementation for log.
Equals exception base type.
Definition Exception_Equals.hpp:24
Exception_Equals(BaseInfo _info, double _lhs, double _rhs, std::wstring _predStr=L"pred") noexcept
Exception_Equals(BaseInfo _info, float _lhs, float _rhs, std::wstring _predStr=L"pred") noexcept
Exception_Equals(BaseInfo _info, const T &_lhs, const T &_rhs, std::wstring _predStr=L"pred") noexcept
Definition Exception_Equals.hpp:39
Default (base) Exception type.
Definition Exception.hpp:24
Exception(BaseInfo _info, bool _pred, std::wstring _msg=L"") noexcept
Base exception create info.
Definition Exception.hpp:28