25 bool DIVIDE_ASSERT_FUNC(
const bool expression,
const char* expressionStr,
const char* file,
const int line,
const char* failMessage )
noexcept
29 if ( !expression ) [[unlikely]]
31 if ( failMessage ==
nullptr || strlen( failMessage ) == 0 ) [[unlikely]]
36 const string msgOut =
Util::StringFormat(
"ASSERT [{} : {}]: {} : {}", file, line, expressionStr, failMessage );
51 assert( expression && msgOut.c_str() );
77 if ( Paths::g_logPath.empty() )
110 return SDL_GetClipboardText();
115 SDL_SetClipboardText( text );
122 SDL_ShowCursor( state ? SDL_TRUE : SDL_FALSE );
128 return SDL_ShowCursor( SDL_QUERY ) == SDL_ENABLE;
133 const std::time_t t = std::time(
nullptr );
134 std::tm* now = std::localtime( &t );
137 strftime( buffer,
sizeof( buffer ),
"%d_%m_%Y__%H_%M_%S", now );
constexpr char ERROR_LOG_FILE[]
constexpr char OUTPUT_LOG_FILE[]
bool DIVIDE_ASSERT_FUNC(const bool expression, const char *expressionStr, const char *file, int line, const char *failMessage) noexcept
It is safe to call evaluate expressions and call functions inside the assert check as it will compile...
constexpr bool LOG_ASSERTS
Log assert fails messages to the error log file.
constexpr bool CONTINUE_ON_ASSERT
Do not call the platform "assert" function in order to continue application execution.
constexpr bool IS_SHIPPING_BUILD
bool resetMainThreadID() noexcept
const std::thread::id & mainThreadID() noexcept
Str StringFormat(const char *fmt, Args &&...args)
bool FindCommandLineArgument(int argc, char **argv, const char *target_arg, const char *arg_prefix="--")
Handle console commands that start with a forward slash.
void SetClipboardText(const char *text) noexcept
bool CursorState() noexcept
SysInfo & sysInfo() noexcept
ResourcePath getWorkingDirectory()
bool DebugBreak(const bool condition) noexcept
std::string CurrentDateTimeString()
void DIVIDE_ASSERT_MSG_BOX(const char *failMessage) noexcept
const char * GetClipboardText() noexcept
ErrorCode PlatformInit(int argc, char **argv)
const SysInfo & const_sysInfo() noexcept
bool GetAvailableMemory(SysInfo &info)
void ToggleCursor(bool state) noexcept
void InitSysInfo(SysInfo &info, I32 argc, char **argv)
static NO_INLINE void errorfn(const char *format, T &&... args)
static void Start(std::string_view logFilePath, std::string_view erroFilePath, bool printCopyright) noexcept
ResourcePath _workingDirectory
size_t _availableRamInBytes