JsonCpp project page Classes Namespace JsonCpp home page

Macros
assertions.h File Reference
#include <cstdlib>
#include <sstream>
#include "config.h"
+ Include dependency graph for assertions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define JSON_ASSERT(condition)
 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. More...
 
#define JSON_FAIL_MESSAGE(message)
 
#define JSON_ASSERT_MESSAGE(condition, message)
 

Macro Definition Documentation

◆ JSON_ASSERT

#define JSON_ASSERT (   condition)
Value:
{ \
if (!(condition)) { \
Json::throwLogicError("assert json failed"); \
} \
}
void throwLogicError(String const &msg)
used internally
Definition: json_value.cpp:238

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.

Definition at line 23 of file assertions.h.

◆ JSON_ASSERT_MESSAGE

#define JSON_ASSERT_MESSAGE (   condition,
  message 
)
Value:
if (!(condition)) { \
JSON_FAIL_MESSAGE(message); \
}

Definition at line 54 of file assertions.h.

◆ JSON_FAIL_MESSAGE

#define JSON_FAIL_MESSAGE (   message)
Value:
{ \
OStringStream oss; \
oss << message; \
abort(); \
}
void throwLogicError(String const &msg)
used internally
Definition: json_value.cpp:238

Definition at line 30 of file assertions.h.