DAW JSON Link
Namespaces | Macros | Typedefs | Functions | Variables
daw_json_assert.h File Reference
#include "version.h"
#include <daw/json/daw_json_exception.h>
#include <daw/daw_attributes.h>
#include <daw/daw_likely.h>
#include <daw/daw_not_null.h>
#include <cstddef>
#include <daw/stdinc/move_fwd_exch.h>
#include <exception>
#include <string_view>

Go to the source code of this file.

Namespaces

 daw
 
 daw::json
 Customization point traits.
 
 daw::json::anonymous_namespace{daw_json_assert.h}
 

Macros

#define daw_json_assert_weak(Bool, ...)
 Assert that Bool is true when in Checked Input mode If false pass rest of args to daw_json_error. More...
 
#define daw_json_ensure(Bool, ...)
 Ensure that Bool is true. If false pass rest of args to daw_json_error. More...
 

Typedefs

using daw::json::daw_json_error_handler_t = daw::not_null< void(*)(json_exception &&, void *)>
 

Functions

DAW_ATTRIB_NOINLINE void daw::json::anonymous_namespace{daw_json_assert.h}::daw_json_error (ErrorReason reason)
 
template<typename ParseState >
DAW_ATTRIB_NOINLINE void daw::json::anonymous_namespace{daw_json_assert.h}::daw_json_error (ErrorReason reason, ParseState const &location)
 
DAW_ATTRIB_NOINLINE void daw::json::anonymous_namespace{daw_json_assert.h}::daw_json_error (json_details::missing_member reason)
 
template<typename ParseState >
DAW_ATTRIB_NOINLINE void daw::json::anonymous_namespace{daw_json_assert.h}::daw_json_error (json_details::missing_member reason, ParseState const &location)
 
DAW_ATTRIB_NOINLINE void daw::json::anonymous_namespace{daw_json_assert.h}::daw_json_error (json_details::missing_token reason)
 
template<typename ParseState >
DAW_ATTRIB_NOINLINE void daw::json::anonymous_namespace{daw_json_assert.h}::daw_json_error (json_details::missing_token reason, ParseState const &location)
 
DAW_ATTRIB_NOINLINE void daw::json::default_error_handler_terminating (json_exception &&jex, void *)
 

Variables

static thread_local daw_json_error_handler_t daw::json::daw_json_error_handler
 
static thread_local void * daw::json::daw_json_error_handler_data = nullptr
 
constexpr bool daw::json::use_daw_json_exceptions_v = false
 

Macro Definition Documentation

◆ daw_json_assert_weak

#define daw_json_assert_weak (   Bool,
  ... 
)
Value:
do { \
if constexpr( not ParseState::is_unchecked_input ) { \
if( DAW_UNLIKELY( not( Bool ) ) ) { \
daw_json_error( __VA_ARGS__ ); \
} \
} \
} while( false )

Assert that Bool is true when in Checked Input mode If false pass rest of args to daw_json_error.

Definition at line 162 of file daw_json_assert.h.

◆ daw_json_ensure

#define daw_json_ensure (   Bool,
  ... 
)
Value:
do { \
if( DAW_UNLIKELY( not( Bool ) ) ) { \
daw_json_error( __VA_ARGS__ ); \
} \
} while( false )

Ensure that Bool is true. If false pass rest of args to daw_json_error.

Definition at line 153 of file daw_json_assert.h.