make sub projects for better file groupping
This commit is contained in:
parent
de4dc0f6c5
commit
6efc4f4ee4
|
|
@ -0,0 +1,8 @@
|
|||
INCLUDEPATH += $$PWD
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/nut_config.h \
|
||||
$$PWD/nut_consts.h \
|
||||
$$PWD/nut_global.h \
|
||||
$$PWD/nut_macros.h \
|
||||
$$PWD/nut_namespace.h
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef NUT_CONFIG_H
|
||||
#define NUT_CONFIG_H
|
||||
|
||||
#if defined(NUT_SHARED) || !defined(NUT_STATIC)
|
||||
# ifdef NUT_STATIC
|
||||
# error "Both NUT_SHARED and NUT_STATIC defined, please make up your mind"
|
||||
# endif
|
||||
# ifndef NUT_SHARED
|
||||
# define NUT_SHARED
|
||||
# endif
|
||||
# if defined(NUT_BUILD_LIB)
|
||||
# define NUT_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define NUT_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define NUT_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // NUT_CONFIG_H
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef DEFINES_P_H
|
||||
#define DEFINES_P_H
|
||||
#ifndef NUT_CONSTS_H
|
||||
#define NUT_CONSTS_H
|
||||
|
||||
#define __NAME "name"
|
||||
#define __TYPE "type"
|
||||
|
|
@ -56,4 +56,4 @@
|
|||
# define NUT_WRAP_NAMESPACE(x) x
|
||||
#endif
|
||||
|
||||
#endif // DEFINES_P_H
|
||||
#endif // NUT_CONSTS_H
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef NUT_GLOBAL_H
|
||||
#define NUT_GLOBAL_H
|
||||
|
||||
#define NUT_NAMESPACE Nut
|
||||
|
||||
#include <QtNut/nut_config.h>
|
||||
#include <QtNut/nut_consts.h>
|
||||
#include <QtNut/nut_macros.h>
|
||||
#include <QtNut/nut_macros.h>
|
||||
#include <QtNut/nut_namespace.h>
|
||||
|
||||
#endif // NUT_GLOBAL_H
|
||||
|
|
@ -1,51 +1,6 @@
|
|||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Nut project.
|
||||
** https://github.com/HamedMasafi/Nut
|
||||
**
|
||||
** Nut is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU Lesser General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Nut is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU Lesser General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU Lesser General Public License
|
||||
** along with Nut. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
**************************************************************************/
|
||||
#ifndef NUT_MACROS_H
|
||||
#define NUT_MACROS_H
|
||||
|
||||
#ifndef SYNTAX_DEFINES_H
|
||||
#define SYNTAX_DEFINES_H
|
||||
|
||||
#define NUT_NAMESPACE Nut
|
||||
|
||||
#include <QtNut/defines_consts.h>
|
||||
#include <QtCore/QtGlobal>
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QMetaClassInfo>
|
||||
|
||||
#if defined(NUT_SHARED) || !defined(NUT_STATIC)
|
||||
# ifdef NUT_STATIC
|
||||
# error "Both NUT_SHARED and NUT_STATIC defined, please make up your mind"
|
||||
# endif
|
||||
# ifndef NUT_SHARED
|
||||
# define NUT_SHARED
|
||||
# endif
|
||||
# if defined(NUT_BUILD_LIB)
|
||||
# define NUT_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define NUT_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define NUT_EXPORT
|
||||
#endif
|
||||
|
||||
#define NUT_INFO(type, name, value) \
|
||||
Q_CLASSINFO(__nut_NAME_PERFIX type #name #value, \
|
||||
|
|
@ -180,132 +135,4 @@ public slots: \
|
|||
#define NUT_NOT_NULL(x) NUT_INFO(__nut_NOT_NULL, x, 1)
|
||||
#define NUT_INDEX(name, field, order)
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
inline bool nutClassInfo(const QMetaClassInfo &classInfo,
|
||||
QString &type, QString &name, QVariant &value)
|
||||
{
|
||||
if (!QString::fromUtf8(classInfo.name()).startsWith(QStringLiteral(__nut_NAME_PERFIX)))
|
||||
return false;
|
||||
|
||||
QStringList parts = QString::fromUtf8(classInfo.value()).split(QStringLiteral("\n"));
|
||||
if (parts.count() != 3)
|
||||
return false;
|
||||
|
||||
type = parts[0];
|
||||
name = parts[1];
|
||||
value = QVariant::fromValue(parts[2]);
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool nutClassInfoString(const QMetaClassInfo &classInfo,
|
||||
QString &type, QString &name, QString &value)
|
||||
{
|
||||
if (!QString::fromUtf8(classInfo.name()).startsWith(QStringLiteral(__nut_NAME_PERFIX)))
|
||||
return false;
|
||||
|
||||
QStringList parts = QString::fromUtf8(classInfo.value()).split(QStringLiteral("\n"));
|
||||
if (parts.count() != 3)
|
||||
return false;
|
||||
|
||||
type = parts[0];
|
||||
name = parts[1];
|
||||
value = parts[2];
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool nutClassInfoBool(const QMetaClassInfo &classInfo,
|
||||
QString &type, QString &name, bool &value)
|
||||
{
|
||||
if (!QString::fromUtf8(classInfo.name()).startsWith(QStringLiteral(__nut_NAME_PERFIX)))
|
||||
return false;
|
||||
|
||||
QStringList parts = QString::fromUtf8(classInfo.value()).split(QStringLiteral("\n"));
|
||||
if (parts.count() != 3)
|
||||
return false;
|
||||
|
||||
QString buffer = parts[2].toLower();
|
||||
if (buffer != QStringLiteral("true") && buffer != QStringLiteral("false"))
|
||||
return false;
|
||||
|
||||
type = parts[0];
|
||||
name = parts[1];
|
||||
value = (buffer == QStringLiteral("true"));
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool nutClassInfoInt(const QMetaClassInfo &classInfo,
|
||||
QString &type, QString &name, bool &value)
|
||||
{
|
||||
if (!QString::fromUtf8(classInfo.name()).startsWith(QStringLiteral(__nut_NAME_PERFIX)))
|
||||
return false;
|
||||
|
||||
QStringList parts = QString::fromUtf8(classInfo.value()).split(QStringLiteral("\n"));
|
||||
if (parts.count() != 3)
|
||||
return false;
|
||||
bool ok;
|
||||
type = parts[0];
|
||||
name = parts[1];
|
||||
value = parts[2].toInt(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
#ifdef NUT_SHARED_POINTER
|
||||
template <class T>
|
||||
using RowList = QList<QSharedPointer<T>>;
|
||||
|
||||
template <class T>
|
||||
using RowSet = QSet<QSharedPointer<T>>;
|
||||
|
||||
template <typename T>
|
||||
using Row = QSharedPointer<T>;
|
||||
|
||||
template<class T>
|
||||
inline Row<T> create() {
|
||||
return QSharedPointer<T>(new T);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline Row<T> create(QObject *parent) {
|
||||
return QSharedPointer<T>(new T(parent));
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline Row<T> createFrom(T *row) {
|
||||
return QSharedPointer<T>(row);
|
||||
}
|
||||
template<class T>
|
||||
inline Row<T> createFrom(const QSharedPointer<T> row) {
|
||||
return row;
|
||||
}
|
||||
|
||||
#else
|
||||
template <typename T>
|
||||
using RowList = QList<T*>;
|
||||
|
||||
template <typename T>
|
||||
using RowSet = QSet<T*>;
|
||||
|
||||
template <typename T>
|
||||
using Row = T*;
|
||||
|
||||
template<class T>
|
||||
inline Row<T> create() {
|
||||
return new T;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T *get(const Row<T> row) {
|
||||
return row;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T *get(const QSharedPointer<T> row) {
|
||||
return row.data();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
NUT_END_NAMESPACE
|
||||
|
||||
#endif // SYNTAX_DEFINES_H
|
||||
#endif // NUT_MACROS_H
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
#ifndef NUT_NAMESPACE_H
|
||||
#define NUT_NAMESPACE_H
|
||||
|
||||
#include <QtNut/nut_config.h>
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QMetaClassInfo>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
inline bool nutClassInfo(const QMetaClassInfo &classInfo,
|
||||
QString &type, QString &name, QVariant &value)
|
||||
{
|
||||
if (!QString::fromUtf8(classInfo.name()).startsWith(QStringLiteral(__nut_NAME_PERFIX)))
|
||||
return false;
|
||||
|
||||
QStringList parts = QString::fromUtf8(classInfo.value()).split(QStringLiteral("\n"));
|
||||
if (parts.count() != 3)
|
||||
return false;
|
||||
|
||||
type = parts[0];
|
||||
name = parts[1];
|
||||
value = QVariant::fromValue(parts[2]);
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool nutClassInfoString(const QMetaClassInfo &classInfo,
|
||||
QString &type, QString &name, QString &value)
|
||||
{
|
||||
if (!QString::fromUtf8(classInfo.name()).startsWith(QStringLiteral(__nut_NAME_PERFIX)))
|
||||
return false;
|
||||
|
||||
QStringList parts = QString::fromUtf8(classInfo.value()).split(QStringLiteral("\n"));
|
||||
if (parts.count() != 3)
|
||||
return false;
|
||||
|
||||
type = parts[0];
|
||||
name = parts[1];
|
||||
value = parts[2];
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool nutClassInfoBool(const QMetaClassInfo &classInfo,
|
||||
QString &type, QString &name, bool &value)
|
||||
{
|
||||
if (!QString::fromUtf8(classInfo.name()).startsWith(QStringLiteral(__nut_NAME_PERFIX)))
|
||||
return false;
|
||||
|
||||
QStringList parts = QString::fromUtf8(classInfo.value()).split(QStringLiteral("\n"));
|
||||
if (parts.count() != 3)
|
||||
return false;
|
||||
|
||||
QString buffer = parts[2].toLower();
|
||||
if (buffer != QStringLiteral("true") && buffer != QStringLiteral("false"))
|
||||
return false;
|
||||
|
||||
type = parts[0];
|
||||
name = parts[1];
|
||||
value = (buffer == QStringLiteral("true"));
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool nutClassInfoInt(const QMetaClassInfo &classInfo,
|
||||
QString &type, QString &name, bool &value)
|
||||
{
|
||||
if (!QString::fromUtf8(classInfo.name()).startsWith(QStringLiteral(__nut_NAME_PERFIX)))
|
||||
return false;
|
||||
|
||||
QStringList parts = QString::fromUtf8(classInfo.value()).split(QStringLiteral("\n"));
|
||||
if (parts.count() != 3)
|
||||
return false;
|
||||
bool ok;
|
||||
type = parts[0];
|
||||
name = parts[1];
|
||||
value = parts[2].toInt(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
#ifdef NUT_RAW_POINTER
|
||||
template <typename T>
|
||||
using RowList = QList<T*>;
|
||||
|
||||
template <typename T>
|
||||
using RowSet = QSet<T*>;
|
||||
|
||||
template <typename T>
|
||||
using Row = T*;
|
||||
|
||||
template<class T>
|
||||
inline Row<T> create() {
|
||||
return new T;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T *get(const Row<T> row) {
|
||||
return row;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T *get(const QSharedPointer<T> row) {
|
||||
return row.data();
|
||||
}
|
||||
#else
|
||||
template <class T>
|
||||
using RowList = QList<QSharedPointer<T>>;
|
||||
|
||||
template <class T>
|
||||
using RowSet = QSet<QSharedPointer<T>>;
|
||||
|
||||
template <typename T>
|
||||
using Row = QSharedPointer<T>;
|
||||
|
||||
template<class T>
|
||||
inline Row<T> create() {
|
||||
return QSharedPointer<T>(new T);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline Row<T> create(QObject *parent) {
|
||||
return QSharedPointer<T>(new T(parent));
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline Row<T> createFrom(T *row) {
|
||||
return QSharedPointer<T>(row);
|
||||
}
|
||||
template<class T>
|
||||
inline Row<T> createFrom(const QSharedPointer<T> row) {
|
||||
return row;
|
||||
}
|
||||
#endif
|
||||
|
||||
NUT_END_NAMESPACE
|
||||
|
||||
#endif // NUT_NAMESPACE_H
|
||||
|
|
@ -63,10 +63,10 @@ int AbstractTableSet::save(Database *db, bool cleanUp)
|
|||
|| t->status() == Table::Deleted) {
|
||||
rowsAffected += t->save(db);
|
||||
if (cleanUp)
|
||||
#ifdef NUT_SHARED_POINTER
|
||||
remove(t);
|
||||
#else
|
||||
#ifdef NUT_RAW_POINTER
|
||||
t->deleteLater();
|
||||
#else
|
||||
remove(t);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +79,7 @@ int AbstractTableSet::save(Database *db, bool cleanUp)
|
|||
|
||||
void AbstractTableSet::clearChilds()
|
||||
{
|
||||
#ifndef NUT_SHARED_POINTER
|
||||
#ifdef NUT_RAW_POINTER
|
||||
foreach (Table *t, data->childs)
|
||||
t->deleteLater();
|
||||
#endif
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
#include <QtCore/QSet>
|
||||
#include <QtCore/QExplicitlySharedDataPointer>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <QtCore/QSharedData>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
#include <QtNut/phraselist.h>
|
||||
#include <QtNut/fieldphrase.h>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
INCLUDEPATH += $$PWD
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/abstracttableset.h \
|
||||
$$PWD/abstracttablesetdata.h \
|
||||
$$PWD/bulkinserter.h \
|
||||
$$PWD/bulkinserter_p.h \
|
||||
$$PWD/changelogtable.h \
|
||||
$$PWD/database.h \
|
||||
$$PWD/database_p.h \
|
||||
$$PWD/query.h \
|
||||
$$PWD/table.h \
|
||||
$$PWD/table_p.h \
|
||||
$$PWD/tableset.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/abstracttableset.cpp \
|
||||
$$PWD/bulkinserter.cpp \
|
||||
$$PWD/changelogtable.cpp \
|
||||
$$PWD/database.cpp \
|
||||
$$PWD/query.cpp \
|
||||
$$PWD/table.cpp \
|
||||
$$PWD/tableset.cpp
|
||||
|
||||
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#include "table.h"
|
||||
#include "tableset.h"
|
||||
#include "database_p.h"
|
||||
#include "defines.h"
|
||||
#include "config/nut_global.h"
|
||||
#include "tablemodel.h"
|
||||
#include "postgresqlgenerator.h"
|
||||
#include "mysqlgenerator.h"
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
#include <QtCore/QSharedDataPointer>
|
||||
#include <QtSql/QSqlDatabase>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/tableset.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#include <QtSql/QSqlQueryModel>
|
||||
#include <QtSql/QSqlQuery>
|
||||
|
||||
#ifdef NUT_SHARED_POINTER
|
||||
#ifndef NUT_RAW_POINTER
|
||||
#include <QtCore/QSharedPointer>
|
||||
#endif
|
||||
|
||||
|
|
@ -351,10 +351,10 @@ Q_OUTOFLINE_TEMPLATE RowList<T> Query<T>::toList(int count)
|
|||
Row<Table> row;
|
||||
if (data.table->className() == d->className) {
|
||||
row = Nut::create<T>();
|
||||
#ifdef NUT_SHARED_POINTER
|
||||
returnList.append(row.objectCast<T>());
|
||||
#else
|
||||
#ifdef NUT_RAW_POINTER
|
||||
returnList.append(dynamic_cast<T*>(table));
|
||||
#else
|
||||
returnList.append(row.objectCast<T>());
|
||||
#endif
|
||||
d->tableSet->add(row);
|
||||
|
||||
|
|
@ -43,6 +43,10 @@ NUT_BEGIN_NAMESPACE
|
|||
* This should be fixed to v1.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \class Table
|
||||
* \brief Base class for all tables
|
||||
*/
|
||||
Table::Table(QObject *parent) : QObject(parent),
|
||||
d(new TablePrivate)
|
||||
{ }
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore/QSet>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/tablemodel.h>
|
||||
#include <QtNut/phrase.h>
|
||||
|
||||
|
|
@ -4,7 +4,8 @@
|
|||
#include <QtCore/QSet>
|
||||
#include <QtCore/QSharedData>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/table.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -100,10 +100,10 @@ Q_OUTOFLINE_TEMPLATE int TableSet<T>::length() const
|
|||
template<class T>
|
||||
Q_OUTOFLINE_TEMPLATE Row<T> TableSet<T>::at(int i) const
|
||||
{
|
||||
#ifdef NUT_SHARED_POINTER
|
||||
return data->childs.at(i).template objectCast<T>();
|
||||
#else
|
||||
#ifdef NUT_RAW_POINTER
|
||||
return reinterpret_cast<T*>(data->childs.at(i));
|
||||
#else
|
||||
return data->childs.at(i).template objectCast<T>();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
INCLUDEPATH += $$PWD
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/abstractsqlgenerator.h \
|
||||
$$PWD/postgresqlgenerator.h \
|
||||
$$PWD/mysqlgenerator.h \
|
||||
$$PWD/sqlitegenerator.h \
|
||||
$$PWD/sqlservergenerator.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/abstractsqlgenerator.cpp \
|
||||
$$PWD/postgresqlgenerator.cpp \
|
||||
$$PWD/mysqlgenerator.cpp \
|
||||
$$PWD/sqlitegenerator.cpp \
|
||||
$$PWD/sqlservergenerator.cpp
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
class QJsonObject;
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
INCLUDEPATH += $$PWD
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/databasemodel.h \
|
||||
$$PWD/sqlmodel.h \
|
||||
$$PWD/sqlmodel_p.h \
|
||||
$$PWD/tablemodel.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/databasemodel.cpp \
|
||||
$$PWD/sqlmodel.cpp \
|
||||
$$PWD/tablemodel.cpp
|
||||
|
||||
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
#include <QtCore/QExplicitlySharedDataPointer>
|
||||
#include <QtCore/QList>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ public:
|
|||
void append(Row<Table> table);
|
||||
// void append(Table *table);
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
Row<Nut::Table> at(const int &i) const;
|
||||
Row<Table> at(const int &i) const;
|
||||
|
||||
void setRenderer(const std::function<QVariant (int, QVariant)> &renderer);
|
||||
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <functional>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
#include <QtCore/QJsonObject>
|
||||
|
||||
#include "tablemodel.h"
|
||||
#include "defines.h"
|
||||
#include "nut_global.h"
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
class QJsonObject;
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ HEADERS += \
|
|||
$$PWD/types/dbgeography.h \
|
||||
$$PWD/tableset.h \
|
||||
$$PWD/defines_consts.h \
|
||||
$$PWD/defines.h \
|
||||
$$PWD/nut_global.h \
|
||||
$$PWD/query.h \
|
||||
$$PWD/databasemodel.h \
|
||||
$$PWD/changelogtable.h \
|
||||
|
|
@ -9,79 +9,18 @@ DEFINES += QT_DEPRECATED_WARNINGS NUT_SHARED NUT_BUILD_LIB
|
|||
|
||||
DEFINES += NUT_SHARED_POINTER
|
||||
|
||||
INCLUDEPATH += \
|
||||
$$PWD/generators \
|
||||
$$PWD/phrases \
|
||||
$$PWD/types
|
||||
include(config/config.pri)
|
||||
include(core/core.pri)
|
||||
include(generators/generators.pri)
|
||||
include(types/types.pri)
|
||||
include(phrases/phrases.pri)
|
||||
include(models/models.pri)
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/generators/abstractsqlgenerator.h \
|
||||
$$PWD/generators/postgresqlgenerator.h \
|
||||
$$PWD/generators/mysqlgenerator.h \
|
||||
$$PWD/generators/sqlitegenerator.h \
|
||||
$$PWD/generators/sqlservergenerator.h \
|
||||
$$PWD/types/dbgeography.h \
|
||||
$$PWD/tableset.h \
|
||||
$$PWD/defines_consts.h \
|
||||
$$PWD/defines.h \
|
||||
$$PWD/query.h \
|
||||
$$PWD/bulkinserter.h \
|
||||
$$PWD/databasemodel.h \
|
||||
$$PWD/changelogtable.h \
|
||||
$$PWD/abstracttableset.h \
|
||||
$$PWD/abstracttablesetdata.h \
|
||||
$$PWD/tablemodel.h \
|
||||
$$PWD/table.h \
|
||||
$$PWD/database.h \
|
||||
$$PWD/database_p.h \
|
||||
$$PWD/serializableobject.h \
|
||||
$$PWD/sqlmodel.h \
|
||||
$$PWD/sqlmodel_p.h \
|
||||
$$PWD/phrase.h \
|
||||
$$PWD/phrases/abstractfieldphrase.h \
|
||||
$$PWD/phrases/assignmentphrase.h \
|
||||
$$PWD/phrases/assignmentphraselist.h \
|
||||
$$PWD/phrases/conditionalphrase.h \
|
||||
$$PWD/phrases/fieldphrase.h \
|
||||
$$PWD/phrases/phrasedata.h \
|
||||
$$PWD/phrases/phrasedatalist.h \
|
||||
$$PWD/phrases/phraselist.h \
|
||||
$$PWD/phrases/fieldphrase_date.h \
|
||||
$$PWD/table_p.h \
|
||||
$$PWD/bulkinserter_p.h \
|
||||
$$PWD/phrases/fieldphrase_bool.h \
|
||||
$$PWD/phrases/fieldphrase_qstring.h
|
||||
$$PWD/phrase.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/generators/abstractsqlgenerator.cpp \
|
||||
$$PWD/generators/postgresqlgenerator.cpp \
|
||||
$$PWD/generators/mysqlgenerator.cpp \
|
||||
$$PWD/generators/sqlitegenerator.cpp \
|
||||
$$PWD/generators/sqlservergenerator.cpp \
|
||||
$$PWD/types/dbgeography.cpp \
|
||||
$$PWD/tableset.cpp \
|
||||
$$PWD/query.cpp \
|
||||
$$PWD/bulkinserter.cpp \
|
||||
$$PWD/databasemodel.cpp \
|
||||
$$PWD/abstracttableset.cpp \
|
||||
$$PWD/changelogtable.cpp \
|
||||
$$PWD/tablemodel.cpp \
|
||||
$$PWD/table.cpp \
|
||||
$$PWD/database.cpp \
|
||||
$$PWD/serializableobject.cpp \
|
||||
$$PWD/sqlmodel.cpp \
|
||||
$$PWD/phrase.cpp \
|
||||
$$PWD/phrases/abstractfieldphrase.cpp \
|
||||
$$PWD/phrases/assignmentphrase.cpp \
|
||||
$$PWD/phrases/assignmentphraselist.cpp \
|
||||
$$PWD/phrases/conditionalphrase.cpp \
|
||||
$$PWD/phrases/fieldphrase.cpp \
|
||||
$$PWD/phrases/phrasedata.cpp \
|
||||
$$PWD/phrases/phrasedatalist.cpp \
|
||||
$$PWD/phrases/phraselist.cpp \
|
||||
$$PWD/phrases/fieldphrase_date.cpp \
|
||||
$$PWD/phrases/fieldphrase_bool.cpp \
|
||||
$$PWD/phrases/fieldphrase_qstring.cpp
|
||||
$$PWD/phrase.cpp
|
||||
|
||||
load(qt_module)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,47 +19,3 @@
|
|||
**************************************************************************/
|
||||
|
||||
#include "phrase.h"
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AssignmentPhrase::AssignmentPhrase(AssignmentPhrase *l, const AssignmentPhrase *r)
|
||||
//{
|
||||
//// data = new PhraseData(l->data, PhraseData::Append, r->data);
|
||||
// qFatal("SS");
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AssignmentPhraseList operator &(const AssignmentPhrase &l, const AssignmentPhrase &r)
|
||||
//{
|
||||
// return AssignmentPhraseList(l, r);
|
||||
//}
|
||||
|
||||
//AssignmentPhraseList operator &(const AssignmentPhrase &l, AssignmentPhrase &&r)
|
||||
//{
|
||||
// r.data = 0;
|
||||
// return AssignmentPhraseList(l, r);
|
||||
//}
|
||||
|
||||
//AssignmentPhraseList operator &(AssignmentPhrase &&l, const AssignmentPhrase &r)
|
||||
//{
|
||||
// l.data = 0;
|
||||
// return AssignmentPhraseList(l, r);
|
||||
//}
|
||||
|
||||
//AssignmentPhraseList operator &(AssignmentPhrase &&l, AssignmentPhrase &&r)
|
||||
//{
|
||||
// r.data = l.data = 0;
|
||||
// return AssignmentPhraseList(l, r);
|
||||
//}
|
||||
|
||||
NUT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#ifndef PHRASE_H
|
||||
#define PHRASE_H
|
||||
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/conditionalphrase.h>
|
||||
#include <QtNut/abstractfieldphrase.h>
|
||||
#include <QtNut/fieldphrase.h>
|
||||
|
|
@ -34,42 +35,4 @@
|
|||
#include <QtNut/fieldphrase_qstring.h>
|
||||
#include <QtNut/fieldphrase_bool.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
#define SPECIALIZATION_NUMERIC_MEMBER(type, op, cond) \
|
||||
ConditionalPhrase operator op(const QVariant &other) \
|
||||
{ \
|
||||
return ConditionalPhrase(this, cond, other); \
|
||||
}
|
||||
|
||||
class AbstractFieldPhrase;
|
||||
class AssignmentPhrase;
|
||||
class PhraseList;
|
||||
|
||||
//AssignmentPhraseList operator &(const AssignmentPhrase &l, const AssignmentPhrase &r);
|
||||
//AssignmentPhraseList operator &(const AssignmentPhrase &l, AssignmentPhrase &&r);
|
||||
//AssignmentPhraseList operator &(AssignmentPhrase &&l, const AssignmentPhrase &r);
|
||||
//AssignmentPhraseList operator &(AssignmentPhrase &&l, AssignmentPhrase &&r);
|
||||
|
||||
|
||||
//ConditionalPhrase operator <(AbstractFieldPhrase &l, ConditionalPhrase &&other)
|
||||
//{
|
||||
// return ConditionalPhrase(&l, PhraseData::Less, other);
|
||||
//}
|
||||
|
||||
//template<typename T>
|
||||
//class FieldPhrase : public AbstractFieldPhrase
|
||||
//{
|
||||
//public:
|
||||
// FieldPhrase(const char *className, const char *s) :
|
||||
// AbstractFieldPhrase(className, s)
|
||||
// {}
|
||||
|
||||
// AssignmentPhrase operator =(const QVariant &other) {
|
||||
// return AssignmentPhrase(this, other);
|
||||
// }
|
||||
//};
|
||||
|
||||
NUT_END_NAMESPACE
|
||||
|
||||
#endif // PHRASE_H
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef ABSTRACTFIELDPHRASE_H
|
||||
#define ABSTRACTFIELDPHRASE_H
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/assignmentphrase.h>
|
||||
#include <QtNut/conditionalphrase.h>
|
||||
#include <QtNut/phraselist.h>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef ASSIGNMENTPHRASE_H
|
||||
#define ASSIGNMENTPHRASE_H
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/assignmentphraselist.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef ASSIGNMENTPHRASELIST_H
|
||||
#define ASSIGNMENTPHRASELIST_H
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef FIELDPHRASE_H
|
||||
#define FIELDPHRASE_H
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/abstractfieldphrase.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef NUT_FIELDPHRASE_BOOL_H
|
||||
#define NUT_FIELDPHRASE_BOOL_H
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/fieldphrase.h>
|
||||
#include <QtNut/fieldphrase.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef NUT_FIELDPHRASE_QSTRING_H
|
||||
#define NUT_FIELDPHRASE_QSTRING_H
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/abstractfieldphrase.h>
|
||||
#include <QtNut/fieldphrase.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef PHRASEDATA_H
|
||||
#define PHRASEDATA_H
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#ifndef PHRASELIST_H
|
||||
#define PHRASELIST_H
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
#include <QtNut/phrasedatalist.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
INCLUDEPATH += $$PWD
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/abstractfieldphrase.h \
|
||||
$$PWD/assignmentphrase.h \
|
||||
$$PWD/assignmentphraselist.h \
|
||||
$$PWD/conditionalphrase.h \
|
||||
$$PWD/fieldphrase.h \
|
||||
$$PWD/phrasedata.h \
|
||||
$$PWD/phrasedatalist.h \
|
||||
$$PWD/phraselist.h \
|
||||
$$PWD/fieldphrase_date.h \
|
||||
$$PWD/fieldphrase_bool.h \
|
||||
$$PWD/fieldphrase_qstring.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/abstractfieldphrase.cpp \
|
||||
$$PWD/assignmentphrase.cpp \
|
||||
$$PWD/assignmentphraselist.cpp \
|
||||
$$PWD/conditionalphrase.cpp \
|
||||
$$PWD/fieldphrase.cpp \
|
||||
$$PWD/phrasedata.cpp \
|
||||
$$PWD/phrasedatalist.cpp \
|
||||
$$PWD/phraselist.cpp \
|
||||
$$PWD/fieldphrase_date.cpp \
|
||||
$$PWD/fieldphrase_bool.cpp \
|
||||
$$PWD/fieldphrase_qstring.cpp
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
#include "serializableobject.h"
|
||||
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
#ifndef SERIALIZABLEOBJECT_H
|
||||
#define SERIALIZABLEOBJECT_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
class SerializableObject
|
||||
{
|
||||
public:
|
||||
SerializableObject() = default;
|
||||
|
||||
virtual void load(const QVariant &value) = 0;
|
||||
virtual QVariant save() = 0;
|
||||
};
|
||||
|
||||
#endif // SERIALIZABLEOBJECT_H
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
#include "tuple.h"
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef TUPLE_H
|
||||
#define TUPLE_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
//class AbstractTuple
|
||||
//{
|
||||
// Q_GADGET
|
||||
//};
|
||||
|
||||
//template <typename T>
|
||||
//class Tuple
|
||||
//{
|
||||
//public:
|
||||
// T _1;
|
||||
//};
|
||||
|
||||
#endif // TUPLE_H
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include <QtNut/defines.h>
|
||||
#include <QtNut/nut_global.h>
|
||||
|
||||
NUT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
INCLUDEPATH += $$PWD
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/dbgeography.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/dbgeography.cpp
|
||||
|
|
@ -2,4 +2,4 @@
|
|||
"QtNut" => "$basedir/src/nut",
|
||||
);
|
||||
|
||||
$publicclassregexp = "^QtJsonSerializer::(?!__private::|MetaWriters::Implementations::|TypeExtractors::|Exception).+";
|
||||
$publicclassregexp = ".+";
|
||||
|
|
|
|||
Loading…
Reference in New Issue