A class for holding a pair of JSON string (as its key) and JSON value (as its value). More...
#include </home/runner/work/metall/metall/include/metall/json/key_value_pair.hpp>
Public Types | |
using | char_type = _char_type |
using | char_traits = _char_traits |
using | allocator_type = Alloc |
using | key_type = std::basic_string_view< char_type, char_traits > |
using | value_type = metall::json::value< allocator_type > |
using | size_type = std::size_t |
Public Member Functions | |
key_value_pair (key_type key, const value_type &value, const allocator_type &alloc=allocator_type()) | |
Constructor. More... | |
key_value_pair (key_type key, value_type &&value, const allocator_type &alloc=allocator_type()) | |
Constructor. More... | |
key_value_pair (const key_value_pair &other) | |
Copy constructor. More... | |
key_value_pair (const key_value_pair &other, const allocator_type &alloc) | |
Allocator-extended copy constructor. More... | |
key_value_pair (key_value_pair &&other) noexcept | |
Move constructor. More... | |
key_value_pair (key_value_pair &&other, const allocator_type &alloc) noexcept | |
Allocator-extended move constructor. More... | |
key_value_pair & | operator= (const key_value_pair &other) |
Copy assignment operator. More... | |
key_value_pair & | operator= (key_value_pair &&other) noexcept |
Move assignment operator. More... | |
void | swap (key_value_pair &other) noexcept |
Swap contents. More... | |
~key_value_pair () noexcept | |
Destructor. More... | |
const key_type | key () const noexcept |
Returns the stored key. More... | |
const char_type * | key_c_str () const noexcept |
Returns the stored key as const char*. More... | |
value_type & | value () noexcept |
References the stored JSON value. More... | |
const value_type & | value () const noexcept |
References the stored JSON value. More... | |
allocator_type | get_allocator () const noexcept |
Return an allocator object. More... | |
Friends | |
bool | operator== (const key_value_pair &lhs, const key_value_pair &rhs) noexcept |
Return true if two key-value pairs are equal. More... | |
bool | operator!= (const key_value_pair &lhs, const key_value_pair &rhs) noexcept |
Return true if two key-value pairs are not equal. More... | |
A class for holding a pair of JSON string (as its key) and JSON value (as its value).
char_type | A char type to store. |
char_traits | A chart traits. |
_allocator_type | An allocator type. |
using metall::json::key_value_pair< char_type, char_traits, Alloc >::char_type = _char_type |
using metall::json::key_value_pair< char_type, char_traits, Alloc >::char_traits = _char_traits |
using metall::json::key_value_pair< char_type, char_traits, Alloc >::allocator_type = Alloc |
using metall::json::key_value_pair< char_type, char_traits, Alloc >::key_type = std::basic_string_view<char_type, char_traits> |
using metall::json::key_value_pair< char_type, char_traits, Alloc >::value_type = metall::json::value<allocator_type> |
using metall::json::key_value_pair< char_type, char_traits, Alloc >::size_type = std::size_t |
|
inline |
Constructor.
key | A key string. |
value | A JSON value to hold. |
alloc | An allocator object to allocate the key and the contents of the JSON value. |
|
inline |
Constructor.
key | A key string. |
value | A JSON value to hold. |
alloc | An allocator object to allocate the key and the contents of the JSON value. |
|
inline |
Copy constructor.
|
inline |
Allocator-extended copy constructor.
|
inlinenoexcept |
Move constructor.
|
inlinenoexcept |
Allocator-extended move constructor.
|
inlinenoexcept |
Destructor.
|
inline |
Copy assignment operator.
|
inlinenoexcept |
Move assignment operator.
|
inlinenoexcept |
Swap contents.
|
inlinenoexcept |
Returns the stored key.
|
inlinenoexcept |
Returns the stored key as const char*.
|
inlinenoexcept |
References the stored JSON value.
|
inlinenoexcept |
References the stored JSON value.
|
inlinenoexcept |
Return an allocator object.
|
friend |
Return true
if two key-value pairs are equal.
lhs | A key-value pair to compare. |
rhs | A key-value pair to compare. |
|
friend |
Return true
if two key-value pairs are not equal.
lhs | A key-value pair to compare. |
rhs | A key-value pair to compare. |
char_type metall::json::key_value_pair< char_type, char_traits, Alloc >::m_short_key[k_short_key_max_length+1] |
uint64_t metall::json::key_value_pair< char_type, char_traits, Alloc >::m_short_key_buf |
char_pointer metall::json::key_value_pair< char_type, char_traits, Alloc >::m_long_key {nullptr} |