17#if __has_include(<source_location>)
18#include <source_location>
23#if defined(__cpp_lib_source_location)
24 using SourceLocation = std::source_location;
54 template<
typename S,
typename... Args>
100#define CE_EXCEPTION_DECL2(Name, Parent) \
101 class Name : public Parent { \
103 template<typename S, typename... Args> \
104 explicit Name(const S& formatString, Args&&... args) : Parent(#Name, formatString, std::forward<Args>(args)...) {} \
106#define CE_EXCEPTION_DECL(Name) CE_EXCEPTION_DECL2(Name, Exception)
#define CE_EXCEPTION_DECL(Name)
Definition Exception.hpp:106
Definition Exception.hpp:43
Exception(Exception &&other) noexcept=default
Exception(const Exception &other)=default
String mDescription
Definition Exception.hpp:46
virtual StringView getSource() const noexcept
Gets the source function that threw the exception.
Definition Exception.hpp:85
virtual UInt32 getLine() const noexcept
Gets line number on which the exception was thrown.
Definition Exception.hpp:91
SourceLocation mSourceLocation
Definition Exception.hpp:47
virtual StringView getDescription() const noexcept
Gets a short description about the exception.
Definition Exception.hpp:94
StringView mTypeName
Definition Exception.hpp:45
virtual StringView getFile() const noexcept
Gets the source file name in which the exception was thrown.
Definition Exception.hpp:88
virtual const String & getFullDescription() const
Returns a string with the full description of the exception.
Definition Exception.hpp:69
Exception(const char *typeName, const String &description="", const SourceLocation &sourceLocation=SourceLocation::current())
Definition Exception.hpp:51
String mFullDescription
Definition Exception.hpp:48
Exception(const char *typeName, const S &formatString, Args &&... args)
Definition Exception.hpp:55
const char * what() const noexcept override
Overriden std::exception::what. Returns the same value as getFullDescription().
Definition Exception.hpp:97
Exception & operator=(Exception &&other) noexcept=default
Exception & operator=(const Exception &other)=default
~Exception() noexcept override=default
Definition Exception.hpp:109
Definition Exception.hpp:110
Definition Exception.hpp:113
Definition Exception.hpp:114
Definition Exception.hpp:112
Definition Exception.hpp:111
Definition Exception.hpp:108
Definition Exception.hpp:115
Definition Application.hpp:19
BasicStringStream< char > StringStream
Wide string stream used for primarily for constructing narrow strings.
Definition StringStream.hpp:32
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition Exception.hpp:26
static SourceLocation current(const char *const filename=__FILE__)
Definition Exception.hpp:30
constexpr std::uint_least32_t column() const noexcept
Definition Exception.hpp:37
constexpr std::uint_least32_t line() const noexcept
Definition Exception.hpp:36
constexpr const char * file_name() const noexcept
Definition Exception.hpp:38
const char * filename
Definition Exception.hpp:27
const char * function
Definition Exception.hpp:28
constexpr const char * function_name() const noexcept
Definition Exception.hpp:39