QxOrm 1.1.8
C++ Object Relational Mapping library
is_qt_variant_compatible.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** http://www.qxorm.com/
00004 ** http://sourceforge.net/projects/qxorm/
00005 ** Original file by Lionel Marty
00006 **
00007 ** This file is part of the QxOrm library
00008 **
00009 ** This software is provided 'as-is', without any express or implied
00010 ** warranty. In no event will the authors be held liable for any
00011 ** damages arising from the use of this software.
00012 **
00013 ** GNU Lesser General Public License Usage
00014 ** This file must be used under the terms of the GNU Lesser
00015 ** General Public License version 2.1 as published by the Free Software
00016 ** Foundation and appearing in the file 'license.lgpl.txt' included in the
00017 ** packaging of this file.  Please review the following information to
00018 ** ensure the GNU Lesser General Public License version 2.1 requirements
00019 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
00020 **
00021 ** If you have questions regarding the use of this file, please contact :
00022 ** contact@qxorm.com
00023 **
00024 ****************************************************************************/
00025 
00026 #ifndef _QX_IS_QT_VARIANT_COMPATIBLE_H_
00027 #define _QX_IS_QT_VARIANT_COMPATIBLE_H_
00028 
00029 #ifdef _MSC_VER
00030 #pragma once
00031 #endif
00032 
00040 #include <boost/type_traits/is_enum.hpp>
00041 
00042 #include <QtCore/qvariant.h>
00043 
00044 namespace qx {
00045 namespace trait {
00046 
00051 template <typename T>
00052 struct is_qt_variant_compatible
00053 { enum { value = boost::is_enum<T>::value }; };
00054 
00055 template <> struct is_qt_variant_compatible<bool>                 { enum { value = true }; };
00056 template <> struct is_qt_variant_compatible<short>                { enum { value = true }; };
00057 template <> struct is_qt_variant_compatible<int>                  { enum { value = true }; };
00058 template <> struct is_qt_variant_compatible<long>                 { enum { value = true }; };
00059 template <> struct is_qt_variant_compatible<long long>            { enum { value = true }; };
00060 template <> struct is_qt_variant_compatible<float>                { enum { value = true }; };
00061 template <> struct is_qt_variant_compatible<double>               { enum { value = true }; };
00062 template <> struct is_qt_variant_compatible<long double>          { enum { value = true }; };
00063 template <> struct is_qt_variant_compatible<unsigned short>       { enum { value = true }; };
00064 template <> struct is_qt_variant_compatible<unsigned int>         { enum { value = true }; };
00065 template <> struct is_qt_variant_compatible<unsigned long>        { enum { value = true }; };
00066 template <> struct is_qt_variant_compatible<unsigned long long>   { enum { value = true }; };
00067 template <> struct is_qt_variant_compatible<QString>              { enum { value = true }; };
00068 template <> struct is_qt_variant_compatible<QDate>                { enum { value = true }; };
00069 template <> struct is_qt_variant_compatible<QTime>                { enum { value = true }; };
00070 template <> struct is_qt_variant_compatible<QDateTime>            { enum { value = true }; };
00071 template <> struct is_qt_variant_compatible<QBitArray>            { enum { value = true }; };
00072 template <> struct is_qt_variant_compatible<QByteArray>           { enum { value = true }; };
00073 template <> struct is_qt_variant_compatible<QLatin1String>        { enum { value = true }; };
00074 template <> struct is_qt_variant_compatible<QStringList>          { enum { value = true }; };
00075 template <> struct is_qt_variant_compatible<QChar>                { enum { value = true }; };
00076 template <> struct is_qt_variant_compatible<QRegExp>              { enum { value = true }; };
00077 template <> struct is_qt_variant_compatible<QLocale>              { enum { value = true }; };
00078 template <> struct is_qt_variant_compatible<QSize>                { enum { value = true }; };
00079 template <> struct is_qt_variant_compatible<QSizeF>               { enum { value = true }; };
00080 template <> struct is_qt_variant_compatible<QPoint>               { enum { value = true }; };
00081 template <> struct is_qt_variant_compatible<QPointF>              { enum { value = true }; };
00082 template <> struct is_qt_variant_compatible<QLine>                { enum { value = true }; };
00083 template <> struct is_qt_variant_compatible<QLineF>               { enum { value = true }; };
00084 template <> struct is_qt_variant_compatible<QRect>                { enum { value = true }; };
00085 template <> struct is_qt_variant_compatible<QRectF>               { enum { value = true }; };
00086 template <> struct is_qt_variant_compatible<QUrl>                 { enum { value = true }; };
00087 template <> struct is_qt_variant_compatible<QVariant>             { enum { value = true }; };
00088 
00089 template <> struct is_qt_variant_compatible< QList<QVariant> >             { enum { value = true }; };
00090 template <> struct is_qt_variant_compatible< QMap<QString, QVariant> >     { enum { value = true }; };
00091 template <> struct is_qt_variant_compatible< QHash<QString, QVariant> >    { enum { value = true }; };
00092 
00093 } // namespace trait
00094 } // namespace qx
00095 
00096 #endif // _QX_IS_QT_VARIANT_COMPATIBLE_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines