7 #include "JSONSingleton.h"
9 json_error_callback_t JSONDebug::register_callback(json_error_callback_t callback) json_nothrow {
10 json_error_callback_t res = JSONSingleton<json_error_callback_t>::get();
11 JSONSingleton<json_error_callback_t>::set(callback);
17 void JSONDebug::_JSON_FAIL(
const json_string & msg) json_nothrow {
18 #ifdef JSON_STDERROR //no callback, just use stderror
20 std::cerr << msg << std::endl;
22 std::cerr << std::string(msg.begin(), msg.end()) << std::endl;
25 if (json_error_callback_t ErrorCallback = JSONSingleton<json_error_callback_t>::get()){
27 ErrorCallback(msg.c_str());
36 void JSONDebug::_JSON_ASSERT(
bool condition,
const json_string & msg) json_nothrow {
37 if (json_unlikely(!condition)){