KItinerary::JsonLdDocument
#include <jsonlddocument.h>
Static Public Member Functions | |
static QVariant | apply (const QVariant &lhs, const QVariant &rhs) |
static QList< QVariant > | fromJson (const QJsonArray &array) |
static QList< QVariant > | fromJson (const QJsonObject &obj) |
static QVariant | fromJsonSingular (const QJsonObject &obj) |
static QVariant | readProperty (const QVariant &obj, const char *name) |
template<typename T > | |
static void | registerType () |
static void | removeProperty (QVariant &obj, const char *name) |
static QJsonArray | toJson (const QList< QVariant > &data) |
static QJsonObject | toJson (const QVariant &data) |
static QJsonValue | toJsonValue (const QVariant &data) |
static void | writeProperty (QVariant &obj, const char *name, const QVariant &value) |
template<typename T > | |
static void | writeProperty (T &obj, const char *name, const QVariant &value) |
Detailed Description
Serialization/deserialization code for JSON-LD data.
- See also
- https://www.w3.org/TR/json-ld/
Definition at line 34 of file jsonlddocument.h.
Member Function Documentation
◆ apply()
Apply all properties of rhs
on to lhs
.
Use this to merge two top-level objects of the same type, with rhs
containing newer information.
Definition at line 564 of file jsonlddocument.cpp.
◆ fromJson() [1/2]
|
static |
Convert JSON-LD array into instantiated data types.
Definition at line 339 of file jsonlddocument.cpp.
◆ fromJson() [2/2]
|
static |
Convert JSON-LD object into an instantiated data type.
Definition at line 348 of file jsonlddocument.cpp.
◆ fromJsonSingular()
|
static |
Convert a single JSON-LD object into an instantiated data type.
- Note
- Use this only if you are sure the JSON-LD object does not expand to multiple objects! That is usually only the case for objects you have written yourself and that semantically are guaranteed to be a single object. Anything received from external sources can expand and should not use this method.
- Since
- 20.04
Definition at line 361 of file jsonlddocument.cpp.
◆ readProperty()
Read property name
on object obj
.
Definition at line 522 of file jsonlddocument.cpp.
◆ registerType()
|
inlinestatic |
Register a custom type for deserialization.
Definition at line 84 of file jsonlddocument.h.
◆ removeProperty()
|
static |
Removes property name
on object obj
.
Definition at line 559 of file jsonlddocument.cpp.
◆ toJson() [1/2]
|
static |
Serialize instantiated data types to JSON-LD.
Definition at line 497 of file jsonlddocument.cpp.
◆ toJson() [2/2]
|
static |
Serialize instantiated data type to JSON-LD.
Definition at line 511 of file jsonlddocument.cpp.
◆ toJsonValue()
|
static |
JSON-LD serrialization of an invidividual data value.
Unlike the above this also works with primitive types.
Definition at line 405 of file jsonlddocument.cpp.
◆ writeProperty() [1/2]
|
static |
Set property name
on object obj
to value value
.
Definition at line 538 of file jsonlddocument.cpp.
◆ writeProperty() [2/2]
|
inlinestatic |
Set property name
on object obj
to value value
.
Definition at line 94 of file jsonlddocument.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:37 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.