SA_Logger
Sapphire's Suite's C++ Logger.
Loading...
Searching...
No Matches
Exception_IsValid.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_IS_VALID_GUARD
6#define SAPPHIRE_LOGGER_EXCEPTION_IS_VALID_GUARD
7
9
20namespace SA
21{
28 {
29 public:
39 template <typename T>
41 const T& _obj,
42 std::wstring _objStr
43 ) noexcept :
44 Exception(std::move(_info),
45 _obj.IsValid(),
46 SA::StringFormat(L"Object \'%1\' of type [%2] and value [%3] .IsValid() must return true!", _objStr, typeid(T).name(), _obj)
47 )
48 {
49 }
50 };
51
52
54
56 #define __SA_CREATE_EXCEPTION_IsValid(_baseInfo, _obj) SA::Exception_IsValid(\
57 _baseInfo,\
58 _obj,\
59 SA_WSTR(_obj)\
60 )
61
63 #define __SA_CREATE_EXCEPTION_IsThisValid(_baseInfo)\
64 __SA_CREATE_EXCEPTION_IsValid(_baseInfo, *this)
65
67}
68
69
78#endif // GUARD
Default Exception type implementation.
IsValid Exception type.
Definition Exception_IsValid.hpp:28
Exception_IsValid(BaseInfo _info, const T &_obj, std::wstring _objStr) noexcept
Value constructor
Definition Exception_IsValid.hpp:40
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