00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef QDATASCHEMAGLOBAL_H
00016 #define QDATASCHEMAGLOBAL_H
00017 #define QDS_VERSION 0x120
00018 #include <qglobal.h>
00019
00020 #if QT_VERSION>=0x040000
00021
00022 #include <Qt/QtCore>
00023 #include <Qt/QtSql>
00024 #include <Qt/QtXml>
00025 #include <QCoreApplication>
00026 #include <QStringList>
00027 #define QSqlFieldInfo QSqlField
00028
00029 #define QDATASCHEMA_QT4
00030 #define QDS_SQLTable QSqlTableModel
00031 #define QDS_int int
00032 #define QDS_IO_ReadOnly QIODevice::ReadOnly
00033 #define QDS_IO_WriteOnly QIODevice::WriteOnly
00034 #define QTextStream_readAll( t ) t.readAll()
00035 #else
00036
00037 #include <qobject.h>
00038 #include <qsqldatabase.h>
00039 #include <qapplication.h>
00040 #include <qsqlrecord.h>
00041 #include <qsqlcursor.h>
00042 #include <qstringlist.h>
00043 #include <qfile.h>
00044 #include <qdom.h>
00045 #include <qtextcodec.h>
00046
00047 #define QDS_SQLTable QSqlCursor
00048 #define QDS_int uint
00049 #define QDS_IO_ReadOnly IO_ReadOnly
00050 #define QDS_IO_WriteOnly IO_WriteOnly
00051 #define QTextStream_readAll( t ) t.read()
00052 #endif
00053
00054 #ifdef Q_OS_WIN32
00055 # include <windows.h>
00056 # include <math.h>
00057 #endif
00058 #ifdef Q_OS_UNIX
00059 # include <unistd.h>
00060 #endif
00061
00062 #if defined(Q_OS_WIN32) && !defined(LIB_NO_DLL)
00063 # define LIB_DLLIMPORT __declspec(dllimport)
00064 # define LIB_DLLEXPORT __declspec(dllexport)
00065 #else
00066 # define LIB_DLLIMPORT
00067 # define LIB_DLLEXPORT
00068 #endif
00069
00070 #if defined (Q_CC_MSVC)
00071 #define TEMPLATE_EXTERN extern
00072 #else
00073 #define TEMPLATE_EXTERN
00074 #endif
00075
00076 #ifdef QDATASCHEMA_EXPORT
00077 # define LIB_EXPORT LIB_DLLEXPORT
00078 #else
00079 # define LIB_EXPORT LIB_DLLIMPORT
00080 #endif
00081
00082 #ifdef QDATASCHEMA_EXPORT
00083 # define LIB_TEMPLATE_EXTERN
00084 #else
00085 # define LIB_TEMPLATE_EXTERN TEMPLATE_EXTERN
00086 #endif
00087
00088 #if defined(Q_CC_MSVC)
00089 # define vsnprintf _vsnprintf
00090 #endif
00091
00092
00093 class QDS
00094 {
00095 public:
00099 enum MO_Type { MO_ROOT, MO_CLASS, MO_ATTR, MO_RELATION };
00100
00101 static int version();
00102 };
00103
00104
00105 QChar toLower(QChar c);
00106 QString toLower(const QString &s);
00107 char toAscii(QChar c);
00108 int indexOf( const QString &str, const QString &find_str );
00109 const char *toLocal8Bit(const QString &s);
00110 QStringList split(const QString &div, const QString &str );
00111 QString trimm(const QString &s);
00112 #endif
00113