7 #ifndef NAZARA_ERROR_HPP 8 #define NAZARA_ERROR_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Core/Config.hpp> 12 #include <Nazara/Core/Enums.hpp> 13 #include <Nazara/Core/String.hpp> 15 #if NAZARA_CORE_ENABLE_ASSERTS || defined(NAZARA_DEBUG) 16 #define NazaraAssert(a, err) if (!(a)) Nz::Error::Trigger(Nz::ErrorType_AssertFailed, err, __LINE__, __FILE__, NAZARA_FUNCTION) 18 #define NazaraAssert(a, err) for (;;) break 21 #define NazaraError(err) Nz::Error::Trigger(Nz::ErrorType_Normal, err, __LINE__, __FILE__, NAZARA_FUNCTION) 22 #define NazaraInternalError(err) Nz::Error::Trigger(Nz::ErrorType_Internal, err, __LINE__, __FILE__, NAZARA_FUNCTION) 23 #define NazaraWarning(err) Nz::Error::Trigger(Nz::ErrorType_Warning, err, __LINE__, __FILE__, NAZARA_FUNCTION) 33 static UInt32 GetFlags();
34 static String GetLastError(
const char** file =
nullptr,
unsigned int* line =
nullptr,
const char**
function =
nullptr);
35 static unsigned int GetLastSystemErrorCode();
36 static String GetLastSystemError(
unsigned int code = GetLastSystemErrorCode());
38 static void SetFlags(UInt32 flags);
40 static void Trigger(ErrorType type,
const String& error);
41 static void Trigger(ErrorType type,
const String& error,
unsigned int line,
const char* file,
const char*
function);
44 static UInt32 s_flags;
46 static const char* s_lastErrorFunction;
47 static const char* s_lastErrorFile;
48 static unsigned int s_lastErrorLine;
52 #endif // NAZARA_ERROR_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Core class that represents a string.
Definition: String.hpp:22
Core class that represents an error.
Definition: Error.hpp:27