|
JSON Voorhees
Killer JSON for C++
|
Inheritance diagram for jsonv::ast_node::integer:
Collaboration diagram for jsonv::ast_node::integer:Public Member Functions | |
| std::int64_t | value () const |
Get the literal as an std::int64_t. | |
Public Member Functions inherited from jsonv::ast_node::basic_dynamic_size_token< integer, ast_node_type::integer > | |
| constexpr | basic_dynamic_size_token (const char *token_begin, std::size_t token_size) |
| constexpr std::size_t | token_size () const |
Public Member Functions inherited from jsonv::ast_node::base< TSelf, KIndexToken > | |
| std::string_view | token_raw () const |
| operator ast_node () const | |
Allow implicit conversion to the more generic ast_node. | |
Additional Inherited Members | |
Static Public Member Functions inherited from jsonv::ast_node::base< TSelf, KIndexToken > | |
| static constexpr ast_node_type | type () |
Get the ast_node_type type. | |
Protected Member Functions inherited from jsonv::ast_node::base< TSelf, KIndexToken > | |
| constexpr | base (const char *token_begin) |
| std::int64_t jsonv::ast_node::integer::value | ( | ) | const |
Get the literal as an std::int64_t.
A literal from 2^63 through 2^64-1 is stored with its bits intact, so it reads back negative – the onus is on the caller to know a particular key is in that range.
| std::invalid_argument | if the literal is outside that range altogether, where there are no bits to keep. parse reads such a literal as the nearest double instead. |