|
#define | NX_KIT_API /*empty*/ |
|
#define | NX_DEBUG_INI ini(). |
|
#define | NX_DEBUG_ENABLE_OUTPUT NX_DEBUG_INI enableOutput |
|
#define | NX_PRINT_PREFIX ::nx::kit::debug::detail::printPrefix(__FILE__) |
|
#define | NX_DEBUG_STREAM *::nx::kit::debug::stream() |
|
#define | NX_DEBUG_ENDL << std::endl |
|
#define | NX_PRINT |
|
#define | NX_OUTPUT |
|
#define | NX_KIT_ASSERT(...) |
|
#define | LL |
|
#define | NX_PRINT_VALUE(VALUE) NX_PRINT << "####### " #VALUE ": " + ::nx::kit::utils::toString(VALUE) |
|
#define | NX_PRINT_HEX_DUMP(CAPTION, BYTES, SIZE) |
|
#define | NX_DEBUG_SAVE_DIR ::nx::kit::IniConfig::iniFilesDir() |
|
#define | NX_SAVE_STR(FILENAME, STR) |
|
#define | NX_SAVE_BIN(FILENAME, BYTES, SIZE) |
|
#define | NX_DEBUG_ENABLE_TIME NX_DEBUG_INI enableTime |
|
#define | NX_TIME_BEGIN(TAG) |
|
#define | NX_TIME_MARK(TAG, MARK) |
|
#define | NX_TIME_END(TAG) |
|
#define | NX_DEBUG_ENABLE_FPS NX_DEBUG_INI enableFps |
|
#define | NX_FPS(TAG, ...) |
|
#define | NX_KIT_DEBUG_DETAIL_PRINT_FUNC ([&](const char* message) { NX_PRINT << message; }) |
|
#define | NX_KIT_DEBUG_DETAIL_MSVC_EXPAND(ARG) ARG |
|
#define | NX_KIT_DEBUG_DETAIL_GET_3RD_ARG(ARG1, ARG2, ARG3, ...) ARG3 |
|
#define | NX_KIT_DEBUG_DETAIL_ASSERT1(CONDITION) |
|
#define | NX_KIT_DEBUG_DETAIL_ASSERT2(CONDITION, MESSAGE) |
|
#define | NX_KIT_DEBUG_DETAIL_CONCAT(X, Y) NX_KIT_DEBUG_DETAIL_CONCAT2(X, Y) |
|
#define | NX_KIT_DEBUG_DETAIL_CONCAT2(X, Y) X##Y |
|
#define | NX_KIT_DEBUG_DETAIL_THREAD_ID() "" |
|
|
char | nx::kit::debug::pathSeparator () |
|
size_t | nx::kit::debug::commonPrefixSize (const std::string &s1, const std::string &s2) |
|
const char * | nx::kit::debug::relativeSrcFilename (const char *file) |
|
std::string | nx::kit::debug::fileBaseNameWithoutExt (const char *file) |
|
std::ostream *& | nx::kit::debug::stream () |
|
void | nx::kit::debug::intentionallyCrash (const char *message) |
|
std::string | nx::kit::debug::hexDumpLine (const char *bytes, int size, int bytesPerLine) |
|
void | nx::kit::debug::detail::assertionFailed (PrintFunc printFunc, const char *conditionStr, const std::string &message, const char *file, int line) |
|
bool | nx::kit::debug::detail::doAssert (bool condition, PrintFunc printFunc, const char *conditionStr, const std::string &message, const char *file, int line) |
|
std::string | nx::kit::debug::detail::printPrefix (const char *file) |
|
void | nx::kit::debug::detail::printHexDump (PrintFunc printFunc, const char *caption, const char *const bytes, int size) |
|
void | nx::kit::debug::detail::saveStr (PrintFunc printFunc, const char *originDir, const char *filename, const char *strCaption, const std::string &str) |
|
void | nx::kit::debug::detail::saveBin (PrintFunc printFunc, const char *originDir, const char *filename, const char *bytes, int size) |
|
Utilities for debugging: measuring execution time and FPS, working with strings, logging values and messages.
This unit can be compiled in the context of any C++ project.
#define NX_KIT_ASSERT |
( |
|
... | ) |
|
Value: __VA_ARGS__, NX_KIT_DEBUG_DETAIL_ASSERT2, NX_KIT_DEBUG_DETAIL_ASSERT1, \
args_required)(__VA_ARGS__))
#define NX_KIT_DEBUG_DETAIL_MSVC_EXPAND(ARG)
Definition: debug.h:258
#define NX_KIT_DEBUG_DETAIL_GET_3RD_ARG(ARG1, ARG2, ARG3,...)
Definition: debug.h:261
If the condition is false, logs the failure with NX_PRINT, and in debug build (i.e. NDEBUG is not defined), crashes the process to let a dump/core be generated.
ATTENTION: Unlike std library assert(), the condition is checked even in Release build to log the failure.
Additionally, allows to handle the failure (because the application must keep going):
- Returns
- Condition evaluation result.