KItinerary::JsonLd
Functions | |
template<typename T > | |
bool | canConvert (const QVariant &value) |
template<typename T > | |
T | convert (const QVariant &value) |
template<typename T > | |
bool | isA (const QVariant &value) |
bool | isSchemaOrgNamespace (QStringView uri) |
QString | normalizeTypeName (QString &&typeName) |
void | renameProperty (QJsonObject &obj, const char *oldName, const char *newName) |
QString | typeName (const QJsonObject &obj) |
bool | valueIsNull (const QVariant &v) |
Detailed Description
JSON-LD data type helper functions.
Utility methods for working with schema.org data in JSON-LD format.
Function Documentation
◆ canConvert()
|
inline |
Checks if the given value can be up-cast to T
.
Definition at line 31 of file datatypes.h.
◆ convert()
|
inline |
Up-cast value
to T
.
- Note
- This does not perform any safety checks!
- See also
- canConvert
Definition at line 47 of file datatypes.h.
◆ isA()
|
inline |
Returns true
if value
is of type T
.
Definition at line 24 of file datatypes.h.
◆ isSchemaOrgNamespace()
|
nodiscard |
Checks whether uri
is in the http://schema.org namespace.
That is more complex than just startsWith since schema.org started to use "https" in their URIs...
Definition at line 31 of file json/jsonld.cpp.
◆ normalizeTypeName()
Definition at line 20 of file json/jsonld.cpp.
◆ renameProperty()
void KItinerary::JsonLd::renameProperty | ( | QJsonObject & | obj, |
const char * | oldName, | ||
const char * | newName ) |
Rename a property, if present and the new name isn't in use already.
Definition at line 17 of file jsonldfilterengine.cpp.
◆ typeName()
|
nodiscard |
Normalized type name from object
.
Definition at line 15 of file json/jsonld.cpp.
◆ valueIsNull()
bool KItinerary::JsonLd::valueIsNull | ( | const QVariant & | v | ) |
Checks whether v
holds a null-like value.
This is similar to QVariant::isNull in Qt5, but differs from the "shallow" QVariant::isNull in Qt6 which doesn't check the content at all.
Definition at line 370 of file jsonlddocument.cpp.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:00:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.