Arkanjo 0.1
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
detail::binary_writer< BasicJsonType, CharType > Class Template Reference

serialization to CBOR and MessagePack values More...

#include <json.hpp>

Public Member Functions

 binary_writer (output_adapter_t< CharType > adapter)
 create a binary writer
 
void write_bson (const BasicJsonType &j)
 
void write_cbor (const BasicJsonType &j)
 
void write_msgpack (const BasicJsonType &j)
 
void write_ubjson (const BasicJsonType &j, const bool use_count, const bool use_type, const bool add_prefix=true, const bool use_bjdata=false, const bjdata_version_t bjdata_version=bjdata_version_t::draft2)
 

Static Public Member Functions

template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value > * = nullptr>
static constexpr CharType to_char_type (std::uint8_t x) noexcept
 
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_unsigned< char >::value > * = nullptr>
static CharType to_char_type (std::uint8_t x) noexcept
 
template<typename C = CharType, enable_if_t< std::is_unsigned< C >::value > * = nullptr>
static constexpr CharType to_char_type (std::uint8_t x) noexcept
 
template<typename InputCharType , typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value &&std::is_same< char, typename std::remove_cv< InputCharType >::type >::value > * = nullptr>
static constexpr CharType to_char_type (InputCharType x) noexcept
 

Detailed Description

template<typename BasicJsonType, typename CharType>
class detail::binary_writer< BasicJsonType, CharType >

serialization to CBOR and MessagePack values

Definition at line 15861 of file json.hpp.

Constructor & Destructor Documentation

◆ binary_writer()

template<typename BasicJsonType , typename CharType >
detail::binary_writer< BasicJsonType, CharType >::binary_writer ( output_adapter_t< CharType > adapter)
explicit

create a binary writer

Parameters
[in]adapteroutput adapter to write to

Definition at line 15873 of file json.hpp.

Member Function Documentation

◆ to_char_type() [1/4]

template<typename BasicJsonType , typename CharType >
template<typename InputCharType , typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value &&std::is_same< char, typename std::remove_cv< InputCharType >::type >::value > * = nullptr>
static constexpr CharType detail::binary_writer< BasicJsonType, CharType >::to_char_type ( InputCharType x)
staticconstexprnoexcept

Definition at line 17664 of file json.hpp.

◆ to_char_type() [2/4]

template<typename BasicJsonType , typename CharType >
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_signed< char >::value > * = nullptr>
static constexpr CharType detail::binary_writer< BasicJsonType, CharType >::to_char_type ( std::uint8_t x)
staticconstexprnoexcept

Definition at line 17622 of file json.hpp.

◆ to_char_type() [3/4]

template<typename BasicJsonType , typename CharType >
template<typename C = CharType, enable_if_t< std::is_signed< C >::value &&std::is_unsigned< char >::value > * = nullptr>
static CharType detail::binary_writer< BasicJsonType, CharType >::to_char_type ( std::uint8_t x)
staticnoexcept

Definition at line 17629 of file json.hpp.

◆ to_char_type() [4/4]

template<typename BasicJsonType , typename CharType >
template<typename C = CharType, enable_if_t< std::is_unsigned< C >::value > * = nullptr>
static constexpr CharType detail::binary_writer< BasicJsonType, CharType >::to_char_type ( std::uint8_t x)
staticconstexprnoexcept

Definition at line 17653 of file json.hpp.

◆ write_bson()

template<typename BasicJsonType , typename CharType >
void detail::binary_writer< BasicJsonType, CharType >::write_bson ( const BasicJsonType & j)
Parameters
[in]jJSON value to serialize
Precondition
j.type() == value_t::object

Definition at line 15882 of file json.hpp.

◆ write_cbor()

template<typename BasicJsonType , typename CharType >
void detail::binary_writer< BasicJsonType, CharType >::write_cbor ( const BasicJsonType & j)
Parameters
[in]jJSON value to serialize

Definition at line 15911 of file json.hpp.

◆ write_msgpack()

template<typename BasicJsonType , typename CharType >
void detail::binary_writer< BasicJsonType, CharType >::write_msgpack ( const BasicJsonType & j)
Parameters
[in]jJSON value to serialize

Definition at line 16235 of file json.hpp.

◆ write_ubjson()

template<typename BasicJsonType , typename CharType >
void detail::binary_writer< BasicJsonType, CharType >::write_ubjson ( const BasicJsonType & j,
const bool use_count,
const bool use_type,
const bool add_prefix = true,
const bool use_bjdata = false,
const bjdata_version_t bjdata_version = bjdata_version_t::draft2 )
Parameters
[in]jJSON value to serialize
[in]use_countwhether to use '#' prefixes (optimized format)
[in]use_typewhether to use '$' prefixes (optimized format)
[in]add_prefixwhether prefixes need to be used for this value
[in]use_bjdatawhether write in BJData format, default is false
[in]bjdata_versionwhich BJData version to use, default is draft2

Definition at line 16562 of file json.hpp.


The documentation for this class was generated from the following file: