libQuotient
A Qt library for building matrix clients
converters.h File Reference
#include "util.h"
#include <QtCore/QDate>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QtCore/QSet>
#include <QtCore/QUrlQuery>
#include <QtCore/QVector>
#include <QtCore/QTimeZone>
#include <type_traits>
#include <vector>
#include <array>
#include <variant>
#include <optional>
Include dependency graph for converters.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Quotient::JsonObjectUnpacker< T >
 
struct  Quotient::JsonConverter< T >
 The switchboard for extra conversion algorithms behind from/toJson. More...
 
struct  Quotient::JsonArrayConverter< ContT >
 
struct  Quotient::HashMapFromJson< HashMapT >
 

Namespaces

 Quotient
 

Functions

void Quotient::editSubobject (QJsonObject &json, auto key, std::invocable< QJsonObject & > auto visitor)
 
void Quotient::replaceSubvalue (QJsonObject &json, auto topLevelKey, auto subKey, QJsonValue subValue)
 
template<typename PodT , typename JsonT >
PodT Quotient::fromJson (const JsonT &)
 
template<typename T >
auto Quotient::toJson (const T &pod)
 
template<typename T >
void Quotient::fillJson (QJsonObject &json, const T &data)
 
template<typename JsonT , typename PodT >
void Quotient::fromJson (const JsonT &json, PodT &pod)
 
template<typename T >
void Quotient::fillFromJson (const QJsonValue &jv, T &pod)
 
template<typename EnumT , typename EnumStringValuesT >
std::optional< EnumT > Quotient::enumFromJsonString (const QString &s, const EnumStringValuesT &enumValues)
 Facility string-to-enum converter. More...
 
template<typename EnumT , typename EnumStringValuesT >
QString Quotient::enumToJsonString (EnumT v, const EnumStringValuesT &enumValues)
 Facility enum-to-string converter. More...
 
template<typename FlagT , typename FlagStringValuesT >
std::optional< FlagT > Quotient::flagFromJsonString (const QString &s, const FlagStringValuesT &flagValues)
 Facility converter for flags. More...
 
template<typename FlagT , typename FlagStringValuesT >
QString Quotient::flagToJsonString (FlagT v, const FlagStringValuesT &flagValues)
 
template<>
bool Quotient::fromJson (const QJsonValue &jv)
 
template<>
QJsonArray Quotient::fromJson (const QJsonDocument &jd)
 
QJsonValue Quotient::toJson (const QDateTime &val)
 
QJsonValue Quotient::toJson (const QDate &val)
 
template<typename... Ts>
QJsonValue Quotient::toJson (const std::variant< Ts... > &v)
 
QJsonObject QUOTIENT_API Quotient::toJson (const QVariantHash &vh)
 
template<bool Force = true, typename ContT , typename KeyT , typename ValT >
void Quotient::addParam (ContT &container, KeyT &&key, ValT &&value)
 
auto Quotient::toSnakeCase (QLatin1String s)
 

Variables

constexpr bool Quotient::IfNotEmpty = false