ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
|
#include <acts/blob/master/thirdparty/nlohmann_json/single_include/nlohmann/json.hpp>
Public Member Functions | |
serializer (output_adapter_t< char > s, const char ichar, error_handler_t error_handler_=error_handler_t::strict) | |
serializer (const serializer &)=delete | |
serializer & | operator= (const serializer &)=delete |
serializer (serializer &&)=delete | |
serializer & | operator= (serializer &&)=delete |
~serializer ()=default | |
void | dump (const BasicJsonType &val, const bool pretty_print, const bool ensure_ascii, const unsigned int indent_step, const unsigned int current_indent=0) |
internal implementation of the serialization function | |
Private Types | |
using | string_t = typename BasicJsonType::string_t |
using | number_float_t = typename BasicJsonType::number_float_t |
using | number_integer_t = typename BasicJsonType::number_integer_t |
using | number_unsigned_t = typename BasicJsonType::number_unsigned_t |
Private Member Functions | |
void | dump_escaped (const string_t &s, const bool ensure_ascii) |
dump escaped string | |
unsigned int | count_digits (number_unsigned_t x) noexcept |
count digits | |
template<typename NumberType , detail::enable_if_t< std::is_same< NumberType, number_unsigned_t >::value orstd::is_same< NumberType, number_integer_t >::value, int > = 0> | |
void | dump_integer (NumberType x) |
dump an integer | |
void | dump_float (number_float_t x) |
dump a floating-point number | |
void | dump_float (number_float_t x, std::true_type) |
void | dump_float (number_float_t x, std::false_type) |
number_unsigned_t | remove_sign (number_unsigned_t x) |
number_unsigned_t | remove_sign (number_integer_t x) noexcept |
Static Private Member Functions | |
static std::uint8_t | decode (std::uint8_t &state, std::uint32_t &codep, const std::uint8_t byte) noexcept |
check whether a string is UTF-8 encoded | |
Private Attributes | |
output_adapter_t< char > | o = nullptr |
the output of the serializer | |
std::array< char, 64 > | number_buffer {{}} |
a (hopefully) large enough character buffer | |
const std::lconv * | loc = nullptr |
the locale | |
const char | thousands_sep = '\0' |
the locale's thousand separator character | |
const char | decimal_point = '\0' |
the locale's decimal point character | |
std::array< char, 512 > | string_buffer {{}} |
string buffer | |
const char | indent_char |
the indentation character | |
string_t | indent_string |
the indentation string | |
const error_handler_t | error_handler |
error_handler how to react on decoding errors | |
Static Private Attributes | |
static constexpr std::uint8_t | UTF8_ACCEPT = 0 |
static constexpr std::uint8_t | UTF8_REJECT = 1 |
Definition at line 13787 of file json.hpp.
View newest version in sPHENIX GitHub at line 13787 of file json.hpp
|
private |
|
private |
|
private |
|
private |
|
inline |
|
delete |
|
delete |
|
default |
|
inlineprivatenoexcept |
count digits
Count the number of decimal (base 10) digits for an input unsigned integer.
[in] | x | unsigned integer number to count its digits |
Definition at line 14303 of file json.hpp.
View newest version in sPHENIX GitHub at line 14303 of file json.hpp
References Acts::UnitConstants::u, and x.
|
inlinestaticprivatenoexcept |
check whether a string is UTF-8 encoded
The function checks each byte of a string whether it is UTF-8 encoded. The result of the check is stored in the state parameter. The function must be called initially with state 0 (accept). State 1 means the string must be rejected, because the current byte is not allowed. If the string is completely processed, but the state is non-zero, the string ended prematurely; that is, the last byte indicated more bytes should have followed.
[in,out] | state | the state of the decoding |
[in,out] | codep | codepoint (valid only if resulting state is UTF8_ACCEPT) |
[in] | byte | next byte to decode |
Definition at line 14527 of file json.hpp.
View newest version in sPHENIX GitHub at line 14527 of file json.hpp
References Acts::UnitConstants::u.
|
inline |
internal implementation of the serialization function
This function is called by the public member function dump and organizes the serialization internally. The indentation level is propagated as additional parameter. In case of arrays and objects, the function is called recursively.
escape_string()
operator<<
"%g"
format[in] | val | value to serialize |
[in] | pretty_print | whether the output shall be pretty-printed |
[in] | indent_step | the indent level |
[in] | current_indent | the current indent level (only used internally) |
Definition at line 13837 of file json.hpp.
View newest version in sPHENIX GitHub at line 13837 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
Referenced by nlohmann::basic_json::dump().
|
inlineprivate |
dump escaped string
Escape a string by replacing certain special characters by a sequence of an escape character (backslash) and another character and other control characters by a sequence of "\u" followed by a four-digit hex representation. The escaped string is written to output stream o.
[in] | s | the string to escape |
[in] | ensure_ascii | whether to escape non-ASCII characters with sequences |
Linear in the length of string s.
Definition at line 14047 of file json.hpp.
View newest version in sPHENIX GitHub at line 14047 of file json.hpp
References JSON_HEDLEY_LIKELY, JSON_THROW, sn, nlohmann::detail::binary_writer< BasicJsonType, CharType >::to_char_type(), nlohmann::to_string(), and Acts::UnitConstants::u.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
dump an integer
Dump a given integer to output stream o. Works internally with number_buffer.
[in] | x | integer number (signed or unsigned) to dump |
NumberType | either number_integer_t or number_unsigned_t |
Definition at line 14342 of file json.hpp.
View newest version in sPHENIX GitHub at line 14342 of file json.hpp
References x.
|
delete |
|
delete |
|
inlineprivate |
|
inlineprivatenoexcept |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |