NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
assertions.h 文件参考
#include <cstdlib>
#include <sstream>
#include "config.h"

浏览源代码.

宏定义

#define JSON_ASSERT(condition)
 
#define JSON_FAIL_MESSAGE(message)
 
#define JSON_ASSERT_MESSAGE(condition, message)
 

宏定义说明

◆ JSON_ASSERT

#define JSON_ASSERT ( condition)
值:
do { \
if (!(condition)) { \
nim_cpp_wrapper_util::Json::throwLogicError("assert json failed"); \
} \
} while (0)

It should not be possible for a maliciously designed file to cause an abort() or seg-fault, so these macros are used only for pre-condition violations and internal logic errors.

◆ JSON_ASSERT_MESSAGE

#define JSON_ASSERT_MESSAGE ( condition,
message )
值:
do { \
if (!(condition)) { \
JSON_FAIL_MESSAGE(message); \
} \
} while (0)

◆ JSON_FAIL_MESSAGE

#define JSON_FAIL_MESSAGE ( message)
值:
do { \
OStringStream oss; \
oss << message; \
nim_cpp_wrapper_util::Json::throwLogicError(oss.str()); \
abort(); \
} while (0)