The QxJson
namespace encapsulates the user-extensible implementation of Qx's JSON parsing facilities.
|
concept | qjson_type |
| Specifies that a type is one of the fundamental JSON types within Qt's JSON system.
|
|
concept | json_struct_inside |
| Specifies that a type is a JSON-tied struct registered with QX_JSON_STRUCT().
|
|
concept | json_struct_outside |
| Specifies that a type is a JSON-tied struct registered with QX_JSON_STRUCT_OUTSIDE().
|
|
concept | json_struct |
| Specifies that a type is a JSON-tied struct.
|
|
concept | json_convertible |
| Specifies that a type is generally convertible to/from JSON.
|
|
concept | json_override_convertible |
|
concept | json_keyable |
| Specifies that a type has a known method for creating a corresponding key.
|
|
concept | json_collective |
| Specifies that a type is a non-associative container, the value type of which is convertible to/from JSON.
|
|
concept | json_associative |
| Specifies that a type is an associative container, the value type of which is convertible, to/from JSON, and for which a key/value type specializaton of keygen() exists.
|
|
concept | json_containing |
| Specifies that a type is a container, and abides by the other corresponding restrictions for that kind of a container.
|
|
concept | json_optional |
| Specifies that a type is a specialization of std::optional that manages values of a JSON convertible type.
|
|
|
template<typename Key , class Value > |
Key | keygen (const Value &value)=delete |
| The keygen template function acts as an interface through which the derivation of a key for a given type, when used in associative containers, is defined.
|
|
◆ ContextNode
Any JSON context node type.
◆ keygen()
template<typename Key , class Value >
template< typename Key, class Value > Key QxJson::keygen |
( |
const Value & | value | ) |
|
|
delete |
Any otherwise convertible JSON type can be parsed into a map as long as a specialization of keygen() exists for that type.
Support for additional types can be added like so:
struct MyStruct
{
int number;
};
{
template<>
QString keygen<QString, MyStruct>(
const MyStruct& value)
{
return value.name;
};
}
struct OtherStruct
{
bool enabled;
};
- See also
- qx-json.h and Converter.