Go to the documentation of this file. 6 #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED 7 #define CPPTL_JSON_ASSERTIONS_H_INCLUDED 12 #if !defined(JSON_IS_AMALGAMATION) 14 #endif // if !defined(JSON_IS_AMALGAMATION) 20 #if JSON_USE_EXCEPTION 23 # define JSON_ASSERT(condition) \ 24 {if (!(condition)) {Json::throwLogicError( "assert json failed" );}} 26 # define JSON_FAIL_MESSAGE(message) \ 28 JSONCPP_OSTRINGSTREAM oss; oss << message; \ 29 Json::throwLogicError(oss.str()); \ 33 #else // JSON_USE_EXCEPTION 35 # define JSON_ASSERT(condition) assert(condition) 39 # define JSON_FAIL_MESSAGE(message) \ 41 JSONCPP_OSTRINGSTREAM oss; oss << message; \ 42 assert(false && oss.str().c_str()); \ 49 #define JSON_ASSERT_MESSAGE(condition, message) \ 51 JSON_FAIL_MESSAGE(message); \ 54 #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED