mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 07:15:34 +08:00
refs #494 Value class CValueCachePacket is a packet of cache value changes with timestamps.
This commit is contained in:
@@ -89,6 +89,24 @@ const &operator>>(const QJsonValueRef &json, ENUM &value)
|
||||
return json;
|
||||
}
|
||||
|
||||
//! \brief Specialized JSON deserialization for pair
|
||||
//! \ingroup JSON
|
||||
template<class FIRST, class SECOND>
|
||||
const QJsonValueRef &operator>>(const QJsonValueRef &json, std::pair<FIRST, SECOND> &pair)
|
||||
{
|
||||
json.toArray() >> pair.first >> pair.second;
|
||||
return json;
|
||||
}
|
||||
|
||||
//! \brief Specialized JSON serialization for pair
|
||||
//! \ingroup JSON
|
||||
template<class FIRST, class SECOND>
|
||||
QJsonArray &operator<<(QJsonArray &json, const std::pair<FIRST, SECOND> &pair)
|
||||
{
|
||||
QJsonArray array;
|
||||
return json << QJsonValue(array << pair.first << pair.second);
|
||||
}
|
||||
|
||||
//! \name Streaming operators for QJsonArray (from value)
|
||||
//! \ingroup JSON
|
||||
//! @{
|
||||
|
||||
Reference in New Issue
Block a user