QxConvert_ToString.inl 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. /****************************************************************************
  2. **
  3. ** https://www.qxorm.com/
  4. ** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
  5. **
  6. ** This file is part of the QxOrm library
  7. **
  8. ** This software is provided 'as-is', without any express or implied
  9. ** warranty. In no event will the authors be held liable for any
  10. ** damages arising from the use of this software
  11. **
  12. ** Commercial Usage
  13. ** Licensees holding valid commercial QxOrm licenses may use this file in
  14. ** accordance with the commercial license agreement provided with the
  15. ** Software or, alternatively, in accordance with the terms contained in
  16. ** a written agreement between you and Lionel Marty
  17. **
  18. ** GNU General Public License Usage
  19. ** Alternatively, this file may be used under the terms of the GNU
  20. ** General Public License version 3.0 as published by the Free Software
  21. ** Foundation and appearing in the file 'license.gpl3.txt' included in the
  22. ** packaging of this file. Please review the following information to
  23. ** ensure the GNU General Public License version 3.0 requirements will be
  24. ** met : http://www.gnu.org/copyleft/gpl.html
  25. **
  26. ** If you are unsure which license is appropriate for your use, or
  27. ** if you have questions regarding the use of this file, please contact :
  28. ** contact@qxorm.com
  29. **
  30. ****************************************************************************/
  31. namespace qx {
  32. namespace cvt {
  33. namespace detail {
  34. template <> struct QxConvert_ToString< qx::trait::no_type > {
  35. static inline QString toString(const qx::trait::no_type & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  36. { Q_UNUSED(t); Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return ""; } };
  37. template <> struct QxConvert_ToString< QString > {
  38. static inline QString toString(const QString & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  39. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return t; } };
  40. template <> struct QxConvert_ToString< QUuid > {
  41. static inline QString toString(const QUuid & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  42. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return t.toString(); } };
  43. template <> struct QxConvert_ToString< QDate > {
  44. static inline QString toString(const QDate & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  45. { Q_UNUSED(index); Q_UNUSED(ctx); return t.toString(format.isEmpty() ? QString(QX_STR_CVT_QDATE_FORMAT) : format); } };
  46. template <> struct QxConvert_ToString< QTime > {
  47. static inline QString toString(const QTime & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  48. { Q_UNUSED(index); Q_UNUSED(ctx); return t.toString(format.isEmpty() ? QString(QX_STR_CVT_QTIME_FORMAT) : format); } };
  49. template <> struct QxConvert_ToString< QDateTime > {
  50. static inline QString toString(const QDateTime & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  51. { Q_UNUSED(index); Q_UNUSED(ctx); return t.toString(format.isEmpty() ? QString(QX_STR_CVT_QDATETIME_FORMAT) : format); } };
  52. template <> struct QxConvert_ToString< QByteArray > {
  53. static inline QString toString(const QByteArray & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  54. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QString(t); } };
  55. template <>
  56. struct QxConvert_ToString< QVariant >
  57. {
  58. static inline QString toString(const QVariant & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  59. {
  60. Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx);
  61. #ifndef _QX_NO_JSON
  62. if (qx::cvt::detail::helper::checkConvertQVariantToString(t))
  63. {
  64. QString type = QString("%1").arg(static_cast<int>(t.type()), 6, 10, QChar('0'));
  65. QString val = "$$JSON$$" + type + "$$";
  66. QJsonValue json = QJsonValue::fromVariant(t);
  67. QJsonDocument doc = (json.isArray() ? QJsonDocument(json.toArray()) : QJsonDocument(json.toObject()));
  68. return (val + QString::fromUtf8(doc.toJson()));
  69. }
  70. #endif // _QX_NO_JSON
  71. return t.toString();
  72. }
  73. };
  74. template <> struct QxConvert_ToString< qx_bool > {
  75. static inline QString toString(const qx_bool & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  76. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return t.toString(); } };
  77. template <> struct QxConvert_ToString< bool > {
  78. static inline QString toString(const bool & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  79. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return (t ? "1" : "0"); } };
  80. template <> struct QxConvert_ToString< char > {
  81. static inline QString toString(const char & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  82. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QString(t); } };
  83. template <> struct QxConvert_ToString< short > {
  84. static inline QString toString(const short & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  85. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  86. template <> struct QxConvert_ToString< int > {
  87. static inline QString toString(const int & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  88. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  89. template <> struct QxConvert_ToString< long > {
  90. static inline QString toString(const long & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  91. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  92. template <> struct QxConvert_ToString< long long > {
  93. static inline QString toString(const long long & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  94. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  95. template <> struct QxConvert_ToString< float > {
  96. static inline QString toString(const float & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  97. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  98. template <> struct QxConvert_ToString< double > {
  99. static inline QString toString(const double & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  100. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  101. template <> struct QxConvert_ToString< unsigned short > {
  102. static inline QString toString(const unsigned short & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  103. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  104. template <> struct QxConvert_ToString< unsigned int > {
  105. static inline QString toString(const unsigned int & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  106. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  107. template <> struct QxConvert_ToString< unsigned long > {
  108. static inline QString toString(const unsigned long & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  109. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  110. template <> struct QxConvert_ToString< unsigned long long > {
  111. static inline QString toString(const unsigned long long & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  112. { Q_UNUSED(index); Q_UNUSED(ctx); return (format.isEmpty() ? QString::number(t) : QString().sprintf(qPrintable(format), t)); } };
  113. template <> struct QxConvert_ToString< qx::QxDateNeutral > {
  114. static inline QString toString(const qx::QxDateNeutral & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  115. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return t.toNeutral(); } };
  116. template <> struct QxConvert_ToString< qx::QxTimeNeutral > {
  117. static inline QString toString(const qx::QxTimeNeutral & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  118. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return t.toNeutral(); } };
  119. template <> struct QxConvert_ToString< qx::QxDateTimeNeutral > {
  120. static inline QString toString(const qx::QxDateTimeNeutral & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  121. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return t.toNeutral(); } };
  122. template <> struct QxConvert_ToString< std::string > {
  123. static inline QString toString(const std::string & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  124. #ifndef QT_NO_STL
  125. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QString::fromStdString(t); } };
  126. #else // QT_NO_STL
  127. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QString::fromLatin1(t.data(), int(t.size())); } };
  128. #endif // QT_NO_STL
  129. template <> struct QxConvert_ToString< std::wstring > {
  130. static inline QString toString(const std::wstring & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  131. #if ((! defined(QT_NO_STL)) && (! defined(QT_NO_STL_WCHAR)))
  132. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QString::fromStdWString(t); } };
  133. #else // ((! defined(QT_NO_STL)) && (! defined(QT_NO_STL_WCHAR)))
  134. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); Q_UNUSED(t); qAssert(false); /* Need STL compatibility ! */ return QString(); } };
  135. #endif // ((! defined(QT_NO_STL)) && (! defined(QT_NO_STL_WCHAR)))
  136. #ifndef _QX_NO_JSON
  137. template <>
  138. struct QxConvert_ToString< QJsonValue >
  139. {
  140. static inline QString toString(const QJsonValue & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  141. {
  142. Q_UNUSED(index); Q_UNUSED(ctx);
  143. QJsonDocument::JsonFormat jsonFormat = QJsonDocument::Compact;
  144. if (! format.isEmpty()) { jsonFormat = ((format == "indented") ? QJsonDocument::Indented : jsonFormat); }
  145. QJsonDocument doc = (t.isArray() ? QJsonDocument(t.toArray()) : QJsonDocument(t.toObject()));
  146. return QString::fromUtf8(doc.toJson(jsonFormat));
  147. }
  148. };
  149. #endif // _QX_NO_JSON
  150. #ifdef _QX_ENABLE_BOOST
  151. template <typename T> struct QxConvert_ToString< boost::optional<T> > {
  152. static inline QString toString(const boost::optional<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  153. { if (t) { return qx::cvt::to_string((* t), format, index, ctx); }; return QString(); } };
  154. #endif // _QX_ENABLE_BOOST
  155. template <typename T1, typename T2> struct QxConvert_ToString< std::pair<T1, T2> > {
  156. static inline QString toString(const std::pair<T1, T2> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  157. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  158. template <typename T1, typename T2> struct QxConvert_ToString< QPair<T1, T2> > {
  159. static inline QString toString(const QPair<T1, T2> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  160. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  161. template <typename T> struct QxConvert_ToString< std::vector<T> > {
  162. static inline QString toString(const std::vector<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  163. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  164. template <typename T> struct QxConvert_ToString< std::list<T> > {
  165. static inline QString toString(const std::list<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  166. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  167. template <typename T> struct QxConvert_ToString< std::set<T> > {
  168. static inline QString toString(const std::set<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  169. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  170. #ifdef _QX_ENABLE_BOOST
  171. template <typename T> struct QxConvert_ToString< boost::unordered_set<T> > {
  172. static inline QString toString(const boost::unordered_set<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  173. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  174. template <typename T> struct QxConvert_ToString< boost::unordered_multiset<T> > {
  175. static inline QString toString(const boost::unordered_multiset<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  176. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  177. #endif // _QX_ENABLE_BOOST
  178. template <typename T> struct QxConvert_ToString< std::unordered_set<T> > {
  179. static inline QString toString(const std::unordered_set<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  180. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  181. template <typename T> struct QxConvert_ToString< std::unordered_multiset<T> > {
  182. static inline QString toString(const std::unordered_multiset<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  183. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  184. template <typename T> struct QxConvert_ToString< QVector<T> > {
  185. static inline QString toString(const QVector<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  186. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  187. template <typename T> struct QxConvert_ToString< QList<T> > {
  188. static inline QString toString(const QList<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  189. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  190. template <typename T> struct QxConvert_ToString< QLinkedList<T> > {
  191. static inline QString toString(const QLinkedList<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  192. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  193. template <typename T> struct QxConvert_ToString< QFlags<T> > {
  194. static inline QString toString(const QFlags<T> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  195. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QString::number(static_cast<int>(t)); } };
  196. template <typename Key, typename Value> struct QxConvert_ToString< std::map<Key, Value> > {
  197. static inline QString toString(const std::map<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  198. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  199. #ifdef _QX_ENABLE_BOOST
  200. template <typename Key, typename Value> struct QxConvert_ToString< boost::unordered_map<Key, Value> > {
  201. static inline QString toString(const boost::unordered_map<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  202. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  203. template <typename Key, typename Value> struct QxConvert_ToString< boost::unordered_multimap<Key, Value> > {
  204. static inline QString toString(const boost::unordered_multimap<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  205. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  206. #endif // _QX_ENABLE_BOOST
  207. template <typename Key, typename Value> struct QxConvert_ToString< std::unordered_map<Key, Value> > {
  208. static inline QString toString(const std::unordered_map<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  209. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  210. template <typename Key, typename Value> struct QxConvert_ToString< std::unordered_multimap<Key, Value> > {
  211. static inline QString toString(const std::unordered_multimap<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  212. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  213. template <typename Key, typename Value> struct QxConvert_ToString< QHash<Key, Value> > {
  214. static inline QString toString(const QHash<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  215. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  216. template <typename Key, typename Value> struct QxConvert_ToString< QMultiHash<Key, Value> > {
  217. static inline QString toString(const QMultiHash<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  218. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  219. template <typename Key, typename Value> struct QxConvert_ToString< QMap<Key, Value> > {
  220. static inline QString toString(const QMap<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  221. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  222. template <typename Key, typename Value> struct QxConvert_ToString< QMultiMap<Key, Value> > {
  223. static inline QString toString(const QMultiMap<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  224. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  225. template <typename Key, typename Value> struct QxConvert_ToString< qx::QxCollection<Key, Value> > {
  226. static inline QString toString(const qx::QxCollection<Key, Value> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  227. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  228. #ifdef _QX_ENABLE_BOOST
  229. template <typename T1> struct QxConvert_ToString< boost::tuple<T1> > {
  230. static inline QString toString(const boost::tuple<T1> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  231. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  232. template <typename T1, typename T2> struct QxConvert_ToString< boost::tuple<T1, T2> > {
  233. static inline QString toString(const boost::tuple<T1, T2> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  234. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  235. template <typename T1, typename T2, typename T3> struct QxConvert_ToString< boost::tuple<T1, T2, T3> > {
  236. static inline QString toString(const boost::tuple<T1, T2, T3> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  237. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  238. template <typename T1, typename T2, typename T3, typename T4> struct QxConvert_ToString< boost::tuple<T1, T2, T3, T4> > {
  239. static inline QString toString(const boost::tuple<T1, T2, T3, T4> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  240. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  241. template <typename T1, typename T2, typename T3, typename T4, typename T5> struct QxConvert_ToString< boost::tuple<T1, T2, T3, T4, T5> > {
  242. static inline QString toString(const boost::tuple<T1, T2, T3, T4, T5> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  243. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  244. template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> struct QxConvert_ToString< boost::tuple<T1, T2, T3, T4, T5, T6> > {
  245. static inline QString toString(const boost::tuple<T1, T2, T3, T4, T5, T6> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  246. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  247. template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> struct QxConvert_ToString< boost::tuple<T1, T2, T3, T4, T5, T6, T7> > {
  248. static inline QString toString(const boost::tuple<T1, T2, T3, T4, T5, T6, T7> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  249. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  250. template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> struct QxConvert_ToString< boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8> > {
  251. static inline QString toString(const boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  252. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  253. template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> struct QxConvert_ToString< boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> > {
  254. static inline QString toString(const boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  255. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  256. #endif // _QX_ENABLE_BOOST
  257. template <typename T1> struct QxConvert_ToString< std::tuple<T1> > {
  258. static inline QString toString(const std::tuple<T1> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  259. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  260. template <typename T1, typename T2> struct QxConvert_ToString< std::tuple<T1, T2> > {
  261. static inline QString toString(const std::tuple<T1, T2> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  262. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  263. template <typename T1, typename T2, typename T3> struct QxConvert_ToString< std::tuple<T1, T2, T3> > {
  264. static inline QString toString(const std::tuple<T1, T2, T3> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  265. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  266. template <typename T1, typename T2, typename T3, typename T4> struct QxConvert_ToString< std::tuple<T1, T2, T3, T4> > {
  267. static inline QString toString(const std::tuple<T1, T2, T3, T4> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  268. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  269. template <typename T1, typename T2, typename T3, typename T4, typename T5> struct QxConvert_ToString< std::tuple<T1, T2, T3, T4, T5> > {
  270. static inline QString toString(const std::tuple<T1, T2, T3, T4, T5> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  271. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  272. template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> struct QxConvert_ToString< std::tuple<T1, T2, T3, T4, T5, T6> > {
  273. static inline QString toString(const std::tuple<T1, T2, T3, T4, T5, T6> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  274. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  275. template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> struct QxConvert_ToString< std::tuple<T1, T2, T3, T4, T5, T6, T7> > {
  276. static inline QString toString(const std::tuple<T1, T2, T3, T4, T5, T6, T7> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  277. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  278. template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> struct QxConvert_ToString< std::tuple<T1, T2, T3, T4, T5, T6, T7, T8> > {
  279. static inline QString toString(const std::tuple<T1, T2, T3, T4, T5, T6, T7, T8> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  280. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  281. template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> struct QxConvert_ToString< std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> > {
  282. static inline QString toString(const std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> & t, const QString & format, int index, qx::cvt::context::ctx_type ctx)
  283. { Q_UNUSED(format); Q_UNUSED(index); Q_UNUSED(ctx); return QX_CVT_DEFAULT_ARCHIVE::to_string(t); } };
  284. } // namespace detail
  285. } // namespace cvt
  286. } // namespace qx