mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 20:13:40 +08:00
refs #192 tweaking include order and moving some JSON things into global namespace
so that we invoke ADL instead of relying on a particular include order
This commit is contained in:
@@ -5,224 +5,218 @@
|
|||||||
|
|
||||||
#include "json.h"
|
#include "json.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
const QJsonValue &operator >>(const QJsonValue &json, int &value)
|
||||||
{
|
{
|
||||||
|
value = json.toInt();
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, int &value)
|
const QJsonValue &operator >>(const QJsonValue &json, qlonglong &value)
|
||||||
{
|
{
|
||||||
value = json.toInt();
|
value = static_cast<qlonglong>(json.toInt());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, qlonglong &value)
|
const QJsonValue &operator >>(const QJsonValue &json, qulonglong &value)
|
||||||
{
|
{
|
||||||
value = static_cast<qlonglong>(json.toInt());
|
value = static_cast<qulonglong>(json.toInt());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, qulonglong &value)
|
const QJsonValue &operator >>(const QJsonValue &json, uint &value)
|
||||||
{
|
{
|
||||||
value = static_cast<qulonglong>(json.toInt());
|
value = static_cast<uint>(json.toInt());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, uint &value)
|
const QJsonValue &operator >>(const QJsonValue &json, qint16 &value)
|
||||||
{
|
{
|
||||||
value = static_cast<uint>(json.toInt());
|
value = static_cast<qint16>(json.toInt());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, qint16 &value)
|
const QJsonValue &operator >>(const QJsonValue &json, QString &value)
|
||||||
{
|
{
|
||||||
value = static_cast<qint16>(json.toInt());
|
value = json.toString();
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, QString &value)
|
const QJsonValue &operator >>(const QJsonValue &json, double &value)
|
||||||
{
|
{
|
||||||
value = json.toString();
|
value = json.toDouble();
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, double &value)
|
const QJsonValue &operator >>(const QJsonValue &json, bool &value)
|
||||||
{
|
{
|
||||||
value = json.toDouble();
|
value = json.toBool();
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, bool &value)
|
const QJsonValue &operator >>(const QJsonValue &json, QDateTime &value)
|
||||||
{
|
{
|
||||||
value = json.toBool();
|
value = QDateTime::fromString(json.toString());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, QDateTime &value)
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, int &value)
|
||||||
{
|
{
|
||||||
value = QDateTime::fromString(json.toString());
|
value = json.toInt();
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, int &value)
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, qlonglong &value)
|
||||||
{
|
{
|
||||||
value = json.toInt();
|
value = static_cast<qlonglong>(json.toInt());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, qlonglong &value)
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, qulonglong &value)
|
||||||
{
|
{
|
||||||
value = static_cast<qlonglong>(json.toInt());
|
value = static_cast<qulonglong>(json.toInt());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, qulonglong &value)
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, uint &value)
|
||||||
{
|
{
|
||||||
value = static_cast<qulonglong>(json.toInt());
|
value = static_cast<uint>(json.toInt());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, uint &value)
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, qint16 &value)
|
||||||
{
|
{
|
||||||
value = static_cast<uint>(json.toInt());
|
value = static_cast<qint16>(json.toInt());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, qint16 &value)
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, QString &value)
|
||||||
{
|
{
|
||||||
value = static_cast<qint16>(json.toInt());
|
value = json.toString();
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, QString &value)
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, double &value)
|
||||||
{
|
{
|
||||||
value = json.toString();
|
value = json.toDouble();
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, double &value)
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, bool &value)
|
||||||
{
|
{
|
||||||
value = json.toDouble();
|
value = json.toBool();
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, bool &value)
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, QDateTime &value)
|
||||||
{
|
{
|
||||||
value = json.toBool();
|
value = QDateTime::fromString(json.toString());
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, QDateTime &value)
|
QJsonArray &operator<<(QJsonArray &json, const int value)
|
||||||
{
|
{
|
||||||
value = QDateTime::fromString(json.toString());
|
json.append(QJsonValue(value));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const int value)
|
QJsonArray &operator<<(QJsonArray &json, const qint16 value)
|
||||||
{
|
{
|
||||||
json.append(QJsonValue(value));
|
json.append(QJsonValue(value));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const qint16 value)
|
QJsonArray &operator<<(QJsonArray &json, const qlonglong value)
|
||||||
{
|
{
|
||||||
json.append(QJsonValue(value));
|
json.append(QJsonValue(value));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const qlonglong value)
|
QJsonArray &operator<<(QJsonArray &json, const uint value)
|
||||||
{
|
{
|
||||||
json.append(QJsonValue(value));
|
json.append(QJsonValue(static_cast<int>(value)));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const uint value)
|
QJsonArray &operator<<(QJsonArray &json, const qulonglong value)
|
||||||
{
|
{
|
||||||
json.append(QJsonValue(static_cast<int>(value)));
|
json.append(QJsonValue(static_cast<int>(value)));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const qulonglong value)
|
QJsonArray &operator<<(QJsonArray &json, const QString &value)
|
||||||
{
|
{
|
||||||
json.append(QJsonValue(static_cast<int>(value)));
|
json.append(QJsonValue(value));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const QString &value)
|
QJsonArray &operator<<(QJsonArray &json, const double value)
|
||||||
{
|
{
|
||||||
json.append(QJsonValue(value));
|
json.append(QJsonValue(value));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const double value)
|
QJsonArray &operator<<(QJsonArray &json, const bool value)
|
||||||
{
|
{
|
||||||
json.append(QJsonValue(value));
|
json.append(QJsonValue(value));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const bool value)
|
QJsonArray &operator<<(QJsonArray &json, const QDateTime &value)
|
||||||
{
|
{
|
||||||
json.append(QJsonValue(value));
|
json.append(QJsonValue(value.toString()));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const QDateTime &value)
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, int> &value)
|
||||||
{
|
{
|
||||||
json.append(QJsonValue(value.toString()));
|
json.insert(value.first, QJsonValue(value.second));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, int> &value)
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qint16> &value)
|
||||||
{
|
{
|
||||||
json.insert(value.first, QJsonValue(value.second));
|
json.insert(value.first, QJsonValue(value.second));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qint16> &value)
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qulonglong> &value)
|
||||||
{
|
{
|
||||||
json.insert(value.first, QJsonValue(value.second));
|
json.insert(value.first, QJsonValue(static_cast<int>(value.second)));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qulonglong> &value)
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qlonglong> &value)
|
||||||
{
|
{
|
||||||
json.insert(value.first, QJsonValue(static_cast<int>(value.second)));
|
json.insert(value.first, QJsonValue(value.second));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qlonglong> &value)
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, uint> &value)
|
||||||
{
|
{
|
||||||
json.insert(value.first, QJsonValue(value.second));
|
json.insert(value.first, QJsonValue(static_cast<int>(value.second)));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, uint> &value)
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, QString> &value)
|
||||||
{
|
{
|
||||||
json.insert(value.first, QJsonValue(static_cast<int>(value.second)));
|
json.insert(value.first, QJsonValue(value.second));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, QString> &value)
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, double> &value)
|
||||||
{
|
{
|
||||||
json.insert(value.first, QJsonValue(value.second));
|
json.insert(value.first, QJsonValue(value.second));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, double> &value)
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, bool> &value)
|
||||||
{
|
{
|
||||||
json.insert(value.first, QJsonValue(value.second));
|
json.insert(value.first, QJsonValue(value.second));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, bool> &value)
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, QDateTime> &value)
|
||||||
{
|
{
|
||||||
json.insert(value.first, QJsonValue(value.second));
|
json.insert(value.first, QJsonValue(value.second.toString()));
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, QDateTime> &value)
|
|
||||||
{
|
|
||||||
json.insert(value.first, QJsonValue(value.second.toString()));
|
|
||||||
return json;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // BlackMisc
|
|
||||||
|
|||||||
@@ -22,90 +22,90 @@
|
|||||||
* \defgroup JSON Streaming operators for JSON
|
* \defgroup JSON Streaming operators for JSON
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//! \name Streaming operators for QJsonValue (to value)
|
||||||
|
//! \ingroup JSON
|
||||||
|
//! @{
|
||||||
|
const QJsonValue &operator >>(const QJsonValue &json, int &value);
|
||||||
|
const QJsonValue &operator >>(const QJsonValue &json, qlonglong &value);
|
||||||
|
const QJsonValue &operator >>(const QJsonValue &json, qulonglong &value);
|
||||||
|
const QJsonValue &operator >>(const QJsonValue &json, uint &value);
|
||||||
|
const QJsonValue &operator >>(const QJsonValue &json, qint16 &value);
|
||||||
|
const QJsonValue &operator >>(const QJsonValue &json, QString &value);
|
||||||
|
const QJsonValue &operator >>(const QJsonValue &json, double &value);
|
||||||
|
const QJsonValue &operator >>(const QJsonValue &json, bool &value);
|
||||||
|
const QJsonValue &operator >>(const QJsonValue &json, QDateTime &value);
|
||||||
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, int &value);
|
||||||
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, qlonglong &value);
|
||||||
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, qulonglong &value);
|
||||||
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, uint &value);
|
||||||
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, qint16 &value);
|
||||||
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, QString &value);
|
||||||
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, double &value);
|
||||||
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, bool &value);
|
||||||
|
const QJsonValueRef &operator >>(const QJsonValueRef &json, QDateTime &value);
|
||||||
|
//! @}
|
||||||
|
|
||||||
|
//! \brief Specialized JSON serialization for enum
|
||||||
|
//! \remarks needs to be in global namespace
|
||||||
|
//! \ingroup JSON
|
||||||
|
template<class ENUM> typename
|
||||||
|
std::enable_if<std::is_enum<ENUM>::value, QJsonObject>::type
|
||||||
|
&operator<<(QJsonObject &json, std::pair<QString, ENUM> value)
|
||||||
|
{
|
||||||
|
json.insert(value.first, QJsonValue(static_cast<int>(value.second)));
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \brief Specialized JSON deserialization for enum
|
||||||
|
//! \ingroup JSON
|
||||||
|
template<class ENUM> typename
|
||||||
|
std::enable_if<std::is_enum<ENUM>::value, QJsonValue>::type
|
||||||
|
const &operator>>(const QJsonValue &json, ENUM &value)
|
||||||
|
{
|
||||||
|
value = static_cast<ENUM>(json.toInt());
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \brief Specialized JSON deserialization for enum
|
||||||
|
//! \ingroup JSON
|
||||||
|
template<class ENUM> typename
|
||||||
|
std::enable_if<std::is_enum<ENUM>::value, QJsonValueRef>::type
|
||||||
|
const &operator>>(const QJsonValueRef &json, ENUM &value)
|
||||||
|
{
|
||||||
|
value = static_cast<ENUM>(json.toInt());
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \name Streaming operators for QJsonArray (from value)
|
||||||
|
//! \ingroup JSON
|
||||||
|
//! @{
|
||||||
|
QJsonArray &operator<<(QJsonArray &json, const int value);
|
||||||
|
QJsonArray &operator<<(QJsonArray &json, const std::pair<QString, qint16> &value);
|
||||||
|
QJsonArray &operator<<(QJsonArray &json, const qlonglong value);
|
||||||
|
QJsonArray &operator<<(QJsonArray &json, const uint value);
|
||||||
|
QJsonArray &operator<<(QJsonArray &json, const qulonglong value);
|
||||||
|
QJsonArray &operator<<(QJsonArray &json, const QString &value);
|
||||||
|
QJsonArray &operator<<(QJsonArray &json, const double value);
|
||||||
|
QJsonArray &operator<<(QJsonArray &json, const bool value);
|
||||||
|
QJsonArray &operator<<(QJsonArray &json, const QDateTime &value);
|
||||||
|
//! @}
|
||||||
|
|
||||||
|
//! \name Streaming operators for QJsonObject (from value)
|
||||||
|
//! \ingroup JSON
|
||||||
|
//! @{
|
||||||
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, int> &value);
|
||||||
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qint16> &value);
|
||||||
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qlonglong> &value);
|
||||||
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, uint> &value);
|
||||||
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qulonglong> &value);
|
||||||
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, QString> &value);
|
||||||
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, double> &value);
|
||||||
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, bool> &value);
|
||||||
|
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, QDateTime> &value);
|
||||||
|
//! @}
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
//! \name Streaming operators for QJsonValue (to value)
|
|
||||||
//! \ingroup JSON
|
|
||||||
//! @{
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, int &value);
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, qlonglong &value);
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, qulonglong &value);
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, uint &value);
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, qint16 &value);
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, QString &value);
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, double &value);
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, bool &value);
|
|
||||||
const QJsonValue &operator >>(const QJsonValue &json, QDateTime &value);
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, int &value);
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, qlonglong &value);
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, qulonglong &value);
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, uint &value);
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, qint16 &value);
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, QString &value);
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, double &value);
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, bool &value);
|
|
||||||
const QJsonValueRef &operator >>(const QJsonValueRef &json, QDateTime &value);
|
|
||||||
//! @}
|
|
||||||
|
|
||||||
//! \brief Specialized JSON serialization for enum
|
|
||||||
//! \remarks needs to be in global namespace
|
|
||||||
//! \ingroup JSON
|
|
||||||
template<class ENUM> typename
|
|
||||||
std::enable_if<std::is_enum<ENUM>::value, QJsonObject>::type
|
|
||||||
&operator<<(QJsonObject &json, std::pair<QString, ENUM> value)
|
|
||||||
{
|
|
||||||
json.insert(value.first, QJsonValue(static_cast<int>(value.second)));
|
|
||||||
return json;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! \brief Specialized JSON deserialization for enum
|
|
||||||
//! \ingroup JSON
|
|
||||||
template<class ENUM> typename
|
|
||||||
std::enable_if<std::is_enum<ENUM>::value, QJsonValue>::type
|
|
||||||
const &operator>>(const QJsonValue &json, ENUM &value)
|
|
||||||
{
|
|
||||||
value = static_cast<ENUM>(json.toInt());
|
|
||||||
return json;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! \brief Specialized JSON deserialization for enum
|
|
||||||
//! \ingroup JSON
|
|
||||||
template<class ENUM> typename
|
|
||||||
std::enable_if<std::is_enum<ENUM>::value, QJsonValueRef>::type
|
|
||||||
const &operator>>(const QJsonValueRef &json, ENUM &value)
|
|
||||||
{
|
|
||||||
value = static_cast<ENUM>(json.toInt());
|
|
||||||
return json;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! \name Streaming operators for QJsonArray (from value)
|
|
||||||
//! \ingroup JSON
|
|
||||||
//! @{
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const int value);
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const std::pair<QString, qint16> &value);
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const qlonglong value);
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const uint value);
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const qulonglong value);
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const QString &value);
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const double value);
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const bool value);
|
|
||||||
QJsonArray &operator<<(QJsonArray &json, const QDateTime &value);
|
|
||||||
//! @}
|
|
||||||
|
|
||||||
//! \name Streaming operators for QJsonObject (from value)
|
|
||||||
//! \ingroup JSON
|
|
||||||
//! @{
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, int> &value);
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qint16> &value);
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qlonglong> &value);
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, uint> &value);
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, qulonglong> &value);
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, QString> &value);
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, double> &value);
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, bool> &value);
|
|
||||||
QJsonObject &operator<<(QJsonObject &json, const std::pair<QString, QDateTime> &value);
|
|
||||||
//! @}
|
|
||||||
|
|
||||||
namespace Json
|
namespace Json
|
||||||
{
|
{
|
||||||
//! \brief Append to first JSON object (concatenate)
|
//! \brief Append to first JSON object (concatenate)
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#define BLACKMISC_TUPLE_H
|
#define BLACKMISC_TUPLE_H
|
||||||
|
|
||||||
#include "tuple_private.h"
|
#include "tuple_private.h"
|
||||||
#include "json.h"
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \defgroup Tuples Tuples Simplified handling of class members (CValueObject) by std::tuple
|
* \defgroup Tuples Tuples Simplified handling of class members (CValueObject) by std::tuple
|
||||||
|
|||||||
@@ -11,13 +11,13 @@
|
|||||||
#ifndef BLACKMISC_TUPLE_PRIVATE_H
|
#ifndef BLACKMISC_TUPLE_PRIVATE_H
|
||||||
#define BLACKMISC_TUPLE_PRIVATE_H
|
#define BLACKMISC_TUPLE_PRIVATE_H
|
||||||
|
|
||||||
#include "json.h"
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QDBusArgument>
|
#include <QDBusArgument>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QJsonArray>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define BLACKMISC_VALUEOBJECT_H
|
#define BLACKMISC_VALUEOBJECT_H
|
||||||
|
|
||||||
#include "tuple.h"
|
#include "tuple.h"
|
||||||
|
#include "json.h"
|
||||||
#include <QtDBus/QDBusMetaType>
|
#include <QtDBus/QDBusMetaType>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|||||||
Reference in New Issue
Block a user