33#ifdef _QX_ENABLE_BOOST
34#ifndef _QX_SERIALIZE_QJSON_BOOST_TUPLE_H_
35#define _QX_SERIALIZE_QJSON_BOOST_TUPLE_H_
48#include <QtCore/qjsonvalue.h>
49#include <QtCore/qjsonobject.h>
50#include <QtCore/qjsonarray.h>
59template <
typename T0,
typename T1>
62 static inline QJsonValue
toJson(
const boost::tuple<T0, T1> & t,
const QString & format)
64 QJsonArray arr; QJsonValue val;
67 return QJsonValue(arr);
71template <
typename T0,
typename T1,
typename T2>
74 static inline QJsonValue
toJson(
const boost::tuple<T0, T1, T2> & t,
const QString & format)
76 QJsonArray arr; QJsonValue val;
80 return QJsonValue(arr);
84template <
typename T0,
typename T1,
typename T2,
typename T3>
87 static inline QJsonValue
toJson(
const boost::tuple<T0, T1, T2, T3> & t,
const QString & format)
89 QJsonArray arr; QJsonValue val;
94 return QJsonValue(arr);
98template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
101 static inline QJsonValue
toJson(
const boost::tuple<T0, T1, T2, T3, T4> & t,
const QString & format)
103 QJsonArray arr; QJsonValue val;
109 return QJsonValue(arr);
113template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
116 static inline QJsonValue
toJson(
const boost::tuple<T0, T1, T2, T3, T4, T5> & t,
const QString & format)
118 QJsonArray arr; QJsonValue val;
125 return QJsonValue(arr);
129template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
132 static inline QJsonValue
toJson(
const boost::tuple<T0, T1, T2, T3, T4, T5, T6> & t,
const QString & format)
134 QJsonArray arr; QJsonValue val;
142 return QJsonValue(arr);
146template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7>
149 static inline QJsonValue
toJson(
const boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> & t,
const QString & format)
151 QJsonArray arr; QJsonValue val;
160 return QJsonValue(arr);
164template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8>
167 static inline QJsonValue
toJson(
const boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> & t,
const QString & format)
169 QJsonArray arr; QJsonValue val;
179 return QJsonValue(arr);
183template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9>
186 static inline QJsonValue
toJson(
const boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & t,
const QString & format)
188 QJsonArray arr; QJsonValue val;
199 return QJsonValue(arr);
203template <
typename T0,
typename T1>
206 static inline qx_bool fromJson(
const QJsonValue & j, boost::tuple<T0, T1> & t,
const QString & format)
208 if (! j.isArray()) {
return qx_bool(
true); }
209 QJsonArray arr = j.toArray();
216template <
typename T0,
typename T1,
typename T2>
219 static inline qx_bool fromJson(
const QJsonValue & j, boost::tuple<T0, T1, T2> & t,
const QString & format)
221 if (! j.isArray()) {
return qx_bool(
true); }
222 QJsonArray arr = j.toArray();
230template <
typename T0,
typename T1,
typename T2,
typename T3>
233 static inline qx_bool fromJson(
const QJsonValue & j, boost::tuple<T0, T1, T2, T3> & t,
const QString & format)
235 if (! j.isArray()) {
return qx_bool(
true); }
236 QJsonArray arr = j.toArray();
245template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
248 static inline qx_bool fromJson(
const QJsonValue & j, boost::tuple<T0, T1, T2, T3, T4> & t,
const QString & format)
250 if (! j.isArray()) {
return qx_bool(
true); }
251 QJsonArray arr = j.toArray();
261template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
264 static inline qx_bool fromJson(
const QJsonValue & j, boost::tuple<T0, T1, T2, T3, T4, T5> & t,
const QString & format)
266 if (! j.isArray()) {
return qx_bool(
true); }
267 QJsonArray arr = j.toArray();
278template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
281 static inline qx_bool fromJson(
const QJsonValue & j, boost::tuple<T0, T1, T2, T3, T4, T5, T6> & t,
const QString & format)
283 if (! j.isArray()) {
return qx_bool(
true); }
284 QJsonArray arr = j.toArray();
296template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7>
299 static inline qx_bool fromJson(
const QJsonValue & j, boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> & t,
const QString & format)
301 if (! j.isArray()) {
return qx_bool(
true); }
302 QJsonArray arr = j.toArray();
315template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8>
318 static inline qx_bool fromJson(
const QJsonValue & j, boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> & t,
const QString & format)
320 if (! j.isArray()) {
return qx_bool(
true); }
321 QJsonArray arr = j.toArray();
335template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9>
338 static inline qx_bool fromJson(
const QJsonValue & j, boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & t,
const QString & format)
340 if (! j.isArray()) {
return qx_bool(
true); }
341 QJsonArray arr = j.toArray();
qx::cvt : namespace to provide global functions to convert any kind of objects to/from QString and QV...
qx_bool : boolean type with code and description message when an error occured
qx_bool from_json(const QJsonValue &j, T &t, const QString &format=QString())
QJsonValue to_json(const T &t, const QString &format=QString())
Root namespace for all QxOrm library features.
static qx_bool fromJson(const QJsonValue &j, boost::tuple< T0, T1, T2, T3, T4 > &t, const QString &format)
static qx_bool fromJson(const QJsonValue &j, boost::tuple< T0, T1, T2, T3 > &t, const QString &format)
static qx_bool fromJson(const QJsonValue &j, boost::tuple< T0, T1, T2 > &t, const QString &format)
static qx_bool fromJson(const QJsonValue &j, boost::tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8 > &t, const QString &format)
static qx_bool fromJson(const QJsonValue &j, boost::tuple< T0, T1, T2, T3, T4, T5, T6 > &t, const QString &format)
static qx_bool fromJson(const QJsonValue &j, boost::tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > &t, const QString &format)
static qx_bool fromJson(const QJsonValue &j, boost::tuple< T0, T1, T2, T3, T4, T5, T6, T7 > &t, const QString &format)
static qx_bool fromJson(const QJsonValue &j, boost::tuple< T0, T1, T2, T3, T4, T5 > &t, const QString &format)
static qx_bool fromJson(const QJsonValue &j, boost::tuple< T0, T1 > &t, const QString &format)
static QJsonValue toJson(const boost::tuple< T0, T1, T2, T3, T4 > &t, const QString &format)
static QJsonValue toJson(const boost::tuple< T0, T1, T2, T3 > &t, const QString &format)
static QJsonValue toJson(const boost::tuple< T0, T1, T2 > &t, const QString &format)
static QJsonValue toJson(const boost::tuple< T0, T1, T2, T3, T4, T5 > &t, const QString &format)
static QJsonValue toJson(const boost::tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > &t, const QString &format)
static QJsonValue toJson(const boost::tuple< T0, T1, T2, T3, T4, T5, T6, T7 > &t, const QString &format)
static QJsonValue toJson(const boost::tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8 > &t, const QString &format)
static QJsonValue toJson(const boost::tuple< T0, T1, T2, T3, T4, T5, T6 > &t, const QString &format)
static QJsonValue toJson(const boost::tuple< T0, T1 > &t, const QString &format)