diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..528bb2a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +before_install: + - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa + - sudo apt-get update -qq + - sudo apt-get install qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev + - sudo apt-get install qt5-default qttools5-dev-tools + +script: + - qmake nut.pro + - make diff --git a/README.md b/README.md index adabd9a..d44fb0d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # Nut +## Build result +| Brancc name | Icon | +| ------------- |:-------------:| +| master | [![Build Status](https://travis-ci.org/HamedMasafi/Nut.svg?branch=master)](https://travis-ci.org/HamedMasafi/Nut) | +| dev | [![Build Status](https://travis-ci.org/HamedMasafi/Nut.svg?branch=dev)](https://travis-ci.org/HamedMasafi/Nut) | + + ## Advanced, Powerful and easy to use ORM for Qt5 @@ -54,4 +61,4 @@ if(post) { } ``` -For more information read [Wiki](wiki). \ No newline at end of file +For more information read [Wiki](wiki). diff --git a/doc/PaxHeader/html b/doc/PaxHeader/html deleted file mode 100644 index e4f8396..0000000 --- a/doc/PaxHeader/html +++ /dev/null @@ -1,3 +0,0 @@ -20 ctime=1465132049 -20 atime=1495727196 -23 SCHILY.fflags=btree diff --git a/doc/html/annotated.html b/doc/html/annotated.html deleted file mode 100644 index 1c3c3a0..0000000 --- a/doc/html/annotated.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - -Nut: Class List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
Class List
-
-
-
Here are the classes, structs, unions and interfaces with brief descriptions:
- - - - - - - - - - - - - - - - - -
oCChangeLogTable
oCDatabaseDatabase class
oCDatabaseModel
oCFieldModel
oCFieldPhrase
oCMySqlGenerator
oCPhraseData
oCPostgreSqlGenerator
oCQueryThis class hold a query
oCRelationModel
oCSqliteGenerator
oCSqlServerGenerator
oCTable
oCTableModel
oCTableSet
\CWherePhrase
-
-
- - - - diff --git a/doc/html/bc_s.png b/doc/html/bc_s.png deleted file mode 100644 index 25e3beb..0000000 Binary files a/doc/html/bc_s.png and /dev/null differ diff --git a/doc/html/bdwn.png b/doc/html/bdwn.png deleted file mode 100644 index 940a0b9..0000000 Binary files a/doc/html/bdwn.png and /dev/null differ diff --git a/doc/html/changelogtable_8h_source.html b/doc/html/changelogtable_8h_source.html deleted file mode 100644 index 1980091..0000000 --- a/doc/html/changelogtable_8h_source.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - -Nut: src/changelogtable.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
changelogtable.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef CHANGELOGTABLE_H
-
22 #define CHANGELOGTABLE_H
-
23 
-
24 #include <QtCore/qglobal.h>
-
25 #include "table.h"
-
26 
-
27 QT_BEGIN_NAMESPACE
-
28 
-
29 class ChangeLogTable : public Table
-
30 {
-
31  Q_OBJECT
-
32 
-
33  NUT_PRIMARY_AUTO_INCREMENT(id)
-
34  NUT_DECLARE_FIELD(int, id, id, setId)
-
35 
-
36  NUT_DECLARE_FIELD(QString, data, data, setData)
-
37 
-
38  NUT_DECLARE_FIELD(int, versionMajor, versionMajor, setVersionMajor)
-
39 
-
40  NUT_DECLARE_FIELD(int, versionMinor, versionMinor, setVersionMinor)
-
41 
-
42 public:
- -
44 };
-
45 
-
46 QT_END_NAMESPACE
-
47 
-
48 #endif // CHANGELOGTABLE_H
-
- - - - diff --git a/doc/html/class_change_log_table-members.html b/doc/html/class_change_log_table-members.html deleted file mode 100644 index 3e9fb2b..0000000 --- a/doc/html/class_change_log_table-members.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
ChangeLogTable Member List
-
-
- -

This is the complete list of members for ChangeLogTable, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - -
add(TableSetBase *) (defined in Table)Table
Added enum value (defined in Table)Table
changedProperties() const (defined in Table)Table
ChangeLogTable() (defined in ChangeLogTable)ChangeLogTable
Deleted enum value (defined in Table)Table
FeatchedFromDB enum value (defined in Table)Table
isPrimaryKeyAutoIncrement() const (defined in Table)Table
Modified enum value (defined in Table)Table
NewCreated enum value (defined in Table)Table
primaryKey() const (defined in Table)Table
primaryValue() const (defined in Table)Table
propertyChanged(QString propName) (defined in Table)Tableprotected
save(Database *db) (defined in Table)Table
setParentTable(Table *master) (defined in Table)Table
setStatus(const Status &status) (defined in Table)Table
setTableSet(TableSetBase *tableSet) (defined in Table)Table
Status enum name (defined in Table)Table
status() const (defined in Table)Table
Table(QObject *tableSet=0) (defined in Table)Tableexplicit
tableSet() const (defined in Table)Table
- - - - diff --git a/doc/html/class_change_log_table.html b/doc/html/class_change_log_table.html deleted file mode 100644 index 7e5b42a..0000000 --- a/doc/html/class_change_log_table.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - -Nut: ChangeLogTable Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-List of all members
-
-
ChangeLogTable Class Reference
-
-
-
-Inheritance diagram for ChangeLogTable:
-
-
- - -Table - -
- - - - - - - - - - - - - - - - - - - -

-Additional Inherited Members

- Public Types inherited from Table
enum  Status {
-  NewCreated, -FeatchedFromDB, -Added, -Modified, -
-  Deleted -
- }
- Public Member Functions inherited from Table
Table (QObject *tableSet=0)
-void add (TableSetBase *)
-void save (Database *db)
-QString primaryKey () const
-bool isPrimaryKeyAutoIncrement () const
-QVariant primaryValue () const
-Status status () const
-void setStatus (const Status &status)
-TableSetBase * tableSet () const
-void setTableSet (TableSetBase *tableSet)
-QSet< QString > changedProperties () const
-bool setParentTable (Table *master)
- Protected Member Functions inherited from Table
-void propertyChanged (QString propName)
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_change_log_table.png b/doc/html/class_change_log_table.png deleted file mode 100644 index c7da9be..0000000 Binary files a/doc/html/class_change_log_table.png and /dev/null differ diff --git a/doc/html/class_change_log_table__coll__graph.dot b/doc/html/class_change_log_table__coll__graph.dot deleted file mode 100644 index ef9e341..0000000 --- a/doc/html/class_change_log_table__coll__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "ChangeLogTable" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="ChangeLogTable",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="Table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table.html"]; -} diff --git a/doc/html/class_change_log_table__coll__graph.md5 b/doc/html/class_change_log_table__coll__graph.md5 deleted file mode 100644 index a9ad158..0000000 --- a/doc/html/class_change_log_table__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -86ebfa9f18d32319833b08908ecc8329 \ No newline at end of file diff --git a/doc/html/class_change_log_table__inherit__graph.dot b/doc/html/class_change_log_table__inherit__graph.dot deleted file mode 100644 index ef9e341..0000000 --- a/doc/html/class_change_log_table__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "ChangeLogTable" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="ChangeLogTable",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="Table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table.html"]; -} diff --git a/doc/html/class_change_log_table__inherit__graph.md5 b/doc/html/class_change_log_table__inherit__graph.md5 deleted file mode 100644 index a9ad158..0000000 --- a/doc/html/class_change_log_table__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -86ebfa9f18d32319833b08908ecc8329 \ No newline at end of file diff --git a/doc/html/class_database-members.html b/doc/html/class_database-members.html deleted file mode 100644 index 6721027..0000000 --- a/doc/html/class_database-members.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
Database Member List
-
-
- -

This is the complete list of members for Database, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - -
add(TableSetBase *) (defined in Database)Database
cleanUp() (defined in Database)Database
close() (defined in Database)Database
connectionName() const Database
Database(QObject *parent=0) (defined in Database)Database
databaseName() const (defined in Database)Database
databaseUpdated(int oldMajor, int oldMinor, int newMajor, int newMinor) (defined in Database)Databaseprotectedvirtual
driver() const (defined in Database)Database
exec(QString sql) (defined in Database)Database
hostName() const (defined in Database)Database
model() const Database
open() (defined in Database)Database
password() const (defined in Database)Database
port() const (defined in Database)Database
saveChanges() (defined in Database)Database
setConnectionName(QString connectionName) (defined in Database)Databaseslot
setDatabaseName(QString databaseName) (defined in Database)Databaseslot
setDriver(QString driver) (defined in Database)Databaseslot
setHostName(QString hostName) (defined in Database)Databaseslot
setPassword(QString password) (defined in Database)Databaseslot
setPort(int port) (defined in Database)Databaseslot
setUserName(QString userName) (defined in Database)Databaseslot
sqlGenertor() const (defined in Database)Database
tableName(QString className) (defined in Database)Database
userName() const (defined in Database)Database
- - - - diff --git a/doc/html/class_database.html b/doc/html/class_database.html deleted file mode 100644 index f2c3e71..0000000 --- a/doc/html/class_database.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - -Nut: Database Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Slots | -Public Member Functions | -Protected Member Functions | -List of all members
-
-
Database Class Reference
-
-
- -

Database class. - More...

- - - - - - - - - -

-Public Slots

-void setDatabaseName (QString databaseName)
-void setHostName (QString hostName)
-void setPort (int port)
-void setUserName (QString userName)
-void setPassword (QString password)
-void setConnectionName (QString connectionName)
-void setDriver (QString driver)
- - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

Database (QObject *parent=0)
-bool open ()
-void close ()
-QSqlQuery exec (QString sql)
-void add (TableSetBase *)
-void saveChanges ()
-void cleanUp ()
-QString databaseName () const
-QString hostName () const
-int port () const
-QString userName () const
-QString password () const
QString connectionName () const
 Database::connectionName.
-QString driver () const
DatabaseModel model () const
 Database::model.
-QString tableName (QString className)
-SqlGeneratorBase * sqlGenertor () const
- - -

-Protected Member Functions

-virtual void databaseUpdated (int oldMajor, int oldMinor, int newMajor, int newMinor)
-

Detailed Description

-

Database class.

-

Member Function Documentation

- -
-
- - - - - - - -
QString Database::connectionName () const
-
- -

Database::connectionName.

-
Returns
Connection name of current Database QSqlDatabase::connectionName
- -
-
- -
-
- - - - - - - -
DatabaseModel Database::model () const
-
- -

Database::model.

-
Returns
The model of this database
- -
-
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_database_model-members.html b/doc/html/class_database_model-members.html deleted file mode 100644 index c3c9603..0000000 --- a/doc/html/class_database_model-members.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
DatabaseModel Member List
-
-
- -

This is the complete list of members for DatabaseModel, including all inherited members.

- - - - - - - - - - - - - -
DatabaseModel() (defined in DatabaseModel)DatabaseModel
fromJson(QJsonObject &json) (defined in DatabaseModel)DatabaseModelstatic
model(QString tableName) const (defined in DatabaseModel)DatabaseModel
modelByClass(QString className) const (defined in DatabaseModel)DatabaseModel
operator==(const DatabaseModel &other) const (defined in DatabaseModel)DatabaseModel
relationByClassNames(QString masterClassName, QString childClassName) (defined in DatabaseModel)DatabaseModel
relationByTableNames(QString masterTableName, QString childTableName) (defined in DatabaseModel)DatabaseModel
setVersionMajor(int versionMajor) (defined in DatabaseModel)DatabaseModel
setVersionMinor(int versionMinor) (defined in DatabaseModel)DatabaseModel
toJson() const (defined in DatabaseModel)DatabaseModel
versionMajor() const (defined in DatabaseModel)DatabaseModel
versionMinor() const (defined in DatabaseModel)DatabaseModel
- - - - diff --git a/doc/html/class_database_model.html b/doc/html/class_database_model.html deleted file mode 100644 index e1096d9..0000000 --- a/doc/html/class_database_model.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - -Nut: DatabaseModel Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -Static Public Member Functions | -List of all members
-
-
DatabaseModel Class Reference
-
-
- - - - - - - - - - - - -

-Public Member Functions

-TableModelmodel (QString tableName) const
-TableModelmodelByClass (QString className) const
-RelationModelrelationByClassNames (QString masterClassName, QString childClassName)
-RelationModelrelationByTableNames (QString masterTableName, QString childTableName)
-bool operator== (const DatabaseModel &other) const
-QJsonObject toJson () const
-int versionMajor () const
-void setVersionMajor (int versionMajor)
-int versionMinor () const
-void setVersionMinor (int versionMinor)
- - -

-Static Public Member Functions

-static DatabaseModel fromJson (QJsonObject &json)
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_database_private-members.html b/doc/html/class_database_private-members.html deleted file mode 100644 index 687cd94..0000000 --- a/doc/html/class_database_private-members.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - -Nut: Member List - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-
DatabasePrivate Member List
-
-
- -

This is the complete list of members for DatabasePrivate, including all inherited members.

- - - - - - - - - - - - - - - - - - - - -
changeLogs (defined in DatabasePrivate)DatabasePrivate
connectionName (defined in DatabasePrivate)DatabasePrivate
createChangeLogs() (defined in DatabasePrivate)DatabasePrivate
currentModel (defined in DatabasePrivate)DatabasePrivate
databaseName (defined in DatabasePrivate)DatabasePrivate
DatabasePrivate(Database *parent) (defined in DatabasePrivate)DatabasePrivate
db (defined in DatabasePrivate)DatabasePrivate
driver (defined in DatabasePrivate)DatabasePrivate
getCurrectScheema() (defined in DatabasePrivate)DatabasePrivate
getLastScheema() (defined in DatabasePrivate)DatabasePrivate
hostName (defined in DatabasePrivate)DatabasePrivate
open() (defined in DatabasePrivate)DatabasePrivate
password (defined in DatabasePrivate)DatabasePrivate
port (defined in DatabasePrivate)DatabasePrivate
sqlGenertor (defined in DatabasePrivate)DatabasePrivate
storeScheemaInDB() (defined in DatabasePrivate)DatabasePrivate
tables (defined in DatabasePrivate)DatabasePrivate
updateDatabase() (defined in DatabasePrivate)DatabasePrivate
userName (defined in DatabasePrivate)DatabasePrivate
- - - - diff --git a/doc/html/class_database_private.html b/doc/html/class_database_private.html deleted file mode 100644 index 8f0654a..0000000 --- a/doc/html/class_database_private.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - -Nut: DatabasePrivate Class Reference - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-Public Member Functions | -Public Attributes | -List of all members
-
-
DatabasePrivate Class Reference
-
-
- - - - - - - - - -

-Public Member Functions

DatabasePrivate (Database *parent)
-bool open ()
-bool updateDatabase ()
-void createChangeLogs ()
-bool storeScheemaInDB ()
-DatabaseModel getLastScheema ()
-QVariantMap getCurrectScheema ()
- - - - - - - - - - - - - -

-Public Attributes

-QSqlDatabase db
-QString hostName
-QString databaseName
-int port
-QString userName
-QString password
-QString connectionName
-QString driver
-QHash< QString, QString > tables
-SqlGeneratorBasesqlGenertor
-DatabaseModel currentModel
-TableSet< ChangeLogTable > * changeLogs
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_database_private__coll__graph.dot b/doc/html/class_database_private__coll__graph.dot deleted file mode 100644 index 03212f6..0000000 --- a/doc/html/class_database_private__coll__graph.dot +++ /dev/null @@ -1,18 +0,0 @@ -digraph "DatabasePrivate" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="DatabasePrivate",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" sqlGenertor" ,fontname="Helvetica"]; - Node2 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; - Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" changeLogs" ,fontname="Helvetica"]; - Node3 [label="TableSet\< ChangeLogTable \>",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_set.html"]; - Node4 -> Node3 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node4 [label="TableSetBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_set_base.html"]; - Node5 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _table" ,fontname="Helvetica"]; - Node5 [label="Table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table.html"]; - Node6 -> Node4 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _database" ,fontname="Helvetica"]; - Node6 [label="Database",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_database.html",tooltip="Database class."]; - Node7 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" currentModel" ,fontname="Helvetica"]; - Node7 [label="DatabaseModel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_database_model.html"]; -} diff --git a/doc/html/class_database_private__coll__graph.md5 b/doc/html/class_database_private__coll__graph.md5 deleted file mode 100644 index 4bae6b8..0000000 --- a/doc/html/class_database_private__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -8fe5281708ddfa2961f57abd25880e3a \ No newline at end of file diff --git a/doc/html/class_field_phrase-members.html b/doc/html/class_field_phrase-members.html deleted file mode 100644 index 4143f80..0000000 --- a/doc/html/class_field_phrase-members.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
FieldPhrase Member List
-
-
- -

This is the complete list of members for FieldPhrase, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_data (defined in WherePhrase)WherePhraseprotected
_dataPointer (defined in WherePhrase)WherePhraseprotected
data() const (defined in WherePhrase)WherePhrase
FieldPhrase(const char *className, const char *s) (defined in FieldPhrase)FieldPhrase
in(QVariantList list) (defined in FieldPhrase)FieldPhrase
in(QStringList list) (defined in FieldPhrase)FieldPhrase
isNull() (defined in FieldPhrase)FieldPhrase
like(QString pattern) (defined in FieldPhrase)FieldPhrase
operator!() (defined in FieldPhrase)FieldPhrase
operator!=(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator!=(const QVariant &other) (defined in WherePhrase)WherePhrase
operator&(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator&&(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator*(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator+(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator-(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator/(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator<(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator<(const QVariant &other) (defined in WherePhrase)WherePhrase
operator<=(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator<=(const QVariant &other) (defined in WherePhrase)WherePhrase
operator=(const QVariant &other) (defined in FieldPhrase)FieldPhrase
operator=(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator==(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator==(const QVariant &other) (defined in WherePhrase)WherePhrase
operator>(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator>(const QVariant &other) (defined in WherePhrase)WherePhrase
operator>=(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator>=(const QVariant &other) (defined in WherePhrase)WherePhrase
operator||(const WherePhrase &other) (defined in WherePhrase)WherePhrase
WherePhrase(const char *className, const char *s) (defined in WherePhrase)WherePhrase
WherePhrase(const WherePhrase &l) (defined in WherePhrase)WherePhrase
WherePhrase(WherePhrase *l) (defined in WherePhrase)WherePhrase
WherePhrase(WherePhrase *l, PhraseData::Condition o) (defined in WherePhrase)WherePhrase
WherePhrase(WherePhrase *l, PhraseData::Condition o, WherePhrase *r) (defined in WherePhrase)WherePhrase
WherePhrase(WherePhrase *l, PhraseData::Condition o, QVariant r) (defined in WherePhrase)WherePhrase
~WherePhrase() (defined in WherePhrase)WherePhrase
- - - - diff --git a/doc/html/class_field_phrase.html b/doc/html/class_field_phrase.html deleted file mode 100644 index 34460f4..0000000 --- a/doc/html/class_field_phrase.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - -Nut: FieldPhrase Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -List of all members
-
-
FieldPhrase Class Reference
-
-
-
-Inheritance diagram for FieldPhrase:
-
-
- - -WherePhrase - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

FieldPhrase (const char *className, const char *s)
-WherePhrase operator= (const QVariant &other)
-WherePhrase operator! ()
-WherePhrase isNull ()
-WherePhrase in (QVariantList list)
-WherePhrase in (QStringList list)
-WherePhrase like (QString pattern)
- Public Member Functions inherited from WherePhrase
WherePhrase (const char *className, const char *s)
WherePhrase (const WherePhrase &l)
WherePhrase (WherePhrase *l)
WherePhrase (WherePhrase *l, PhraseData::Condition o)
WherePhrase (WherePhrase *l, PhraseData::Condition o, WherePhrase *r)
WherePhrase (WherePhrase *l, PhraseData::Condition o, QVariant r)
-WherePhrase operator== (const WherePhrase &other)
-WherePhrase operator!= (const WherePhrase &other)
-WherePhrase operator< (const WherePhrase &other)
-WherePhrase operator> (const WherePhrase &other)
-WherePhrase operator<= (const WherePhrase &other)
-WherePhrase operator>= (const WherePhrase &other)
-WherePhrase operator= (const WherePhrase &other)
-WherePhrase operator+ (const WherePhrase &other)
-WherePhrase operator- (const WherePhrase &other)
-WherePhrase operator* (const WherePhrase &other)
-WherePhrase operator/ (const WherePhrase &other)
-WherePhrase operator&& (const WherePhrase &other)
-WherePhrase operator|| (const WherePhrase &other)
-WherePhrase operator& (const WherePhrase &other)
-WherePhrase operator== (const QVariant &other)
-WherePhrase operator!= (const QVariant &other)
-WherePhrase operator< (const QVariant &other)
-WherePhrase operator> (const QVariant &other)
-WherePhrase operator<= (const QVariant &other)
-WherePhrase operator>= (const QVariant &other)
-PhraseDatadata () const
- - - - -

-Additional Inherited Members

- Protected Attributes inherited from WherePhrase
-PhraseData_data
-QSharedPointer< PhraseData_dataPointer
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_field_phrase.png b/doc/html/class_field_phrase.png deleted file mode 100644 index b70309d..0000000 Binary files a/doc/html/class_field_phrase.png and /dev/null differ diff --git a/doc/html/class_field_phrase__coll__graph.dot b/doc/html/class_field_phrase__coll__graph.dot deleted file mode 100644 index ef5170e..0000000 --- a/doc/html/class_field_phrase__coll__graph.dot +++ /dev/null @@ -1,11 +0,0 @@ -digraph "FieldPhrase" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="FieldPhrase",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="WherePhrase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_where_phrase.html"]; - Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _data" ,fontname="Helvetica"]; - Node3 [label="PhraseData",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_phrase_data.html"]; - Node3 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" right\nleft" ,fontname="Helvetica"]; -} diff --git a/doc/html/class_field_phrase__coll__graph.md5 b/doc/html/class_field_phrase__coll__graph.md5 deleted file mode 100644 index b839634..0000000 --- a/doc/html/class_field_phrase__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -103b0aad8cc915f43947192bd3805964 \ No newline at end of file diff --git a/doc/html/class_field_phrase__inherit__graph.dot b/doc/html/class_field_phrase__inherit__graph.dot deleted file mode 100644 index 81f363a..0000000 --- a/doc/html/class_field_phrase__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "FieldPhrase" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="FieldPhrase",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="WherePhrase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_where_phrase.html"]; -} diff --git a/doc/html/class_field_phrase__inherit__graph.md5 b/doc/html/class_field_phrase__inherit__graph.md5 deleted file mode 100644 index 388ba91..0000000 --- a/doc/html/class_field_phrase__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -87684cbcf043d65b5350df79356e5068 \ No newline at end of file diff --git a/doc/html/class_my_sql_generator-members.html b/doc/html/class_my_sql_generator-members.html deleted file mode 100644 index 7caa644..0000000 --- a/doc/html/class_my_sql_generator-members.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
MySqlGenerator Member List
-
-
- -

This is the complete list of members for MySqlGenerator, including all inherited members.

- - - -
fieldType(FieldModel *field) (defined in MySqlGenerator)MySqlGenerator
MySqlGenerator(Database *parent=0) (defined in MySqlGenerator)MySqlGenerator
- - - - diff --git a/doc/html/class_my_sql_generator.html b/doc/html/class_my_sql_generator.html deleted file mode 100644 index 32e7f0b..0000000 --- a/doc/html/class_my_sql_generator.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - -Nut: MySqlGenerator Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -List of all members
-
-
MySqlGenerator Class Reference
-
-
- - - - -

-Public Member Functions

MySqlGenerator (Database *parent=0)
-QString fieldType (FieldModel *field)
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_my_sql_generator.png b/doc/html/class_my_sql_generator.png deleted file mode 100644 index 8be461e..0000000 Binary files a/doc/html/class_my_sql_generator.png and /dev/null differ diff --git a/doc/html/class_my_sql_generator__coll__graph.dot b/doc/html/class_my_sql_generator__coll__graph.dot deleted file mode 100644 index a7fc54f..0000000 --- a/doc/html/class_my_sql_generator__coll__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "MySqlGenerator" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="MySqlGenerator",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; -} diff --git a/doc/html/class_my_sql_generator__coll__graph.md5 b/doc/html/class_my_sql_generator__coll__graph.md5 deleted file mode 100644 index 3fd78db..0000000 --- a/doc/html/class_my_sql_generator__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -023ffb099946dfc3a779f5f02af55273 \ No newline at end of file diff --git a/doc/html/class_my_sql_generator__inherit__graph.dot b/doc/html/class_my_sql_generator__inherit__graph.dot deleted file mode 100644 index a7fc54f..0000000 --- a/doc/html/class_my_sql_generator__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "MySqlGenerator" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="MySqlGenerator",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; -} diff --git a/doc/html/class_my_sql_generator__inherit__graph.md5 b/doc/html/class_my_sql_generator__inherit__graph.md5 deleted file mode 100644 index 3fd78db..0000000 --- a/doc/html/class_my_sql_generator__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -023ffb099946dfc3a779f5f02af55273 \ No newline at end of file diff --git a/doc/html/class_phrase_data-members.html b/doc/html/class_phrase_data-members.html deleted file mode 100644 index 5e53e48..0000000 --- a/doc/html/class_phrase_data-members.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
PhraseData Member List
-
-
- -

This is the complete list of members for PhraseData, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Add enum value (defined in PhraseData)PhraseData
And enum value (defined in PhraseData)PhraseData
Append enum value (defined in PhraseData)PhraseData
Condition enum name (defined in PhraseData)PhraseData
Divide enum value (defined in PhraseData)PhraseData
Equal enum value (defined in PhraseData)PhraseData
Field enum value (defined in PhraseData)PhraseData
Greater enum value (defined in PhraseData)PhraseData
GreaterEqual enum value (defined in PhraseData)PhraseData
In enum value (defined in PhraseData)PhraseData
left (defined in PhraseData)PhraseData
Less enum value (defined in PhraseData)PhraseData
LessEqual enum value (defined in PhraseData)PhraseData
Like enum value (defined in PhraseData)PhraseData
Minus enum value (defined in PhraseData)PhraseData
Multiple enum value (defined in PhraseData)PhraseData
Not enum value (defined in PhraseData)PhraseData
NotAssign enum value (defined in PhraseData)PhraseData
NotEqual enum value (defined in PhraseData)PhraseData
NotIn enum value (defined in PhraseData)PhraseData
NotLike enum value (defined in PhraseData)PhraseData
NotNull enum value (defined in PhraseData)PhraseData
Null enum value (defined in PhraseData)PhraseData
operand (defined in PhraseData)PhraseData
operatorCond (defined in PhraseData)PhraseData
Or enum value (defined in PhraseData)PhraseData
PhraseData(const char *className, const char *s) (defined in PhraseData)PhraseData
PhraseData(PhraseData *l, Condition o) (defined in PhraseData)PhraseData
PhraseData(PhraseData *l, Condition o, const PhraseData *r) (defined in PhraseData)PhraseData
PhraseData(PhraseData *l, Condition o, QVariant r) (defined in PhraseData)PhraseData
right (defined in PhraseData)PhraseData
Set enum value (defined in PhraseData)PhraseData
text (defined in PhraseData)PhraseData
type (defined in PhraseData)PhraseData
Type enum name (defined in PhraseData)PhraseData
WithOther enum value (defined in PhraseData)PhraseData
WithoutOperand enum value (defined in PhraseData)PhraseData
WithVariant enum value (defined in PhraseData)PhraseData
~PhraseData() (defined in PhraseData)PhraseData
- - - - diff --git a/doc/html/class_phrase_data.html b/doc/html/class_phrase_data.html deleted file mode 100644 index fc5b12e..0000000 --- a/doc/html/class_phrase_data.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - -Nut: PhraseData Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Types | -Public Member Functions | -Public Attributes | -List of all members
-
-
PhraseData Class Reference
-
-
- - - - -

-Public Types

enum  Condition {
-  NotAssign = 0, -Equal, -Less, -LessEqual, -
-  Null, -In, -Like, -Not = 10, -
-  NotEqual, -GreaterEqual, -Greater, -NotNull, -
-  NotIn, -NotLike, -And = 20, -Or, -
-  Append, -Set, -Add, -Minus, -
-  Multiple, -Divide -
- }
enum  Type { Field, -WithVariant, -WithOther, -WithoutOperand - }
- - - - - -

-Public Member Functions

PhraseData (const char *className, const char *s)
PhraseData (PhraseData *l, Condition o)
PhraseData (PhraseData *l, Condition o, const PhraseData *r)
PhraseData (PhraseData *l, Condition o, QVariant r)
- - - - - - - -

-Public Attributes

-Type type
-Condition operatorCond
-QString text
-const PhraseDataleft
-const PhraseDataright
-QVariant operand
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_phrase_data__coll__graph.dot b/doc/html/class_phrase_data__coll__graph.dot deleted file mode 100644 index a3d5701..0000000 --- a/doc/html/class_phrase_data__coll__graph.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph "PhraseData" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="PhraseData",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node1 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" right\nleft" ,fontname="Helvetica"]; -} diff --git a/doc/html/class_phrase_data__coll__graph.md5 b/doc/html/class_phrase_data__coll__graph.md5 deleted file mode 100644 index 712393d..0000000 --- a/doc/html/class_phrase_data__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -51ab63e19ea2a4c75af258b7766c1d05 \ No newline at end of file diff --git a/doc/html/class_postgre_sql_generator-members.html b/doc/html/class_postgre_sql_generator-members.html deleted file mode 100644 index bf4734d..0000000 --- a/doc/html/class_postgre_sql_generator-members.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
PostgreSqlGenerator Member List
-
-
- -

This is the complete list of members for PostgreSqlGenerator, including all inherited members.

- - - - -
diff(FieldModel *oldField, FieldModel *newField) (defined in PostgreSqlGenerator)PostgreSqlGenerator
fieldType(FieldModel *field) (defined in PostgreSqlGenerator)PostgreSqlGenerator
PostgreSqlGenerator(Database *parent) (defined in PostgreSqlGenerator)PostgreSqlGenerator
- - - - diff --git a/doc/html/class_postgre_sql_generator.html b/doc/html/class_postgre_sql_generator.html deleted file mode 100644 index d80f7cf..0000000 --- a/doc/html/class_postgre_sql_generator.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - -Nut: PostgreSqlGenerator Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -List of all members
-
-
PostgreSqlGenerator Class Reference
-
-
- - - - - -

-Public Member Functions

PostgreSqlGenerator (Database *parent)
-QString fieldType (FieldModel *field)
-QString diff (FieldModel *oldField, FieldModel *newField)
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_postgre_sql_generator.png b/doc/html/class_postgre_sql_generator.png deleted file mode 100644 index 543a4cc..0000000 Binary files a/doc/html/class_postgre_sql_generator.png and /dev/null differ diff --git a/doc/html/class_postgre_sql_generator__coll__graph.dot b/doc/html/class_postgre_sql_generator__coll__graph.dot deleted file mode 100644 index 26f74b4..0000000 --- a/doc/html/class_postgre_sql_generator__coll__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "PostgreSqlGenerator" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="PostgreSqlGenerator",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; -} diff --git a/doc/html/class_postgre_sql_generator__coll__graph.md5 b/doc/html/class_postgre_sql_generator__coll__graph.md5 deleted file mode 100644 index 6fca22b..0000000 --- a/doc/html/class_postgre_sql_generator__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -c6b3185ef84ad7bb3cf2a81c2b2832b6 \ No newline at end of file diff --git a/doc/html/class_postgre_sql_generator__inherit__graph.dot b/doc/html/class_postgre_sql_generator__inherit__graph.dot deleted file mode 100644 index 26f74b4..0000000 --- a/doc/html/class_postgre_sql_generator__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "PostgreSqlGenerator" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="PostgreSqlGenerator",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; -} diff --git a/doc/html/class_postgre_sql_generator__inherit__graph.md5 b/doc/html/class_postgre_sql_generator__inherit__graph.md5 deleted file mode 100644 index 6fca22b..0000000 --- a/doc/html/class_postgre_sql_generator__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -c6b3185ef84ad7bb3cf2a81c2b2832b6 \ No newline at end of file diff --git a/doc/html/class_query-members.html b/doc/html/class_query-members.html deleted file mode 100644 index 21e969d..0000000 --- a/doc/html/class_query-members.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
Query< T > Member List
-
-
- -

This is the complete list of members for Query< T >, including all inherited members.

- - - - - - - - - - - - - - - -
average(FieldPhrase &f) (defined in Query< T >)Query< T >
count() (defined in Query< T >)Query< T >
first() (defined in Query< T >)Query< T >
join(const QString &tableName) (defined in Query< T >)Query< T >
join(Table *c) (defined in Query< T >)Query< T >
max(FieldPhrase &f) (defined in Query< T >)Query< T >
min(FieldPhrase &f) (defined in Query< T >)Query< T >
orderBy(QString fieldName, QString type) (defined in Query< T >)Query< T >
orderBy(WherePhrase phrase)Query< T >
Query(Database *database, TableSetBase *tableSet) (defined in Query< T >)Query< T >
remove() (defined in Query< T >)Query< T >
setWhere(WherePhrase where)Query< T >
toList(int count=-1)Query< T >
~Query() (defined in Query< T >)Query< T >
- - - - diff --git a/doc/html/class_query.html b/doc/html/class_query.html deleted file mode 100644 index 8fe2163..0000000 --- a/doc/html/class_query.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - -Nut: Query< T > Class Template Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -List of all members
-
-
Query< T > Class Template Reference
-
-
- -

This class hold a query. - More...

- - - - - - - - - - - - - - - - -

-Public Member Functions

Query (Database *database, TableSetBase *tableSet)
QList< T * > toList (int count=-1)
-int remove ()
-T * first ()
-int count ()
-QVariant max (FieldPhrase &f)
-QVariant min (FieldPhrase &f)
-QVariant average (FieldPhrase &f)
-Query< T > * join (const QString &tableName)
Query< T > * setWhere (WherePhrase where)
 Where phrase is a phrase using table's static field methods.
-Query< T > * join (Table *c)
-Query< T > * orderBy (QString fieldName, QString type)
Query< T > * orderBy (WherePhrase phrase)
-

Detailed Description

-

template<class T>
-class Query< T >

- -

This class hold a query.

-

A query can be used for getting database rows, editing or deleting without row fetching. A query can be used for getting data from database.

-
auto q = db.posts()->createQuery();
-
q->join(Post::commentsTable());
-
q->orderBy(!Post::saveDateField() & Post::bodyField());
-
q->setWhere(Post::idField() > 5);
-
-
auto posts = q->toList();
-

In below code posts is a QList<Post> that contain rows from database from this query:

-
SELECT * FROM post WHERE post.id>5 ORDER BY post.saveDate DESC, post.body
-

Member Function Documentation

- -
-
-
-template<class T >
- - - - - - - - -
Q_OUTOFLINE_TEMPLATE Query< T > * Query< T >::orderBy (WherePhrase phrase)
-
-
Parameters
- - -
phraseOrder phrase
-
-
-
Returns
This function return class itself orderBy set a new order for this query. Order can be a hrase like that:
query->orderBy(Post::idField());
-
If you need more than one order field seprate them by & operator, example:
query->orderBy(Post::idField() & Post::bodyField());
-
Order can be also DESC, for that put exclamation mark near field
query->orderBy(!Post::idField & Post::bodyField());
-
- -
-
- -
-
-
-template<class T >
- - - - - - - - -
Q_OUTOFLINE_TEMPLATE Query< T > * Query< T >::setWhere (WherePhrase where)
-
- -

Where phrase is a phrase using table's static field methods.

-
q->setWhere(Post::idField() == 4 || Post::titleField().isNull());
-

In sql this is like below code:

-
... WHERE post.id=4 OR post.title IS NULL
-
Parameters
- - -
whereWhere phrase
-
-
-
Returns
This function return class itself
- -
-
- -
-
-
-template<class T >
- - - - - - - - -
Q_OUTOFLINE_TEMPLATE QList< T * > Query< T >::toList (int count = -1)
-
-
Parameters
- - -
countTotal rows must be returned
-
-
-
Returns
This function return class itself This function return rows
- -
-
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_query.png b/doc/html/class_query.png deleted file mode 100644 index 5d08006..0000000 Binary files a/doc/html/class_query.png and /dev/null differ diff --git a/doc/html/class_query__coll__graph.dot b/doc/html/class_query__coll__graph.dot deleted file mode 100644 index 78d39cf..0000000 --- a/doc/html/class_query__coll__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "Query< T >" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="Query\< T \>",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="QueryBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_query_base.html"]; -} diff --git a/doc/html/class_query__coll__graph.md5 b/doc/html/class_query__coll__graph.md5 deleted file mode 100644 index 477486e..0000000 --- a/doc/html/class_query__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -547c306758686aa02e5e961a8060cf85 \ No newline at end of file diff --git a/doc/html/class_query__inherit__graph.dot b/doc/html/class_query__inherit__graph.dot deleted file mode 100644 index 78d39cf..0000000 --- a/doc/html/class_query__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "Query< T >" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="Query\< T \>",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="QueryBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_query_base.html"]; -} diff --git a/doc/html/class_query__inherit__graph.md5 b/doc/html/class_query__inherit__graph.md5 deleted file mode 100644 index 477486e..0000000 --- a/doc/html/class_query__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -547c306758686aa02e5e961a8060cf85 \ No newline at end of file diff --git a/doc/html/class_query_base-members.html b/doc/html/class_query_base-members.html deleted file mode 100644 index 3a75f94..0000000 --- a/doc/html/class_query_base-members.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - -Nut: Member List - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-
QueryBase Member List
-
-
- -

This is the complete list of members for QueryBase, including all inherited members.

- - -
QueryBase(QObject *parent=0) (defined in QueryBase)QueryBaseexplicit
- - - - diff --git a/doc/html/class_query_base.html b/doc/html/class_query_base.html deleted file mode 100644 index e894d0d..0000000 --- a/doc/html/class_query_base.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - -Nut: QueryBase Class Reference - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-Public Member Functions | -List of all members
-
-
QueryBase Class Reference
-
-
-
-Inheritance diagram for QueryBase:
-
-
- - -Query< T > - -
- - - -

-Public Member Functions

QueryBase (QObject *parent=0)
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_query_base.png b/doc/html/class_query_base.png deleted file mode 100644 index 7622f37..0000000 Binary files a/doc/html/class_query_base.png and /dev/null differ diff --git a/doc/html/class_query_base__inherit__graph.dot b/doc/html/class_query_base__inherit__graph.dot deleted file mode 100644 index e03320d..0000000 --- a/doc/html/class_query_base__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "QueryBase" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="QueryBase",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="Query\< T \>",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_query.html",tooltip="This class hold a query."]; -} diff --git a/doc/html/class_query_base__inherit__graph.md5 b/doc/html/class_query_base__inherit__graph.md5 deleted file mode 100644 index b2c3f58..0000000 --- a/doc/html/class_query_base__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -60beaff9fc8b9df9e32a7857286bb1d1 \ No newline at end of file diff --git a/doc/html/class_query_private-members.html b/doc/html/class_query_private-members.html deleted file mode 100644 index 011d2c9..0000000 --- a/doc/html/class_query_private-members.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - -Nut: Member List - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-
QueryPrivate Member List
-
-
- -

This is the complete list of members for QueryPrivate, including all inherited members.

- - - - - - - - - - -
database (defined in QueryPrivate)QueryPrivate
joinClassName (defined in QueryPrivate)QueryPrivate
orderPhrases (defined in QueryPrivate)QueryPrivate
orders (defined in QueryPrivate)QueryPrivate
QueryPrivate(QueryBase *parent)QueryPrivate
select (defined in QueryPrivate)QueryPrivate
tableName (defined in QueryPrivate)QueryPrivate
tableSet (defined in QueryPrivate)QueryPrivate
wheres (defined in QueryPrivate)QueryPrivate
- - - - diff --git a/doc/html/class_query_private.html b/doc/html/class_query_private.html deleted file mode 100644 index 7945552..0000000 --- a/doc/html/class_query_private.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - -Nut: QueryPrivate Class Reference - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-Public Member Functions | -Public Attributes | -List of all members
-
-
QueryPrivate Class Reference
-
-
- - - - -

-Public Member Functions

 QueryPrivate (QueryBase *parent)
 
-
- - - - - - - - - -

-Public Attributes

-QString tableName
-QString select
-Databasedatabase
-TableSetBasetableSet
-QString joinClassName
-QList< WherePhrasewheres
-QHash< QString, QString > orders
-QList< WherePhraseorderPhrases
-

Constructor & Destructor Documentation

- -
-
- - - - - - - - -
QT_BEGIN_NAMESPACE QueryPrivate::QueryPrivate (QueryBaseparent)
-
- -


-

-

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/.

- -
-
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_query_private__coll__graph.dot b/doc/html/class_query_private__coll__graph.dot deleted file mode 100644 index 3354695..0000000 --- a/doc/html/class_query_private__coll__graph.dot +++ /dev/null @@ -1,13 +0,0 @@ -digraph "QueryPrivate" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="QueryPrivate",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" database" ,fontname="Helvetica"]; - Node2 [label="Database",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_database.html",tooltip="Database class."]; - Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" tableSet" ,fontname="Helvetica"]; - Node3 [label="TableSetBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_set_base.html"]; - Node4 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _table" ,fontname="Helvetica"]; - Node4 [label="Table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table.html"]; - Node2 -> Node3 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _database" ,fontname="Helvetica"]; -} diff --git a/doc/html/class_query_private__coll__graph.md5 b/doc/html/class_query_private__coll__graph.md5 deleted file mode 100644 index 191c2ee..0000000 --- a/doc/html/class_query_private__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -60f83570a399e28206ec50e1e049a435 \ No newline at end of file diff --git a/doc/html/class_sql_generator_base-members.html b/doc/html/class_sql_generator_base-members.html deleted file mode 100644 index bd42605..0000000 --- a/doc/html/class_sql_generator_base-members.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - -Nut: Member List - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-
SqlGeneratorBase Member List
-
-
- -

This is the complete list of members for SqlGeneratorBase, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AgregateType enum name (defined in SqlGeneratorBase)SqlGeneratorBase
Average enum value (defined in SqlGeneratorBase)SqlGeneratorBase
CommandType enum name (defined in SqlGeneratorBase)SqlGeneratorBase
Count enum value (defined in SqlGeneratorBase)SqlGeneratorBase
Delete enum value (defined in SqlGeneratorBase)SqlGeneratorBase
deleteCommand(QList< WherePhrase > &wheres, QString tableName) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
deleteRecord(Table *t, QString tableName) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
deleteRecords(QString tableName, QString where) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
diff(DatabaseModel lastModel, DatabaseModel newModel) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
diff(FieldModel *oldField, FieldModel *newField) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
diff(TableModel *oldTable, TableModel *newTable) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
escapeValue(const QVariant &v) const (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
fieldDeclare(FieldModel *field) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
fieldType(FieldModel *field)=0 (defined in SqlGeneratorBase)SqlGeneratorBasepure virtual
Insert enum value (defined in SqlGeneratorBase)SqlGeneratorBase
insertRecord(Table *t, QString tableName) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
masterDatabaseName(QString databaseName) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
Max enum value (defined in SqlGeneratorBase)SqlGeneratorBase
Min enum value (defined in SqlGeneratorBase)SqlGeneratorBase
operatorString(const PhraseData::Condition &cond) const (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
phrase(const PhraseData *d) const (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
saveRecord(Table *t, QString tableName) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
Select enum value (defined in SqlGeneratorBase)SqlGeneratorBase
SelectALl enum value (defined in SqlGeneratorBase)SqlGeneratorBase
selectCommand(AgregateType t, QString agregateArg, QList< WherePhrase > &wheres, QList< WherePhrase > &orders, QString tableName, QString joinClassName) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
selectCommand(QList< WherePhrase > &wheres, QHash< QString, QString > &orders, QString tableName, QString joinClassName) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
selectCommand(QString selectPhrase, QList< WherePhrase > &wheres, QHash< QString, QString > &orders, QString tableName, QString joinClassName) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
SqlGeneratorBase(Database *parent) (defined in SqlGeneratorBase)SqlGeneratorBase
Update enum value (defined in SqlGeneratorBase)SqlGeneratorBase
updateRecord(Table *t, QString tableName) (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
~SqlGeneratorBase() (defined in SqlGeneratorBase)SqlGeneratorBasevirtual
- - - - diff --git a/doc/html/class_sql_generator_base.html b/doc/html/class_sql_generator_base.html deleted file mode 100644 index f241b52..0000000 --- a/doc/html/class_sql_generator_base.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - -Nut: SqlGeneratorBase Class Reference - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-Public Types | -Public Member Functions | -List of all members
-
-
SqlGeneratorBase Class Reference
-
-
-
-Inheritance diagram for SqlGeneratorBase:
-
-
- - -MySqlGenerator -PostgreSqlGenerator -SqliteGenerator -SqlServerGenerator - -
- - - - -

-Public Types

enum  CommandType { Select, -Insert, -Update, -Delete - }
enum  AgregateType {
-  SelectALl, -Count, -Min, -Max, -
-  Average -
- }
- - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

SqlGeneratorBase (Database *parent)
-virtual QString masterDatabaseName (QString databaseName)
-virtual QString fieldType (FieldModel *field)=0
-virtual QString fieldDeclare (FieldModel *field)
-virtual QStringList diff (DatabaseModel lastModel, DatabaseModel newModel)
-virtual QString diff (FieldModel *oldField, FieldModel *newField)
-virtual QString diff (TableModel *oldTable, TableModel *newTable)
-virtual QString saveRecord (Table *t, QString tableName)
-virtual QString insertRecord (Table *t, QString tableName)
-virtual QString updateRecord (Table *t, QString tableName)
-virtual QString deleteRecord (Table *t, QString tableName)
-virtual QString deleteRecords (QString tableName, QString where)
-virtual QString selectCommand (AgregateType t, QString agregateArg, QList< WherePhrase > &wheres, QList< WherePhrase > &orders, QString tableName, QString joinClassName)
-virtual QString selectCommand (QList< WherePhrase > &wheres, QHash< QString, QString > &orders, QString tableName, QString joinClassName)
-virtual QString selectCommand (QString selectPhrase, QList< WherePhrase > &wheres, QHash< QString, QString > &orders, QString tableName, QString joinClassName)
-virtual QString deleteCommand (QList< WherePhrase > &wheres, QString tableName)
-virtual QString escapeValue (const QVariant &v) const
-virtual QString phrase (const PhraseData *d) const
-virtual QString operatorString (const PhraseData::Condition &cond) const
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_sql_generator_base.png b/doc/html/class_sql_generator_base.png deleted file mode 100644 index 7982eaa..0000000 Binary files a/doc/html/class_sql_generator_base.png and /dev/null differ diff --git a/doc/html/class_sql_generator_base__inherit__graph.dot b/doc/html/class_sql_generator_base__inherit__graph.dot deleted file mode 100644 index f9c50d3..0000000 --- a/doc/html/class_sql_generator_base__inherit__graph.dot +++ /dev/null @@ -1,14 +0,0 @@ -digraph "SqlGeneratorBase" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="MySqlGenerator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_my_sql_generator.html"]; - Node1 -> Node3 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node3 [label="PostgreSqlGenerator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_postgre_sql_generator.html"]; - Node1 -> Node4 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node4 [label="SqliteGenerator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sqlite_generator.html"]; - Node1 -> Node5 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node5 [label="SqlServerGenerator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_server_generator.html"]; -} diff --git a/doc/html/class_sql_generator_base__inherit__graph.md5 b/doc/html/class_sql_generator_base__inherit__graph.md5 deleted file mode 100644 index 52e844a..0000000 --- a/doc/html/class_sql_generator_base__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -ea9d48b9acc84881c74f50d8a6f0671e \ No newline at end of file diff --git a/doc/html/class_sql_server_generator-members.html b/doc/html/class_sql_server_generator-members.html deleted file mode 100644 index f9c7c84..0000000 --- a/doc/html/class_sql_server_generator-members.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
SqlServerGenerator Member List
-
-
- -

This is the complete list of members for SqlServerGenerator, including all inherited members.

- - - - - - -
diff(FieldModel *oldField, FieldModel *newField) (defined in SqlServerGenerator)SqlServerGenerator
escapeValue(const QVariant &v) const (defined in SqlServerGenerator)SqlServerGenerator
fieldType(FieldModel *field) (defined in SqlServerGenerator)SqlServerGenerator
masterDatabaseName(QString databaseName) (defined in SqlServerGenerator)SqlServerGenerator
SqlServerGenerator(Database *parent=0) (defined in SqlServerGenerator)SqlServerGenerator
- - - - diff --git a/doc/html/class_sql_server_generator.html b/doc/html/class_sql_server_generator.html deleted file mode 100644 index ff67967..0000000 --- a/doc/html/class_sql_server_generator.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - -Nut: SqlServerGenerator Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -List of all members
-
-
SqlServerGenerator Class Reference
-
-
- - - - - - - -

-Public Member Functions

SqlServerGenerator (Database *parent=0)
-QString masterDatabaseName (QString databaseName)
-QString fieldType (FieldModel *field)
-QString diff (FieldModel *oldField, FieldModel *newField)
-QString escapeValue (const QVariant &v) const
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_sql_server_generator.png b/doc/html/class_sql_server_generator.png deleted file mode 100644 index 1645b69..0000000 Binary files a/doc/html/class_sql_server_generator.png and /dev/null differ diff --git a/doc/html/class_sql_server_generator__coll__graph.dot b/doc/html/class_sql_server_generator__coll__graph.dot deleted file mode 100644 index 19f0792..0000000 --- a/doc/html/class_sql_server_generator__coll__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "SqlServerGenerator" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="SqlServerGenerator",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; -} diff --git a/doc/html/class_sql_server_generator__coll__graph.md5 b/doc/html/class_sql_server_generator__coll__graph.md5 deleted file mode 100644 index 6d35e14..0000000 --- a/doc/html/class_sql_server_generator__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -6acaf3703929fe49ea862deaca14b8c1 \ No newline at end of file diff --git a/doc/html/class_sql_server_generator__inherit__graph.dot b/doc/html/class_sql_server_generator__inherit__graph.dot deleted file mode 100644 index 19f0792..0000000 --- a/doc/html/class_sql_server_generator__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "SqlServerGenerator" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="SqlServerGenerator",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; -} diff --git a/doc/html/class_sql_server_generator__inherit__graph.md5 b/doc/html/class_sql_server_generator__inherit__graph.md5 deleted file mode 100644 index 6d35e14..0000000 --- a/doc/html/class_sql_server_generator__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -6acaf3703929fe49ea862deaca14b8c1 \ No newline at end of file diff --git a/doc/html/class_sqlite_generator-members.html b/doc/html/class_sqlite_generator-members.html deleted file mode 100644 index 0d437f0..0000000 --- a/doc/html/class_sqlite_generator-members.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
SqliteGenerator Member List
-
-
- -

This is the complete list of members for SqliteGenerator, including all inherited members.

- - - -
fieldType(FieldModel *field) (defined in SqliteGenerator)SqliteGenerator
SqliteGenerator(Database *parent=0) (defined in SqliteGenerator)SqliteGenerator
- - - - diff --git a/doc/html/class_sqlite_generator.html b/doc/html/class_sqlite_generator.html deleted file mode 100644 index 03f0a00..0000000 --- a/doc/html/class_sqlite_generator.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - -Nut: SqliteGenerator Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -List of all members
-
-
SqliteGenerator Class Reference
-
-
- - - - -

-Public Member Functions

SqliteGenerator (Database *parent=0)
-QString fieldType (FieldModel *field)
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_sqlite_generator.png b/doc/html/class_sqlite_generator.png deleted file mode 100644 index 27c38fd..0000000 Binary files a/doc/html/class_sqlite_generator.png and /dev/null differ diff --git a/doc/html/class_sqlite_generator__coll__graph.dot b/doc/html/class_sqlite_generator__coll__graph.dot deleted file mode 100644 index 4b007b0..0000000 --- a/doc/html/class_sqlite_generator__coll__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "SqliteGenerator" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="SqliteGenerator",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; -} diff --git a/doc/html/class_sqlite_generator__coll__graph.md5 b/doc/html/class_sqlite_generator__coll__graph.md5 deleted file mode 100644 index 463b4b5..0000000 --- a/doc/html/class_sqlite_generator__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -ebb557040f1fe0a7998308b6c508cbbc \ No newline at end of file diff --git a/doc/html/class_sqlite_generator__inherit__graph.dot b/doc/html/class_sqlite_generator__inherit__graph.dot deleted file mode 100644 index 4b007b0..0000000 --- a/doc/html/class_sqlite_generator__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "SqliteGenerator" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="SqliteGenerator",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; -} diff --git a/doc/html/class_sqlite_generator__inherit__graph.md5 b/doc/html/class_sqlite_generator__inherit__graph.md5 deleted file mode 100644 index 463b4b5..0000000 --- a/doc/html/class_sqlite_generator__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -ebb557040f1fe0a7998308b6c508cbbc \ No newline at end of file diff --git a/doc/html/class_table-members.html b/doc/html/class_table-members.html deleted file mode 100644 index 8003ef3..0000000 --- a/doc/html/class_table-members.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
Table Member List
-
-
- -

This is the complete list of members for Table, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - -
add(TableSetBase *) (defined in Table)Table
Added enum value (defined in Table)Table
changedProperties() const (defined in Table)Table
Deleted enum value (defined in Table)Table
FeatchedFromDB enum value (defined in Table)Table
isPrimaryKeyAutoIncrement() const (defined in Table)Table
Modified enum value (defined in Table)Table
NewCreated enum value (defined in Table)Table
primaryKey() const (defined in Table)Table
primaryValue() const (defined in Table)Table
propertyChanged(QString propName) (defined in Table)Tableprotected
Query (defined in Table)Tablefriend
save(Database *db) (defined in Table)Table
setParentTable(Table *master) (defined in Table)Table
setStatus(const Status &status) (defined in Table)Table
setTableSet(TableSetBase *tableSet) (defined in Table)Table
status() const (defined in Table)Table
Status enum name (defined in Table)Table
Table(QObject *tableSet=0) (defined in Table)Tableexplicit
tableSet() const (defined in Table)Table
- - - - diff --git a/doc/html/class_table.html b/doc/html/class_table.html deleted file mode 100644 index 658c228..0000000 --- a/doc/html/class_table.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - -Nut: Table Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Types | -Public Member Functions | -Protected Member Functions | -Friends | -List of all members
-
-
Table Class Reference
-
-
-
-Inheritance diagram for Table:
-
-
- - -ChangeLogTable - -
- - - -

-Public Types

enum  Status {
-  NewCreated, -FeatchedFromDB, -Added, -Modified, -
-  Deleted -
- }
- - - - - - - - - - - - - -

-Public Member Functions

Table (QObject *tableSet=0)
-void add (TableSetBase *)
-void save (Database *db)
-QString primaryKey () const
-bool isPrimaryKeyAutoIncrement () const
-QVariant primaryValue () const
-Status status () const
-void setStatus (const Status &status)
-TableSetBase * tableSet () const
-void setTableSet (TableSetBase *tableSet)
-QSet< QString > changedProperties () const
-bool setParentTable (Table *master)
- - -

-Protected Member Functions

-void propertyChanged (QString propName)
- - -

-Friends

-class Query
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_table.png b/doc/html/class_table.png deleted file mode 100644 index ca9f764..0000000 Binary files a/doc/html/class_table.png and /dev/null differ diff --git a/doc/html/class_table__inherit__graph.dot b/doc/html/class_table__inherit__graph.dot deleted file mode 100644 index c245cf6..0000000 --- a/doc/html/class_table__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "Table" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="Table",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="ChangeLogTable",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_change_log_table.html"]; -} diff --git a/doc/html/class_table__inherit__graph.md5 b/doc/html/class_table__inherit__graph.md5 deleted file mode 100644 index a4ad1ae..0000000 --- a/doc/html/class_table__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -9dea5dc195855e66af5a7e705fd500de \ No newline at end of file diff --git a/doc/html/class_table_model-members.html b/doc/html/class_table_model-members.html deleted file mode 100644 index d462177..0000000 --- a/doc/html/class_table_model-members.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
TableModel Member List
-
-
- -

This is the complete list of members for TableModel, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - -
className() const (defined in TableModel)TableModel
field(QString name) const (defined in TableModel)TableModel
fields() const (defined in TableModel)TableModel
fieldsNames() const (defined in TableModel)TableModel
findByClassName(QString className) (defined in TableModel)TableModelstatic
findByName(QString name) (defined in TableModel)TableModelstatic
findByTypeId(int typeId) (defined in TableModel)TableModelstatic
foregionKey(QString otherTable) const (defined in TableModel)TableModel
foregionKeys() const (defined in TableModel)TableModel
model(QString className) (defined in TableModel)TableModelstatic
name() const (defined in TableModel)TableModel
operator!=(const TableModel &t) const (defined in TableModel)TableModel
operator==(const TableModel &t) const (defined in TableModel)TableModel
primaryKey() const (defined in TableModel)TableModel
setClassName(const QString &className) (defined in TableModel)TableModel
setName(const QString &name) (defined in TableModel)TableModel
setTypeId(const int &typeId) (defined in TableModel)TableModel
TableModel(int typeId, QString tableName) (defined in TableModel)TableModel
TableModel(QJsonObject json, QString tableName) (defined in TableModel)TableModel
toJson() const (defined in TableModel)TableModel
toString() const (defined in TableModel)TableModel
typeId() const (defined in TableModel)TableModel
- - - - diff --git a/doc/html/class_table_model.html b/doc/html/class_table_model.html deleted file mode 100644 index 0c4509b..0000000 --- a/doc/html/class_table_model.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Nut: TableModel Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -Static Public Member Functions | -List of all members
-
-
TableModel Class Reference
-
-
- - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

TableModel (int typeId, QString tableName)
TableModel (QJsonObject json, QString tableName)
-QJsonObject toJson () const
-FieldModelfield (QString name) const
-RelationModelforegionKey (QString otherTable) const
-QString toString () const
-QString primaryKey () const
-QString name () const
-void setName (const QString &name)
-QString className () const
-void setClassName (const QString &className)
-int typeId () const
-void setTypeId (const int &typeId)
-QList< FieldModel * > fields () const
-QList< RelationModel * > foregionKeys () const
-QStringList fieldsNames () const
-bool operator== (const TableModel &t) const
-bool operator!= (const TableModel &t) const
- - - - - -

-Static Public Member Functions

-static TableModelmodel (QString className)
-static TableModelfindByTypeId (int typeId)
-static TableModelfindByName (QString name)
-static TableModelfindByClassName (QString className)
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_table_set-members.html b/doc/html/class_table_set-members.html deleted file mode 100644 index 5f5e953..0000000 --- a/doc/html/class_table_set-members.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
TableSet< T > Member List
-
-
- -

This is the complete list of members for TableSet< T >, including all inherited members.

- - - - - - - - - - - - -
append(T *t) (defined in TableSet< T >)TableSet< T >
append(QList< T * > t) (defined in TableSet< T >)TableSet< T >
at(int i) const (defined in TableSet< T >)TableSet< T >
createQuery() (defined in TableSet< T >)TableSet< T >
length() const (defined in TableSet< T >)TableSet< T >
operator[](int i) const (defined in TableSet< T >)TableSet< T >
remove(T *t) (defined in TableSet< T >)TableSet< T >
remove(QList< T * > t) (defined in TableSet< T >)TableSet< T >
TableSet(Database *parent) (defined in TableSet< T >)TableSet< T >
TableSet(Table *parent) (defined in TableSet< T >)TableSet< T >
type() const (defined in TableSet< T >)TableSet< T >
- - - - diff --git a/doc/html/class_table_set.html b/doc/html/class_table_set.html deleted file mode 100644 index f712144..0000000 --- a/doc/html/class_table_set.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - -Nut: TableSet< T > Class Template Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -List of all members
-
-
TableSet< T > Class Template Reference
-
-
- - - - - - - - - - - - - -

-Public Member Functions

TableSet (Database *parent)
TableSet (Table *parent)
-void append (T *t)
-void append (QList< T * > t)
-void remove (T *t)
-void remove (QList< T * > t)
-T type () const
-int length () const
-T * at (int i) const
-const T & operator[] (int i) const
-Query< T > * createQuery ()
-
The documentation for this class was generated from the following file: -
- - - - diff --git a/doc/html/class_table_set.png b/doc/html/class_table_set.png deleted file mode 100644 index a52c727..0000000 Binary files a/doc/html/class_table_set.png and /dev/null differ diff --git a/doc/html/class_table_set__coll__graph.dot b/doc/html/class_table_set__coll__graph.dot deleted file mode 100644 index fa42d31..0000000 --- a/doc/html/class_table_set__coll__graph.dot +++ /dev/null @@ -1,12 +0,0 @@ -digraph "TableSet< T >" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="TableSet\< T \>",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="TableSetBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_set_base.html"]; - Node3 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _table" ,fontname="Helvetica"]; - Node3 [label="Table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table.html"]; - Node4 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _database" ,fontname="Helvetica"]; - Node4 [label="Database",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_database.html",tooltip="Database class."]; -} diff --git a/doc/html/class_table_set__coll__graph.md5 b/doc/html/class_table_set__coll__graph.md5 deleted file mode 100644 index 5633186..0000000 --- a/doc/html/class_table_set__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -90264495d23d131df80ff722d3f65da4 \ No newline at end of file diff --git a/doc/html/class_table_set__inherit__graph.dot b/doc/html/class_table_set__inherit__graph.dot deleted file mode 100644 index aabd13a..0000000 --- a/doc/html/class_table_set__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "TableSet< T >" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="TableSet\< T \>",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="TableSetBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_set_base.html"]; -} diff --git a/doc/html/class_table_set__inherit__graph.md5 b/doc/html/class_table_set__inherit__graph.md5 deleted file mode 100644 index 2491ae5..0000000 --- a/doc/html/class_table_set__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -f21d19525cb44d8b50ee7d327a2f06ea \ No newline at end of file diff --git a/doc/html/class_table_set_base-members.html b/doc/html/class_table_set_base-members.html deleted file mode 100644 index 446ca14..0000000 --- a/doc/html/class_table_set_base-members.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - -Nut: Member List - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-
TableSetBase Member List
-
-
- -

This is the complete list of members for TableSetBase, including all inherited members.

- - - - - - - - - - - - - - - -
_childClassName (defined in TableSetBase)TableSetBaseprotected
_database (defined in TableSetBase)TableSetBaseprotected
_table (defined in TableSetBase)TableSetBaseprotected
_tableName (defined in TableSetBase)TableSetBaseprotected
_tables (defined in TableSetBase)TableSetBaseprotected
_tablesList (defined in TableSetBase)TableSetBaseprotected
add(Table *t) (defined in TableSetBase)TableSetBase
childClassName() const (defined in TableSetBase)TableSetBase
clearChilds() (defined in TableSetBase)TableSetBase
database() const (defined in TableSetBase)TableSetBase
save(Database *db) (defined in TableSetBase)TableSetBasevirtual
setDatabase(Database *database) (defined in TableSetBase)TableSetBase
TableSetBase(Database *parent) (defined in TableSetBase)TableSetBase
TableSetBase(Table *parent) (defined in TableSetBase)TableSetBase
- - - - diff --git a/doc/html/class_table_set_base.html b/doc/html/class_table_set_base.html deleted file mode 100644 index 849c974..0000000 --- a/doc/html/class_table_set_base.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - -Nut: TableSetBase Class Reference - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- -
-
-
-Public Member Functions | -Protected Attributes | -List of all members
-
-
TableSetBase Class Reference
-
-
-
-Inheritance diagram for TableSetBase:
-
-
- - -TableSet< T > - -
- - - - - - - - - - -

-Public Member Functions

TableSetBase (Database *parent)
TableSetBase (Table *parent)
-virtual void save (Database *db)
-void clearChilds ()
-void add (Table *t)
-QString childClassName () const
-Databasedatabase () const
-void setDatabase (Database *database)
- - - - - - - -

-Protected Attributes

-QSet< Table * > _tables
-QList< Table * > _tablesList
-QString _tableName
-Database_database
-Table_table
-QString _childClassName
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_table_set_base.png b/doc/html/class_table_set_base.png deleted file mode 100644 index 363fb34..0000000 Binary files a/doc/html/class_table_set_base.png and /dev/null differ diff --git a/doc/html/class_table_set_base__coll__graph.dot b/doc/html/class_table_set_base__coll__graph.dot deleted file mode 100644 index bed16e2..0000000 --- a/doc/html/class_table_set_base__coll__graph.dot +++ /dev/null @@ -1,10 +0,0 @@ -digraph "TableSetBase" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="TableSetBase",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _table" ,fontname="Helvetica"]; - Node2 [label="Table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table.html"]; - Node3 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _database" ,fontname="Helvetica"]; - Node3 [label="Database",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_database.html",tooltip="Database class."]; -} diff --git a/doc/html/class_table_set_base__coll__graph.md5 b/doc/html/class_table_set_base__coll__graph.md5 deleted file mode 100644 index 076fc07..0000000 --- a/doc/html/class_table_set_base__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -84029e71d91ab60f169ee476e2c01af7 \ No newline at end of file diff --git a/doc/html/class_table_set_base__inherit__graph.dot b/doc/html/class_table_set_base__inherit__graph.dot deleted file mode 100644 index 25e8f4c..0000000 --- a/doc/html/class_table_set_base__inherit__graph.dot +++ /dev/null @@ -1,10 +0,0 @@ -digraph "TableSetBase" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="TableSetBase",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="TableSet\< T \>",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_set.html"]; - Node1 -> Node3 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node3 [label="TableSet\< ChangeLogTable \>",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_set.html"]; -} diff --git a/doc/html/class_table_set_base__inherit__graph.md5 b/doc/html/class_table_set_base__inherit__graph.md5 deleted file mode 100644 index 600fa5f..0000000 --- a/doc/html/class_table_set_base__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -92dcbf78b057869573baa6087debe2ad \ No newline at end of file diff --git a/doc/html/class_where_phrase-members.html b/doc/html/class_where_phrase-members.html deleted file mode 100644 index 4364cb6..0000000 --- a/doc/html/class_where_phrase-members.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
WherePhrase Member List
-
-
- -

This is the complete list of members for WherePhrase, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_data (defined in WherePhrase)WherePhraseprotected
_dataPointer (defined in WherePhrase)WherePhraseprotected
data() const (defined in WherePhrase)WherePhrase
operator!=(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator!=(const QVariant &other) (defined in WherePhrase)WherePhrase
operator&(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator&&(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator*(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator+(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator-(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator/(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator<(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator<(const QVariant &other) (defined in WherePhrase)WherePhrase
operator<=(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator<=(const QVariant &other) (defined in WherePhrase)WherePhrase
operator=(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator==(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator==(const QVariant &other) (defined in WherePhrase)WherePhrase
operator>(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator>(const QVariant &other) (defined in WherePhrase)WherePhrase
operator>=(const WherePhrase &other) (defined in WherePhrase)WherePhrase
operator>=(const QVariant &other) (defined in WherePhrase)WherePhrase
operator||(const WherePhrase &other) (defined in WherePhrase)WherePhrase
WherePhrase(const char *className, const char *s) (defined in WherePhrase)WherePhrase
WherePhrase(const WherePhrase &l) (defined in WherePhrase)WherePhrase
WherePhrase(WherePhrase *l) (defined in WherePhrase)WherePhrase
WherePhrase(WherePhrase *l, PhraseData::Condition o) (defined in WherePhrase)WherePhrase
WherePhrase(WherePhrase *l, PhraseData::Condition o, WherePhrase *r) (defined in WherePhrase)WherePhrase
WherePhrase(WherePhrase *l, PhraseData::Condition o, QVariant r) (defined in WherePhrase)WherePhrase
~WherePhrase() (defined in WherePhrase)WherePhrase
- - - - diff --git a/doc/html/class_where_phrase.html b/doc/html/class_where_phrase.html deleted file mode 100644 index 8600024..0000000 --- a/doc/html/class_where_phrase.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - -Nut: WherePhrase Class Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-Public Member Functions | -Protected Attributes | -List of all members
-
-
WherePhrase Class Reference
-
-
-
-Inheritance diagram for WherePhrase:
-
-
- - -FieldPhrase - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

WherePhrase (const char *className, const char *s)
WherePhrase (const WherePhrase &l)
WherePhrase (WherePhrase *l)
WherePhrase (WherePhrase *l, PhraseData::Condition o)
WherePhrase (WherePhrase *l, PhraseData::Condition o, WherePhrase *r)
WherePhrase (WherePhrase *l, PhraseData::Condition o, QVariant r)
-WherePhrase operator== (const WherePhrase &other)
-WherePhrase operator!= (const WherePhrase &other)
-WherePhrase operator< (const WherePhrase &other)
-WherePhrase operator> (const WherePhrase &other)
-WherePhrase operator<= (const WherePhrase &other)
-WherePhrase operator>= (const WherePhrase &other)
-WherePhrase operator= (const WherePhrase &other)
-WherePhrase operator+ (const WherePhrase &other)
-WherePhrase operator- (const WherePhrase &other)
-WherePhrase operator* (const WherePhrase &other)
-WherePhrase operator/ (const WherePhrase &other)
-WherePhrase operator&& (const WherePhrase &other)
-WherePhrase operator|| (const WherePhrase &other)
-WherePhrase operator& (const WherePhrase &other)
-WherePhrase operator== (const QVariant &other)
-WherePhrase operator!= (const QVariant &other)
-WherePhrase operator< (const QVariant &other)
-WherePhrase operator> (const QVariant &other)
-WherePhrase operator<= (const QVariant &other)
-WherePhrase operator>= (const QVariant &other)
-PhraseDatadata () const
- - - -

-Protected Attributes

-PhraseData_data
-QSharedPointer< PhraseData_dataPointer
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/doc/html/class_where_phrase.png b/doc/html/class_where_phrase.png deleted file mode 100644 index ce29941..0000000 Binary files a/doc/html/class_where_phrase.png and /dev/null differ diff --git a/doc/html/class_where_phrase__coll__graph.dot b/doc/html/class_where_phrase__coll__graph.dot deleted file mode 100644 index 6dcee08..0000000 --- a/doc/html/class_where_phrase__coll__graph.dot +++ /dev/null @@ -1,9 +0,0 @@ -digraph "WherePhrase" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="WherePhrase",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" _data" ,fontname="Helvetica"]; - Node2 [label="PhraseData",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_phrase_data.html"]; - Node2 -> Node2 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" right\nleft" ,fontname="Helvetica"]; -} diff --git a/doc/html/class_where_phrase__coll__graph.md5 b/doc/html/class_where_phrase__coll__graph.md5 deleted file mode 100644 index b71752f..0000000 --- a/doc/html/class_where_phrase__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -d0d928bba89abe7480bf303b70fd3f5f \ No newline at end of file diff --git a/doc/html/class_where_phrase__inherit__graph.dot b/doc/html/class_where_phrase__inherit__graph.dot deleted file mode 100644 index 89d9809..0000000 --- a/doc/html/class_where_phrase__inherit__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "WherePhrase" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="WherePhrase",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="FieldPhrase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_field_phrase.html"]; -} diff --git a/doc/html/class_where_phrase__inherit__graph.md5 b/doc/html/class_where_phrase__inherit__graph.md5 deleted file mode 100644 index 738e125..0000000 --- a/doc/html/class_where_phrase__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -8f3496018ead8706b4f6c07c575a5d83 \ No newline at end of file diff --git a/doc/html/classes.html b/doc/html/classes.html deleted file mode 100644 index dff4f90..0000000 --- a/doc/html/classes.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - -Nut: Class Index - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
Class Index
-
-
-
C | D | F | M | P | Q | R | S | T | W
- - - - - - - - - - - - -
  C  
-
FieldPhrase   
  Q  
-
SqlServerGenerator   
  M  
-
  T  
-
ChangeLogTable   Query   
  D  
-
MySqlGenerator   
  R  
-
Table   
  P  
-
TableModel   
Database   RelationModel   TableSet   
DatabaseModel   PhraseData   
  S  
-
  W  
-
  F  
-
PostgreSqlGenerator   
SqliteGenerator   WherePhrase   
FieldModel   
-
C | D | F | M | P | Q | R | S | T | W
-
- - - - diff --git a/doc/html/closed.png b/doc/html/closed.png deleted file mode 100644 index 98cc2c9..0000000 Binary files a/doc/html/closed.png and /dev/null differ diff --git a/doc/html/database_8h_source.html b/doc/html/database_8h_source.html deleted file mode 100644 index 22aa65d..0000000 --- a/doc/html/database_8h_source.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - -Nut: src/database.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
database.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef DATABASE_H
-
22 #define DATABASE_H
-
23 
-
24 #include <QtCore/qglobal.h>
-
25 #include <QtCore/QList>
-
26 #include <QtSql/QSqlDatabase>
-
27 
-
28 #include "defines.h"
-
29 #include "tableset.h"
-
30 
-
31 QT_BEGIN_NAMESPACE
-
32 
-
33 class DatabaseModel;
-
34 class DatabasePrivate;
-
35 class TableSetBase;
-
36 class SqlGeneratorBase;
-
37 class NUT_EXPORT Database : public QObject
-
38 {
-
39  Q_OBJECT
-
40 
-
41  DatabasePrivate *d_ptr;
-
42  Q_DECLARE_PRIVATE(Database)
-
43 
-
44 public:
-
45  Database(QObject *parent = 0);
-
46 
-
47  bool open();
-
48  void close();
-
49 
-
50  QSqlQuery exec(QString sql);
-
51 
-
52  void add(TableSetBase *);
-
53  void saveChanges();
-
54  void cleanUp();
-
55 
-
56  QString databaseName() const;
-
57  QString hostName() const;
-
58  int port() const;
-
59  QString userName() const;
-
60  QString password() const;
-
61  QString connectionName() const;
-
62  QString driver() const;
-
63 
-
64  DatabaseModel model() const;
-
65  QString tableName(QString className);
-
66 
-
67  SqlGeneratorBase *sqlGenertor() const;
-
68 
-
69 protected:
-
70  virtual void databaseUpdated(int oldMajor, int oldMinor, int newMajor, int newMinor);
-
71 
-
72 public slots:
-
73  void setDatabaseName(QString databaseName);
-
74  void setHostName(QString hostName);
-
75  void setPort(int port);
-
76  void setUserName(QString userName);
-
77  void setPassword(QString password);
-
78  void setConnectionName(QString connectionName);
-
79  void setDriver(QString driver);
-
80 
-
81 private:
-
82  QSet<TableSetBase*> tableSets;
-
83 };
-
84 
-
85 QT_END_NAMESPACE
-
86 
-
87 #endif // DATABASE_H
-
- - - - diff --git a/doc/html/database__p_8h_source.html b/doc/html/database__p_8h_source.html deleted file mode 100644 index 35e082a..0000000 --- a/doc/html/database__p_8h_source.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - -Nut: src/database_p.h Source File - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- - -
-
-
-
database_p.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef DATABASE_P_H
-
22 #define DATABASE_P_H
-
23 
-
24 #include "database.h"
-
25 #include "databasemodel.h"
-
26 #include "changelogtable.h"
-
27 
-
28 #include <QDebug>
-
29 
-
30 QT_BEGIN_NAMESPACE
-
31 
- -
33 {
-
34  Database *q_ptr;
-
35  Q_DECLARE_PUBLIC(Database)
-
36 
-
37 public:
-
38  DatabasePrivate(Database *parent);
-
39 
-
40 
-
41  bool open();
-
42 
-
43  bool updateDatabase();
-
44  void createChangeLogs();
-
45  bool storeScheemaInDB();
-
46  DatabaseModel getLastScheema();
-
47  QVariantMap getCurrectScheema();
-
48 
-
49  QSqlDatabase db;
-
50 
-
51  QString hostName;
-
52  QString databaseName;
-
53  int port;
-
54  QString userName;
-
55  QString password;
-
56  QString connectionName;
-
57  QString driver;
-
58 
-
59  QHash<QString, QString> tables;
-
60 
-
61  SqlGeneratorBase *sqlGenertor;
-
62  DatabaseModel currentModel;
-
63 
-
64  TableSet<ChangeLogTable> *changeLogs;
-
65 };
-
66 
-
67 QT_END_NAMESPACE
-
68 
-
69 #endif // DATABASE_P_H
-
- - - - diff --git a/doc/html/databasemodel_8h_source.html b/doc/html/databasemodel_8h_source.html deleted file mode 100644 index 55e4619..0000000 --- a/doc/html/databasemodel_8h_source.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - -Nut: src/databasemodel.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
databasemodel.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef DATABASEMODEL_H
-
22 #define DATABASEMODEL_H
-
23 
-
24 #include <QtCore/QList>
-
25 
-
26 QT_BEGIN_NAMESPACE
-
27 
-
28 class TableModel;
-
29 struct RelationModel;
-
30 class QJsonObject;
-
31 class DatabaseModel : public QList<TableModel*>
-
32 {
-
33  int _versionMajor, _versionMinor;
-
34 public:
-
35  DatabaseModel();
-
36 
-
37  TableModel *model(QString tableName) const;
-
38  TableModel *modelByClass(QString className) const;
-
39 
-
40  RelationModel *relationByClassNames(QString masterClassName, QString childClassName);
-
41  RelationModel *relationByTableNames(QString masterTableName, QString childTableName);
-
42 
-
43  bool operator ==(const DatabaseModel &other) const;
-
44 
-
45  static DatabaseModel fromJson(QJsonObject &json);
-
46  QJsonObject toJson() const;
-
47 
-
48  int versionMajor() const;
-
49  void setVersionMajor(int versionMajor);
-
50 
-
51  int versionMinor() const;
-
52  void setVersionMinor(int versionMinor);
-
53 };
-
54 
-
55 QT_END_NAMESPACE
-
56 
-
57 #endif // DATABASEMODEL_H
-
- - - - diff --git a/doc/html/defines_8h_source.html b/doc/html/defines_8h_source.html deleted file mode 100644 index 556e254..0000000 --- a/doc/html/defines_8h_source.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - -Nut: src/defines.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
defines.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef SYNTAX_DEFINES_H
-
22 #define SYNTAX_DEFINES_H
-
23 
-
24 #include "qglobal.h"
-
25 #include "defines_p.h"
-
26 
-
27 #define QT_NAMESPACE Nut
-
28 
-
29 #ifdef NUT_COMPILE_STATIC
-
30 # define NUT_EXPORT
-
31 #else
-
32 # define NUT_EXPORT Q_DECL_EXPORT
-
33 #endif
-
34 
-
35 // Database
-
36 #define NUT_DB_VERSION(major, minor) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX __nut_DB_VERSION), QT_STRINGIFY(#major "." #minor))
-
37 
-
38 #define NUT_DECLARE_TABLE(type, name) \
-
39  Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX __nut_TABLE " " #type), #name) \
-
40  Q_PROPERTY(type* name READ name) \
-
41  Q_PROPERTY(TableSet<type> name##s READ name##s) \
-
42  type* m_##name; \
-
43  TableSet<type> *m_##name##s; \
-
44 public: \
-
45  static const type _##name; \
-
46  type* name() const{ return m_##name; } \
-
47  TableSet<type> *name##s() const { return m_##name##s; }
-
48 
-
49 //Table
-
50 #define NUT_DECLARE_FIELD(type, name, read, write) \
-
51  Q_PROPERTY(type name READ read WRITE write) \
-
52  Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #name " " __nut_FIELD), #name) \
-
53  type m_##name; \
-
54 public: \
-
55  static FieldPhrase name##Field(){ \
-
56  static FieldPhrase f = FieldPhrase(staticMetaObject.className(), #name); \
-
57  return f; \
-
58  } \
-
59  type read() const{ \
-
60  return m_##name; \
-
61  } \
-
62  void write(type name){ \
-
63  m_##name = name; \
-
64  propertyChanged(#name); \
-
65  }
-
66 
-
67 #define NUT_FOREGION_KEY(type, keytype, name, read, write) \
-
68  Q_PROPERTY(type* name READ read WRITE write) \
-
69  NUT_DECLARE_FIELD(keytype, name##Id, read##Id, write##Id) \
-
70  Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #name "Id " __nut_FOREGION_KEY), #type) \
-
71  type *m_##name; \
-
72 public: \
-
73  type *read() const { return m_##name ; } \
-
74  void write(type *name){ \
-
75  m_##name = name; \
-
76  }
-
77 
-
78 #define NUT_DECLARE_CHILD_TABLE(type, n) \
-
79  private: \
-
80  TableSet<type> *m_##n; \
-
81  public: \
-
82  static type *n##Table(){ \
-
83  static type *f = new type(); \
-
84  return f; \
-
85  } \
-
86  TableSet<type> *n(){ \
-
87  return m_##n; \
-
88  }
-
89 
-
90 
-
91 #define NUT_INDEX(name, field, order)
-
92 #define NUT_PRIMARY_KEY(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_PRIMARY_KEY), #x)
-
93 #define NUT_AUTO_INCREMENT(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_AUTO_INCREMENT), #x)
-
94 #define NUT_PRIMARY_AUTO_INCREMENT(x) NUT_PRIMARY_KEY(x) \
-
95  NUT_AUTO_INCREMENT(x)
-
96 #define NUT_UNIQUE(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_UNIQUE), #x)
-
97 #define NUT_LEN(x, n) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_LEN), #n)
-
98 #define NUT_DEFAULT_VALUE(x, n) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_DEFAULT_VALUE), #n)
-
99 #define NUT_NOT_NULL(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_NOT_NULL), "1")
-
100 
-
101 #ifndef NUT_NO_KEYWORDS
-
102 # define FROM(x) /*QScopedPointer<QueryBase*>*/(x->createQuery())
-
103 # define WHERE(x) ->setWhere(x)
-
104 # define JOIN(x) ->join(#x)
-
105 # define ORDERBY(x) ->orderBy(#x, "ASC");
-
106 # define ORDERBY_DESC(x) ->orderBy(#x, "DESC");
-
107 
-
108 # define SELECT() ->toList()
-
109 # define COUNT() ->count()
-
110 # define DELETE() ->remove()
-
111 # define FIRST() ->first()
-
112 #endif // NUT_NO_KEYWORDS
-
113 
-
114 
-
115 
-
116 #endif // SYNTAX_DEFINES_H
-
- - - - diff --git a/doc/html/defines__p_8h_source.html b/doc/html/defines__p_8h_source.html deleted file mode 100644 index 7de61c5..0000000 --- a/doc/html/defines__p_8h_source.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - -Nut: src/defines_p.h Source File - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - -
- All Classes Functions
- - -
- -
- - -
-
-
-
defines_p.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef DEFINES_P_H
-
22 #define DEFINES_P_H
-
23 
-
24 #define __NAME "name"
-
25 #define __TYPE "type"
-
26 #define __FIELDS "fields"
-
27 #define __nut_FIELD "field"
-
28 
-
29 #define __nut_DB_VERSION "database_version"
-
30 #define __nut_NAME_PERFIX "nut_db_key::"
-
31 #define __nut_PRIMARY_KEY "primary_key"
-
32 #define __nut_AUTO_INCREMENT "auto_increment"
-
33 #define __nut_UNIQUE "unique"
-
34 #define __nut_TABLE "table"
-
35 #define __nut_TABLE_NAME "table_name"
-
36 
-
37 #define __nut_LEN "len"
-
38 #define __nut_DEFAULT_VALUE "def"
-
39 #define __nut_NOT_NULL "notnull"
-
40 
-
41 #define __nut_FOREGION_KEY "foregion_key"
-
42 #define __nut_NEW "new"
-
43 #define __nut_REMOVE "remove"
-
44 #define __nut_CHANGE "change"
-
45 
-
46 #endif // DEFINES_P_H
-
- - - - diff --git a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html deleted file mode 100644 index 1bef402..0000000 --- a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - -Nut: src/ Directory Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
src Directory Reference
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Files

file  changelogtable.cpp
file  changelogtable.h [code]
file  database.cpp
file  database.h [code]
file  databasemodel.cpp
file  databasemodel.h [code]
file  defines.h [code]
file  mysqlgenerator.cpp
file  mysqlgenerator.h [code]
file  postgresqlgenerator.cpp
file  postgresqlgenerator.h [code]
file  query.cpp
file  query.h [code]
file  querybase.cpp
file  sqlgeneratorbase.cpp
file  sqlitegenerator.cpp
file  sqlitegenerator.h [code]
file  sqlservergenerator.cpp
file  sqlservergenerator.h [code]
file  table.cpp
file  table.h [code]
file  tablemodel.cpp
file  tablemodel.h [code]
file  tableset.cpp
file  tableset.h [code]
file  tablesetbase.cpp
file  wherephrase.cpp
file  wherephrase.h [code]
-
- - - - diff --git a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.dot b/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.dot deleted file mode 100644 index 771c667..0000000 --- a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.dot +++ /dev/null @@ -1,6 +0,0 @@ -digraph "src/" { - compound=true - node [ fontsize="10", fontname="Helvetica"]; - edge [ labelfontsize="10", labelfontname="Helvetica"]; - dir_68267d1309a1af8e8297ef4c3efbcdba [shape=box, label="src", style="filled", fillcolor="#eeeeff", pencolor="black", URL="dir_68267d1309a1af8e8297ef4c3efbcdba.html"]; -} diff --git a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 b/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 deleted file mode 100644 index 232647c..0000000 --- a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 +++ /dev/null @@ -1 +0,0 @@ -d20f30a36274e113bcc267fb4ea2e5c7 \ No newline at end of file diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css deleted file mode 100644 index 0c559a0..0000000 --- a/doc/html/doxygen.css +++ /dev/null @@ -1,1163 +0,0 @@ -/* The standard CSS for doxygen */ - -body, table, div, p, dl { - font: 400 14px/19px Roboto,sans-serif; -} - -/* @group Heading Levels */ - -h1 { - font-size: 150%; -} - -.title { - font-size: 150%; - font-weight: bold; - margin: 10px 2px; -} - -h2 { - border-bottom: 1px solid #879ECB; - color: #354C7B; - font-size: 150%; - font-weight: normal; - margin-top: 1.75em; - padding-top: 8px; - padding-bottom: 4px; - width: 100%; -} - -h3 { - font-size: 100%; -} - -h1, h2, h3, h4, h5, h6 { - -webkit-transition: text-shadow 0.5s linear; - -moz-transition: text-shadow 0.5s linear; - -ms-transition: text-shadow 0.5s linear; - -o-transition: text-shadow 0.5s linear; - transition: text-shadow 0.5s linear; - margin-right: 15px; -} - -h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { - text-shadow: 0 0 15px cyan; -} - -dt { - font-weight: bold; -} - -div.multicol { - -moz-column-gap: 1em; - -webkit-column-gap: 1em; - -moz-column-count: 3; - -webkit-column-count: 3; -} - -p.startli, p.startdd, p.starttd { - margin-top: 2px; -} - -p.endli { - margin-bottom: 0px; -} - -p.enddd { - margin-bottom: 4px; -} - -p.endtd { - margin-bottom: 2px; -} - -/* @end */ - -caption { - font-weight: bold; -} - -span.legend { - font-size: 70%; - text-align: center; -} - -h3.version { - font-size: 90%; - text-align: center; -} - -div.qindex, div.navtab{ - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; -} - -div.qindex, div.navpath { - width: 100%; - line-height: 140%; -} - -div.navtab { - margin-right: 15px; -} - -/* @group Link Styling */ - -a { - color: #3D578C; - font-weight: normal; - text-decoration: none; -} - -.contents a:visited { - color: #4665A2; -} - -a:hover { - text-decoration: underline; -} - -a.qindex { - font-weight: bold; -} - -a.qindexHL { - font-weight: bold; - background-color: #9CAFD4; - color: #ffffff; - border: 1px double #869DCA; -} - -.contents a.qindexHL:visited { - color: #ffffff; -} - -a.el { - font-weight: bold; -} - -a.elRef { -} - -a.code, a.code:visited { - color: #4665A2; -} - -a.codeRef, a.codeRef:visited { - color: #4665A2; -} - -/* @end */ - -dl.el { - margin-left: -1cm; -} - -pre.fragment { - border: 1px solid #C4CFE5; - background-color: #FBFCFD; - padding: 4px 6px; - margin: 4px 8px 4px 2px; - overflow: auto; - word-wrap: break-word; - font-size: 9pt; - line-height: 125%; - font-family: monospace, fixed; - font-size: 105%; -} - -div.fragment { - padding: 4px; - margin: 4px; - background-color: #FBFCFD; - border: 1px solid #C4CFE5; -} - -div.line { - font-family: monospace, fixed; - font-size: 13px; - min-height: 13px; - line-height: 1.0; - text-wrap: unrestricted; - white-space: -moz-pre-wrap; /* Moz */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - white-space: pre-wrap; /* CSS3 */ - word-wrap: break-word; /* IE 5.5+ */ - text-indent: -53px; - padding-left: 53px; - padding-bottom: 0px; - margin: 0px; - -webkit-transition-property: background-color, box-shadow; - -webkit-transition-duration: 0.5s; - -moz-transition-property: background-color, box-shadow; - -moz-transition-duration: 0.5s; - -ms-transition-property: background-color, box-shadow; - -ms-transition-duration: 0.5s; - -o-transition-property: background-color, box-shadow; - -o-transition-duration: 0.5s; - transition-property: background-color, box-shadow; - transition-duration: 0.5s; -} - -div.line.glow { - background-color: cyan; - box-shadow: 0 0 10px cyan; -} - - -span.lineno { - padding-right: 4px; - text-align: right; - border-right: 2px solid #0F0; - background-color: #E8E8E8; - white-space: pre; -} -span.lineno a { - background-color: #D8D8D8; -} - -span.lineno a:hover { - background-color: #C8C8C8; -} - -div.ah { - background-color: black; - font-weight: bold; - color: #ffffff; - margin-bottom: 3px; - margin-top: 3px; - padding: 0.2em; - border: solid thin #333; - border-radius: 0.5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - box-shadow: 2px 2px 3px #999; - -webkit-box-shadow: 2px 2px 3px #999; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); -} - -div.groupHeader { - margin-left: 16px; - margin-top: 12px; - font-weight: bold; -} - -div.groupText { - margin-left: 16px; - font-style: italic; -} - -body { - background-color: white; - color: black; - margin: 0; -} - -div.contents { - margin-top: 10px; - margin-left: 12px; - margin-right: 8px; -} - -td.indexkey { - background-color: #EBEFF6; - font-weight: bold; - border: 1px solid #C4CFE5; - margin: 2px 0px 2px 0; - padding: 2px 10px; - white-space: nowrap; - vertical-align: top; -} - -td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; - padding: 2px 10px; - margin: 2px 0px; -} - -tr.memlist { - background-color: #EEF1F7; -} - -p.formulaDsp { - text-align: center; -} - -img.formulaDsp { - -} - -img.formulaInl { - vertical-align: middle; -} - -div.center { - text-align: center; - margin-top: 0px; - margin-bottom: 0px; - padding: 0px; -} - -div.center img { - border: 0px; -} - -address.footer { - text-align: right; - padding-right: 12px; -} - -img.footer { - border: 0px; - vertical-align: middle; -} - -/* @group Code Colorization */ - -span.keyword { - color: #008000 -} - -span.keywordtype { - color: #604020 -} - -span.keywordflow { - color: #e08000 -} - -span.comment { - color: #800000 -} - -span.preprocessor { - color: #806020 -} - -span.stringliteral { - color: #002080 -} - -span.charliteral { - color: #008080 -} - -span.vhdldigit { - color: #ff00ff -} - -span.vhdlchar { - color: #000000 -} - -span.vhdlkeyword { - color: #700070 -} - -span.vhdllogic { - color: #ff0000 -} - -blockquote { - background-color: #F7F8FB; - border-left: 2px solid #9CAFD4; - margin: 0 24px 0 4px; - padding: 0 12px 0 16px; -} - -/* @end */ - -/* -.search { - color: #003399; - font-weight: bold; -} - -form.search { - margin-bottom: 0px; - margin-top: 0px; -} - -input.search { - font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -*/ - -td.tiny { - font-size: 75%; -} - -.dirtab { - padding: 4px; - border-collapse: collapse; - border: 1px solid #A3B4D7; -} - -th.dirtab { - background: #EBEFF6; - font-weight: bold; -} - -hr { - height: 0px; - border: none; - border-top: 1px solid #4A6AAA; -} - -hr.footer { - height: 1px; -} - -/* @group Member Descriptions */ - -table.memberdecls { - border-spacing: 0px; - padding: 0px; -} - -.memberdecls td, .fieldtable tr { - -webkit-transition-property: background-color, box-shadow; - -webkit-transition-duration: 0.5s; - -moz-transition-property: background-color, box-shadow; - -moz-transition-duration: 0.5s; - -ms-transition-property: background-color, box-shadow; - -ms-transition-duration: 0.5s; - -o-transition-property: background-color, box-shadow; - -o-transition-duration: 0.5s; - transition-property: background-color, box-shadow; - transition-duration: 0.5s; -} - -.memberdecls td.glow, .fieldtable tr.glow { - background-color: cyan; - box-shadow: 0 0 15px cyan; -} - -.mdescLeft, .mdescRight, -.memItemLeft, .memItemRight, -.memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; - border: none; - margin: 4px; - padding: 1px 0 0 8px; -} - -.mdescLeft, .mdescRight { - padding: 0px 8px 4px 8px; - color: #555; -} - -.memItemLeft, .memItemRight, .memTemplParams { - border-bottom: 1px solid #DEE4F0; -} - -.memItemLeft, .memTemplItemLeft { - white-space: nowrap; -} - -.memItemRight { - width: 100%; -} - -.memTemplParams { - color: #4665A2; - white-space: nowrap; -} - -/* @end */ - -/* @group Member Details */ - -/* Styles for detailed member documentation */ - -.memtemplate { - font-size: 80%; - color: #4665A2; - font-weight: normal; - margin-left: 9px; -} - -.memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} - -.mempage { - width: 100%; -} - -.memitem { - padding: 0; - margin-bottom: 10px; - margin-right: 5px; - -webkit-transition: box-shadow 0.5s linear; - -moz-transition: box-shadow 0.5s linear; - -ms-transition: box-shadow 0.5s linear; - -o-transition: box-shadow 0.5s linear; - transition: box-shadow 0.5s linear; - display: table !important; - width: 100%; -} - -.memitem.glow { - box-shadow: 0 0 15px cyan; -} - -.memname { - font-weight: bold; - margin-left: 6px; -} - -.memname td { - vertical-align: bottom; -} - -.memproto, dl.reflist dt { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 6px 0px 6px 0px; - color: #253555; - font-weight: bold; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; - /* opera specific markup */ - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - border-top-right-radius: 4px; - border-top-left-radius: 4px; - /* firefox specific markup */ - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - -moz-border-radius-topright: 4px; - -moz-border-radius-topleft: 4px; - /* webkit specific markup */ - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-border-top-right-radius: 4px; - -webkit-border-top-left-radius: 4px; - -} - -.memdoc, dl.reflist dd { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 6px 10px 2px 10px; - background-color: #FBFCFD; - border-top-width: 0; - background-image:url('nav_g.png'); - background-repeat:repeat-x; - background-color: #FFFFFF; - /* opera specific markup */ - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - /* firefox specific markup */ - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-bottomright: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - /* webkit specific markup */ - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -} - -dl.reflist dt { - padding: 5px; -} - -dl.reflist dd { - margin: 0px 0px 10px 0px; - padding: 5px; -} - -.paramkey { - text-align: right; -} - -.paramtype { - white-space: nowrap; -} - -.paramname { - color: #602020; - white-space: nowrap; -} -.paramname em { - font-style: normal; -} -.paramname code { - line-height: 14px; -} - -.params, .retval, .exception, .tparams { - margin-left: 0px; - padding-left: 0px; -} - -.params .paramname, .retval .paramname { - font-weight: bold; - vertical-align: top; -} - -.params .paramtype { - font-style: italic; - vertical-align: top; -} - -.params .paramdir { - font-family: "courier new",courier,monospace; - vertical-align: top; -} - -table.mlabels { - border-spacing: 0px; -} - -td.mlabels-left { - width: 100%; - padding: 0px; -} - -td.mlabels-right { - vertical-align: bottom; - padding: 0px; - white-space: nowrap; -} - -span.mlabels { - margin-left: 8px; -} - -span.mlabel { - background-color: #728DC1; - border-top:1px solid #5373B4; - border-left:1px solid #5373B4; - border-right:1px solid #C4CFE5; - border-bottom:1px solid #C4CFE5; - text-shadow: none; - color: white; - margin-right: 4px; - padding: 2px 3px; - border-radius: 3px; - font-size: 7pt; - white-space: nowrap; -} - - - -/* @end */ - -/* these are for tree view when not used as main index */ - -div.directory { - margin: 10px 0px; - border-top: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; - width: 100%; -} - -.directory table { - border-collapse:collapse; -} - -.directory td { - margin: 0px; - padding: 0px; - vertical-align: top; -} - -.directory td.entry { - white-space: nowrap; - padding-right: 6px; -} - -.directory td.entry a { - outline:none; -} - -.directory td.entry a img { - border: none; -} - -.directory td.desc { - width: 100%; - padding-left: 6px; - padding-right: 6px; - padding-top: 3px; - border-left: 1px solid rgba(0,0,0,0.05); -} - -.directory tr.even { - padding-left: 6px; - background-color: #F7F8FB; -} - -.directory img { - vertical-align: -30%; -} - -.directory .levels { - white-space: nowrap; - width: 100%; - text-align: right; - font-size: 9pt; -} - -.directory .levels span { - cursor: pointer; - padding-left: 2px; - padding-right: 2px; - color: #3D578C; -} - -div.dynheader { - margin-top: 8px; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -address { - font-style: normal; - color: #2A3D61; -} - -table.doxtable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.doxtable th { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -table.fieldtable { - width: 100%; - margin-bottom: 10px; - border: 1px solid #A8B8D9; - border-spacing: 0px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); - box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); -} - -.fieldtable td, .fieldtable th { - padding: 3px 7px 2px; -} - -.fieldtable td.fieldtype, .fieldtable td.fieldname { - white-space: nowrap; - border-right: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; - vertical-align: top; -} - -.fieldtable td.fielddoc { - border-bottom: 1px solid #A8B8D9; - width: 100%; -} - -.fieldtable tr:last-child td { - border-bottom: none; -} - -.fieldtable th { - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; - font-size: 90%; - color: #253555; - padding-bottom: 4px; - padding-top: 5px; - text-align:left; - -moz-border-radius-topleft: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom: 1px solid #A8B8D9; -} - - -.tabsearch { - top: 0px; - left: 10px; - height: 36px; - background-image: url('tab_b.png'); - z-index: 101; - overflow: hidden; - font-size: 13px; -} - -.navpath ul -{ - font-size: 11px; - background-image:url('tab_b.png'); - background-repeat:repeat-x; - height:30px; - line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; - overflow:hidden; - margin:0px; - padding:0px; -} - -.navpath li -{ - list-style-type:none; - float:left; - padding-left:10px; - padding-right:15px; - background-image:url('bc_s.png'); - background-repeat:no-repeat; - background-position:right; - color:#364D7C; -} - -.navpath li.navelem a -{ - height:32px; - display:block; - text-decoration: none; - outline: none; - font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; -} - -.navpath li.navelem a:hover -{ - color:#6884BD; -} - -.navpath li.footer -{ - list-style-type:none; - float:right; - padding-left:10px; - padding-right:15px; - background-image:none; - background-repeat:no-repeat; - background-position:right; - color:#364D7C; - font-size: 8pt; -} - - -div.summary -{ - float: right; - font-size: 8pt; - padding-right: 5px; - width: 50%; - text-align: right; -} - -div.summary a -{ - white-space: nowrap; -} - -div.ingroups -{ - font-size: 8pt; - width: 50%; - text-align: left; -} - -div.ingroups a -{ - white-space: nowrap; -} - -div.header -{ - background-image:url('nav_h.png'); - background-repeat:repeat-x; - background-color: #F9FAFC; - margin: 0px; - border-bottom: 1px solid #C4CFE5; -} - -div.headertitle -{ - padding: 5px 5px 5px 10px; -} - -dl -{ - padding: 0 0 0 10px; -} - -/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ -dl.section -{ - margin-left: 0px; - padding-left: 0px; -} - -dl.note -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #D0C000; -} - -dl.warning, dl.attention -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #FF0000; -} - -dl.pre, dl.post, dl.invariant -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #00D000; -} - -dl.deprecated -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #505050; -} - -dl.todo -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #00C0E0; -} - -dl.test -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #3030E0; -} - -dl.bug -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #C08050; -} - -dl.section dd { - margin-bottom: 6px; -} - - -#projectlogo -{ - text-align: center; - vertical-align: bottom; - border-collapse: separate; -} - -#projectlogo img -{ - border: 0px none; -} - -#projectname -{ - font: 300% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 2px 0px; -} - -#projectbrief -{ - font: 120% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#projectnumber -{ - font: 50% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#titlearea -{ - padding: 0px; - margin: 0px; - width: 100%; - border-bottom: 1px solid #5373B4; -} - -.image -{ - text-align: center; -} - -.dotgraph -{ - text-align: center; -} - -.mscgraph -{ - text-align: center; -} - -.caption -{ - font-weight: bold; -} - -div.zoom -{ - border: 1px solid #90A5CE; -} - -dl.citelist { - margin-bottom:50px; -} - -dl.citelist dt { - color:#334975; - float:left; - font-weight:bold; - margin-right:10px; - padding:5px; -} - -dl.citelist dd { - margin:2px 0; - padding:5px 0; -} - -div.toc { - padding: 14px 25px; - background-color: #F4F6FA; - border: 1px solid #D8DFEE; - border-radius: 7px 7px 7px 7px; - float: right; - height: auto; - margin: 0 20px 10px 10px; - width: 200px; -} - -div.toc li { - background: url("bdwn.png") no-repeat scroll 0 5px transparent; - font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; - margin-top: 5px; - padding-left: 10px; - padding-top: 2px; -} - -div.toc h3 { - font: bold 12px/1.2 Arial,FreeSans,sans-serif; - color: #4665A2; - border-bottom: 0 none; - margin: 0; -} - -div.toc ul { - list-style: none outside none; - border: medium none; - padding: 0px; -} - -div.toc li.level1 { - margin-left: 0px; -} - -div.toc li.level2 { - margin-left: 15px; -} - -div.toc li.level3 { - margin-left: 30px; -} - -div.toc li.level4 { - margin-left: 45px; -} - -.inherit_header { - font-weight: bold; - color: gray; - cursor: pointer; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.inherit_header td { - padding: 6px 0px 2px 5px; -} - -.inherit { - display: none; -} - -tr.heading h2 { - margin-top: 12px; - margin-bottom: 4px; -} - -@media print -{ - #top { display: none; } - #side-nav { display: none; } - #nav-path { display: none; } - body { overflow:visible; } - h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } - .summary { display: none; } - .memitem { page-break-inside: avoid; } - #doc-content - { - margin-left:0 !important; - height:auto !important; - width:auto !important; - overflow:inherit; - display:inline; - } -} - diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png deleted file mode 100644 index 3ff17d8..0000000 Binary files a/doc/html/doxygen.png and /dev/null differ diff --git a/doc/html/dynsections.js b/doc/html/dynsections.js deleted file mode 100644 index 116542f..0000000 --- a/doc/html/dynsections.js +++ /dev/null @@ -1,78 +0,0 @@ -function toggleVisibility(linkObj) -{ - var base = $(linkObj).attr('id'); - var summary = $('#'+base+'-summary'); - var content = $('#'+base+'-content'); - var trigger = $('#'+base+'-trigger'); - var src=$(trigger).attr('src'); - if (content.is(':visible')===true) { - content.hide(); - summary.show(); - $(linkObj).addClass('closed').removeClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); - } else { - content.show(); - summary.hide(); - $(linkObj).removeClass('closed').addClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); - } - return false; -} - -function updateStripes() -{ - $('table.directory tr'). - removeClass('even').filter(':visible:even').addClass('even'); -} -function toggleLevel(level) -{ - $('table.directory tr').each(function(){ - var l = this.id.split('_').length-1; - var i = $('#img'+this.id.substring(3)); - var a = $('#arr'+this.id.substring(3)); - if (l - - - - -Nut: File List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
File List
-
-
-
Here is a list of all documented files with brief descriptions:
-
[detail level 12]
- - - - - - - - - - - - - - -
\-src
 o*changelogtable.h
 o*database.h
 o*databasemodel.h
 o*defines.h
 o*mysqlgenerator.h
 o*postgresqlgenerator.h
 o*query.h
 o*sqlitegenerator.h
 o*sqlservergenerator.h
 o*table.h
 o*tablemodel.h
 o*tableset.h
 \*wherephrase.h
-
-
- - - - diff --git a/doc/html/ftv2blank.png b/doc/html/ftv2blank.png deleted file mode 100644 index 63c605b..0000000 Binary files a/doc/html/ftv2blank.png and /dev/null differ diff --git a/doc/html/ftv2cl.png b/doc/html/ftv2cl.png deleted file mode 100644 index 132f657..0000000 Binary files a/doc/html/ftv2cl.png and /dev/null differ diff --git a/doc/html/ftv2doc.png b/doc/html/ftv2doc.png deleted file mode 100644 index 17edabf..0000000 Binary files a/doc/html/ftv2doc.png and /dev/null differ diff --git a/doc/html/ftv2folderclosed.png b/doc/html/ftv2folderclosed.png deleted file mode 100644 index bb8ab35..0000000 Binary files a/doc/html/ftv2folderclosed.png and /dev/null differ diff --git a/doc/html/ftv2folderopen.png b/doc/html/ftv2folderopen.png deleted file mode 100644 index d6c7f67..0000000 Binary files a/doc/html/ftv2folderopen.png and /dev/null differ diff --git a/doc/html/ftv2lastnode.png b/doc/html/ftv2lastnode.png deleted file mode 100644 index 63c605b..0000000 Binary files a/doc/html/ftv2lastnode.png and /dev/null differ diff --git a/doc/html/ftv2link.png b/doc/html/ftv2link.png deleted file mode 100644 index 17edabf..0000000 Binary files a/doc/html/ftv2link.png and /dev/null differ diff --git a/doc/html/ftv2mlastnode.png b/doc/html/ftv2mlastnode.png deleted file mode 100644 index 0b63f6d..0000000 Binary files a/doc/html/ftv2mlastnode.png and /dev/null differ diff --git a/doc/html/ftv2mnode.png b/doc/html/ftv2mnode.png deleted file mode 100644 index 0b63f6d..0000000 Binary files a/doc/html/ftv2mnode.png and /dev/null differ diff --git a/doc/html/ftv2mo.png b/doc/html/ftv2mo.png deleted file mode 100644 index 4bfb80f..0000000 Binary files a/doc/html/ftv2mo.png and /dev/null differ diff --git a/doc/html/ftv2node.png b/doc/html/ftv2node.png deleted file mode 100644 index 63c605b..0000000 Binary files a/doc/html/ftv2node.png and /dev/null differ diff --git a/doc/html/ftv2ns.png b/doc/html/ftv2ns.png deleted file mode 100644 index 72e3d71..0000000 Binary files a/doc/html/ftv2ns.png and /dev/null differ diff --git a/doc/html/ftv2plastnode.png b/doc/html/ftv2plastnode.png deleted file mode 100644 index c6ee22f..0000000 Binary files a/doc/html/ftv2plastnode.png and /dev/null differ diff --git a/doc/html/ftv2pnode.png b/doc/html/ftv2pnode.png deleted file mode 100644 index c6ee22f..0000000 Binary files a/doc/html/ftv2pnode.png and /dev/null differ diff --git a/doc/html/ftv2splitbar.png b/doc/html/ftv2splitbar.png deleted file mode 100644 index fe895f2..0000000 Binary files a/doc/html/ftv2splitbar.png and /dev/null differ diff --git a/doc/html/ftv2vertline.png b/doc/html/ftv2vertline.png deleted file mode 100644 index 63c605b..0000000 Binary files a/doc/html/ftv2vertline.png and /dev/null differ diff --git a/doc/html/functions.html b/doc/html/functions.html deleted file mode 100644 index 4072e27..0000000 --- a/doc/html/functions.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - -Nut: Class Members - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
Here is a list of all documented class members with links to the class documentation for each member:
-
- - - - diff --git a/doc/html/functions_func.html b/doc/html/functions_func.html deleted file mode 100644 index 5823612..0000000 --- a/doc/html/functions_func.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - -Nut: Class Members - Functions - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
- - - - diff --git a/doc/html/graph_legend.dot b/doc/html/graph_legend.dot deleted file mode 100644 index 789df56..0000000 --- a/doc/html/graph_legend.dot +++ /dev/null @@ -1,22 +0,0 @@ -digraph "Graph Legend" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node9 [shape="box",label="Inherited",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",fillcolor="grey75",style="filled" fontcolor="black"]; - Node10 -> Node9 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node10 [shape="box",label="PublicBase",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classPublicBase.html"]; - Node11 -> Node10 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node11 [shape="box",label="Truncated",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="red",URL="$classTruncated.html"]; - Node13 -> Node9 [dir="back",color="darkgreen",fontsize="10",style="solid",fontname="Helvetica"]; - Node13 [shape="box",label="ProtectedBase",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classProtectedBase.html"]; - Node14 -> Node9 [dir="back",color="firebrick4",fontsize="10",style="solid",fontname="Helvetica"]; - Node14 [shape="box",label="PrivateBase",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classPrivateBase.html"]; - Node15 -> Node9 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node15 [shape="box",label="Undocumented",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="grey75"]; - Node16 -> Node9 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node16 [shape="box",label="Templ< int >",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classTempl.html"]; - Node17 -> Node16 [dir="back",color="orange",fontsize="10",style="dashed",label="< int >",fontname="Helvetica"]; - Node17 [shape="box",label="Templ< T >",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classTempl.html"]; - Node18 -> Node9 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label="m_usedClass",fontname="Helvetica"]; - Node18 [shape="box",label="Used",fontsize="10",height=0.2,width=0.4,fontname="Helvetica",color="black",URL="$classUsed.html"]; -} diff --git a/doc/html/graph_legend.html b/doc/html/graph_legend.html deleted file mode 100644 index 07f9403..0000000 --- a/doc/html/graph_legend.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - -Nut: Graph Legend - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
- -
- All Classes Functions
- - -
- -
- -
-
-
Graph Legend
-
-
-

This page explains how to interpret the graphs that are generated by doxygen.

-

Consider the following example:

-
/*! Invisible class because of truncation */
-
class Invisible { };
-
-
/*! Truncated class, inheritance relation is hidden */
-
class Truncated : public Invisible { };
-
-
/* Class not documented with doxygen comments */
-
class Undocumented { };
-
-
/*! Class that is inherited using public inheritance */
-
class PublicBase : public Truncated { };
-
-
/*! A template class */
-
template<class T> class Templ { };
-
-
/*! Class that is inherited using protected inheritance */
-
class ProtectedBase { };
-
-
/*! Class that is inherited using private inheritance */
-
class PrivateBase { };
-
-
/*! Class that is used by the Inherited class */
-
class Used { };
-
-
/*! Super class that inherits a number of other classes */
-
class Inherited : public PublicBase,
-
protected ProtectedBase,
-
private PrivateBase,
-
public Undocumented,
-
public Templ<int>
-
{
-
private:
-
Used *m_usedClass;
-
};
-

This will result in the following graph:

-
- -
-

The boxes in the above graph have the following meaning:

- -

The arrows have the following meaning:

- -
- - - - diff --git a/doc/html/graph_legend.md5 b/doc/html/graph_legend.md5 deleted file mode 100644 index a06ed05..0000000 --- a/doc/html/graph_legend.md5 +++ /dev/null @@ -1 +0,0 @@ -387ff8eb65306fa251338d3c9bd7bfff \ No newline at end of file diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html deleted file mode 100644 index 081bccf..0000000 --- a/doc/html/hierarchy.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - -Nut: Class Hierarchy - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
Class Hierarchy
-
-
-
This inheritance list is sorted roughly, but not completely, alphabetically:
-
- - - - diff --git a/doc/html/index.html b/doc/html/index.html deleted file mode 100644 index 73a1134..0000000 --- a/doc/html/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - -Nut: Main Page - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - -
-
-
-
Nut Documentation
-
-
-
- - - - diff --git a/doc/html/inherit_graph_0.dot b/doc/html/inherit_graph_0.dot deleted file mode 100644 index 5e9c6db..0000000 --- a/doc/html/inherit_graph_0.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="Database",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_database.html",tooltip="Database class."]; -} diff --git a/doc/html/inherit_graph_0.md5 b/doc/html/inherit_graph_0.md5 deleted file mode 100644 index 80ead58..0000000 --- a/doc/html/inherit_graph_0.md5 +++ /dev/null @@ -1 +0,0 @@ -5ca3f49b5b32e85c0cf481bda271619d \ No newline at end of file diff --git a/doc/html/inherit_graph_1.dot b/doc/html/inherit_graph_1.dot deleted file mode 100644 index 42d7b40..0000000 --- a/doc/html/inherit_graph_1.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="DatabaseModel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_database_model.html"]; -} diff --git a/doc/html/inherit_graph_1.md5 b/doc/html/inherit_graph_1.md5 deleted file mode 100644 index a8648b3..0000000 --- a/doc/html/inherit_graph_1.md5 +++ /dev/null @@ -1 +0,0 @@ -5ce739371874f79b4785274545c71802 \ No newline at end of file diff --git a/doc/html/inherit_graph_10.dot b/doc/html/inherit_graph_10.dot deleted file mode 100644 index 8d1ab5d..0000000 --- a/doc/html/inherit_graph_10.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="TableModel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_model.html"]; -} diff --git a/doc/html/inherit_graph_10.md5 b/doc/html/inherit_graph_10.md5 deleted file mode 100644 index 2938aed..0000000 --- a/doc/html/inherit_graph_10.md5 +++ /dev/null @@ -1 +0,0 @@ -f0709f891cea52872b983686df433105 \ No newline at end of file diff --git a/doc/html/inherit_graph_11.dot b/doc/html/inherit_graph_11.dot deleted file mode 100644 index 9da6f00..0000000 --- a/doc/html/inherit_graph_11.dot +++ /dev/null @@ -1,9 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="TableSetBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_set_base.html"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="TableSet\< T \>",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_set.html"]; -} diff --git a/doc/html/inherit_graph_11.md5 b/doc/html/inherit_graph_11.md5 deleted file mode 100644 index 1a760c9..0000000 --- a/doc/html/inherit_graph_11.md5 +++ /dev/null @@ -1 +0,0 @@ -c9b8d540c0064524d169feefd072881c \ No newline at end of file diff --git a/doc/html/inherit_graph_12.dot b/doc/html/inherit_graph_12.dot deleted file mode 100644 index 1eb190c..0000000 --- a/doc/html/inherit_graph_12.dot +++ /dev/null @@ -1,9 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="WherePhrase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_where_phrase.html"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="FieldPhrase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_field_phrase.html"]; -} diff --git a/doc/html/inherit_graph_12.md5 b/doc/html/inherit_graph_12.md5 deleted file mode 100644 index 90bbdcf..0000000 --- a/doc/html/inherit_graph_12.md5 +++ /dev/null @@ -1 +0,0 @@ -36302c611c26de05ff36821856fa0842 \ No newline at end of file diff --git a/doc/html/inherit_graph_2.dot b/doc/html/inherit_graph_2.dot deleted file mode 100644 index e4c758e..0000000 --- a/doc/html/inherit_graph_2.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="DatabasePrivate",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_database_private.html"]; -} diff --git a/doc/html/inherit_graph_2.md5 b/doc/html/inherit_graph_2.md5 deleted file mode 100644 index e7be255..0000000 --- a/doc/html/inherit_graph_2.md5 +++ /dev/null @@ -1 +0,0 @@ -4072b3e6cfca64cd2c20fe3ea6df2925 \ No newline at end of file diff --git a/doc/html/inherit_graph_3.dot b/doc/html/inherit_graph_3.dot deleted file mode 100644 index e546bd3..0000000 --- a/doc/html/inherit_graph_3.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="FieldModel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$struct_field_model.html"]; -} diff --git a/doc/html/inherit_graph_3.md5 b/doc/html/inherit_graph_3.md5 deleted file mode 100644 index 7e0b4de..0000000 --- a/doc/html/inherit_graph_3.md5 +++ /dev/null @@ -1 +0,0 @@ -8bef0e923a16f064eeb6c736da96e974 \ No newline at end of file diff --git a/doc/html/inherit_graph_4.dot b/doc/html/inherit_graph_4.dot deleted file mode 100644 index 0f932b0..0000000 --- a/doc/html/inherit_graph_4.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="PhraseData",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_phrase_data.html"]; -} diff --git a/doc/html/inherit_graph_4.md5 b/doc/html/inherit_graph_4.md5 deleted file mode 100644 index a5cfac6..0000000 --- a/doc/html/inherit_graph_4.md5 +++ /dev/null @@ -1 +0,0 @@ -11e55387f0b8b3f101ddeb0af2bd6bca \ No newline at end of file diff --git a/doc/html/inherit_graph_5.dot b/doc/html/inherit_graph_5.dot deleted file mode 100644 index 26b5f04..0000000 --- a/doc/html/inherit_graph_5.dot +++ /dev/null @@ -1,9 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="QueryBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_query_base.html"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="Query\< T \>",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_query.html",tooltip="This class hold a query."]; -} diff --git a/doc/html/inherit_graph_5.md5 b/doc/html/inherit_graph_5.md5 deleted file mode 100644 index c688ede..0000000 --- a/doc/html/inherit_graph_5.md5 +++ /dev/null @@ -1 +0,0 @@ -9c42ae8bd0a48510e10dc126303a02e3 \ No newline at end of file diff --git a/doc/html/inherit_graph_6.dot b/doc/html/inherit_graph_6.dot deleted file mode 100644 index 39b6fdd..0000000 --- a/doc/html/inherit_graph_6.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="QueryPrivate",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_query_private.html"]; -} diff --git a/doc/html/inherit_graph_6.md5 b/doc/html/inherit_graph_6.md5 deleted file mode 100644 index 6f771fb..0000000 --- a/doc/html/inherit_graph_6.md5 +++ /dev/null @@ -1 +0,0 @@ -5b0e8035c748a5832740488fd743ff49 \ No newline at end of file diff --git a/doc/html/inherit_graph_7.dot b/doc/html/inherit_graph_7.dot deleted file mode 100644 index c70a476..0000000 --- a/doc/html/inherit_graph_7.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="RelationModel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$struct_relation_model.html"]; -} diff --git a/doc/html/inherit_graph_7.md5 b/doc/html/inherit_graph_7.md5 deleted file mode 100644 index 0572f78..0000000 --- a/doc/html/inherit_graph_7.md5 +++ /dev/null @@ -1 +0,0 @@ -60b6713ba2fd61d340d231c07a0cf4a9 \ No newline at end of file diff --git a/doc/html/inherit_graph_8.dot b/doc/html/inherit_graph_8.dot deleted file mode 100644 index 3aaade2..0000000 --- a/doc/html/inherit_graph_8.dot +++ /dev/null @@ -1,15 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="SqlGeneratorBase",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_generator_base.html"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="MySqlGenerator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_my_sql_generator.html"]; - Node1 -> Node3 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node3 [label="PostgreSqlGenerator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_postgre_sql_generator.html"]; - Node1 -> Node4 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node4 [label="SqliteGenerator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sqlite_generator.html"]; - Node1 -> Node5 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node5 [label="SqlServerGenerator",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_sql_server_generator.html"]; -} diff --git a/doc/html/inherit_graph_8.md5 b/doc/html/inherit_graph_8.md5 deleted file mode 100644 index 89f2275..0000000 --- a/doc/html/inherit_graph_8.md5 +++ /dev/null @@ -1 +0,0 @@ -b3aa1854fa4197c62ac7beefd04ba94f \ No newline at end of file diff --git a/doc/html/inherit_graph_9.dot b/doc/html/inherit_graph_9.dot deleted file mode 100644 index 3120542..0000000 --- a/doc/html/inherit_graph_9.dot +++ /dev/null @@ -1,9 +0,0 @@ -digraph "Graphical Class Hierarchy" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - rankdir="LR"; - Node1 [label="Table",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table.html"]; - Node1 -> Node2 [dir="back",color="midnightblue",fontsize="10",style="solid",fontname="Helvetica"]; - Node2 [label="ChangeLogTable",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_change_log_table.html"]; -} diff --git a/doc/html/inherit_graph_9.md5 b/doc/html/inherit_graph_9.md5 deleted file mode 100644 index 9fb062a..0000000 --- a/doc/html/inherit_graph_9.md5 +++ /dev/null @@ -1 +0,0 @@ -5b7ee67cc8096dfce5b8e87fc4c7e58c \ No newline at end of file diff --git a/doc/html/inherits.html b/doc/html/inherits.html deleted file mode 100644 index bbb4e51..0000000 --- a/doc/html/inherits.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - -Nut: Class Hierarchy - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
- -
- All Classes Functions
- - -
- -
- -
-
-
Class Hierarchy
-
-
- - - - - - - - - - - - - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
-
- - - - diff --git a/doc/html/jquery.js b/doc/html/jquery.js deleted file mode 100644 index 63939e7..0000000 --- a/doc/html/jquery.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")), -f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c) -{if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); diff --git a/doc/html/mysqlgenerator_8h_source.html b/doc/html/mysqlgenerator_8h_source.html deleted file mode 100644 index 38ebdd1..0000000 --- a/doc/html/mysqlgenerator_8h_source.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - -Nut: src/mysqlgenerator.h Source File - - - - - - -
-
-
- - - - - -
-
Nut -  0.1 -
-
- - - - - - - -
-
-
mysqlgenerator.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef MYSQLGENERATOR_H
-
22 #define MYSQLGENERATOR_H
-
23 
-
24 #include <QtCore/qglobal.h>
-
25 #include "sqlgeneratorbase_p.h"
-
26 
-
27 QT_BEGIN_NAMESPACE
-
28 
-
29 class MySqlGenerator : public SqlGeneratorBase
-
30 {
-
31 public:
-
32  MySqlGenerator(Database *parent = 0);
-
33 
-
34  QString fieldType(FieldModel *field);
-
35 
-
36 };
-
37 
-
38 QT_END_NAMESPACE
-
39 
-
40 #endif // MYSQLGENERATOR_H
-
- - - - diff --git a/doc/html/nav_f.png b/doc/html/nav_f.png deleted file mode 100644 index 72a58a5..0000000 Binary files a/doc/html/nav_f.png and /dev/null differ diff --git a/doc/html/nav_g.png b/doc/html/nav_g.png deleted file mode 100644 index 2093a23..0000000 Binary files a/doc/html/nav_g.png and /dev/null differ diff --git a/doc/html/nav_h.png b/doc/html/nav_h.png deleted file mode 100644 index 33389b1..0000000 Binary files a/doc/html/nav_h.png and /dev/null differ diff --git a/doc/html/open.png b/doc/html/open.png deleted file mode 100644 index 30f75c7..0000000 Binary files a/doc/html/open.png and /dev/null differ diff --git a/doc/html/postgresqlgenerator_8h_source.html b/doc/html/postgresqlgenerator_8h_source.html deleted file mode 100644 index 09636f5..0000000 --- a/doc/html/postgresqlgenerator_8h_source.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - -Nut: src/postgresqlgenerator.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
postgresqlgenerator.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef POSTGRESQLGENERATOR_H
-
22 #define POSTGRESQLGENERATOR_H
-
23 
-
24 #include <QtCore/qglobal.h>
-
25 #include "sqlgeneratorbase_p.h"
-
26 
-
27 QT_BEGIN_NAMESPACE
-
28 
-
29 class PostgreSqlGenerator : public SqlGeneratorBase
-
30 {
-
31 public:
- -
33 
-
34  QString fieldType(FieldModel *field);
-
35 
-
36  QString diff(FieldModel *oldField, FieldModel *newField);
-
37 };
-
38 
-
39 QT_END_NAMESPACE
-
40 
-
41 #endif // POSTGRESQLGENERATOR_H
-
- - - - diff --git a/doc/html/query_8h_source.html b/doc/html/query_8h_source.html deleted file mode 100644 index 9f69fb1..0000000 --- a/doc/html/query_8h_source.html +++ /dev/null @@ -1,320 +0,0 @@ - - - - - -Nut: src/query.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
query.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef QUERY_H
-
22 #define QUERY_H
-
23 
-
24 #include <QtCore/QVariant>
-
25 #include <QtCore/QDebug>
-
26 #include <QtCore/QScopedPointer>
-
27 #include <QtCore/QRegularExpression>
-
28 
-
29 #include "query_p.h"
-
30 #include "database.h"
-
31 #include "databasemodel.h"
-
32 #include "tablesetbase_p.h"
-
33 #include "sqlgeneratorbase_p.h"
-
34 #include "querybase_p.h"
-
35 #include "wherephrase.h"
-
36 
-
37 QT_BEGIN_NAMESPACE
-
38 
-
39 template<class T>
-
40 class NUT_EXPORT Query : public QueryBase
-
41 {
-
42  QueryPrivate *d_ptr;
-
43  Q_DECLARE_PRIVATE(Query)
-
44 
-
45 public:
-
46  Query(Database *database, TableSetBase *tableSet);
-
47  ~Query();
-
48 
-
49  QList<T *> toList(int count = -1);
-
50  int remove();
-
51  T *first();
-
52 
-
53  int count();
-
54 
-
55  QVariant max(FieldPhrase &f);
-
56  QVariant min(FieldPhrase &f);
-
57  QVariant average(FieldPhrase &f){
-
58  //TODO: ...
-
59  return QVariant();
-
60  }
-
61 
-
62  Query<T> *join(const QString &tableName);
-
63  Query<T> *setWhere(WherePhrase where);
-
64 
-
65  Query<T> *join(Table *c){
-
66  join(c->metaObject()->className());
-
67  return this;
-
68  }
-
69 
-
70 // Query<T> *setWhere(const QString &where);
-
71  Query<T> *orderBy(QString fieldName, QString type);
-
72  Query<T> *orderBy(WherePhrase phrase);
-
73 };
-
74 
-
75 template<class T>
-
76 Q_OUTOFLINE_TEMPLATE Query<T>::Query(Database *database, TableSetBase *tableSet) : QueryBase(database),
-
77  d_ptr(new QueryPrivate(this))
-
78 {
-
79  Q_D(Query);
-
80 
-
81  d->database = database;
-
82  d->tableSet = tableSet;
-
83  d->tableName = d->database->tableName(T::staticMetaObject.className());
-
84 }
-
85 
-
86 template<class T>
-
87 Q_OUTOFLINE_TEMPLATE Query<T>::~Query()
-
88 {
-
89  qDebug() << "Query::~Query()";
-
90  Q_D(Query);
-
91  delete d;
-
92 }
-
93 
-
94 template<class T>
-
95 Q_OUTOFLINE_TEMPLATE QList<T *> Query<T>::toList(int count)
-
96 {
-
97  Q_D(Query);
-
98  QList<T*> result;
-
99  d->select = "*";
-
100 
-
101 // QSqlQuery q = d->database->exec(d->database->sqlGenertor()->selectCommand(d->wheres, d->orders, d->tableName, d->joinClassName));
-
102  QSqlQuery q = d->database->exec(d->database->sqlGenertor()->selectCommand(
-
103  SqlGeneratorBase::SelectALl,
-
104  "",
-
105  d->wheres,
-
106  d->orderPhrases,
-
107  d->tableName,
-
108  d->joinClassName));
-
109 
-
110  QString pk =d->database->model().model(d->tableName)->primaryKey();
-
111  QVariant lastPkValue = QVariant();
-
112  int childTypeId = 0;
-
113  T *lastRow = 0;
-
114  TableSetBase *childTableSet;
-
115  QStringList masterFields = d->database->model().model(d->tableName)->fieldsNames();
-
116  QStringList childFields;
-
117  if(!d->joinClassName.isNull())
-
118  if(d->database->model().modelByClass(d->joinClassName)){
-
119  childFields = d->database->model().modelByClass(d->joinClassName)->fieldsNames();
-
120  QString joinTableName = d->database->tableName(d->joinClassName);
-
121  childTypeId = d->database->model().model(joinTableName)->typeId();
-
122  }
-
123 
-
124  while (q.next()) {
-
125  if(lastPkValue != q.value(pk)){
-
126  T *t = new T();
-
127 
-
128  foreach (QString field, masterFields)
-
129  t->setProperty(field.toLatin1().data(), q.value(field));
-
130 
-
131  t->setTableSet(d->tableSet);
-
132  t->setStatus(Table::FeatchedFromDB);
-
133  t->setParent(this);
-
134 
-
135  result.append(t);
-
136  lastRow = t;
-
137 
-
138  if(childTypeId){
-
139  QSet<TableSetBase*> tableSets = t->tableSets;
-
140  foreach (TableSetBase *ts, tableSets)
-
141  if(ts->childClassName() == d->joinClassName)
-
142  childTableSet = ts;
-
143  }
-
144  }
-
145 
-
146  if(childTypeId){
-
147  const QMetaObject *childMetaObject = QMetaType::metaObjectForType(childTypeId);
-
148  Table *childTable = qobject_cast<Table*>(childMetaObject->newInstance());
-
149 
-
150  foreach (QString field, childFields)
-
151  childTable->setProperty(field.toLatin1().data(), q.value(field));
-
152 
-
153  childTable->setParent(this);
-
154  childTable->setParentTable(lastRow);
-
155  childTable->setStatus(Table::FeatchedFromDB);
-
156  childTable->setTableSet(childTableSet);
-
157  childTableSet->add(childTable);
-
158  }
-
159  lastPkValue = q.value(pk);
-
160 
-
161  if(!--count)
-
162  break;
-
163  }
-
164 
-
165  deleteLater();
-
166  return result;
-
167 }
-
168 
-
169 template<class T>
-
170 Q_OUTOFLINE_TEMPLATE T *Query<T>::first()
-
171 {
-
172  QList<T *> list = toList(1);
-
173 
-
174  if(list.count())
-
175  return list.first();
-
176  else
-
177  return 0;
-
178 }
-
179 
-
180 template<class T>
-
181 Q_OUTOFLINE_TEMPLATE int Query<T>::count()
-
182 {
-
183  Q_D(Query);
-
184 
-
185  d->select = "COUNT(*)";
-
186  QSqlQuery q = d->database->exec(d->database->sqlGenertor()->selectCommand("COUNT(*)", d->wheres, d->orders, d->tableName, d->joinClassName));
-
187 
-
188  if(q.next())
-
189  return q.value(0).toInt();
-
190  return 0;
-
191 }
-
192 
-
193 template<class T>
-
194 Q_OUTOFLINE_TEMPLATE QVariant Query<T>::max(FieldPhrase &f){
-
195  Q_D(Query);
-
196 
-
197  QSqlQuery q = d->database->exec(d->database->sqlGenertor()->selectCommand("MAX(" + f.data()->text + ")", d->wheres, d->orders, d->tableName, d->joinClassName));
-
198 
-
199  if(q.next())
-
200  return q.value(0).toInt();
-
201  return 0;
-
202 }
-
203 
-
204 template<class T>
-
205 Q_OUTOFLINE_TEMPLATE QVariant Query<T>::min(FieldPhrase &f){
-
206  Q_D(Query);
-
207 
-
208  QSqlQuery q = d->database->exec(d->database->sqlGenertor()->selectCommand("MIN(" + f.data()->text + ")", d->wheres, d->orders, d->tableName, d->joinClassName));
-
209 
-
210  if(q.next())
-
211  return q.value(0).toInt();
-
212  return 0;
-
213 }
-
214 
-
215 template<class T>
-
216 Q_OUTOFLINE_TEMPLATE int Query<T>::remove()
-
217 {
-
218  Q_D(Query);
-
219 
-
220  QString sql = d->database->sqlGenertor()->deleteCommand(d->wheres, d->tableName);
-
221 // d->_database->sqlGenertor()->deleteRecords(_tableName, queryText());
-
222 // sql = compileCommand(sql);
-
223  QSqlQuery q = d->database->exec(sql);
-
224  return q.numRowsAffected();
-
225 }
-
226 
-
227 template<class T>
-
228 Q_OUTOFLINE_TEMPLATE Query<T> *Query<T>::join(const QString &tableName)
-
229 {
-
230  Q_D(Query);
-
231  d->joinClassName = tableName;
-
232  return this;
-
233 }
-
234 
-
235 template<class T>
-
236 Q_OUTOFLINE_TEMPLATE Query<T> *Query<T>::setWhere(WherePhrase where)
-
237 {
-
238  Q_D(Query);
-
239  d->wheres.append(where);
-
240  return this;
-
241 }
-
242 
-
243 template<class T>
-
244 Q_OUTOFLINE_TEMPLATE Query<T> *Query<T>::orderBy(QString fieldName, QString type)
-
245 {
-
246  Q_D(Query);
-
247  d->orders.insert(fieldName, type);
-
248  return this;
-
249 }
-
250 
-
251 template<class T>
-
252 Q_OUTOFLINE_TEMPLATE Query<T> *Query<T>::orderBy(WherePhrase phrase)
-
253 {
-
254  Q_D(Query);
-
255  d->orderPhrases.append(phrase);
-
256  return this;
-
257 }
-
258 
-
259 QT_END_NAMESPACE
-
260 
-
261 #endif // QUERY_H
-
- - - - diff --git a/doc/html/query__p_8h_source.html b/doc/html/query__p_8h_source.html deleted file mode 100644 index 7ef6e3f..0000000 --- a/doc/html/query__p_8h_source.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - -Nut: src/query_p.h Source File - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - - - - -
- -
- - -
-
-
-
query_p.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef QUERY_P_H
-
22 #define QUERY_P_H
-
23 
-
24 #include "wherephrase.h"
-
25 
-
26 #include <QList>
-
27 #include <QString>
-
28 
-
29 class Database;
-
30 class TableSetBase;
-
31 //template<class T>
-
32 class QueryBase;
- -
34  QueryBase *q_ptr;
-
35  Q_DECLARE_PUBLIC(QueryBase)
-
36 
-
37 public:
-
38  QueryPrivate(QueryBase *parent);
-
39  QString tableName;
-
40  QString select;
-
41  Database *database;
-
42  TableSetBase *tableSet;
-
43  QString joinClassName;
-
44  QList<WherePhrase> wheres;
-
45  QHash<QString, QString> orders;
-
46  QList<WherePhrase> orderPhrases;
-
47 };
-
48 
-
49 #endif // QUERY_P_H
-
- - - - diff --git a/doc/html/querybase__p_8h_source.html b/doc/html/querybase__p_8h_source.html deleted file mode 100644 index 9e92b6f..0000000 --- a/doc/html/querybase__p_8h_source.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - -Nut: src/querybase_p.h Source File - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - - - - -
- -
- - -
-
-
-
querybase_p.h
-
-
-
1 #ifndef QUERYBASE_H
-
2 #define QUERYBASE_H
-
3 
-
4 #include <QtCore/QObject>
-
5 #include <QtCore/qglobal.h>
-
6 
-
7 class QueryBase : public QObject
-
8 {
-
9  Q_OBJECT
-
10 public:
-
11  explicit QueryBase(QObject *parent = 0);
-
12 
-
13 signals:
-
14 
-
15 public slots:
-
16 };
-
17 
-
18 #endif // QUERYBASE_H
-
- - - - diff --git a/doc/html/search/all_63.html b/doc/html/search/all_63.html deleted file mode 100644 index 56b5ad1..0000000 --- a/doc/html/search/all_63.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_63.js b/doc/html/search/all_63.js deleted file mode 100644 index 3a2e4e3..0000000 --- a/doc/html/search/all_63.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['changelogtable',['ChangeLogTable',['../class_change_log_table.html',1,'']]], - ['connectionname',['connectionName',['../class_database.html#a69c42807ea444ab5f38573ad661db11d',1,'Database']]] -]; diff --git a/doc/html/search/all_64.html b/doc/html/search/all_64.html deleted file mode 100644 index b53ff08..0000000 --- a/doc/html/search/all_64.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_64.js b/doc/html/search/all_64.js deleted file mode 100644 index 5314b90..0000000 --- a/doc/html/search/all_64.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['database',['Database',['../class_database.html',1,'']]], - ['databasemodel',['DatabaseModel',['../class_database_model.html',1,'']]] -]; diff --git a/doc/html/search/all_66.html b/doc/html/search/all_66.html deleted file mode 100644 index 3d1f8b3..0000000 --- a/doc/html/search/all_66.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_66.js b/doc/html/search/all_66.js deleted file mode 100644 index 8b88ca4..0000000 --- a/doc/html/search/all_66.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['fieldmodel',['FieldModel',['../struct_field_model.html',1,'']]], - ['fieldphrase',['FieldPhrase',['../class_field_phrase.html',1,'']]] -]; diff --git a/doc/html/search/all_6d.html b/doc/html/search/all_6d.html deleted file mode 100644 index 2e27d4d..0000000 --- a/doc/html/search/all_6d.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_6d.js b/doc/html/search/all_6d.js deleted file mode 100644 index 0f030d4..0000000 --- a/doc/html/search/all_6d.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['model',['model',['../class_database.html#a30bc122da3fe8232ba22ce437d5b2986',1,'Database']]], - ['mysqlgenerator',['MySqlGenerator',['../class_my_sql_generator.html',1,'']]] -]; diff --git a/doc/html/search/all_6f.html b/doc/html/search/all_6f.html deleted file mode 100644 index 61827e8..0000000 --- a/doc/html/search/all_6f.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_6f.js b/doc/html/search/all_6f.js deleted file mode 100644 index d9b9b26..0000000 --- a/doc/html/search/all_6f.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['orderby',['orderBy',['../class_query.html#aa06b66cc9bbe9f3901215c943b94bb89',1,'Query']]] -]; diff --git a/doc/html/search/all_70.html b/doc/html/search/all_70.html deleted file mode 100644 index 0340151..0000000 --- a/doc/html/search/all_70.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_70.js b/doc/html/search/all_70.js deleted file mode 100644 index af97fc8..0000000 --- a/doc/html/search/all_70.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['phrasedata',['PhraseData',['../class_phrase_data.html',1,'']]], - ['postgresqlgenerator',['PostgreSqlGenerator',['../class_postgre_sql_generator.html',1,'']]] -]; diff --git a/doc/html/search/all_71.html b/doc/html/search/all_71.html deleted file mode 100644 index b4dc1e6..0000000 --- a/doc/html/search/all_71.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_71.js b/doc/html/search/all_71.js deleted file mode 100644 index 3b168a7..0000000 --- a/doc/html/search/all_71.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['query',['Query',['../class_query.html',1,'']]] -]; diff --git a/doc/html/search/all_72.html b/doc/html/search/all_72.html deleted file mode 100644 index 0ab18d6..0000000 --- a/doc/html/search/all_72.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_72.js b/doc/html/search/all_72.js deleted file mode 100644 index 8756a80..0000000 --- a/doc/html/search/all_72.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['relationmodel',['RelationModel',['../struct_relation_model.html',1,'']]] -]; diff --git a/doc/html/search/all_73.html b/doc/html/search/all_73.html deleted file mode 100644 index 1ec8f17..0000000 --- a/doc/html/search/all_73.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_73.js b/doc/html/search/all_73.js deleted file mode 100644 index 81b145e..0000000 --- a/doc/html/search/all_73.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['setwhere',['setWhere',['../class_query.html#ab4be37c2a469cbd549b7df9e5f415599',1,'Query']]], - ['sqlitegenerator',['SqliteGenerator',['../class_sqlite_generator.html',1,'']]], - ['sqlservergenerator',['SqlServerGenerator',['../class_sql_server_generator.html',1,'']]] -]; diff --git a/doc/html/search/all_74.html b/doc/html/search/all_74.html deleted file mode 100644 index fdc6589..0000000 --- a/doc/html/search/all_74.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_74.js b/doc/html/search/all_74.js deleted file mode 100644 index ddc78a8..0000000 --- a/doc/html/search/all_74.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['table',['Table',['../class_table.html',1,'']]], - ['tablemodel',['TableModel',['../class_table_model.html',1,'']]], - ['tableset',['TableSet',['../class_table_set.html',1,'']]], - ['tolist',['toList',['../class_query.html#a6c939f50425b98cc3e0d3df9e155d302',1,'Query']]] -]; diff --git a/doc/html/search/all_77.html b/doc/html/search/all_77.html deleted file mode 100644 index 73323d3..0000000 --- a/doc/html/search/all_77.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/all_77.js b/doc/html/search/all_77.js deleted file mode 100644 index f25b912..0000000 --- a/doc/html/search/all_77.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['wherephrase',['WherePhrase',['../class_where_phrase.html',1,'']]] -]; diff --git a/doc/html/search/classes_63.html b/doc/html/search/classes_63.html deleted file mode 100644 index 72c66b9..0000000 --- a/doc/html/search/classes_63.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_63.js b/doc/html/search/classes_63.js deleted file mode 100644 index 8644043..0000000 --- a/doc/html/search/classes_63.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['changelogtable',['ChangeLogTable',['../class_change_log_table.html',1,'']]] -]; diff --git a/doc/html/search/classes_64.html b/doc/html/search/classes_64.html deleted file mode 100644 index 5902708..0000000 --- a/doc/html/search/classes_64.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_64.js b/doc/html/search/classes_64.js deleted file mode 100644 index 5314b90..0000000 --- a/doc/html/search/classes_64.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['database',['Database',['../class_database.html',1,'']]], - ['databasemodel',['DatabaseModel',['../class_database_model.html',1,'']]] -]; diff --git a/doc/html/search/classes_66.html b/doc/html/search/classes_66.html deleted file mode 100644 index 941988c..0000000 --- a/doc/html/search/classes_66.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_66.js b/doc/html/search/classes_66.js deleted file mode 100644 index 8b88ca4..0000000 --- a/doc/html/search/classes_66.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['fieldmodel',['FieldModel',['../struct_field_model.html',1,'']]], - ['fieldphrase',['FieldPhrase',['../class_field_phrase.html',1,'']]] -]; diff --git a/doc/html/search/classes_6d.html b/doc/html/search/classes_6d.html deleted file mode 100644 index abe6f0d..0000000 --- a/doc/html/search/classes_6d.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_6d.js b/doc/html/search/classes_6d.js deleted file mode 100644 index b1ad27d..0000000 --- a/doc/html/search/classes_6d.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['mysqlgenerator',['MySqlGenerator',['../class_my_sql_generator.html',1,'']]] -]; diff --git a/doc/html/search/classes_70.html b/doc/html/search/classes_70.html deleted file mode 100644 index e4b5208..0000000 --- a/doc/html/search/classes_70.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_70.js b/doc/html/search/classes_70.js deleted file mode 100644 index af97fc8..0000000 --- a/doc/html/search/classes_70.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['phrasedata',['PhraseData',['../class_phrase_data.html',1,'']]], - ['postgresqlgenerator',['PostgreSqlGenerator',['../class_postgre_sql_generator.html',1,'']]] -]; diff --git a/doc/html/search/classes_71.html b/doc/html/search/classes_71.html deleted file mode 100644 index 80a4fbb..0000000 --- a/doc/html/search/classes_71.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_71.js b/doc/html/search/classes_71.js deleted file mode 100644 index 3b168a7..0000000 --- a/doc/html/search/classes_71.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['query',['Query',['../class_query.html',1,'']]] -]; diff --git a/doc/html/search/classes_72.html b/doc/html/search/classes_72.html deleted file mode 100644 index 0d0ddb4..0000000 --- a/doc/html/search/classes_72.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_72.js b/doc/html/search/classes_72.js deleted file mode 100644 index 8756a80..0000000 --- a/doc/html/search/classes_72.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['relationmodel',['RelationModel',['../struct_relation_model.html',1,'']]] -]; diff --git a/doc/html/search/classes_73.html b/doc/html/search/classes_73.html deleted file mode 100644 index a1bf0b9..0000000 --- a/doc/html/search/classes_73.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_73.js b/doc/html/search/classes_73.js deleted file mode 100644 index b1ccdc2..0000000 --- a/doc/html/search/classes_73.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['sqlitegenerator',['SqliteGenerator',['../class_sqlite_generator.html',1,'']]], - ['sqlservergenerator',['SqlServerGenerator',['../class_sql_server_generator.html',1,'']]] -]; diff --git a/doc/html/search/classes_74.html b/doc/html/search/classes_74.html deleted file mode 100644 index f7f27ce..0000000 --- a/doc/html/search/classes_74.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_74.js b/doc/html/search/classes_74.js deleted file mode 100644 index 88dd00f..0000000 --- a/doc/html/search/classes_74.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['table',['Table',['../class_table.html',1,'']]], - ['tablemodel',['TableModel',['../class_table_model.html',1,'']]], - ['tableset',['TableSet',['../class_table_set.html',1,'']]] -]; diff --git a/doc/html/search/classes_77.html b/doc/html/search/classes_77.html deleted file mode 100644 index e3967e9..0000000 --- a/doc/html/search/classes_77.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/classes_77.js b/doc/html/search/classes_77.js deleted file mode 100644 index f25b912..0000000 --- a/doc/html/search/classes_77.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['wherephrase',['WherePhrase',['../class_where_phrase.html',1,'']]] -]; diff --git a/doc/html/search/close.png b/doc/html/search/close.png deleted file mode 100644 index 9342d3d..0000000 Binary files a/doc/html/search/close.png and /dev/null differ diff --git a/doc/html/search/functions_63.html b/doc/html/search/functions_63.html deleted file mode 100644 index 9ebe11d..0000000 --- a/doc/html/search/functions_63.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/functions_63.js b/doc/html/search/functions_63.js deleted file mode 100644 index de7fec2..0000000 --- a/doc/html/search/functions_63.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['connectionname',['connectionName',['../class_database.html#a69c42807ea444ab5f38573ad661db11d',1,'Database']]] -]; diff --git a/doc/html/search/functions_6d.html b/doc/html/search/functions_6d.html deleted file mode 100644 index d01ac53..0000000 --- a/doc/html/search/functions_6d.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/functions_6d.js b/doc/html/search/functions_6d.js deleted file mode 100644 index 7d1f677..0000000 --- a/doc/html/search/functions_6d.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['model',['model',['../class_database.html#a30bc122da3fe8232ba22ce437d5b2986',1,'Database']]] -]; diff --git a/doc/html/search/functions_6f.html b/doc/html/search/functions_6f.html deleted file mode 100644 index 222f0f8..0000000 --- a/doc/html/search/functions_6f.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/functions_6f.js b/doc/html/search/functions_6f.js deleted file mode 100644 index d9b9b26..0000000 --- a/doc/html/search/functions_6f.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['orderby',['orderBy',['../class_query.html#aa06b66cc9bbe9f3901215c943b94bb89',1,'Query']]] -]; diff --git a/doc/html/search/functions_71.html b/doc/html/search/functions_71.html deleted file mode 100644 index af909d4..0000000 --- a/doc/html/search/functions_71.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/functions_71.js b/doc/html/search/functions_71.js deleted file mode 100644 index 651a68d..0000000 --- a/doc/html/search/functions_71.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['queryprivate',['QueryPrivate',['../class_query_private.html#a3e9a8f34c861028721594834c0437321',1,'QueryPrivate']]] -]; diff --git a/doc/html/search/functions_73.html b/doc/html/search/functions_73.html deleted file mode 100644 index 774d577..0000000 --- a/doc/html/search/functions_73.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/functions_73.js b/doc/html/search/functions_73.js deleted file mode 100644 index 7f90321..0000000 --- a/doc/html/search/functions_73.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['setwhere',['setWhere',['../class_query.html#ab4be37c2a469cbd549b7df9e5f415599',1,'Query']]] -]; diff --git a/doc/html/search/functions_74.html b/doc/html/search/functions_74.html deleted file mode 100644 index e3c96c3..0000000 --- a/doc/html/search/functions_74.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
-
Loading...
-
- -
Searching...
-
No Matches
- -
- - diff --git a/doc/html/search/functions_74.js b/doc/html/search/functions_74.js deleted file mode 100644 index 8449f51..0000000 --- a/doc/html/search/functions_74.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['tolist',['toList',['../class_query.html#a6c939f50425b98cc3e0d3df9e155d302',1,'Query']]] -]; diff --git a/doc/html/search/mag_sel.png b/doc/html/search/mag_sel.png deleted file mode 100644 index 81f6040..0000000 Binary files a/doc/html/search/mag_sel.png and /dev/null differ diff --git a/doc/html/search/nomatches.html b/doc/html/search/nomatches.html deleted file mode 100644 index b1ded27..0000000 --- a/doc/html/search/nomatches.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - -
-
No Matches
-
- - diff --git a/doc/html/search/search.css b/doc/html/search/search.css deleted file mode 100644 index d18c1da..0000000 --- a/doc/html/search/search.css +++ /dev/null @@ -1,238 +0,0 @@ -/*---------------- Search Box */ - -#FSearchBox { - float: left; -} - -#MSearchBox { - white-space : nowrap; - position: absolute; - float: none; - display: inline; - margin-top: 8px; - right: 0px; - width: 170px; - z-index: 102; - background-color: white; -} - -#MSearchBox .left -{ - display:block; - position:absolute; - left:10px; - width:20px; - height:19px; - background:url('search_l.png') no-repeat; - background-position:right; -} - -#MSearchSelect { - display:block; - position:absolute; - width:20px; - height:19px; -} - -.left #MSearchSelect { - left:4px; -} - -.right #MSearchSelect { - right:5px; -} - -#MSearchField { - display:block; - position:absolute; - height:19px; - background:url('search_m.png') repeat-x; - border:none; - width:116px; - margin-left:20px; - padding-left:4px; - color: #909090; - outline: none; - font: 9pt Arial, Verdana, sans-serif; -} - -#FSearchBox #MSearchField { - margin-left:15px; -} - -#MSearchBox .right { - display:block; - position:absolute; - right:10px; - top:0px; - width:20px; - height:19px; - background:url('search_r.png') no-repeat; - background-position:left; -} - -#MSearchClose { - display: none; - position: absolute; - top: 4px; - background : none; - border: none; - margin: 0px 4px 0px 0px; - padding: 0px 0px; - outline: none; -} - -.left #MSearchClose { - left: 6px; -} - -.right #MSearchClose { - right: 2px; -} - -.MSearchBoxActive #MSearchField { - color: #000000; -} - -/*---------------- Search filter selection */ - -#MSearchSelectWindow { - display: none; - position: absolute; - left: 0; top: 0; - border: 1px solid #90A5CE; - background-color: #F9FAFC; - z-index: 1; - padding-top: 4px; - padding-bottom: 4px; - -moz-border-radius: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -} - -.SelectItem { - font: 8pt Arial, Verdana, sans-serif; - padding-left: 2px; - padding-right: 12px; - border: 0px; -} - -span.SelectionMark { - margin-right: 4px; - font-family: monospace; - outline-style: none; - text-decoration: none; -} - -a.SelectItem { - display: block; - outline-style: none; - color: #000000; - text-decoration: none; - padding-left: 6px; - padding-right: 12px; -} - -a.SelectItem:focus, -a.SelectItem:active { - color: #000000; - outline-style: none; - text-decoration: none; -} - -a.SelectItem:hover { - color: #FFFFFF; - background-color: #3D578C; - outline-style: none; - text-decoration: none; - cursor: pointer; - display: block; -} - -/*---------------- Search results window */ - -iframe#MSearchResults { - width: 60ex; - height: 15em; -} - -#MSearchResultsWindow { - display: none; - position: absolute; - left: 0; top: 0; - border: 1px solid #000; - background-color: #EEF1F7; -} - -/* ----------------------------------- */ - - -#SRIndex { - clear:both; - padding-bottom: 15px; -} - -.SREntry { - font-size: 10pt; - padding-left: 1ex; -} - -.SRPage .SREntry { - font-size: 8pt; - padding: 1px 5px; -} - -body.SRPage { - margin: 5px 2px; -} - -.SRChildren { - padding-left: 3ex; padding-bottom: .5em -} - -.SRPage .SRChildren { - display: none; -} - -.SRSymbol { - font-weight: bold; - color: #425E97; - font-family: Arial, Verdana, sans-serif; - text-decoration: none; - outline: none; -} - -a.SRScope { - display: block; - color: #425E97; - font-family: Arial, Verdana, sans-serif; - text-decoration: none; - outline: none; -} - -a.SRSymbol:focus, a.SRSymbol:active, -a.SRScope:focus, a.SRScope:active { - text-decoration: underline; -} - -span.SRScope { - padding-left: 4px; -} - -.SRPage .SRStatus { - padding: 2px 5px; - font-size: 8pt; - font-style: italic; -} - -.SRResult { - display: none; -} - -DIV.searchresults { - margin-left: 10px; - margin-right: 10px; -} diff --git a/doc/html/search/search.js b/doc/html/search/search.js deleted file mode 100644 index 38f13fc..0000000 --- a/doc/html/search/search.js +++ /dev/null @@ -1,799 +0,0 @@ -// Search script generated by doxygen -// Copyright (C) 2009 by Dimitri van Heesch. - -// The code in this file is loosly based on main.js, part of Natural Docs, -// which is Copyright (C) 2003-2008 Greg Valure -// Natural Docs is licensed under the GPL. - -var indexSectionsWithContent = -{ - 0: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001101000000101111110010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - 1: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001101000000100111110010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - 2: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000101000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" -}; - -var indexSectionNames = -{ - 0: "all", - 1: "classes", - 2: "functions" -}; - -function convertToId(search) -{ - var result = ''; - for (i=0;i do a search - { - this.Search(); - } - } - - this.OnSearchSelectKey = function(evt) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 && this.searchIndex0) // Up - { - this.searchIndex--; - this.OnSelectItem(this.searchIndex); - } - else if (e.keyCode==13 || e.keyCode==27) - { - this.OnSelectItem(this.searchIndex); - this.CloseSelectionWindow(); - this.DOMSearchField().focus(); - } - return false; - } - - // --------- Actions - - // Closes the results window. - this.CloseResultsWindow = function() - { - this.DOMPopupSearchResultsWindow().style.display = 'none'; - this.DOMSearchClose().style.display = 'none'; - this.Activate(false); - } - - this.CloseSelectionWindow = function() - { - this.DOMSearchSelectWindow().style.display = 'none'; - } - - // Performs a search. - this.Search = function() - { - this.keyTimeout = 0; - - // strip leading whitespace - var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); - - var code = searchValue.toLowerCase().charCodeAt(0); - var hexCode; - if (code<16) - { - hexCode="0"+code.toString(16); - } - else - { - hexCode=code.toString(16); - } - - var resultsPage; - var resultsPageWithSearch; - var hasResultsPage; - - if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1') - { - resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html'; - resultsPageWithSearch = resultsPage+'?'+escape(searchValue); - hasResultsPage = true; - } - else // nothing available for this search term - { - resultsPage = this.resultsPath + '/nomatches.html'; - resultsPageWithSearch = resultsPage; - hasResultsPage = false; - } - - window.frames.MSearchResults.location = resultsPageWithSearch; - var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); - - if (domPopupSearchResultsWindow.style.display!='block') - { - var domSearchBox = this.DOMSearchBox(); - this.DOMSearchClose().style.display = 'inline'; - if (this.insideFrame) - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - domPopupSearchResultsWindow.style.position = 'relative'; - domPopupSearchResultsWindow.style.display = 'block'; - var width = document.body.clientWidth - 8; // the -8 is for IE :-( - domPopupSearchResultsWindow.style.width = width + 'px'; - domPopupSearchResults.style.width = width + 'px'; - } - else - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; - var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; - domPopupSearchResultsWindow.style.display = 'block'; - left -= domPopupSearchResults.offsetWidth; - domPopupSearchResultsWindow.style.top = top + 'px'; - domPopupSearchResultsWindow.style.left = left + 'px'; - } - } - - this.lastSearchValue = searchValue; - this.lastResultsPage = resultsPage; - } - - // -------- Activation Functions - - // Activates or deactivates the search panel, resetting things to - // their default values if necessary. - this.Activate = function(isActive) - { - if (isActive || // open it - this.DOMPopupSearchResultsWindow().style.display == 'block' - ) - { - this.DOMSearchBox().className = 'MSearchBoxActive'; - - var searchField = this.DOMSearchField(); - - if (searchField.value == this.searchLabel) // clear "Search" term upon entry - { - searchField.value = ''; - this.searchActive = true; - } - } - else if (!isActive) // directly remove the panel - { - this.DOMSearchBox().className = 'MSearchBoxInactive'; - this.DOMSearchField().value = this.searchLabel; - this.searchActive = false; - this.lastSearchValue = '' - this.lastResultsPage = ''; - } - } -} - -// ----------------------------------------------------------------------- - -// The class that handles everything on the search results page. -function SearchResults(name) -{ - // The number of matches from the last run of . - this.lastMatchCount = 0; - this.lastKey = 0; - this.repeatOn = false; - - // Toggles the visibility of the passed element ID. - this.FindChildElement = function(id) - { - var parentElement = document.getElementById(id); - var element = parentElement.firstChild; - - while (element && element!=parentElement) - { - if (element.nodeName == 'DIV' && element.className == 'SRChildren') - { - return element; - } - - if (element.nodeName == 'DIV' && element.hasChildNodes()) - { - element = element.firstChild; - } - else if (element.nextSibling) - { - element = element.nextSibling; - } - else - { - do - { - element = element.parentNode; - } - while (element && element!=parentElement && !element.nextSibling); - - if (element && element!=parentElement) - { - element = element.nextSibling; - } - } - } - } - - this.Toggle = function(id) - { - var element = this.FindChildElement(id); - if (element) - { - if (element.style.display == 'block') - { - element.style.display = 'none'; - } - else - { - element.style.display = 'block'; - } - } - } - - // Searches for the passed string. If there is no parameter, - // it takes it from the URL query. - // - // Always returns true, since other documents may try to call it - // and that may or may not be possible. - this.Search = function(search) - { - if (!search) // get search word from URL - { - search = window.location.search; - search = search.substring(1); // Remove the leading '?' - search = unescape(search); - } - - search = search.replace(/^ +/, ""); // strip leading spaces - search = search.replace(/ +$/, ""); // strip trailing spaces - search = search.toLowerCase(); - search = convertToId(search); - - var resultRows = document.getElementsByTagName("div"); - var matches = 0; - - var i = 0; - while (i < resultRows.length) - { - var row = resultRows.item(i); - if (row.className == "SRResult") - { - var rowMatchName = row.id.toLowerCase(); - rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' - - if (search.length<=rowMatchName.length && - rowMatchName.substr(0, search.length)==search) - { - row.style.display = 'block'; - matches++; - } - else - { - row.style.display = 'none'; - } - } - i++; - } - document.getElementById("Searching").style.display='none'; - if (matches == 0) // no results - { - document.getElementById("NoMatches").style.display='block'; - } - else // at least one result - { - document.getElementById("NoMatches").style.display='none'; - } - this.lastMatchCount = matches; - return true; - } - - // return the first item with index index or higher that is visible - this.NavNext = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index++; - } - return focusItem; - } - - this.NavPrev = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index--; - } - return focusItem; - } - - this.ProcessKeys = function(e) - { - if (e.type == "keydown") - { - this.repeatOn = false; - this.lastKey = e.keyCode; - } - else if (e.type == "keypress") - { - if (!this.repeatOn) - { - if (this.lastKey) this.repeatOn = true; - return false; // ignore first keypress after keydown - } - } - else if (e.type == "keyup") - { - this.lastKey = 0; - this.repeatOn = false; - } - return this.lastKey!=0; - } - - this.Nav = function(evt,itemIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - var newIndex = itemIndex-1; - var focusItem = this.NavPrev(newIndex); - if (focusItem) - { - var child = this.FindChildElement(focusItem.parentNode.parentNode.id); - if (child && child.style.display == 'block') // children visible - { - var n=0; - var tmpElem; - while (1) // search for last child - { - tmpElem = document.getElementById('Item'+newIndex+'_c'+n); - if (tmpElem) - { - focusItem = tmpElem; - } - else // found it! - { - break; - } - n++; - } - } - } - if (focusItem) - { - focusItem.focus(); - } - else // return focus to search field - { - parent.document.getElementById("MSearchField").focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = itemIndex+1; - var focusItem; - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem && elem.style.display == 'block') // children visible - { - focusItem = document.getElementById('Item'+itemIndex+'_c0'); - } - if (!focusItem) focusItem = this.NavNext(newIndex); - if (focusItem) focusItem.focus(); - } - else if (this.lastKey==39) // Right - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'block'; - } - else if (this.lastKey==37) // Left - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'none'; - } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; - } - - this.NavChild = function(evt,itemIndex,childIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - if (childIndex>0) - { - var newIndex = childIndex-1; - document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); - } - else // already at first child, jump to parent - { - document.getElementById('Item'+itemIndex).focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = childIndex+1; - var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); - if (!elem) // last child, jump to parent next parent - { - elem = this.NavNext(itemIndex+1); - } - if (elem) - { - elem.focus(); - } - } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; - } -} - -function setKeyActions(elem,action) -{ - elem.setAttribute('onkeydown',action); - elem.setAttribute('onkeypress',action); - elem.setAttribute('onkeyup',action); -} - -function setClassAttr(elem,attr) -{ - elem.setAttribute('class',attr); - elem.setAttribute('className',attr); -} - -function createResults() -{ - var results = document.getElementById("SRResults"); - for (var e=0; e - - - - -Nut: src/sqlgeneratorbase_p.h Source File - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - - - - -
- -
- - -
-
-
-
sqlgeneratorbase_p.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef SQLGENERATORBASE_H
-
22 #define SQLGENERATORBASE_H
-
23 
-
24 #include <QtCore/qglobal.h>
-
25 #include <QtCore/QObject>
-
26 #include <QtCore/QStringList>
-
27 #include "wherephrase.h"
-
28 
-
29 QT_BEGIN_NAMESPACE
-
30 
-
31 class Table;
-
32 struct FieldModel;
-
33 class DatabaseModel;
-
34 class TableModel;
-
35 class Database;
-
36 //struct PhraseData;
-
37 //class WherePhrase;
-
38 class SqlGeneratorBase : public QObject
-
39 {
-
40 // Q_OBJECT
-
41 
-
42  Database *_database;
-
43 public:
-
44  enum CommandType{
-
45  Select,
-
46  Insert,
-
47  Update,
-
48  Delete
-
49  };
-
50  enum AgregateType{
-
51  SelectALl,
-
52  Count,
-
53  Min,
-
54  Max,
-
55  Average
-
56  };
-
57 
-
58  SqlGeneratorBase(Database *parent);
-
59  virtual ~SqlGeneratorBase();
-
60 
-
61  virtual QString masterDatabaseName(QString databaseName);
-
62 
-
63  virtual QString fieldType(FieldModel *field) = 0;
-
64  virtual QString fieldDeclare(FieldModel *field);
-
65 
-
66  virtual QStringList diff(DatabaseModel lastModel, DatabaseModel newModel);
-
67  virtual QString diff(FieldModel *oldField, FieldModel *newField);
-
68  virtual QString diff(TableModel *oldTable, TableModel *newTable);
-
69 
-
70  virtual QString saveRecord(Table *t, QString tableName);
-
71  virtual QString insertRecord(Table *t, QString tableName);
-
72  virtual QString updateRecord(Table *t, QString tableName);
-
73  virtual QString deleteRecord(Table *t, QString tableName);
-
74 
-
75 
-
76  virtual QString deleteRecords(QString tableName, QString where);
-
77 
-
78  virtual QString selectCommand(AgregateType t, QString agregateArg,
-
79  QList<WherePhrase> &wheres, QList<WherePhrase> &orders,
-
80  QString tableName, QString joinClassName);
-
81 
-
82  virtual QString selectCommand(QList<WherePhrase> &wheres, QHash<QString, QString> &orders,
-
83  QString tableName, QString joinClassName);
-
84  virtual QString selectCommand(QString selectPhrase,
-
85  QList<WherePhrase> &wheres, QHash<QString, QString> &orders,
-
86  QString tableName, QString joinClassName);
-
87 
-
88  virtual QString deleteCommand(QList<WherePhrase> &wheres, QString tableName);
-
89 
-
90  virtual QString escapeValue(const QVariant &v) const;
-
91  virtual QString phrase(const PhraseData *d) const;
-
92  virtual QString operatorString(const PhraseData::Condition &cond) const;
-
93 
-
94 private:
-
95  QString agregateText(const AgregateType &t, const QString &arg = QString::null) const;
-
96  QString fromTableText(const QString &tableName, QString &joinClassName, QString &orderBy) const;
-
97  QString createWhere(QList<WherePhrase> &wheres);
-
98  QString phraseOrder(const PhraseData *d) const;
-
99 };
-
100 
-
101 QT_END_NAMESPACE
-
102 
-
103 #endif // SQLGENERATORBASE_H
-
- - - - diff --git a/doc/html/sqlitegenerator_8h_source.html b/doc/html/sqlitegenerator_8h_source.html deleted file mode 100644 index bab9f7e..0000000 --- a/doc/html/sqlitegenerator_8h_source.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - -Nut: src/sqlitegenerator.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
sqlitegenerator.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef SQLITEGENERATOR_H
-
22 #define SQLITEGENERATOR_H
-
23 
-
24 #include <QtCore/qglobal.h>
-
25 #include "sqlgeneratorbase_p.h"
-
26 
-
27 class SqliteGenerator : public SqlGeneratorBase
-
28 {
-
29 public:
-
30  SqliteGenerator(Database *parent = 0);
-
31 
-
32  QString fieldType(FieldModel *field);
-
33 };
-
34 
-
35 #endif // SQLITEGENERATOR_H
-
- - - - diff --git a/doc/html/sqlservergenerator_8h_source.html b/doc/html/sqlservergenerator_8h_source.html deleted file mode 100644 index 5c2bd1e..0000000 --- a/doc/html/sqlservergenerator_8h_source.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - -Nut: src/sqlservergenerator.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
sqlservergenerator.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef SQLSERVERGENERATOR_H
-
22 #define SQLSERVERGENERATOR_H
-
23 
-
24 #include <QtCore/qglobal.h>
-
25 #include "sqlgeneratorbase_p.h"
-
26 
-
27 QT_BEGIN_NAMESPACE
-
28 
-
29 class SqlServerGenerator : public SqlGeneratorBase
-
30 {
-
31 public:
-
32  SqlServerGenerator(Database *parent = 0);
-
33 
-
34  QString masterDatabaseName(QString databaseName);
-
35 
-
36  QString fieldType(FieldModel *field);
-
37  QString diff(FieldModel *oldField, FieldModel *newField);
-
38 
-
39  QString escapeValue(const QVariant &v) const;
-
40 };
-
41 
-
42 QT_END_NAMESPACE
-
43 
-
44 #endif // SQLSERVERGENERATOR_H
-
- - - - diff --git a/doc/html/struct_field_model-members.html b/doc/html/struct_field_model-members.html deleted file mode 100644 index 75ef313..0000000 --- a/doc/html/struct_field_model-members.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
FieldModel Member List
-
-
- -

This is the complete list of members for FieldModel, including all inherited members.

- - - - - - - - - - - - -
defaultValue (defined in FieldModel)FieldModel
FieldModel() (defined in FieldModel)FieldModel
isAutoIncrement (defined in FieldModel)FieldModel
isPrimaryKey (defined in FieldModel)FieldModel
isUnique (defined in FieldModel)FieldModel
length (defined in FieldModel)FieldModel
name (defined in FieldModel)FieldModel
notNull (defined in FieldModel)FieldModel
operator!=(const FieldModel &f) const (defined in FieldModel)FieldModel
operator==(const FieldModel &f) const (defined in FieldModel)FieldModel
type (defined in FieldModel)FieldModel
- - - - diff --git a/doc/html/struct_field_model.html b/doc/html/struct_field_model.html deleted file mode 100644 index c278ac5..0000000 --- a/doc/html/struct_field_model.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - -Nut: FieldModel Struct Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
- -
-
FieldModel Struct Reference
-
-
- - - - -

-Public Member Functions

-bool operator== (const FieldModel &f) const
-bool operator!= (const FieldModel &f) const
- - - - - - - - - -

-Public Attributes

-QString name
-QVariant::Type type
-int length
-QString defaultValue
-bool notNull
-bool isPrimaryKey
-bool isAutoIncrement
-bool isUnique
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/doc/html/struct_relation_model-members.html b/doc/html/struct_relation_model-members.html deleted file mode 100644 index 8141fa7..0000000 --- a/doc/html/struct_relation_model-members.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -Nut: Member List - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
-
-
RelationModel Member List
-
-
- -

This is the complete list of members for RelationModel, including all inherited members.

- - - - - -
className (defined in RelationModel)RelationModel
foregionColumn (defined in RelationModel)RelationModel
localColumn (defined in RelationModel)RelationModel
table (defined in RelationModel)RelationModel
- - - - diff --git a/doc/html/struct_relation_model.html b/doc/html/struct_relation_model.html deleted file mode 100644 index c7521ea..0000000 --- a/doc/html/struct_relation_model.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - -Nut: RelationModel Struct Reference - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - -
-
- -
-
RelationModel Struct Reference
-
-
- - - - - - -

-Public Attributes

-QString className
-QString localColumn
-TableModeltable
-QString foregionColumn
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/doc/html/struct_relation_model__coll__graph.dot b/doc/html/struct_relation_model__coll__graph.dot deleted file mode 100644 index 1dc97af..0000000 --- a/doc/html/struct_relation_model__coll__graph.dot +++ /dev/null @@ -1,8 +0,0 @@ -digraph "RelationModel" -{ - edge [fontname="Helvetica",fontsize="10",labelfontname="Helvetica",labelfontsize="10"]; - node [fontname="Helvetica",fontsize="10",shape=record]; - Node1 [label="RelationModel",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"]; - Node2 -> Node1 [dir="back",color="darkorchid3",fontsize="10",style="dashed",label=" table" ,fontname="Helvetica"]; - Node2 [label="TableModel",height=0.2,width=0.4,color="black", fillcolor="white", style="filled",URL="$class_table_model.html"]; -} diff --git a/doc/html/struct_relation_model__coll__graph.md5 b/doc/html/struct_relation_model__coll__graph.md5 deleted file mode 100644 index 3c01a46..0000000 --- a/doc/html/struct_relation_model__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -1d1016c6a2521ac7f33ccacd3e9a5373 \ No newline at end of file diff --git a/doc/html/sync_off.png b/doc/html/sync_off.png deleted file mode 100644 index 3b443fc..0000000 Binary files a/doc/html/sync_off.png and /dev/null differ diff --git a/doc/html/sync_on.png b/doc/html/sync_on.png deleted file mode 100644 index e08320f..0000000 Binary files a/doc/html/sync_on.png and /dev/null differ diff --git a/doc/html/tab_a.png b/doc/html/tab_a.png deleted file mode 100644 index 3b725c4..0000000 Binary files a/doc/html/tab_a.png and /dev/null differ diff --git a/doc/html/tab_b.png b/doc/html/tab_b.png deleted file mode 100644 index 258c141..0000000 Binary files a/doc/html/tab_b.png and /dev/null differ diff --git a/doc/html/tab_h.png b/doc/html/tab_h.png deleted file mode 100644 index 4ca9102..0000000 Binary files a/doc/html/tab_h.png and /dev/null differ diff --git a/doc/html/tab_s.png b/doc/html/tab_s.png deleted file mode 100644 index ab478c9..0000000 Binary files a/doc/html/tab_s.png and /dev/null differ diff --git a/doc/html/table_8h_source.html b/doc/html/table_8h_source.html deleted file mode 100644 index 3173331..0000000 --- a/doc/html/table_8h_source.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - -Nut: src/table.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
table.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef TABLE_H
-
22 #define TABLE_H
-
23 
-
24 #include <QtCore/QObject>
-
25 #include <QtCore/qglobal.h>
-
26 #include <QtCore/QSet>
-
27 
-
28 #include "tablemodel.h"
-
29 #include "defines.h"
-
30 #include "wherephrase.h"
-
31 
-
32 QT_BEGIN_NAMESPACE
-
33 
-
34 class Database;
-
35 class TableSetBase;
-
36 class NUT_EXPORT Table : public QObject
-
37 {
-
38  Q_OBJECT
-
39 
-
40 public:
-
41  explicit Table(QObject *tableSet = 0);
-
42 
-
43  enum Status{
-
44  NewCreated,
-
45  FeatchedFromDB,
-
46  Added,
-
47  Modified,
-
48  Deleted
-
49  };
-
50 
-
51  void add(TableSetBase *);
-
52  void save(Database *db);
-
53 
-
54  QString primaryKey() const;
-
55  bool isPrimaryKeyAutoIncrement() const;
-
56  QVariant primaryValue() const;
-
57  Status status() const;
-
58  void setStatus(const Status &status);
-
59 
-
60  TableSetBase *tableSet() const;
-
61  void setTableSet(TableSetBase *tableSet);
-
62 
-
63  QSet<QString> changedProperties() const;
-
64 
-
65  bool setParentTable(Table *master);
-
66 signals:
-
67 
-
68 public slots:
-
69 
-
70 protected:
-
71  void propertyChanged(QString propName);
-
72 
-
73 private:
-
74  Status _status;
-
75  QSet<QString> _changedProperties;
-
76  TableSetBase *_tableSet;
-
77 
-
78  QSet<TableSetBase*> tableSets;
-
79 
-
80  template<class T>
-
81  friend class Query;
-
82 };
-
83 
-
84 QT_END_NAMESPACE
-
85 
-
86 #endif // TABLE_H
-
- - - - diff --git a/doc/html/tablemodel_8h_source.html b/doc/html/tablemodel_8h_source.html deleted file mode 100644 index a8b6660..0000000 --- a/doc/html/tablemodel_8h_source.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - -Nut: src/tablemodel.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
tablemodel.h
-
-
-
1 ï»¿/**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef TABLESCHEEMA_H
-
22 #define TABLESCHEEMA_H
-
23 
-
24 #include <QtCore/QVariant>
-
25 #include <QDebug>
-
26 class QJsonObject;
-
27 class TableModel;
-
28 
-
29 struct FieldModel{
-
30  FieldModel() : name(QString::null), length(0), defaultValue(QString::null),
-
31  notNull(false), isPrimaryKey(false), isAutoIncrement(false), isUnique(false)
-
32  {
-
33 
-
34  }
-
35 
-
36  QString name;
-
37  QVariant::Type type;
-
38  int length;
-
39  QString defaultValue;
-
40  bool notNull;
-
41  bool isPrimaryKey;
-
42  bool isAutoIncrement;
-
43  bool isUnique;
-
44 
-
45  bool operator ==(const FieldModel &f) const{
-
46 
-
47  bool b = name == f.name
-
48  && type == f.type
-
49  && length == f.length
-
50  && defaultValue == f.defaultValue
-
51  && notNull == f.notNull;
-
52 
-
53  return b;
-
54  }
-
55 
-
56  bool operator !=(const FieldModel &f) const{
-
57  return !(*this == f);
-
58  }
-
59 };
-
60 
- -
62  QString className;
-
63  QString localColumn;
-
64  TableModel *table;
-
65  QString foregionColumn;
-
66 };
- -
68 {
-
69 public:
-
70 
-
71  TableModel(int typeId, QString tableName);
-
72  TableModel(QJsonObject json, QString tableName);
-
73 
-
74  QJsonObject toJson() const;
-
75 
-
76 // static TableScheema *registerTable(int typeId, QString tableName);
-
77 // static void createForegionKeys();
-
78  static TableModel* model(QString className);
-
79 
-
80  FieldModel *field(QString name) const;
-
81  RelationModel *foregionKey(QString otherTable) const;
-
82 
-
83  QString toString() const;
-
84 
-
85  QString primaryKey() const;
-
86 
-
87  QString name() const;
-
88  void setName(const QString &name);
-
89 
-
90  QString className() const;
-
91  void setClassName(const QString &className);
-
92 
-
93  int typeId() const;
-
94  void setTypeId(const int &typeId);
-
95  QList<FieldModel *> fields() const;
-
96  QList<RelationModel *> foregionKeys() const;
-
97  QStringList fieldsNames() const;
-
98 
-
99  static TableModel *findByTypeId(int typeId);
-
100  static TableModel *findByName(QString name);
-
101  static TableModel *findByClassName(QString className);
-
102 
-
103  bool operator ==(const TableModel &t) const;
-
104  bool operator !=(const TableModel &t) const;
-
105 
-
106 private:
-
107  QString _name;
-
108  QString _className;
-
109  int _typeId;
-
110  QList<FieldModel*> _fields;
-
111  QList<RelationModel*> _foregionKeys;
-
112  static QSet<TableModel*>_allModels;
-
113 };
-
114 
-
115 #endif // TABLESCHEEMA_H
-
- - - - diff --git a/doc/html/tableset_8h_source.html b/doc/html/tableset_8h_source.html deleted file mode 100644 index f5ba5c9..0000000 --- a/doc/html/tableset_8h_source.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - - -Nut: src/tableset.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
tableset.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef TABLESET_H
-
22 #define TABLESET_H
-
23 
-
24 #include <QtCore/qglobal.h>
-
25 #include <QtCore/QVariant>
-
26 #include <QtCore/QMetaMethod>
-
27 #include <QtSql/QSqlQuery>
-
28 
-
29 #include "tablesetbase_p.h"
-
30 #include "database.h"
-
31 #include "table.h"
-
32 
-
33 QT_BEGIN_NAMESPACE
-
34 
-
35 template<class T>
-
36 class Query;
-
37 
-
38 template<class T>
-
39 class NUT_EXPORT TableSet : public TableSetBase
-
40 {
-
41 public:
-
42  TableSet(Database *parent);
-
43  TableSet(Table *parent);
-
44 
-
45  void append(T *t);
-
46  void append(QList<T*> t);
-
47  void remove(T *t);
-
48  void remove(QList<T*> t);
-
49 
-
50  inline T type() const {}
-
51 
-
52  int length() const;
-
53  T *at(int i) const;
-
54  const T &operator[](int i) const;
-
55  Query<T> *createQuery();
-
56 };
-
57 
-
58 template<class T>
-
59 Q_OUTOFLINE_TEMPLATE TableSet<T>::TableSet(Database *parent) : TableSetBase(parent)
-
60 {
-
61  _childClassName = T::staticMetaObject.className();
-
62 }
-
63 
-
64 template<class T>
-
65 Q_OUTOFLINE_TEMPLATE TableSet<T>::TableSet(Table *parent) : TableSetBase(parent)
-
66 {
-
67  _childClassName = T::staticMetaObject.className();
-
68 }
-
69 
-
70 template<class T>
-
71 Q_OUTOFLINE_TEMPLATE Query<T> *TableSet<T>::createQuery()
-
72 {
-
73  Query<T> *q = new Query<T>(_database, this);
-
74 
-
75  return q;
-
76 }
-
77 
-
78 template<class T>
-
79 Q_OUTOFLINE_TEMPLATE int TableSet<T>::length() const
-
80 {
-
81  return _tables.count();
-
82 }
-
83 
-
84 template<class T>
-
85 Q_OUTOFLINE_TEMPLATE T *TableSet<T>::at(int i) const
-
86 {
-
87  return (T*)_tablesList.at(i);
-
88 }
-
89 
-
90 template<class T>
-
91 Q_OUTOFLINE_TEMPLATE const T &TableSet<T>::operator[](int i) const
-
92 {
-
93  return _tablesList[i];
-
94 }
-
95 
-
96 template<class T>
-
97 Q_OUTOFLINE_TEMPLATE void TableSet<T>::append(T *t)
-
98 {
-
99  _tables.insert(t);
-
100  _tablesList.append(t);
-
101 // rows.append(t);
-
102  t->setTableSet(this);
-
103  if(t->status() != Table::FeatchedFromDB)
-
104  t->setStatus(Table::Added);
-
105 }
-
106 
-
107 template<class T>
-
108 Q_OUTOFLINE_TEMPLATE void TableSet<T>::append(QList<T *> t)
-
109 {
-
110  foreach (T* i, t)
-
111  append(i);
-
112 }
-
113 
-
114 template<class T>
-
115 Q_OUTOFLINE_TEMPLATE void TableSet<T>::remove(T *t)
-
116 {
-
117  _tables.remove(t);
-
118  t->setStatus(Table::Deleted);
-
119 }
-
120 
-
121 template<class T>
-
122 Q_OUTOFLINE_TEMPLATE void TableSet<T>::remove(QList<T *> t)
-
123 {
-
124  foreach (T* i, t)
-
125  remove(i);
-
126 }
-
127 
-
128 QT_END_NAMESPACE
-
129 
-
130 #endif // TABLESET_H
-
- - - - diff --git a/doc/html/tablesetbase__p_8h_source.html b/doc/html/tablesetbase__p_8h_source.html deleted file mode 100644 index cdd5930..0000000 --- a/doc/html/tablesetbase__p_8h_source.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - -Nut: src/tablesetbase_p.h Source File - - - - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - - - - - -
- -
- - -
-
-
-
tablesetbase_p.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef TABLESETBASE_H
-
22 #define TABLESETBASE_H
-
23 
-
24 #include <QtCore/QObject>
-
25 #include <QtCore/qglobal.h>
-
26 #include <QtCore/QSet>
-
27 
-
28 #include "defines.h"
-
29 
-
30 class Table;
-
31 class Database;
-
32 class TableSetBase : public QObject
-
33 {
-
34 
-
35 public:
-
36  TableSetBase(Database *parent);
-
37  TableSetBase(Table *parent);
-
38 
-
39  virtual void save(Database *db);
-
40  void clearChilds();
-
41  void add(Table* t);
-
42  QString childClassName() const;
-
43 
-
44  Database *database() const;
-
45  void setDatabase(Database *database);
-
46 
-
47 protected:
-
48  QSet<Table*> _tables;
-
49  QList<Table*> _tablesList;
-
50  QString _tableName;
-
51  Database *_database;
-
52  Table *_table;
-
53  QString _childClassName;
-
54 };
-
55 
-
56 #endif // TABLESETBASE_H
-
- - - - diff --git a/doc/html/tabs.css b/doc/html/tabs.css deleted file mode 100644 index 9cf578f..0000000 --- a/doc/html/tabs.css +++ /dev/null @@ -1,60 +0,0 @@ -.tabs, .tabs2, .tabs3 { - background-image: url('tab_b.png'); - width: 100%; - z-index: 101; - font-size: 13px; - font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; -} - -.tabs2 { - font-size: 10px; -} -.tabs3 { - font-size: 9px; -} - -.tablist { - margin: 0; - padding: 0; - display: table; -} - -.tablist li { - float: left; - display: table-cell; - background-image: url('tab_b.png'); - line-height: 36px; - list-style: none; -} - -.tablist a { - display: block; - padding: 0 20px; - font-weight: bold; - background-image:url('tab_s.png'); - background-repeat:no-repeat; - background-position:right; - color: #283A5D; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; - outline: none; -} - -.tabs3 .tablist a { - padding: 0 10px; -} - -.tablist a:hover { - background-image: url('tab_h.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); - text-decoration: none; -} - -.tablist li.current a { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); -} diff --git a/doc/html/wherephrase_8h_source.html b/doc/html/wherephrase_8h_source.html deleted file mode 100644 index 06db3c3..0000000 --- a/doc/html/wherephrase_8h_source.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - -Nut: src/wherephrase.h Source File - - - - - - -
-
- - - - - - -
-
Nut -  0.1 -
-
-
- - - - - -
-
-
-
wherephrase.h
-
-
-
1 /**************************************************************************
-
2 **
-
3 ** This file is part of Nut project.
-
4 ** https://github.com/HamedMasafi/Nut
-
5 **
-
6 ** Nut is free software: you can redistribute it and/or modify
-
7 ** it under the terms of the GNU Lesser General Public License as published by
-
8 ** the Free Software Foundation, either version 3 of the License, or
-
9 ** (at your option) any later version.
-
10 **
-
11 ** Nut is distributed in the hope that it will be useful,
-
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
-
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
14 ** GNU Lesser General Public License for more details.
-
15 **
-
16 ** You should have received a copy of the GNU Lesser General Public License
-
17 ** along with Nut. If not, see <http://www.gnu.org/licenses/>.
-
18 **
-
19 **************************************************************************/
-
20 
-
21 #ifndef PHRASE_H
-
22 #define PHRASE_H
-
23 
-
24 #include <QtCore/qglobal.h>
-
25 
-
26 #include <QVariant>
-
27 #include <QDate>
-
28 #include <QDateTime>
-
29 #include <QTime>
-
30 #include <QSharedPointer>
-
31 
-
32 QT_BEGIN_NAMESPACE
-
33 
-
34 class SqlGeneratorBase;
-
35 class PhraseData{
-
36 public:
-
37  enum Condition
-
38  {
-
39  NotAssign = 0,
-
40  Equal,
-
41  Less,
-
42  LessEqual,
-
43  Null,
-
44  In,
-
45  Like,
-
46 
-
47  Not = 10,
-
48  NotEqual,
-
49  GreaterEqual,
-
50  Greater,
-
51  NotNull,
-
52  NotIn,
-
53  NotLike,
-
54 
-
55  And = 20,
-
56  Or,
-
57 
-
58 
-
59  Append,
-
60  Set,
-
61 
-
62  Add,
-
63  Minus,
-
64  Multiple,
-
65  Divide
-
66  };
-
67 
-
68  enum Type{
-
69  Field,
-
70  WithVariant,
-
71  WithOther,
-
72  WithoutOperand
-
73  };
-
74  Type type;
-
75 
-
76  Condition operatorCond;
-
77 
-
78  QString text;
-
79  const PhraseData *left;
-
80  const PhraseData *right;
-
81  QVariant operand;
-
82 
-
83  PhraseData(const char *className, const char* s);
-
84  PhraseData(PhraseData *l, Condition o);
-
85  PhraseData(PhraseData *l, Condition o, const PhraseData *r);
-
86  PhraseData(PhraseData *l, Condition o, QVariant r);
-
87 
-
88  ~PhraseData();
-
89 };
-
90 
- -
92 protected:
-
93  PhraseData *_data;
-
94  QSharedPointer<PhraseData> _dataPointer;
-
95 
-
96 public:
-
97  WherePhrase(const char *className, const char* s);
-
98 
-
99  WherePhrase(const WherePhrase &l);
- -
101  WherePhrase(WherePhrase *l, PhraseData::Condition o);
-
102  WherePhrase(WherePhrase *l, PhraseData::Condition o, WherePhrase *r);
-
103  WherePhrase(WherePhrase *l, PhraseData::Condition o, QVariant r);
-
104 
-
105  ~WherePhrase();
-
106 
-
107  WherePhrase operator ==(const WherePhrase &other);
-
108  WherePhrase operator !=(const WherePhrase &other);
-
109  WherePhrase operator <(const WherePhrase &other);
-
110  WherePhrase operator >(const WherePhrase &other);
-
111  WherePhrase operator <=(const WherePhrase &other);
-
112  WherePhrase operator >=(const WherePhrase &other);
-
113 
-
114  WherePhrase operator =(const WherePhrase &other);
-
115 
-
116  WherePhrase operator +(const WherePhrase &other);
-
117  WherePhrase operator -(const WherePhrase &other);
-
118  WherePhrase operator *(const WherePhrase &other);
-
119  WherePhrase operator /(const WherePhrase &other);
-
120 
-
121  WherePhrase operator &&(const WherePhrase &other);
-
122  WherePhrase operator ||(const WherePhrase &other);
-
123 
-
124  WherePhrase operator &(const WherePhrase &other);
-
125 
-
126 
-
127  WherePhrase operator ==(const QVariant &other);
-
128  WherePhrase operator !=(const QVariant &other);
-
129  WherePhrase operator <(const QVariant &other);
-
130  WherePhrase operator >(const QVariant &other);
-
131  WherePhrase operator <=(const QVariant &other);
-
132  WherePhrase operator >=(const QVariant &other);
-
133 
-
134 
-
135  PhraseData *data() const;
-
136 };
-
137 
-
138 class FieldPhrase: public WherePhrase{
-
139 public:
-
140  FieldPhrase(const char *className, const char* s);
-
141 
-
142  WherePhrase operator =(const QVariant &other);
-
143  WherePhrase operator !();
-
144 
-
145  WherePhrase isNull();
-
146  WherePhrase in(QVariantList list);
-
147  WherePhrase in(QStringList list);
-
148  WherePhrase like(QString pattern);
-
149 };
-
150 
-
151 
-
152 //TODO: make FieldPhrase template class
-
153 //template <typename T>
-
154 //class FieldPhrase: public WherePhrase{
-
155 
-
156 //};
-
157 
-
158 QT_END_NAMESPACE
-
159 
-
160 #endif // PHRASE_H
-
- - - - diff --git a/include/DbGeography b/include/DbGeography index 7e8c4fa..66d3f2d 100644 --- a/include/DbGeography +++ b/include/DbGeography @@ -1 +1 @@ -#include "../src/dbgeography.h" +#include "../src/types/dbgeography.h" diff --git a/include/Nut b/include/Nut index 2dfb0b9..5b89c95 100644 --- a/include/Nut +++ b/include/Nut @@ -2,5 +2,4 @@ #include "../src/table.h" #include "../src/database.h" #include "../src/tableset.h" -#include "../src/dbgeography.h" #include "../src/query.h" diff --git a/include/dbgeography.h b/include/dbgeography.h index 7e8c4fa..66d3f2d 100644 --- a/include/dbgeography.h +++ b/include/dbgeography.h @@ -1 +1 @@ -#include "../src/dbgeography.h" +#include "../src/types/dbgeography.h" diff --git a/include/header_copier b/include/header_copier old mode 100644 new mode 100755 index 6265d12..e228c19 --- a/include/header_copier +++ b/include/header_copier @@ -1,27 +1,42 @@ #!/bin/bash -exec 3< <(egrep -o "class\sNUT_EXPORT\s(\S+)" ../src -R 2>&1) +src_dir="src" +namespace_name="nut" -pattern="\.\.\/src\/([a-z]+)\.h\:class\sNUT_EXPORT\s(\w+)" +ns=$(echo $namespace_name|awk '{print tolower($0)}') +Ns="Nut" +NS=$(echo $namespace_name|awk '{print toupper($0)}') +echo $NS +exit -echo "" > "Nut" -echo "" > "nut.h" +create_sub_folder=true -#mkdir -p Nut +exec 3< <(egrep -o "class\s${NS}_EXPORT\s(\S+)" "../$src_dir" -R 2>&1) + +pattern="\.\.\/$src_dir\/([a-z]+)\.h\:class\s${NS}_EXPORT\s(\w+)" + +echo "" > "$Ns" +echo "" > "$ns.h" + +if [[ -z create_sub_folder ]]; then + mkdir -p $Ns +fi while read line; do if [[ $line =~ $pattern ]]; then header=${BASH_REMATCH[1]} class=${BASH_REMATCH[2]} - echo "#include \"../src/$header.h\"" > $class - echo "#include \"../src/$header.h\"" > "$header.h" - - #echo "#include \"../src/$header.h\"" > "Nut/$class" - #echo "#include \"../src/$header.h\"" > "Nut/$header.h" - - echo "#include \"../src/$header.h\"" >> "Nut" - echo "#include \"../src/$header.h\"" >> "nut.h" + echo "#include \"../$src_dir/$header.h\"" > $class + echo "#include \"../$src_dir/$header.h\"" > "$header.h" + + if [[ -z create_sub_folder ]]; then + echo "#include \"../$src_dir/$header.h\"" > "$Ns/$class" + echo "#include \"../$src_dir/$header.h\"" > "$Ns/$header.h" + fi + + echo "#include \"../$src_dir/$header.h\"" >> "$Ns" + echo "#include \"../$src_dir/$header.h\"" >> "$ns.h" fi done <&3 exec 3<&- diff --git a/nut.pri b/nut.pri index fc794ff..4932d79 100644 --- a/nut.pri +++ b/nut.pri @@ -3,41 +3,43 @@ QT += core sql INCLUDEPATH += $$PWD/include HEADERS += \ + $$PWD/src/generators/sqlgeneratorbase_p.h \ + $$PWD/src/generators/postgresqlgenerator.h \ + $$PWD/src/generators/mysqlgenerator.h \ + $$PWD/src/generators/sqlitegenerator.h \ + $$PWD/src/generators/sqlservergenerator.h \ + $$PWD/src/types/dbgeography.h \ $$PWD/src/tableset.h \ $$PWD/src/defines_p.h \ $$PWD/src/defines.h \ $$PWD/src/query.h \ $$PWD/src/databasemodel.h \ - $$PWD/src/sqlgeneratorbase_p.h \ - $$PWD/src/postgresqlgenerator.h \ $$PWD/src/changelogtable.h \ $$PWD/src/tablesetbase_p.h \ $$PWD/src/querybase_p.h \ - $$PWD/src/mysqlgenerator.h \ - $$PWD/src/sqlitegenerator.h \ $$PWD/src/tablemodel.h \ - $$PWD/src/sqlservergenerator.h \ $$PWD/src/wherephrase.h \ $$PWD/src/query_p.h \ $$PWD/src/table.h \ $$PWD/src/database.h \ $$PWD/src/database_p.h \ - $$PWD/src/dbgeography.h + $$PWD/src/serializableobject.h SOURCES += \ + $$PWD/src/generators/sqlgeneratorbase.cpp \ + $$PWD/src/generators/postgresqlgenerator.cpp \ + $$PWD/src/generators/mysqlgenerator.cpp \ + $$PWD/src/generators/sqlitegenerator.cpp \ + $$PWD/src/generators/sqlservergenerator.cpp \ + $$PWD/src/types/dbgeography.cpp \ $$PWD/src/tableset.cpp \ $$PWD/src/query.cpp \ $$PWD/src/databasemodel.cpp \ $$PWD/src/tablesetbase.cpp \ - $$PWD/src/sqlgeneratorbase.cpp \ - $$PWD/src/postgresqlgenerator.cpp \ $$PWD/src/changelogtable.cpp \ $$PWD/src/querybase.cpp \ - $$PWD/src/mysqlgenerator.cpp \ - $$PWD/src/sqlitegenerator.cpp \ $$PWD/src/tablemodel.cpp \ - $$PWD/src/sqlservergenerator.cpp \ $$PWD/src/wherephrase.cpp \ $$PWD/src/table.cpp \ $$PWD/src/database.cpp \ - $$PWD/src/dbgeography.cpp + $$PWD/src/serializableobject.cpp diff --git a/nut.pro b/nut.pro new file mode 100644 index 0000000..9603a19 --- /dev/null +++ b/nut.pro @@ -0,0 +1,49 @@ +QT += sql +QT -= gui + +TARGET = nut +TEMPLATE = lib + +DEFINES += QT_DEPRECATED_WARNINGS + +HEADERS += \ + $$PWD/src/generators/sqlgeneratorbase_p.h \ + $$PWD/src/generators/postgresqlgenerator.h \ + $$PWD/src/generators/mysqlgenerator.h \ + $$PWD/src/generators/sqlitegenerator.h \ + $$PWD/src/generators/sqlservergenerator.h \ + $$PWD/src/types/dbgeography.h \ + $$PWD/src/tableset.h \ + $$PWD/src/defines_p.h \ + $$PWD/src/defines.h \ + $$PWD/src/query.h \ + $$PWD/src/databasemodel.h \ + $$PWD/src/changelogtable.h \ + $$PWD/src/tablesetbase_p.h \ + $$PWD/src/querybase_p.h \ + $$PWD/src/tablemodel.h \ + $$PWD/src/wherephrase.h \ + $$PWD/src/query_p.h \ + $$PWD/src/table.h \ + $$PWD/src/database.h \ + $$PWD/src/database_p.h \ + $$PWD/src/serializableobject.h + +SOURCES += \ + $$PWD/src/generators/sqlgeneratorbase.cpp \ + $$PWD/src/generators/postgresqlgenerator.cpp \ + $$PWD/src/generators/mysqlgenerator.cpp \ + $$PWD/src/generators/sqlitegenerator.cpp \ + $$PWD/src/generators/sqlservergenerator.cpp \ + $$PWD/src/types/dbgeography.cpp \ + $$PWD/src/tableset.cpp \ + $$PWD/src/query.cpp \ + $$PWD/src/databasemodel.cpp \ + $$PWD/src/tablesetbase.cpp \ + $$PWD/src/changelogtable.cpp \ + $$PWD/src/querybase.cpp \ + $$PWD/src/tablemodel.cpp \ + $$PWD/src/wherephrase.cpp \ + $$PWD/src/table.cpp \ + $$PWD/src/database.cpp \ + $$PWD/src/serializableobject.cpp diff --git a/nut.qbs b/nut.qbs new file mode 100644 index 0000000..d7e3dc1 --- /dev/null +++ b/nut.qbs @@ -0,0 +1,39 @@ +import qbs + +Product { + type: "staticlibrary" + name: "nut" + Depends { name: 'cpp' } + Depends { name: "Qt.core" } + Depends { name: "Qt.sql" } + + Export { + Depends { name: "cpp" } + Depends { name: "Qt.core" } + Depends { name: "Qt.sql" } + cpp.includePaths: [ + product.sourceDirectory + "/src", + product.sourceDirectory + "/include" + ] + } + + files: [ + "src/tableset.cpp", + "src/query.cpp", + "src/databasemodel.cpp", + "src/tablesetbase.cpp", + "src/changelogtable.cpp", + "src/querybase.cpp", + "src/tablemodel.cpp", + "src/wherephrase.cpp", + "src/table.cpp", + "src/database.cpp", + "src/generators/sqlgeneratorbase.cpp", + "src/generators/postgresqlgenerator.cpp", + "src/generators/mysqlgenerator.cpp", + "src/generators/sqlitegenerator.cpp", + "src/generators/sqlservergenerator.cpp", + "src/types/dbgeography.cpp", + "src/serializableobject.cpp" + ] +} diff --git a/src/changelogtable.cpp b/src/changelogtable.cpp index b66c4df..93e096c 100644 --- a/src/changelogtable.cpp +++ b/src/changelogtable.cpp @@ -22,7 +22,7 @@ NUT_BEGIN_NAMESPACE -ChangeLogTable::ChangeLogTable() +ChangeLogTable::ChangeLogTable(QObject *tableSet) : Table(tableSet) { diff --git a/src/changelogtable.h b/src/changelogtable.h index 4b9f618..27c4f70 100644 --- a/src/changelogtable.h +++ b/src/changelogtable.h @@ -35,14 +35,14 @@ class ChangeLogTable : public Table NUT_DECLARE_FIELD(QString, data, data, setData) - NUT_DECLARE_FIELD(int, versionMajor, versionMajor, setVersionMajor) - - NUT_DECLARE_FIELD(int, versionMinor, versionMinor, setVersionMinor) + NUT_DECLARE_FIELD(QString, version, version, setVersion) public: - ChangeLogTable(); + ChangeLogTable(QObject *parentTableSet = Q_NULLPTR); }; NUT_END_NAMESPACE +Q_DECLARE_METATYPE(Nut::ChangeLogTable*) + #endif // CHANGELOGTABLE_H diff --git a/src/database.cpp b/src/database.cpp index 5abe025..9ffdf45 100644 --- a/src/database.cpp +++ b/src/database.cpp @@ -34,11 +34,12 @@ #include "database_p.h" #include "defines.h" #include "tablemodel.h" -#include "postgresqlgenerator.h" -#include "mysqlgenerator.h" -#include "sqlitegenerator.h" -#include "sqlservergenerator.h" +#include "generators/postgresqlgenerator.h" +#include "generators/mysqlgenerator.h" +#include "generators/sqlitegenerator.h" +#include "generators/sqlservergenerator.h" #include "query.h" +#include "changelogtable.h" #include #include @@ -47,27 +48,35 @@ NUT_BEGIN_NAMESPACE -int DatabasePrivate::lastId = 0; +qulonglong DatabasePrivate::lastId = 0; QMap DatabasePrivate::allTableMaps; -DatabasePrivate::DatabasePrivate(Database *parent) : q_ptr(parent) +DatabasePrivate::DatabasePrivate(Database *parent) : q_ptr(parent), isDatabaseNew(false) { } bool DatabasePrivate::open(bool update) { + if (db.isOpen()) + return true; Q_Q(Database); // if (update) - bool isNew = getCurrectScheema(); - connectionName = q->metaObject()->className() + QString::number(DatabasePrivate::lastId); db = QSqlDatabase::addDatabase(driver, connectionName); db.setHostName(hostName); + db.setPort(port); db.setDatabaseName(databaseName); db.setUserName(userName); db.setPassword(password); + + if (driver.toLower().startsWith("qsqlite") + && !QFile::exists(databaseName)) { + //Force to execute update database + isDatabaseNew = true; + update = true; + } bool ok = db.open(); if (!ok) { @@ -79,6 +88,8 @@ bool DatabasePrivate::open(bool update) || db.lastError().text().contains("Cannot open database") || db.lastError().text().contains("Unknown database '" + databaseName + "'")) { + + db.close(); db.setDatabaseName(sqlGenertor->masterDatabaseName(databaseName)); ok = db.open(); qDebug("Creating database"); @@ -86,10 +97,13 @@ bool DatabasePrivate::open(bool update) db.exec("CREATE DATABASE " + databaseName); db.close(); - if (db.lastError().type() != QSqlError::NoError) + if (db.lastError().type() != QSqlError::NoError) { qWarning("Creating database error: %s", db.lastError().text().toLatin1().data()); + return false; + } + isDatabaseNew = true; return open(update); } else { qWarning("Unknown error detecting change logs, %s", @@ -99,7 +113,7 @@ bool DatabasePrivate::open(bool update) return false; } - if(isNew) + if(update) return updateDatabase(); else return true; @@ -109,7 +123,10 @@ bool DatabasePrivate::updateDatabase() { Q_Q(Database); - DatabaseModel last = getLastScheema(); + if (!getCurrectScheema()) + return true; + + DatabaseModel last = isDatabaseNew ? DatabaseModel() : getLastScheema(); DatabaseModel current = currentModel; if (last == current) { @@ -123,30 +140,28 @@ bool DatabasePrivate::updateDatabase() qDebug("Databse is changed"); QStringList sql = sqlGenertor->diff(last, current); + db.transaction(); foreach (QString s, sql) { db.exec(s); if (db.lastError().type() != QSqlError::NoError) - qWarning("Error executing sql command, %s", + qWarning("Error executing sql command `%s`, %s", + qPrintable(s), db.lastError().text().toLatin1().data()); } - storeScheemaInDB(); + putModelToDatabase(); bool ok = db.commit(); if (db.lastError().type() == QSqlError::NoError) { - q->databaseUpdated(last.versionMajor(), last.versionMinor(), - current.versionMajor(), current.versionMinor()); - QString versionText = QString::number(current.versionMajor()) + "_" - + QString::number(current.versionMinor()); + q->databaseUpdated(last.version(), current.version()); for (int i = 0; i < q->metaObject()->methodCount(); i++) { QMetaMethod m = q->metaObject()->method(i); - if (m.name() == "update" + versionText) { + if (m.name() == "update" + current.version()) { m.invoke(q, Qt::DirectConnection, - Q_ARG(int, current.versionMajor()), - Q_ARG(int, current.versionMinor())); + Q_ARG(QString, current.version())); break; } } @@ -162,6 +177,7 @@ bool DatabasePrivate::getCurrectScheema() { Q_Q(Database); + //is not first instanicate of this class if (allTableMaps.contains(q->metaObject()->className())) { currentModel = allTableMaps[q->metaObject()->className()]; return false; @@ -170,7 +186,7 @@ bool DatabasePrivate::getCurrectScheema() tables.clear(); // TODO: change logs must not be in model - int changeLogTypeId = qRegisterMetaType(); + int changeLogTypeId = qRegisterMetaType(); currentModel.append( new TableModel(changeLogTypeId, __CHANGE_LOG_TABLE_NAME)); tables.insert(ChangeLogTable::staticMetaObject.className(), @@ -179,19 +195,27 @@ bool DatabasePrivate::getCurrectScheema() changeLogs = new TableSet(q); for (int i = 0; i < q->metaObject()->classInfoCount(); i++) { - QMetaClassInfo ci = q->metaObject()->classInfo(i); - QString ciName - = QString(ci.name()).replace(__nut_NAME_PERFIX, "").replace("\"", - ""); - if (ciName.startsWith(__nut_TABLE)) - tables.insert(ciName.split(" ").at(1), ci.value()); + QString type; + QString name; + QString value; - if (ciName == __nut_DB_VERSION) { + if (!checkClassInfo(q->metaObject()->classInfo(i), + type, name, value)) { + continue; + } + + if (type == __nut_TABLE) + tables.insert(name, value); + + if (type == __nut_DB_VERSION) + currentModel.setVersion(name); + + /* TODO: remove QStringList version = QString(ci.value()).replace("\"", "").split('.'); bool ok = false; if (version.length() == 1) { - currentModel.setVersionMajor(version.at(0).toInt(&ok)); + currentModel.setVersion(version.at(0).toInt(&ok)); } else if (version.length() == 2) { currentModel.setVersionMajor(version.at(0).toInt(&ok)); currentModel.setVersionMinor(version.at(1).toInt(&ok)); @@ -199,8 +223,7 @@ bool DatabasePrivate::getCurrectScheema() if (!ok) qFatal("NUT_DB_VERSION macro accept version in format 'x' or " - "'x[.y]' only, and x,y must be integer values\n"); - } + "'x[.y]' only, and x,y must be integer values\n");*/ } for (int i = 1; i < q->metaObject()->propertyCount(); i++) { @@ -214,37 +237,52 @@ bool DatabasePrivate::getCurrectScheema() } } - foreach (TableModel *sch, currentModel) - foreach (RelationModel *fk, sch->foregionKeys()) - fk->table = currentModel.tableByClassName(fk->className); + foreach (TableModel *table, currentModel) + foreach (RelationModel *fk, table->foregionKeys()) + fk->masterTable = currentModel.tableByClassName(fk->masterClassName); allTableMaps.insert(q->metaObject()->className(), currentModel); return true; } +bool DatabasePrivate::checkClassInfo(const QMetaClassInfo &classInfo, QString &type, QString &name, QString &value) +{ + if (!QString(classInfo.name()).startsWith(__nut_NAME_PERFIX)) { + return false; + } else { + QStringList parts = QString(classInfo.value()).split("\n"); + if (parts.count() != 3) + return false; + + type = parts[0]; + name = parts[1]; + value = parts[2]; + return true; + } +} + DatabaseModel DatabasePrivate::getLastScheema() { - Q_Q(Database); - ChangeLogTable *u = changeLogs->query() ->orderBy(!ChangeLogTable::idField()) ->first(); - DatabaseModel ret(q->metaObject()->className()); +// DatabaseModel ret(q->metaObject()->className()); if (u) { QJsonObject json = QJsonDocument::fromJson( QByteArray(u->data().toLocal8Bit().data())).object(); + DatabaseModel ret = json; + return ret; + /* foreach (QString key, json.keys()) { TableModel *sch = new TableModel(json.value(key).toObject(), key); ret.append(sch); - } - - u->deleteLater(); + }*/ } - return ret; + return DatabaseModel(); // QSqlQuery query = q->exec("select * from __change_logs order by id // desc limit 1"); @@ -262,7 +300,7 @@ DatabaseModel DatabasePrivate::getLastScheema() // return ret; } -bool DatabasePrivate::storeScheemaInDB() +bool DatabasePrivate::putModelToDatabase() { Q_Q(Database); DatabaseModel current = currentModel; @@ -270,8 +308,7 @@ bool DatabasePrivate::storeScheemaInDB() ChangeLogTable *changeLog = new ChangeLogTable(); changeLog->setData(QJsonDocument(current.toJson()).toJson()); - changeLog->setVersionMajor(current.versionMajor()); - changeLog->setVersionMinor(current.versionMinor()); + changeLog->setVersion(current.version()); changeLogs->append(changeLog); q->saveChanges(); changeLog->deleteLater(); @@ -308,18 +345,33 @@ Database::Database(QObject *parent) DatabasePrivate::lastId++; } -Database::Database(const Database &other, QObject *parent) - : QObject(parent), d_ptr(new DatabasePrivate(this)) +Database::Database(const Database &other) + : QObject(other.parent()), d_ptr(new DatabasePrivate(this)) { DatabasePrivate::lastId++; setDriver(other.driver()); setHostName(other.hostName()); + setPort(other.port()); setDatabaseName(other.databaseName()); setUserName(other.userName()); setPassword(other.password()); } +Database::Database(const QSqlDatabase &other) +{ + //TODO: make a polish here + DatabasePrivate::lastId++; + +// setDriver(other.driver()); + setHostName(other.hostName()); + setPort(other.port()); + setDatabaseName(other.databaseName()); + setUserName(other.userName()); + setPassword(other.password()); + qRegisterMetaType(); +} + Database::~Database() { Q_D(Database); @@ -443,16 +495,19 @@ SqlGeneratorBase *Database::sqlGenertor() const return d->sqlGenertor; } -void Database::databaseUpdated(int oldMajor, int oldMinor, int newMajor, - int newMinor) +void Database::databaseUpdated(QString oldVersion, QString newVersion) { - Q_UNUSED(oldMajor); - Q_UNUSED(oldMinor); - Q_UNUSED(newMajor); - Q_UNUSED(newMinor); + Q_UNUSED(oldVersion); + Q_UNUSED(newVersion); } +/** + * @brief Database::open + * Opens the database connection using the current connection values. + * Returns true on success; otherwise returns false. + * @return bool + */ bool Database::open() { return open(true); diff --git a/src/database.h b/src/database.h index 4166e69..455d491 100644 --- a/src/database.h +++ b/src/database.h @@ -44,7 +44,8 @@ class NUT_EXPORT Database : public QObject public: Database(QObject *parent = 0); - Database(const Database &other, QObject *parent = 0); + Database(const Database &other); + Database(const QSqlDatabase &other); ~Database(); bool open(); @@ -71,8 +72,7 @@ public: protected: //remove minor version - virtual void databaseUpdated(int oldMajor, int oldMinor, int newMajor, - int newMinor); + virtual void databaseUpdated(QString oldVersion, QString newVersion); public slots: void setDatabaseName(QString databaseName); diff --git a/src/database_p.h b/src/database_p.h index 33c4b05..8265273 100644 --- a/src/database_p.h +++ b/src/database_p.h @@ -23,12 +23,12 @@ #include "database.h" #include "databasemodel.h" -#include "changelogtable.h" #include NUT_BEGIN_NAMESPACE +class ChangeLogTable; class DatabasePrivate { Database *q_ptr; @@ -41,10 +41,12 @@ public: bool updateDatabase(); void createChangeLogs(); - bool storeScheemaInDB(); + bool putModelToDatabase(); DatabaseModel getLastScheema(); bool getCurrectScheema(); + bool checkClassInfo(const QMetaClassInfo &classInfo, + QString &type, QString &name, QString &value); QSqlDatabase db; QString hostName; @@ -63,9 +65,11 @@ public: QT_DEPRECATED QHash tables; static QMap allTableMaps; - static int lastId; + static qulonglong lastId; QSet tableSets; + + bool isDatabaseNew; }; NUT_END_NAMESPACE diff --git a/src/databasemodel.cpp b/src/databasemodel.cpp index 3cea9da..e5adc6d 100644 --- a/src/databasemodel.cpp +++ b/src/databasemodel.cpp @@ -21,22 +21,42 @@ #include "databasemodel.h" #include "tablemodel.h" +#include #include NUT_BEGIN_NAMESPACE QMap DatabaseModel::_models; -DatabaseModel::DatabaseModel(const QString &name) : QList(), _databaseClassName(name), _versionMajor(0), _versionMinor(0) +#define NODE_VERSION "version" +#define NODE_TABLES "tables" +DatabaseModel::DatabaseModel(const QString &name) : + QList(), _databaseClassName(name), _version(QString::null) { _models.insert(name, this); } -DatabaseModel::DatabaseModel(const DatabaseModel &other) : QList(other), _versionMajor(0), _versionMinor(0) +DatabaseModel::DatabaseModel(const DatabaseModel &other) : + QList(other), _version(QString::null) { } +DatabaseModel::DatabaseModel(const QJsonObject &json) : + QList() +{ + setVersion(json.value(NODE_VERSION).toString()); + + QJsonObject tables = json.value(NODE_TABLES).toObject(); + foreach (QString key, tables.keys()) { + if(!tables.value(key).isObject()) + continue; + + TableModel *sch = new TableModel(tables.value(key).toObject(), key); + append(sch); + } +} + TableModel *DatabaseModel::tableByName(QString tableName) const { for(int i = 0; i < size(); i++){ @@ -46,23 +66,22 @@ TableModel *DatabaseModel::tableByName(QString tableName) const return s; } - qWarning("Table with name '%s' not found in model", - qUtf8Printable(tableName)); +// qWarning("Table with name '%s' not found in model", +// qUtf8Printable(tableName)); return 0; } TableModel *DatabaseModel::tableByClassName(QString className) const { + QStringList l; for(int i = 0; i < size(); i++){ TableModel *s = at(i); + l.append(s->className()); if(s->className() == className) return s; } - qWarning("Table with class name '%s' not found in model", - qUtf8Printable(className)); -// Q_UNREACHABLE(); return 0; } @@ -85,21 +104,41 @@ bool DatabaseModel::operator ==(const DatabaseModel &other) const return true; } +DatabaseModel DatabaseModel::operator +(const DatabaseModel &other) +{ + DatabaseModel model; + DatabaseModel::const_iterator i; + + for (i = constBegin(); i != constEnd(); ++i) + model.append(*i); + + for (i = other.constBegin(); i != other.constEnd(); ++i) + model.append(*i); + + return model; +} + QJsonObject DatabaseModel::toJson() const { QJsonObject obj; -// obj.insert(QT_STRINGIFY(versionMajor), QJsonValue(_versionMajor)); -// obj.insert(QT_STRINGIFY(versionMinor), QJsonValue(_versionMinor)); - + obj.insert(NODE_VERSION, QJsonValue(_version)); + QJsonObject tables; for(int i = 0; i < size(); i++){ TableModel *s = at(i); - obj.insert(s->name(), s->toJson()); + tables.insert(s->name(), s->toJson()); } + obj.insert(NODE_TABLES, tables); + return obj; } +DatabaseModel::operator QJsonObject() +{ + return toJson(); +} + RelationModel *DatabaseModel::relationByClassNames(const QString &masterClassName, const QString &childClassName) { TableModel *childTable = tableByClassName(childClassName); @@ -108,7 +147,7 @@ RelationModel *DatabaseModel::relationByClassNames(const QString &masterClassNam return 0; foreach (RelationModel *rel, childTable->foregionKeys()) - if(rel->className == masterClassName) + if(rel->masterClassName == masterClassName) return rel; return 0; @@ -122,7 +161,7 @@ RelationModel *DatabaseModel::relationByTableNames(const QString &masterTableNam return 0; foreach (RelationModel *rel, childTable->foregionKeys()) - if(rel->table->name() == masterTableName) + if(rel->masterTable->name() == masterTableName) return rel; return 0; @@ -132,10 +171,10 @@ DatabaseModel DatabaseModel::fromJson(QJsonObject &json) { DatabaseModel model(QString::null); -// model.setVersionMajor(json.value(QT_STRINGIFY(versionMajor)).toInt()); -// model.setVersionMinor(json.value(QT_STRINGIFY(versionMinor)).toInt()); + model.setVersion(json.value(NODE_VERSION).toString()); - foreach (QString key, json.keys()) { + QJsonObject tables = json.value(NODE_TABLES).toObject(); + foreach (QString key, tables.keys()) { if(!json.value(key).isObject()) continue; @@ -145,24 +184,14 @@ DatabaseModel DatabaseModel::fromJson(QJsonObject &json) return model; } -int DatabaseModel::versionMajor() const +QString DatabaseModel::version() const { - return _versionMajor; + return _version; } -void DatabaseModel::setVersionMajor(int versionMajor) +void DatabaseModel::setVersion(QString version) { - _versionMajor = versionMajor; -} - -int DatabaseModel::versionMinor() const -{ - return _versionMinor; -} - -void DatabaseModel::setVersionMinor(int versionMinor) -{ - _versionMinor = versionMinor; + _version = version; } bool DatabaseModel::remove(const QString &tableName) @@ -177,6 +206,15 @@ bool DatabaseModel::remove(const QString &tableName) return false; } +void DatabaseModel::fixRelations() +{ + /*TODO: fixme + foreach (TableModel *table, currentModel) + foreach (RelationModel *fk, table->foregionKeys()) + fk->masterTable = currentModel.tableByClassName(fk->masterClassName); + */ +} + DatabaseModel *DatabaseModel::modelByName(const QString &name) { if (_models.contains(name)) diff --git a/src/databasemodel.h b/src/databasemodel.h index 8a57f7d..c4e25b8 100644 --- a/src/databasemodel.h +++ b/src/databasemodel.h @@ -22,6 +22,9 @@ #define DATABASEMODEL_H #include +#include +#include + #include "defines.h" class QJsonObject; @@ -33,12 +36,13 @@ struct RelationModel; class DatabaseModel : public QList { QString _databaseClassName; - int _versionMajor, _versionMinor; + QString _version; static QMap _models; public: DatabaseModel(const QString &name = QString::null); DatabaseModel(const DatabaseModel &other); + DatabaseModel(const QJsonObject &json); TableModel *tableByName(QString tableName) const; TableModel *tableByClassName(QString className) const; @@ -49,18 +53,21 @@ public: const QString &childClassName); bool operator==(const DatabaseModel &other) const; + DatabaseModel operator +(const DatabaseModel &other); + Q_DECL_DEPRECATED static DatabaseModel fromJson(QJsonObject &json); QJsonObject toJson() const; + operator QJsonObject(); - int versionMajor() const; - void setVersionMajor(int versionMajor); - - int versionMinor() const; - void setVersionMinor(int versionMinor); + QString version() const; + void setVersion(QString version); bool remove(const QString &tableName); + //TODO: may be private (called from DatabasePrivate::getCurrectScheema only) + void fixRelations(); + static DatabaseModel *modelByName(const QString &name); }; diff --git a/src/defines.h b/src/defines.h index 5dc0b89..b8f4f89 100644 --- a/src/defines.h +++ b/src/defines.h @@ -26,43 +26,34 @@ #include "defines_p.h" #include "qglobal.h" - #ifdef NUT_COMPILE_STATIC # define NUT_EXPORT #else # define NUT_EXPORT Q_DECL_EXPORT #endif - -#ifdef NUT_NAMESPACE -//TODO: remove unused macro -# define __NUT_NAMESPACE_PERFIX NUT_NAMESPACE:: -# define NUT_WRAP_NAMESPACE(x) NUT_NAMESPACE::x -#else -//TODO: remove unused macro -# define __NUT_NAMESPACE_PERFIX -# define NUT_WRAP_NAMESPACE(x) x -#endif +#define NUT_INFO(type, name, value) \ + Q_CLASSINFO(__nut_NAME_PERFIX type #name #value, type "\n" #name "\n" #value) // Database -//TODO: remove minor version -#define NUT_DB_VERSION(major, minor) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX __nut_DB_VERSION), QT_STRINGIFY(#major "." #minor)) +#define NUT_DB_VERSION(version) \ + NUT_INFO(__nut_DB_VERSION, version, 0) #define NUT_DECLARE_TABLE(type, name) \ - Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX __nut_TABLE " " #type), #name) \ + NUT_INFO(__nut_TABLE, type, name) \ Q_PROPERTY(type* name READ name) \ - Q_PROPERTY(NUT_WRAP_NAMESPACE(TableSet) name##s READ name##s) \ + Q_PROPERTY(NUT_WRAP_NAMESPACE(TableSet) name##Table READ name##Table) \ type* m_##name; \ - NUT_WRAP_NAMESPACE(TableSet) *m_##name##s; \ + NUT_WRAP_NAMESPACE(TableSet) *m_##name##Table; \ public: \ static const type _##name; \ type* name() const{ return m_##name; } \ - NUT_WRAP_NAMESPACE(TableSet) *name##s() const { return m_##name##s; } + NUT_WRAP_NAMESPACE(TableSet) *name##Table() const { return m_##name##Table; } //Table #define NUT_DECLARE_FIELD(type, name, read, write) \ Q_PROPERTY(type name READ read WRITE write) \ - Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #name " " __nut_FIELD), #name) \ + NUT_INFO(__nut_FIELD, name, 0) \ type m_##name; \ public: \ static NUT_WRAP_NAMESPACE(FieldPhrase) name ## Field(){ \ @@ -80,7 +71,7 @@ public: \ #define NUT_FOREGION_KEY(type, keytype, name, read, write) \ Q_PROPERTY(type* name READ read WRITE write) \ NUT_DECLARE_FIELD(keytype, name##Id, read##Id, write##Id) \ - Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #name "Id " __nut_FOREGION_KEY), #type) \ + NUT_INFO(__nut_FOREGION_KEY, name, type) \ type *m_##name; \ public: \ type *read() const { return m_##name ; } \ @@ -92,38 +83,27 @@ public: \ private: \ NUT_WRAP_NAMESPACE(TableSet) *m_##n; \ public: \ - static type *n##Table(){ \ - static type *f = new type(); \ - return f; \ - } \ - NUT_WRAP_NAMESPACE(TableSet) *n(){ \ - return m_##n; \ - } + static type *n##Table(); \ + NUT_WRAP_NAMESPACE(TableSet) *n(); + +#define NUT_IMPLEMENT_CHILD_TABLE(class, type, n) \ + type *class::n##Table(){ \ + static type *f = new type(); \ + return f; \ + } \ + NUT_WRAP_NAMESPACE(TableSet) *class::n(){ \ + return m_##n; \ + } +#define NUT_PRIMARY_KEY(x) NUT_INFO(__nut_PRIMARY_KEY, x, 0) +#define NUT_AUTO_INCREMENT(x) NUT_INFO(__nut_AUTO_INCREMENT, x, 0) +#define NUT_PRIMARY_AUTO_INCREMENT(x) NUT_PRIMARY_KEY(x) \ + NUT_AUTO_INCREMENT(x) +#define NUT_UNIQUE(x) NUT_INFO(__nut_UNIQUE, x, 0) +#define NUT_LEN(field, len) NUT_INFO(__nut_LEN, field, len) +#define NUT_DEFAULT_VALUE(x, n) NUT_INFO(__nut_DEFAULT_VALUE, x, n) +#define NUT_NOT_NULL(x) NUT_INFO(__nut_NOT_NULL, x, 1) #define NUT_INDEX(name, field, order) -#define NUT_PRIMARY_KEY(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_PRIMARY_KEY), #x) -#define NUT_AUTO_INCREMENT(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_AUTO_INCREMENT), #x) -#define NUT_PRIMARY_AUTO_INCREMENT(x) NUT_PRIMARY_KEY(x) \ - NUT_AUTO_INCREMENT(x) -#define NUT_UNIQUE(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_UNIQUE), #x) -#define NUT_LEN(field, len) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #field " " __nut_LEN), #len) -#define NUT_DEFAULT_VALUE(x, n) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_DEFAULT_VALUE), #n) -#define NUT_NOT_NULL(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_NOT_NULL), "1") - -#ifndef NUT_NO_KEYWORDS -# define FROM(x) (x->query()) -# define WHERE(x) ->setWhere(x) -# define JOIN(x) ->join(#x) -# define ORDERBY(x) ->orderBy(#x); -# define ORDERBY_DESC(x) ->orderBy(!#x); - -# define SELECT() ->toList() -# define COUNT() ->count() -# define DELETE() ->remove() -# define FIRST() ->first() -#endif // NUT_NO_KEYWORDS - - #endif // SYNTAX_DEFINES_H diff --git a/src/defines_p.h b/src/defines_p.h index 425d02c..4c9bea2 100644 --- a/src/defines_p.h +++ b/src/defines_p.h @@ -44,11 +44,13 @@ #define __nut_CHANGE "change" #ifdef NUT_NAMESPACE -# define NUT_BEGIN_NAMESPACE namespace NUT_NAMESPACE{ -# define NUT_END_NAMESPACE } +# define NUT_BEGIN_NAMESPACE namespace NUT_NAMESPACE{ +# define NUT_END_NAMESPACE } +# define NUT_WRAP_NAMESPACE(x) NUT_NAMESPACE::x #else # define NUT_BEGIN_NAMESPACE # define NUT_END_NAMESPACE +# define NUT_WRAP_NAMESPACE(x) x #endif #endif // DEFINES_P_H diff --git a/src/mysqlgenerator.cpp b/src/generators/mysqlgenerator.cpp similarity index 78% rename from src/mysqlgenerator.cpp rename to src/generators/mysqlgenerator.cpp index f2d4c1a..559e392 100644 --- a/src/mysqlgenerator.cpp +++ b/src/generators/mysqlgenerator.cpp @@ -19,7 +19,7 @@ **************************************************************************/ #include "mysqlgenerator.h" -#include "tablemodel.h" +#include "../tablemodel.h" #include #include @@ -134,4 +134,24 @@ QString MySqlGenerator::phrase(const PhraseData *d) const return SqlGeneratorBase::phrase(d); } +QString MySqlGenerator::selectCommand(SqlGeneratorBase::AgregateType t, + QString agregateArg, + QString tableName, + QList &wheres, + QList &orders, + QList joins, + int skip, int take) +{ + QString command = SqlGeneratorBase::selectCommand(t, agregateArg, + tableName, + wheres, orders, + joins, skip, take); + + if (take != -1 && skip != -1) + command.append(QString(" LIMIT %1 OFFSET %2") + .arg(take) + .arg(skip)); + return command; +} + NUT_END_NAMESPACE diff --git a/src/mysqlgenerator.h b/src/generators/mysqlgenerator.h similarity index 87% rename from src/mysqlgenerator.h rename to src/generators/mysqlgenerator.h index 8243ada..bf4ec6f 100644 --- a/src/mysqlgenerator.h +++ b/src/generators/mysqlgenerator.h @@ -35,6 +35,7 @@ public: QString escapeValue(const QVariant &v) const; QVariant readValue(const QVariant::Type &type, const QVariant &dbValue); QString phrase(const PhraseData *d) const; + QString selectCommand(AgregateType t, QString agregateArg, QString tableName, QList &wheres, QList &orders, QList joins, int skip, int take); }; NUT_END_NAMESPACE diff --git a/src/postgresqlgenerator.cpp b/src/generators/postgresqlgenerator.cpp similarity index 98% rename from src/postgresqlgenerator.cpp rename to src/generators/postgresqlgenerator.cpp index 0ff4b46..105e663 100644 --- a/src/postgresqlgenerator.cpp +++ b/src/generators/postgresqlgenerator.cpp @@ -19,8 +19,8 @@ **************************************************************************/ #include "postgresqlgenerator.h" -#include "table.h" -#include "tablemodel.h" +#include "../table.h" +#include "../tablemodel.h" NUT_BEGIN_NAMESPACE diff --git a/src/postgresqlgenerator.h b/src/generators/postgresqlgenerator.h similarity index 100% rename from src/postgresqlgenerator.h rename to src/generators/postgresqlgenerator.h diff --git a/src/sqlgeneratorbase.cpp b/src/generators/sqlgeneratorbase.cpp similarity index 70% rename from src/sqlgeneratorbase.cpp rename to src/generators/sqlgeneratorbase.cpp index fa1c0cb..3a7b88f 100644 --- a/src/sqlgeneratorbase.cpp +++ b/src/generators/sqlgeneratorbase.cpp @@ -19,20 +19,39 @@ **************************************************************************/ #include +#include #include #include #include +#include #include -#include "database.h" -#include "databasemodel.h" #include "sqlgeneratorbase_p.h" -#include "table.h" -#include "tablemodel.h" -#include "wherephrase.h" +#include "../database.h" +#include "../table.h" +#include "../databasemodel.h" +#include "../tablemodel.h" +#include "../wherephrase.h" NUT_BEGIN_NAMESPACE +/* + * Index: + * ALTER TABLE `travelLog` ADD INDEX(`driverId`); + * + * Foreign key: + * ALTER TABLE `travelLog` + * ADD CONSTRAINT `travelLog_ibfk_1` + * FOREIGN KEY (`driverId`) + * REFERENCES `account` (`id`) + * ON DELETE CASCADE + * ON UPDATE CASCADE; + * + * SELECT + * FROM dbo.GiftTypes + * INNER JOIN dbo.GiftCards ON dbo.GiftTypes.GiftTypeID = dbo.GiftCards.GiftTypeID + * INNER JOIN dbo.Entities ON dbo.GiftCards.GiftCardID = dbo.Entities.GiftCardID + */ SqlGeneratorBase::SqlGeneratorBase(Database *parent) : QObject((QObject *)parent) { @@ -50,6 +69,12 @@ QString SqlGeneratorBase::masterDatabaseName(QString databaseName) return ""; } +QString SqlGeneratorBase::createTable(TableModel *table) +{ + Q_UNUSED(table); + return ""; +} + QString SqlGeneratorBase::saveRecord(Table *t, QString tableName) { Q_ASSERT(!tableName.isEmpty() && !tableName.isNull()); @@ -71,6 +96,20 @@ QString SqlGeneratorBase::saveRecord(Table *t, QString tableName) return ""; } +QString SqlGeneratorBase::recordsPhrase(TableModel *table) +{ + if (!table) + return ""; + + QString ret = ""; + foreach (FieldModel *f, table->fields()) { + if (!ret.isEmpty()) + ret.append(", "); + ret.append(QString("%1.%2 AS [%1.%2]").arg(table->name()).arg(f->name)); + } + return ret; +} + QString SqlGeneratorBase::fieldDeclare(FieldModel *field) { return field->name + " " + fieldType(field) + (field->notNull ? " NOT NULL" : ""); @@ -81,18 +120,15 @@ QStringList SqlGeneratorBase::diff(DatabaseModel lastModel, { QStringList ret; - QSet tableNames; - foreach (TableModel *table, lastModel) - tableNames.insert(table->name()); + DatabaseModel unionModel = lastModel + newModel; - foreach (TableModel *table, newModel) - tableNames.insert(table->name()); - - foreach (QString tableName, tableNames) { - TableModel *oldTable = lastModel.tableByName(tableName); - TableModel *newTable = newModel.tableByName(tableName); + foreach (TableModel *table, unionModel) { + TableModel *oldTable = lastModel.tableByName(table->name()); + TableModel *newTable = newModel.tableByName(table->name()); QString sql = diff(oldTable, newTable); - ret << sql; + + if (!sql.isEmpty()) + ret << sql; } return ret; @@ -164,6 +200,98 @@ QString SqlGeneratorBase::diff(TableModel *oldTable, TableModel *newTable) return sql; } +QString SqlGeneratorBase::join(const QString &mainTable, + const QList list, + QStringList *order) +{ + QString ret = mainTable; + QList::const_iterator i; + for (i = list.begin(); i != list.end(); ++i) { + if ((*i)->masterTable->name() == mainTable) { + ret.append(QString(" INNER JOIN %3 ON %1.%2 = %3.%4") + .arg((*i)->masterTable->name()) + .arg((*i)->masterTable->primaryKey()) + .arg((*i)->slaveTable->name()) + .arg((*i)->localColumn)); + + if (order != Q_NULLPTR) + order->append((*i)->slaveTable->name() + "." + (*i)->slaveTable->primaryKey()); + } else { + ret.append(QString(" INNER JOIN %3 ON %1.%2 = %3.%4") + .arg(mainTable) + .arg((*i)->localColumn) + .arg((*i)->masterTable->name()) + .arg((*i)->masterTable->primaryKey())); + + if (order != Q_NULLPTR) + order->append((*i)->masterTable->name() + "." + (*i)->masterTable->primaryKey()); + } + } + return ret; +} + +QString SqlGeneratorBase::join(const QStringList &list, QStringList *order) +{ + //TODO: reorder list first! + //TODO: make this ungly code better and bugless :-) + /* + * Known issues: + * Support onle near joins, far supports with medium table finding not support yet + */ + + if (!list.count()) + return ""; + + if (list.count() == 1) + return "[" + list.first() + "]"; + + DatabaseModel model = _database->model(); + QStringList clone = list; + QString mainTable = clone.takeFirst(); + QString ret = "[" + mainTable + "]"; + + do { + if (!clone.count()) + break; + + QString table = clone.first();// model.tableByClassName(clone.first())->name(); + RelationModel *rel = model.relationByClassNames(mainTable, clone.first()); + if (rel) { + //mainTable is master of table + ret.append(QString(" INNER JOIN [%1] ON %4.%2 = %1.%3") + .arg(table) + .arg(rel->masterTable->primaryKey()) + .arg(rel->localColumn) + .arg(mainTable)); + + if (order != Q_NULLPTR) + order->append(mainTable + "." + rel->masterTable->primaryKey()); + + } else{ + rel = model.relationByClassNames(clone.first(), mainTable); + if (rel) { + // table is master of mainTable + ret.append(QString(" INNER JOIN [%1] ON %4.%2 = %1.%3") + .arg(table) + .arg(rel->localColumn) + .arg(rel->masterTable->primaryKey()) + .arg(mainTable)); + + if (order != Q_NULLPTR) + order->append(mainTable + "." + rel->localColumn); + + } else { +// qInfo("Relation for %s and %s not exists", +// qPrintable(table), qPrintable(mainTable)); + } + } + + clone.takeFirst(); + } while (clone.count()); + + return ret; +} + QString SqlGeneratorBase::insertRecord(Table *t, QString tableName) { QString sql = ""; @@ -274,14 +402,10 @@ QString SqlGeneratorBase::fromTableText(const QString &tableName, .arg(rel->localColumn); orderBy = tableName + "." + pk; } else { - qWarning( - QString( - "Relation between table %1 and class %2 (%3) not exists!") - .arg(tableName) - .arg(joinClassName) - .arg(joinTableName.isNull() ? "NULL" : joinTableName) - .toLatin1() - .data()); + qWarning("Relation between table %s and class %s (%s) not exists!", + qPrintable(tableName), + qPrintable(joinClassName), + qPrintable(joinTableName.isNull() ? "NULL" : joinTableName)); joinClassName = QString::null; } } @@ -304,23 +428,40 @@ QString SqlGeneratorBase::deleteRecords(QString tableName, QString where) QString SqlGeneratorBase::selectCommand(SqlGeneratorBase::AgregateType t, QString agregateArg, + QString tableName, QList &wheres, QList &orders, - QString tableName, - QString joinClassName, int skip, int take) + QList joins, + int skip, int take) { Q_UNUSED(take); Q_UNUSED(skip); + QStringList joinedOrders; QString select = agregateText(t, agregateArg); + + //TODO: temporatory disabled + if (t == SelectAll) { + QSet tables; + tables.insert(_database->model().tableByName(tableName)); + foreach (RelationModel *rel, joins) + tables << rel->masterTable << rel->slaveTable; + + select = ""; + foreach (TableModel *t, tables) { + if (!select.isEmpty()) + select.append(", "); + select.append(recordsPhrase(t)); + } + } + QString from = join(tableName, joins, &joinedOrders); QString where = createWhere(wheres); - QString order = ""; - QString from = fromTableText(tableName, joinClassName, order); + QString orderText = joinedOrders.join(", "); foreach (WherePhrase p, orders) { - if (order != "") - order.append(", "); - order.append(phraseOrder(p.data())); + if (orderText != "") + orderText.append(", "); + orderText.append(phraseOrder(p.data())); } QString sql = "SELECT " + select + " FROM " + from; @@ -328,8 +469,8 @@ QString SqlGeneratorBase::selectCommand(SqlGeneratorBase::AgregateType t, if (where != "") sql.append(" WHERE " + where); - if (order != "") - sql.append(" ORDER BY " + order); + if (orderText != "") + sql.append(" ORDER BY " + orderText); for (int i = 0; i < _database->model().count(); i++) sql = sql.replace(_database->model().at(i)->className() + ".", @@ -337,7 +478,7 @@ QString SqlGeneratorBase::selectCommand(SqlGeneratorBase::AgregateType t, replaceTableNames(sql); - return sql; + return sql + " "; } QString SqlGeneratorBase::createWhere(QList &wheres) @@ -357,7 +498,8 @@ QString SqlGeneratorBase::createWhere(QList &wheres) void SqlGeneratorBase::replaceTableNames(QString &command) { foreach (TableModel *m, TableModel::allModels()) - command = command.replace("[" + m->className() + "].", "`" + m->name() + "`."); + command = command + .replace("[" + m->className() + "]", "`" + m->name() + "`"); } void SqlGeneratorBase::removeTableNames(QString &command) @@ -405,14 +547,6 @@ QString SqlGeneratorBase::updateCommand(WherePhrase &phrase, return sql; } -QString SqlGeneratorBase::joinTables(QStringList tables) -{ - Q_UNUSED(tables); - //TODO: implement me -// _database->model().relationByClassNames() - return ""; -} - QString SqlGeneratorBase::escapeValue(const QVariant &v) const { switch (v.type()) { @@ -428,18 +562,22 @@ QString SqlGeneratorBase::escapeValue(const QVariant &v) const return v.toString(); break; + case QVariant::Uuid: + return v.toUuid().toString(); + break; + case QVariant::Char: case QVariant::String: return "'" + v.toString() + "'"; case QVariant::DateTime: - return "'" + v.toDateTime().toString() + "'"; + return "'" + v.toDateTime().toString(Qt::ISODate) + "'"; case QVariant::Date: - return "'" + v.toDate().toString() + "'"; + return "'" + v.toDate().toString(Qt::ISODate) + "'"; case QVariant::Time: - return "'" + v.toTime().toString() + "'"; + return "'" + v.toTime().toString(Qt::ISODate) + "'"; case QVariant::StringList: case QVariant::List: @@ -460,6 +598,7 @@ QString SqlGeneratorBase::escapeValue(const QVariant &v) const return ""; default: + Q_UNREACHABLE(); return ""; } } diff --git a/src/sqlgeneratorbase_p.h b/src/generators/sqlgeneratorbase_p.h similarity index 86% rename from src/sqlgeneratorbase_p.h rename to src/generators/sqlgeneratorbase_p.h index 9714948..011f6b1 100644 --- a/src/sqlgeneratorbase_p.h +++ b/src/generators/sqlgeneratorbase_p.h @@ -24,7 +24,7 @@ #include #include #include -#include "wherephrase.h" +#include "../wherephrase.h" NUT_BEGIN_NAMESPACE @@ -33,8 +33,7 @@ struct FieldModel; class DatabaseModel; class TableModel; class Database; -//struct PhraseData; -//class WherePhrase; +class RelationModel; class SqlGeneratorBase : public QObject { // Q_OBJECT @@ -61,6 +60,8 @@ public: virtual QString masterDatabaseName(QString databaseName); + virtual QString createTable(TableModel *table); + virtual QString fieldType(FieldModel *field) = 0; virtual QString fieldDeclare(FieldModel *field); @@ -68,28 +69,31 @@ public: virtual QString diff(FieldModel *oldField, FieldModel *newField); virtual QString diff(TableModel *oldTable, TableModel *newTable); + virtual QString join(const QString &mainTable, + const QList list, + QStringList *order = Q_NULLPTR); + virtual QString join(const QStringList &list, QStringList *order = Q_NULLPTR); + virtual QString saveRecord(Table *t, QString tableName); + + virtual QString recordsPhrase(TableModel *table); + virtual QString insertRecord(Table *t, QString tableName); virtual QString updateRecord(Table *t, QString tableName); virtual QString deleteRecord(Table *t, QString tableName); - - virtual QString deleteRecords(QString tableName, QString where); virtual QString selectCommand(AgregateType t, - QString agregateArg, + QString agregateArg, QString tableName, QList &wheres, QList &orders, - QString tableName, - QString joinClassName, + QList joins, int skip = -1, int take = -1); virtual QString deleteCommand(QList &wheres, QString tableName); virtual QString updateCommand(WherePhrase &phrase, QList &wheres, QString tableName); - virtual QString joinTables(QStringList tables); - virtual QString escapeValue(const QVariant &v) const; virtual QVariant readValue(const QVariant::Type &type, const QVariant &dbValue); virtual QString phrase(const PhraseData *d) const; diff --git a/src/sqlitegenerator.cpp b/src/generators/sqlitegenerator.cpp similarity index 62% rename from src/sqlitegenerator.cpp rename to src/generators/sqlitegenerator.cpp index 744bb27..bddd186 100644 --- a/src/sqlitegenerator.cpp +++ b/src/generators/sqlitegenerator.cpp @@ -19,8 +19,8 @@ **************************************************************************/ #include "sqlitegenerator.h" -#include "table.h" -#include "tablemodel.h" +#include "../table.h" +#include "../tablemodel.h" NUT_BEGIN_NAMESPACE @@ -54,10 +54,9 @@ QString SqliteGenerator::fieldType(FieldModel *field) dbType = "real"; break; case QVariant::Int: -// if(field->isPrimaryKey) -// dbType = "INTEGER PRIMARY KEY"; -// else - dbType = "integer"; + dbType = "integer"; +// if (field->isAutoIncrement) +// dbType.append(" PRIMARY KEY AUTOINCREMENT"); break; case QVariant::String: if(field->length) @@ -72,4 +71,24 @@ QString SqliteGenerator::fieldType(FieldModel *field) return dbType; } +QString SqliteGenerator::selectCommand(SqlGeneratorBase::AgregateType t, + QString agregateArg, + QString tableName, + QList &wheres, + QList &orders, + QList joins, + int skip, int take) +{ + QString command = SqlGeneratorBase::selectCommand(t, agregateArg, + tableName, + wheres, orders, + joins, skip, take); + + if (take != -1 && skip != -1) + command.append(QString(" LIMIT %1 OFFSET %2") + .arg(take) + .arg(skip)); + return command; +} + NUT_END_NAMESPACE diff --git a/src/sqlitegenerator.h b/src/generators/sqlitegenerator.h similarity index 80% rename from src/sqlitegenerator.h rename to src/generators/sqlitegenerator.h index d607e0e..eeefffa 100644 --- a/src/sqlitegenerator.h +++ b/src/generators/sqlitegenerator.h @@ -32,6 +32,12 @@ public: SqliteGenerator(Database *parent = 0); QString fieldType(FieldModel *field); + + QString selectCommand(AgregateType t, QString agregateArg, + QString tableName, + QList &wheres, + QList &orders, + QList joins, int skip, int take); }; NUT_END_NAMESPACE diff --git a/src/sqlservergenerator.cpp b/src/generators/sqlservergenerator.cpp similarity index 83% rename from src/sqlservergenerator.cpp rename to src/generators/sqlservergenerator.cpp index cdca934..d1c5b3c 100644 --- a/src/sqlservergenerator.cpp +++ b/src/generators/sqlservergenerator.cpp @@ -19,8 +19,8 @@ **************************************************************************/ #include "sqlservergenerator.h" -#include "table.h" -#include "tablemodel.h" +#include "../table.h" +#include "../tablemodel.h" #include #include @@ -133,15 +133,20 @@ QString SqlServerGenerator::escapeValue(const QVariant &v) const return SqlGeneratorBase::escapeValue(v); } -QString SqlServerGenerator::selectCommand( - SqlGeneratorBase::AgregateType t, QString agregateArg, - QList &wheres, QList &orders, QString tableName, - QString joinClassName, int skip, int take) +QString SqlServerGenerator::selectCommand(SqlGeneratorBase::AgregateType t, + QString agregateArg, + QString tableName, + QList &wheres, + QList &orders, + QList joins, int skip, int take) { - QString command = SqlGeneratorBase::selectCommand(t, agregateArg, wheres, orders, tableName, joinClassName, skip, take); + QString command = SqlGeneratorBase::selectCommand(t, agregateArg, + tableName, + wheres, orders, + joins, skip, take); if (take != -1 && skip != -1) - command.append(QString("OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY") + command.append(QString("OFFSET %1 ROWS FETCH NEXT %2 ROWS ONLY") .arg(skip) .arg(take)); return command; diff --git a/src/sqlservergenerator.h b/src/generators/sqlservergenerator.h similarity index 89% rename from src/sqlservergenerator.h rename to src/generators/sqlservergenerator.h index 0966b27..9368050 100644 --- a/src/sqlservergenerator.h +++ b/src/generators/sqlservergenerator.h @@ -39,9 +39,10 @@ public: QString escapeValue(const QVariant &v) const; QString selectCommand(AgregateType t, QString agregateArg, + QString tableName, QList &wheres, - QList &orders, QString tableName, - QString joinClassName, int skip, int take); + QList &orders, + QList joins, int skip, int take); }; NUT_END_NAMESPACE diff --git a/src/query.cpp b/src/query.cpp index 9fc86ca..eacf1ba 100644 --- a/src/query.cpp +++ b/src/query.cpp @@ -23,7 +23,7 @@ NUT_BEGIN_NAMESPACE QueryPrivate::QueryPrivate(QueryBase *parent) : q_ptr(parent), - joinClassName(QString::null), skip(-1), take(-1) + skip(-1), take(-1) { } diff --git a/src/query.h b/src/query.h index a14b845..1fb4796 100644 --- a/src/query.h +++ b/src/query.h @@ -26,12 +26,14 @@ #include #include #include +#include +#include #include "query_p.h" #include "database.h" #include "databasemodel.h" #include "tablesetbase_p.h" -#include "sqlgeneratorbase_p.h" +#include "generators/sqlgeneratorbase_p.h" #include "querybase_p.h" #include "wherephrase.h" #include "tablemodel.h" @@ -39,7 +41,7 @@ NUT_BEGIN_NAMESPACE template -class NUT_EXPORT Query : public QueryBase + class NUT_EXPORT Query : public QueryBase { QueryPrivate *d_ptr; Q_DECLARE_PRIVATE(Query) @@ -48,37 +50,43 @@ class NUT_EXPORT Query : public QueryBase public: Query(Database *database, TableSetBase *tableSet, bool autoDelete); - ~Query(); - Query *join(const QString &tableName); + //ddl Query *setWhere(WherePhrase where); - Query *join(Table *c) + Query *join(const QString &className); + Query *join(Table *c); + + template + Query *join() { - join(c->metaObject()->className()); + join(TABLE::staticMetaObject.className()); return this; } -// Query *orderBy(QString fieldName, QString type); - Query *skip(int &n); - Query *take(int &n); + // Query *orderBy(QString fieldName, QString type); + Query *skip(int n); + Query *take(int n); Query *orderBy(WherePhrase phrase); Query *include(TableSetBase *t); Query *include(Table *t); - int count(); - QVariant max(FieldPhrase &f); - QVariant min(FieldPhrase &f); - QVariant average(FieldPhrase &f); + //data selecting T *first(); - QList toList(int count = -1); + QList toList(int count = -1); template QList select(const FieldPhrase f); + int count(); + QVariant max(const FieldPhrase &f); + QVariant min(const FieldPhrase &f); + QVariant average(const FieldPhrase &f); + //data mailpulation int update(WherePhrase phrase); int remove(); + //debug purpose QString sqlCommand() const; }; @@ -98,9 +106,9 @@ Q_OUTOFLINE_TEMPLATE Query::Query(Database *database, TableSetBase *tableSet, d->database = database; d->tableSet = tableSet; - d->tableName - = // TableModel::findByClassName(T::staticMetaObject.className())->name(); - d->database->model() + d->className = T::staticMetaObject.className(); + d->tableName = + d->database->model() .tableByClassName(T::staticMetaObject.className()) ->name(); } @@ -109,110 +117,171 @@ template Q_OUTOFLINE_TEMPLATE Query::~Query() { Q_D(Query); - delete d; } template Q_OUTOFLINE_TEMPLATE QList Query::toList(int count) { + Q_UNUSED(count); Q_D(Query); - QList result; + QList returnList; d->select = "*"; - // QSqlQuery q = - // d->database->exec(d->database->sqlGenertor()->selectCommand(d->wheres, - // d->orders, d->tableName, d->joinClassName)); d->sql = d->database->sqlGenertor()->selectCommand( - SqlGeneratorBase::SelectAll, "", d->wheres, d->orderPhrases, - d->tableName, d->joinClassName, d->skip, d->take); + SqlGeneratorBase::SelectAll, "", + d->tableName, + d->wheres, d->orderPhrases, d->relations, + d->skip, d->take); QSqlQuery q = d->database->exec(d->sql); - - // QString pk = TableModel::findByName(d->tableName)->primaryKey(); - QString pk = d->database->model().tableByName(d->tableName)->primaryKey(); - QVariant lastPkValue = QVariant(); - int childTypeId = 0; - T *lastRow = 0; - TableSetBase *childTableSet = Q_NULLPTR; - - // FIXME: getting table error - // QStringList masterFields = - // TableModel::findByName(d->tableName)->fieldsNames(); - QStringList masterFields - = d->database->model().tableByName(d->tableName)->fieldsNames(); - QStringList childFields; - if (!d->joinClassName.isNull()) { - TableModel *joinTableModel - = TableModel::findByClassName(d->joinClassName); - if (joinTableModel) { - // childFields = - // d->database->model().modelByClass(d->joinClassName)->fieldsNames(); - childFields - = TableModel::findByClassName(d->joinClassName)->fieldsNames(); - QString joinTableName = d->database->tableName(d->joinClassName); - childTypeId = d->database->model().tableByName(joinTableName)->typeId(); - // childTypeId = - // TableModel::findByName(joinTableName)->typeId(); - } + if (q.lastError().isValid()) { + qDebug() << q.lastError().text(); + return returnList; } - while (q.next()) { - if (lastPkValue != q.value(pk)) { - T *t = new T(); - foreach (QString field, masterFields) - t->setProperty(field.toLatin1().data(), q.value(field)); - // for (int i = 0; i < t->metaObject()->propertyCount(); - // i++) { - // const QMetaProperty p = - // t->metaObject()->property(i); + QSet relatedTables; + relatedTables << d->database->model().tableByName(d->tableName); + foreach (RelationModel *rel, d->relations) + relatedTables << rel->slaveTable << rel->masterTable; - // p.write(t, - // d->database->sqlGenertor()->readValue(p.type(), - // q.value(p.name()))); - // } - t->setTableSet(d->tableSet); - t->setStatus(Table::FeatchedFromDB); - t->setParent(this); - t->clear(); + struct LevelData{ + QList masters; + QList slaves; + QList masterFields; + QString keyFiledname; + QVariant lastKeyValue; + TableModel *table; + Table *lastRow; + }; + QVector levels; + QSet importedTables; + auto add_table = [&](int i, TableModel* table) { + if (importedTables.contains(table->name())) + return; + importedTables.insert(table->name()); - result.append(t); - lastRow = t; + LevelData data; + data.table = table; + data.keyFiledname = data.table->name() + "." + data.table->primaryKey(); + data.lastKeyValue = QVariant(); - if (childTypeId) { - QSet tableSets = t->tableSets; - foreach (TableSetBase *ts, tableSets) - if (ts->childClassName() == d->joinClassName) - childTableSet = ts; + QHash masters; + foreach (RelationModel *rel, d->relations) + if (rel->slaveTable->name() == table->name()) + masters.insert(rel->masterTable->name(), rel->localProperty); + + for (int j = 0; j < levels.count(); ++j) { + LevelData &dt = levels[j]; + + QHashIterator it(masters); + while (it.hasNext()) { + it.next(); + + if (dt.table->name() == it.key()) { + data.masters.append(j); + data.masterFields.append(it.value()); + dt.slaves.append(i); + } } } - if (childTypeId) { - const QMetaObject *childMetaObject - = QMetaType::metaObjectForType(childTypeId); - Table *childTable - = qobject_cast(childMetaObject->newInstance()); - - foreach (QString field, childFields) - childTable->setProperty(field.toLatin1().data(), - q.value(field)); - // TODO: set database for table - childTable->setParent(this); - childTable->setParentTable(lastRow); - childTable->setStatus(Table::FeatchedFromDB); - childTable->setTableSet(childTableSet); - childTable->clear(); - childTableSet->add(childTable); - } - lastPkValue = q.value(pk); - - if (!--count) - break; + levels.append(data); + }; + for (int i = 0; i < d->relations.count(); ++i) { + RelationModel *rel = d->relations[i]; + add_table(i, rel->masterTable); + add_table(i, rel->slaveTable); } + if (!importedTables.count()) { + LevelData data; + data.table = d->database->model().tableByName(d->tableName); + data.keyFiledname = d->tableName + "." + data.table->primaryKey(); + data.lastKeyValue = QVariant(); + + levels.append(data); + } + + QVector checked; + checked.reserve(levels.count()); + for (int i = 0; i < levels.count(); ++i) + checked.append(false); + + while (q.next()) { + checked.fill(false); + + int p = levels.count(); + int n = -1; + int lastP = p; + + while (p) { + // Q_ASSERT(p != lastP); + // if (p == lastP) + // qFatal("NULL Loop detected"); + + n = (++n) % levels.count(); + if (checked[n]) + continue; + LevelData &data = levels[n]; + + // check if key value is changed + if (data.lastKeyValue == q.value(data.keyFiledname)) { + --p; + continue; + } + + // check if master if current table has processed + foreach (int m, data.masters) + if (!checked[m]) + continue; + + checked[n] = true; + --p; + data.lastKeyValue = q.value(data.keyFiledname); + + //create table row + Table *table; + if (data.table->className() == d->className) { + table = new T(); + table->setParentTableSet(d->tableSet); + returnList.append(dynamic_cast(table)); + } else { + const QMetaObject *childMetaObject + = QMetaType::metaObjectForType(data.table->typeId()); + table = qobject_cast
(childMetaObject->newInstance()); + + } + + QStringList childFields = data.table->fieldsNames(); + foreach (QString field, childFields) + table->setProperty(field.toLatin1().data(), + q.value(data.table->name() + "." + field)); + + for (int i = 0; i < data.masters.count(); ++i) { + int master = data.masters[i]; + table->setProperty(data.masterFields[i].toLocal8Bit().data(), + QVariant::fromValue(levels[master].lastRow)); + + table->setParentTableSet( + levels[master].lastRow->childTableSet( + data.table->className())); + } + + table->setStatus(Table::FeatchedFromDB); + table->setParent(this); + table->clear(); + + //set last created row + data.lastRow = table; + + lastP = p; + } //while + } // while if (m_autoDelete) deleteLater(); - return result; + + return returnList; } template @@ -221,9 +290,12 @@ Q_OUTOFLINE_TEMPLATE QList Query::select(const FieldPhrase f) { Q_D(Query); QList ret; + + d->joins.prepend(d->tableName); d->sql = d->database->sqlGenertor()->selectCommand( - SqlGeneratorBase::SignleField, f.data()->text, d->wheres, - d->orderPhrases, d->tableName, d->joinClassName, d->skip, d->take); + SqlGeneratorBase::SignleField, f.data()->text, + d->tableName, d->wheres, + d->orderPhrases, d->relations, d->skip, d->take); QSqlQuery q = d->database->exec(d->sql); @@ -240,7 +312,9 @@ Q_OUTOFLINE_TEMPLATE QList Query::select(const FieldPhrase f) template Q_OUTOFLINE_TEMPLATE T *Query::first() { - QList list = toList(1); + skip(0); + take(1); + QList list = toList(1); if (list.count()) return list.first(); @@ -253,9 +327,14 @@ Q_OUTOFLINE_TEMPLATE int Query::count() { Q_D(Query); + d->joins.prepend(d->tableName); d->select = "COUNT(*)"; d->sql = d->database->sqlGenertor()->selectCommand(SqlGeneratorBase::Count, - QStringLiteral("*"), d->wheres, d->orderPhrases, d->tableName, d->joinClassName); + QStringLiteral("*"), + d->tableName, + d->wheres, + d->orderPhrases, + d->relations); QSqlQuery q = d->database->exec(d->sql); if (q.next()) @@ -264,13 +343,15 @@ Q_OUTOFLINE_TEMPLATE int Query::count() } template -Q_OUTOFLINE_TEMPLATE QVariant Query::max(FieldPhrase &f) +Q_OUTOFLINE_TEMPLATE QVariant Query::max(const FieldPhrase &f) { Q_D(Query); + d->joins.prepend(d->tableName); d->sql = d->database->sqlGenertor()->selectCommand( - SqlGeneratorBase::Max, f.data()->text, d->wheres, d->orderPhrases, - d->tableName, d->joinClassName); + SqlGeneratorBase::Max, f.data()->text, d->tableName, + d->wheres, d->orderPhrases, + d->relations); QSqlQuery q = d->database->exec(d->sql); if (q.next()) @@ -279,13 +360,15 @@ Q_OUTOFLINE_TEMPLATE QVariant Query::max(FieldPhrase &f) } template -Q_OUTOFLINE_TEMPLATE QVariant Query::min(FieldPhrase &f) +Q_OUTOFLINE_TEMPLATE QVariant Query::min(const FieldPhrase &f) { Q_D(Query); + d->joins.prepend(d->tableName); d->sql = d->database->sqlGenertor()->selectCommand( - SqlGeneratorBase::Min, f.data()->text, d->wheres, d->orderPhrases, - d->tableName, d->joinClassName); + SqlGeneratorBase::Min, f.data()->text, d->tableName, + d->wheres, d->orderPhrases, + d->relations); QSqlQuery q = d->database->exec(d->sql); if (q.next()) @@ -294,13 +377,15 @@ Q_OUTOFLINE_TEMPLATE QVariant Query::min(FieldPhrase &f) } template -Q_OUTOFLINE_TEMPLATE QVariant Query::average(FieldPhrase &f) +Q_OUTOFLINE_TEMPLATE QVariant Query::average(const FieldPhrase &f) { Q_D(Query); + d->joins.prepend(d->tableName); d->sql = d->database->sqlGenertor()->selectCommand( - SqlGeneratorBase::Average, f.data()->text, d->wheres, d->orderPhrases, - d->tableName, d->joinClassName); + SqlGeneratorBase::Average, f.data()->text, d->tableName, + d->wheres, d->orderPhrases, + d->relations); QSqlQuery q = d->database->exec(d->sql); if (q.next()) @@ -309,10 +394,31 @@ Q_OUTOFLINE_TEMPLATE QVariant Query::average(FieldPhrase &f) } template -Q_OUTOFLINE_TEMPLATE Query *Query::join(const QString &tableName) +Q_OUTOFLINE_TEMPLATE Query *Query::join(const QString &className) { Q_D(Query); - d->joinClassName = tableName; + + RelationModel *rel = d->database->model() + .relationByClassNames(d->className, className); + if (!rel) + rel = d->database->model() + .relationByClassNames(className, d->className); + + if (!rel) { + qInfo("No relation between %s and %s", + qPrintable(d->className), qPrintable(className)); + return this; + } + + d->relations.append(rel); + d->joins.append(className); + return this; +} + +template +Q_OUTOFLINE_TEMPLATE Query *Query::join(Table *c) +{ + join(c->metaObject()->className()); return this; } @@ -325,7 +431,7 @@ Q_OUTOFLINE_TEMPLATE Query *Query::setWhere(WherePhrase where) } template -Q_OUTOFLINE_TEMPLATE Query *Query::skip(int &n) +Q_OUTOFLINE_TEMPLATE Query *Query::skip(int n) { Q_D(Query); d->skip = n; @@ -333,7 +439,7 @@ Q_OUTOFLINE_TEMPLATE Query *Query::skip(int &n) } template -Q_OUTOFLINE_TEMPLATE Query *Query::take(int &n) +Q_OUTOFLINE_TEMPLATE Query *Query::take(int n) { Q_D(Query); d->take = n; @@ -361,7 +467,6 @@ template Q_OUTOFLINE_TEMPLATE Query *Query::include(TableSetBase *t) { Q_D(Query); - d->joinClassName = t->childClassName(); return this; } @@ -369,7 +474,6 @@ template Q_OUTOFLINE_TEMPLATE Query *Query::include(Table *t) { Q_D(Query); - d->joinClassName = t->metaObject()->className(); return this; } diff --git a/src/query_p.h b/src/query_p.h index 8046c3c..4b48859 100644 --- a/src/query_p.h +++ b/src/query_p.h @@ -30,8 +30,8 @@ NUT_BEGIN_NAMESPACE class Database; class TableSetBase; -//template class QueryBase; +class RelationModel; class QueryPrivate{ QueryBase *q_ptr; Q_DECLARE_PUBLIC(QueryBase) @@ -41,11 +41,13 @@ public: ~QueryPrivate(); QString sql; + QString className; QString tableName; QString select; Database *database; TableSetBase *tableSet; - QString joinClassName; + QStringList joins; + QList relations; QList wheres; QList orderPhrases; QHash orders; diff --git a/src/querybase.cpp b/src/querybase.cpp index 56f93d0..5a9526d 100644 --- a/src/querybase.cpp +++ b/src/querybase.cpp @@ -1,5 +1,9 @@ #include "querybase_p.h" +#include "table.h" +#include "tablesetbase_p.h" + + NUT_BEGIN_NAMESPACE QueryBase::QueryBase(QObject *parent) : QObject(parent) @@ -7,4 +11,9 @@ QueryBase::QueryBase(QObject *parent) : QObject(parent) } +void QueryBase::addTableToSet(TableSetBase *set, Table *table) +{ + set->add(table); +} + NUT_END_NAMESPACE diff --git a/src/querybase_p.h b/src/querybase_p.h index c5f370d..4d53ce3 100644 --- a/src/querybase_p.h +++ b/src/querybase_p.h @@ -28,13 +28,16 @@ NUT_BEGIN_NAMESPACE //TODO: remove this class +class Table; +class TableSetBase; class QueryBase : public QObject { Q_OBJECT public: explicit QueryBase(QObject *parent = 0); -signals: +protected: + void addTableToSet(TableSetBase *set, Table *table); public slots: }; diff --git a/src/serializableobject.cpp b/src/serializableobject.cpp new file mode 100644 index 0000000..667c57b --- /dev/null +++ b/src/serializableobject.cpp @@ -0,0 +1,6 @@ +#include "serializableobject.h" + +SerializableObject::SerializableObject() +{ + +} diff --git a/src/serializableobject.h b/src/serializableobject.h new file mode 100644 index 0000000..ffc65b1 --- /dev/null +++ b/src/serializableobject.h @@ -0,0 +1,15 @@ +#ifndef SERIALIZABLEOBJECT_H +#define SERIALIZABLEOBJECT_H + +#include + +class SerializableObject +{ +public: + SerializableObject(); + + virtual void load(const QVariant &value) = 0; + virtual QVariant save() = 0; +}; + +#endif // SERIALIZABLEOBJECT_H diff --git a/src/table.cpp b/src/table.cpp index 75eb7bc..eeea6ec 100644 --- a/src/table.cpp +++ b/src/table.cpp @@ -22,52 +22,42 @@ #include #include "table.h" #include "database.h" -#include "sqlgeneratorbase_p.h" +#include "databasemodel.h" +#include "generators/sqlgeneratorbase_p.h" NUT_BEGIN_NAMESPACE -Table::Table(QObject *parent) : QObject(parent) +/* + * FIXME: + * Qt can not access metaObject inside of constructor + * so, if we can't initalize myModel inside of ctor. in + * other side myModel inited in propertyChanged signal, so + * any method that uses myModel (like: primaryKey, ...) can't + * be accessed before any property set. So ugly, but there are + * no other way for now. + * + * This should be fixed to v1.2 + */ + +Table::Table(QObject *parent) : QObject(parent), myModel(0) { setStatus(NewCreated); } void Table::add(TableSetBase *t) { - this->tableSets.insert(t); + this->childTableSets.insert(t); } QString Table::primaryKey() const { -// static QString ret = QString::null; - -// if(ret == QString::null){ -// for(int i = 0; i < metaObject()->classInfoCount(); i++){ -// QMetaClassInfo ci = metaObject()->classInfo(i); -// QString ciName = ci.name(); - -// if(ciName.startsWith(__nut_NAME_PERFIX)) -// ciName.remove(__nut_NAME_PERFIX); - -// if(ciName.contains(" ")){ -// QStringList parts = ciName.split(" "); -// QString propName = parts.at(1); -// if(propName == __nut_PRIMARY_KEY) -// ret = parts.at(0); -// } -// } - -// if(ret == QString::null) -// ret = ""; -// } - -// return ret; - return TableModel::findByClassName(metaObject()->className())->primaryKey(); + return myModel->primaryKey(); } bool Table::isPrimaryKeyAutoIncrement() const { - return TableModel::findByClassName(metaObject()->className())->field(primaryKey())->isAutoIncrement; + return myModel->field(myModel->primaryKey())->isAutoIncrement; } @@ -78,14 +68,20 @@ QVariant Table::primaryValue() const void Table::propertyChanged(QString propName) { - if(propName == primaryKey()) + if (!myModel) + myModel = TableModel::findByClassName(metaObject()->className()); + + if (!myModel) + qFatal ("model for this class not found"); + + if (propName == primaryKey()) return; _changedProperties.insert(propName); - if(_status == FeatchedFromDB) + if (_status == FeatchedFromDB) _status = Modified; - if(_status == NewCreated) + if (_status == NewCreated) _status = Added; } @@ -102,12 +98,12 @@ QSet Table::changedProperties() const bool Table::setParentTable(Table *master) { QString masterClassName = master->metaObject()->className(); - TableModel *myModel = TableModel::findByClassName(metaObject()->className()); foreach (RelationModel *r, myModel->foregionKeys()) - if(r->className == masterClassName) + if(r->masterClassName == masterClassName) { - setProperty(QString(r->localColumn).toLatin1().data(), master->primaryValue()); + setProperty(QString(r->localColumn).toLatin1().data(), + master->primaryValue()); _changedProperties.insert(r->localColumn); return true; } @@ -115,15 +111,23 @@ bool Table::setParentTable(Table *master) return false; } -TableSetBase *Table::tableSet() const +TableSetBase *Table::parentTableSet() const { - return _tableSet; + return _parentTableSet; } -void Table::setTableSet(TableSetBase *parent) +void Table::setParentTableSet(TableSetBase *parent) { - _tableSet = parent; - _tableSet->add(this); + _parentTableSet = parent; + _parentTableSet->add(this); +} + +TableSetBase *Table::childTableSet(const QString &name) const +{ + foreach (TableSetBase *t, childTableSets) + if (t->childClassName() == name) + return t; + return Q_NULLPTR; } int Table::save(Database *db) @@ -133,7 +137,7 @@ int Table::save(Database *db) if(status() == Added && isPrimaryKeyAutoIncrement()) setProperty(primaryKey().toLatin1().data(), q.lastInsertId()); - foreach(TableSetBase *ts, tableSets) + foreach(TableSetBase *ts, childTableSets) ts->save(db); setStatus(FeatchedFromDB); diff --git a/src/table.h b/src/table.h index da9f8cb..0262328 100644 --- a/src/table.h +++ b/src/table.h @@ -33,12 +33,13 @@ NUT_BEGIN_NAMESPACE class Database; class TableSetBase; +class TableModel; class NUT_EXPORT Table : public QObject { Q_OBJECT public: - explicit Table(QObject *tableSet = 0); + explicit Table(QObject *parentTableSet = 0); enum Status{ NewCreated, @@ -56,8 +57,10 @@ public: Status status() const; void setStatus(const Status &status); - TableSetBase *tableSet() const; - void setTableSet(TableSetBase *tableSet); + TableSetBase *parentTableSet() const; + void setParentTableSet(TableSetBase *parentTableSet); + + TableSetBase *childTableSet(const QString &name) const; QSet changedProperties() const; @@ -70,11 +73,13 @@ protected: void propertyChanged(QString propName); private: + TableModel *myModel; Status _status; QSet _changedProperties; - TableSetBase *_tableSet; + //TODO: is this removable? + TableSetBase *_parentTableSet; - QSet tableSets; + QSet childTableSets; void clear(); void add(TableSetBase *); diff --git a/src/tablemodel.cpp b/src/tablemodel.cpp index 7e3758a..8c272a2 100644 --- a/src/tablemodel.cpp +++ b/src/tablemodel.cpp @@ -30,8 +30,11 @@ NUT_BEGIN_NAMESPACE +/* + * TODO: It may be good idea if we replace this QSet with two QHash! + * one for className search and another for typeId. + */ QSet TableModel::_allModels; -//QMap TableScheema::scheemas; QString TableModel::name() const { @@ -95,6 +98,9 @@ QSet TableModel::allModels() return _allModels; } +/* + * This is not used anywhere + */ TableModel *TableModel::findByTypeId(int typeId) { foreach (TableModel *model, _allModels) @@ -103,20 +109,18 @@ TableModel *TableModel::findByTypeId(int typeId) return 0; } -//TableModel *TableModel::findByName(QString name) -//{ -// foreach (TableModel *model, _allModels) -// if(model->name() == name) -// return model; -// return 0; -//} - +/** + * @brief TableModel::findByClassName + * Find a table model by class name + * @param className + * @return + */ TableModel *TableModel::findByClassName(QString className) { - foreach (TableModel *model, _allModels){ + foreach (TableModel *model, _allModels) if(model->className() == className) return model; - } + return 0; } @@ -144,6 +148,23 @@ bool TableModel::operator !=(const TableModel &t) const return !(*this == t); } +bool TableModel::checkClassInfo(const QMetaClassInfo &classInfo, + QString &type, QString &name, QString &value) +{ + if (!QString(classInfo.name()).startsWith(__nut_NAME_PERFIX)) { + return false; + } else { + QStringList parts = QString(classInfo.value()).split("\n"); + if (parts.count() != 3) + return false; + + type = parts[0]; + name = parts[1]; + value = parts[2]; + return true; + } +} + TableModel::TableModel(int typeId, QString tableName) { //TODO: check that @@ -163,20 +184,19 @@ TableModel::TableModel(int typeId, QString tableName) // get fields names for(int j = 0; j < tableMetaObject->classInfoCount(); j++){ - QString name = tableMetaObject->classInfo(j).name(); - name = name.replace("\"", ""); + QString type; + QString name; + QString value; - name = name.remove(__nut_NAME_PERFIX); + if (!checkClassInfo(tableMetaObject->classInfo(j), + type, name, value)) { + continue; + } - if(name.contains(" ")){ - QStringList parts = name.split(" "); - QString propName = parts.at(1); - - if(propName == __nut_FIELD){ - FieldModel *f = new FieldModel; - f->name = parts.at(0); - _fields.append(f); - } + if(type == __nut_FIELD){ + FieldModel *f = new FieldModel; + f->name = name; + _fields.append(f); } } // Browse all fields @@ -195,47 +215,48 @@ TableModel::TableModel(int typeId, QString tableName) // Browse class infos for(int j = 0; j < tableMetaObject->classInfoCount(); j++){ - QString name = tableMetaObject->classInfo(j).name(); - QString value = tableMetaObject->classInfo(j).value(); + QString type; + QString name; + QString value; - name = name.replace("\"", "").remove(__nut_NAME_PERFIX); - value = value.replace("\"", ""); + if (!checkClassInfo(tableMetaObject->classInfo(j), + type, name, value)) { + continue; + } - if(name.contains(" ")){ - QStringList parts = name.split(" "); - QString propName = parts.at(1); + if(type == __nut_FOREGION_KEY){ + RelationModel *fk = new RelationModel; + fk->slaveTable = this; + fk->localColumn = name + "Id"; + fk->localProperty = name; + fk->foregionColumn = value; + fk->masterClassName = value; + _foregionKeys.append(fk); + } - if(propName == __nut_FOREGION_KEY){ - RelationModel *fk = new RelationModel; - fk->localColumn = parts.at(0); - fk->foregionColumn = value; - fk->className = value; - _foregionKeys.append(fk); - } - - if(propName == __nut_FIELD){ - - } - - - FieldModel *f = field(parts.at(0)); - if(!f) - continue; - - if(propName == __nut_LEN) - f->length = value.toInt(); - else if(propName == __nut_NOT_NULL) - f->notNull = true; - else if(propName == __nut_DEFAULT_VALUE) - f->defaultValue = value; - else if(propName == __nut_PRIMARY_KEY) - f->isPrimaryKey = true; - else if(propName == __nut_AUTO_INCREMENT) - f->isAutoIncrement = true; - else if(propName == __nut_UNIQUE) - f->isUnique = true; + if(type == __nut_FIELD){ } + + + FieldModel *f = field(name); + if(!f) + continue; + + if(type == __nut_LEN) + f->length = value.toInt(); + else if(type == __nut_NOT_NULL) + f->notNull = true; + else if(type == __nut_DEFAULT_VALUE) + f->defaultValue = value; + else if(type == __nut_PRIMARY_KEY) + f->isPrimaryKey = true; + else if(type == __nut_AUTO_INCREMENT) + f->isAutoIncrement = true; + else if(type == __nut_UNIQUE) + f->isUnique = true; + + } if(!findByTypeId(typeId) && !tableName.isNull()) @@ -321,41 +342,10 @@ QJsonObject TableModel::toJson() const return obj; } -//TableScheema *TableScheema::registerTable(int typeId, QString tableName) -//{ -// TableScheema *scheema = new TableScheema(typeId, tableName); -// scheemas.insert(typeId, scheema); -// return scheema; -//} - -//void TableScheema::createForegionKeys() -//{ -// foreach (TableScheema *sch, scheemas) { -// foreach (ForegionKey *fk, sch->_foregionKeys) { -// fk->table = scheema(fk->tableName); -// } -// } -//} - -//TableModel *TableModel::model(QString className) -//{ -// qFatal(""); -//#ifdef NUT_NAMESPACE -// if(className.startsWith(QT_STRINGIFY(NUT_NAMESPACE) "::")) -// className = className.replace(QT_STRINGIFY(NUT_NAMESPACE) "::", ""); -//#endif - -// foreach (TableModel *s, _allModels) -// if(s->_className == className){ -// return s; -// } -// return 0; -//} - RelationModel *TableModel::foregionKey(QString otherTable) const { foreach (RelationModel *fk, _foregionKeys) - if(fk->className == otherTable) + if(fk->masterClassName == otherTable) return fk; return 0; diff --git a/src/tablemodel.h b/src/tablemodel.h index 700032e..42615e5 100644 --- a/src/tablemodel.h +++ b/src/tablemodel.h @@ -65,10 +65,15 @@ struct FieldModel{ }; struct RelationModel{ - QString className; + //slave QString localColumn; - TableModel *table; + QString localProperty; + TableModel *slaveTable; + //master QString foregionColumn; + TableModel *masterTable; + + QString masterClassName; }; class TableModel { @@ -117,6 +122,8 @@ private: QList _fields; QList _foregionKeys; static QSet_allModels; + bool checkClassInfo(const QMetaClassInfo &classInfo, + QString &type, QString &name, QString &value); }; NUT_END_NAMESPACE diff --git a/src/tableset.h b/src/tableset.h index c315098..1cb4762 100644 --- a/src/tableset.h +++ b/src/tableset.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "tablesetbase_p.h" @@ -43,11 +44,11 @@ public: TableSet(Table *parent); void append(T *t); - void append(QList t); + void append(QList t); void remove(T *t); - void remove(QList t); + void remove(QList t); - inline T type() const {} + inline T *type() const {} int length() const; T *at(int i) const; @@ -91,7 +92,7 @@ Q_OUTOFLINE_TEMPLATE int TableSet::length() const } template -Q_OUTOFLINE_TEMPLATE T *TableSet::at(int i) const +Q_OUTOFLINE_TEMPLATE T *TableSet::at(int i) const { return (T*)_tablesList.at(i); } @@ -108,7 +109,7 @@ Q_OUTOFLINE_TEMPLATE void TableSet::append(T *t) _tables.insert(t); _tablesList.append(t); // rows.append(t); - t->setTableSet(this); + t->setParentTableSet(this); if(t->status() != Table::FeatchedFromDB) t->setStatus(Table::Added); } diff --git a/src/tablesetbase_p.h b/src/tablesetbase_p.h index 68f7df0..801c11b 100644 --- a/src/tablesetbase_p.h +++ b/src/tablesetbase_p.h @@ -40,7 +40,6 @@ public: virtual int save(Database *db, bool cleanUp = false); void clearChilds(); - void add(Table* t); QString childClassName() const; Database *database() const; @@ -53,6 +52,12 @@ protected: Database *_database; Table *_table; QString _childClassName; + +private: + void add(Table* t); + + friend class Table; + friend class QueryBase; }; NUT_END_NAMESPACE diff --git a/src/dbgeography.cpp b/src/types/dbgeography.cpp similarity index 78% rename from src/dbgeography.cpp rename to src/types/dbgeography.cpp index 67d28b8..11d4407 100644 --- a/src/dbgeography.cpp +++ b/src/types/dbgeography.cpp @@ -22,15 +22,34 @@ NUT_BEGIN_NAMESPACE -DbGeography::DbGeography(QObject *parent) +DbGeography::DbGeography() : m_longitude(0), m_latitude(0) { } DbGeography::DbGeography(const DbGeography &other) { - setLatitude(other.latitude()); setLongitude(other.longitude()); + setLatitude(other.latitude()); +} + +DbGeography::DbGeography(const QVariant &value) +{ + QStringList parts = value.toString().split(','); + if (parts.count() == 2) { + setLongitude(parts[0].toDouble()); + setLatitude(parts[1].toDouble()); + } else { + qWarning("Input value for DbGeography is invalid: %s", + qPrintable(value.toString())); + setLongitude(0); + setLatitude(0); + } +} + +qreal DbGeography::longitude() const +{ + return m_longitude; } qreal DbGeography::latitude() const @@ -38,9 +57,13 @@ qreal DbGeography::latitude() const return m_latitude; } -qreal DbGeography::longitude() const +void DbGeography::setLongitude(qreal longitude) + { - return m_longitude; + if (qFuzzyCompare(m_longitude, longitude)) + return; + + m_longitude = longitude; } void DbGeography::setLatitude(qreal latitude) @@ -50,27 +73,9 @@ void DbGeography::setLatitude(qreal latitude) m_latitude = latitude; } - -void DbGeography::setLongitude(qreal longitude) +DbGeography::operator QVariant() { - if (qFuzzyCompare(m_longitude, longitude)) - return; - - m_longitude = longitude; -} - -QString DbGeography::toString() -{ - return QString("%1,%2").arg(longitude()).arg(latitude()); -} - -void DbGeography::fromString(const QString &s) -{ - QStringList parts = s.split(','); - if (parts.count() == 2) { - setLongitude(parts[0].toDouble()); - setLatitude(parts[1].toDouble()); - } + return QVariant::fromValue(QString("%1,%2").arg(longitude()).arg(latitude())); } NUT_END_NAMESPACE diff --git a/src/dbgeography.h b/src/types/dbgeography.h similarity index 81% rename from src/dbgeography.h rename to src/types/dbgeography.h index 6cc9160..9a7dfd0 100644 --- a/src/dbgeography.h +++ b/src/types/dbgeography.h @@ -21,37 +21,34 @@ #ifndef DBGEOGRAPHY_H #define DBGEOGRAPHY_H -#include "defines.h" +#include "../defines.h" #include #include +#include NUT_BEGIN_NAMESPACE -class NUT_EXPORT DbGeography //: public QObject +class NUT_EXPORT DbGeography { - qreal m_latitude; qreal m_longitude; + qreal m_latitude; public: - explicit DbGeography(QObject *parent = 0); + explicit DbGeography(); DbGeography(const DbGeography &other); + DbGeography(const QVariant &value); - qreal latitude() const; qreal longitude() const; + qreal latitude() const; - void setLatitude(qreal latitude); void setLongitude(qreal longitude); + void setLatitude(qreal latitude); - QString toString(); - void fromString(const QString &s); + operator QVariant(); }; NUT_END_NAMESPACE -#ifdef NUT_NAMESPACE - Q_DECLARE_METATYPE(NUT_NAMESPACE::DbGeography) -#else - Q_DECLARE_METATYPE(DbGeography) -#endif +Q_DECLARE_METATYPE(NUT_WRAP_NAMESPACE(DbGeography)) #endif // DBGEOGRAPHY_H diff --git a/src/wherephrase.cpp b/src/wherephrase.cpp index 8d4a93d..af0514c 100644 --- a/src/wherephrase.cpp +++ b/src/wherephrase.cpp @@ -230,4 +230,5 @@ WherePhrase WherePhrase::operator>=(const QVariant &other) return WherePhrase(this, PhraseData::GreaterEqual, other); } + NUT_END_NAMESPACE diff --git a/src/wherephrase.h b/src/wherephrase.h index f7eada9..371a640 100644 --- a/src/wherephrase.h +++ b/src/wherephrase.h @@ -30,9 +30,11 @@ #include #include #include "defines.h" -#include "dbgeography.h" +#include "types/dbgeography.h" +#if __cplusplus >= 201103L #include +#endif NUT_BEGIN_NAMESPACE @@ -143,6 +145,8 @@ class FieldPhrase : public WherePhrase public: FieldPhrase(const char *className, const char *s); + WherePhrase operator=(const FieldPhrase &other); + WherePhrase operator=(const WherePhrase &other); WherePhrase operator=(const QVariant &other); WherePhrase operator+(const QVariant &other); @@ -177,6 +181,13 @@ operator=(const QVariant &other) return WherePhrase(this, PhraseData::Set, other); } +template +Q_OUTOFLINE_TEMPLATE WherePhrase +FieldPhrase::operator=(const FieldPhrase &other) +{ + return WherePhrase(this, PhraseData::Equal, &other); +} + template Q_OUTOFLINE_TEMPLATE WherePhrase FieldPhrase:: operator=(const WherePhrase &other) @@ -448,11 +459,13 @@ public: return WherePhrase(this, PhraseData::In, vlist); } +#if __cplusplus >= 201103L template WherePhrase in(std::initializer_list list) { return in(QList(list)); } +#endif WherePhrase in(int count, ...) { diff --git a/test/basic/maintest.cpp b/test/basic/maintest.cpp index 5365825..cc77796 100644 --- a/test/basic/maintest.cpp +++ b/test/basic/maintest.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "consts.h" @@ -10,17 +11,26 @@ #include "tablemodel.h" #include "databasemodel.h" +#include "user.h" #include "post.h" #include "comment.h" +#include "score.h" + +#define PRINT(x) qDebug() << #x "=" << x; +#define TIC() QElapsedTimer timer; timer.start() +#define TOC() qDebug() << QString("Elapsed time: %1ms for %2") \ + .arg(timer.elapsed() / 1000.) \ + .arg(__func__) MainTest::MainTest(QObject *parent) : QObject(parent) { - } void MainTest::initTestCase() { - qDebug() << "User type id:" << qRegisterMetaType(); + qDebug() << "User type id:" << qRegisterMetaType(); + qDebug() << "Post type id:" << qRegisterMetaType(); + qDebug() << "Score type id:" << qRegisterMetaType(); qDebug() << "Comment type id:" << qRegisterMetaType(); qDebug() << "DB type id:" << qRegisterMetaType(); @@ -40,12 +50,21 @@ void MainTest::initTestCase() void MainTest::dataScheema() { - auto json = db.model().toJson(); - auto model = DatabaseModel::fromJson(json); +// auto json = db.model().toJson(); +// auto model = DatabaseModel::fromJson(json); // qDebug() << model.toJson(); // qDebug() << db.model().toJson(); - QTEST_ASSERT(model == db.model()); + // QTEST_ASSERT(model == db.model()); +} + +void MainTest::createUser() +{ + user = new User; + user->setUsername("admin"); + user->setPassword("123456"); + db.users()->append(user); + db.saveChanges(); } void MainTest::createPost() @@ -60,8 +79,15 @@ void MainTest::createPost() Comment *comment = new Comment; comment->setMessage("comment #" + QString::number(i)); comment->setSaveDate(QDateTime::currentDateTime()); + comment->setAuthorId(user->id()); newPost->comments()->append(comment); } + for (int i = 0; i < 10; ++i) { + Score *score = new Score; + score->setScore(i % 5); + newPost->scores()->append(score); + } + db.saveChanges(); postId = newPost->id(); @@ -81,8 +107,9 @@ void MainTest::createPost2() for(int i = 0 ; i < 3; i++){ Comment *comment = new Comment; - comment->setMessage("comment #" + QString::number(i)); + comment->setMessage("comment #" + QString::number(i + 2)); comment->setSaveDate(QDateTime::currentDateTime()); + comment->setAuthor(user); comment->setPostId(newPost->id()); db.comments()->append(comment); } @@ -94,16 +121,17 @@ void MainTest::createPost2() void MainTest::selectPosts() { - auto q = db.posts()->query(); - q->join(Post::commentsTable()); - q->orderBy(!Post::saveDateField() & Post::bodyField()); - q->setWhere(Post::idField() == postId); + auto q = db.posts()->query() + ->join()//Comment::authorIdField() == Post::idField()) + ->orderBy(!Post::saveDateField() & Post::bodyField()) + ->setWhere(Post::idField() == postId); auto posts = q->toList(); - post = posts.at(0); post->setBody(""); + PRINT(posts.length()); + PRINT(posts.at(0)->comments()->length()); QTEST_ASSERT(posts.length() == 1); QTEST_ASSERT(posts.at(0)->comments()->length() == 3); QTEST_ASSERT(posts.at(0)->title() == "post title"); @@ -114,12 +142,28 @@ void MainTest::selectPosts() db.cleanUp(); } +void MainTest::selectScoreAverage() +{ + auto a = db.scores()->query() + ->join() + ->setWhere(Post::idField() == 1) + ->average(Score::scoreField()); + qDebug() << a; +} + +void MainTest::selectFirst() +{ + auto posts = db.posts()->query() + ->first(); + + QTEST_ASSERT(posts != Q_NULLPTR); +} + void MainTest::selectPostsWithoutTitle() { auto q = db.posts()->query(); q->setWhere(Post::titleField().isNull()); auto count = q->count(); - qDebug() << q->sqlCommand(); QTEST_ASSERT(count == 0); } @@ -151,6 +195,21 @@ void MainTest::testDate() QTEST_ASSERT(q->saveDate() == d); } +void MainTest::join() +{ + TIC(); + auto q = db.comments()->query() + ->join() + ->join(); + + auto comments = q->toList(); + + TOC(); + QTEST_ASSERT(comments.length()); + QTEST_ASSERT(comments[0]->author()); + QTEST_ASSERT(comments[0]->author()->username() == "admin"); +} + void MainTest::selectWithInvalidRelation() { @@ -159,13 +218,6 @@ void MainTest::selectWithInvalidRelation() q->toList(); } -void MainTest::select10NewstPosts() -{ - auto q = db.posts()->query(); - q->orderBy(!Post::saveDateField()); - q->toList(10); -} - void MainTest::modifyPost() { auto q = db.posts()->query(); @@ -182,6 +234,7 @@ void MainTest::modifyPost() ->setWhere(Post::idField() == postId); post = q->first(); + PRINT(post->title()); QTEST_ASSERT(post->title() == "new name"); } @@ -189,7 +242,6 @@ void MainTest::emptyDatabase() { auto commentsCount = db.comments()->query()->remove(); auto postsCount = db.posts()->query()->remove(); - QTEST_ASSERT(postsCount == 3); QTEST_ASSERT(commentsCount == 6); } diff --git a/test/basic/maintest.h b/test/basic/maintest.h index 2d55666..5a56759 100644 --- a/test/basic/maintest.h +++ b/test/basic/maintest.h @@ -6,12 +6,15 @@ #include "weblogdatabase.h" class Post; +class User; class MainTest : public QObject { Q_OBJECT WeblogDatabase db; int postId; Post *post; + User *user; + public: explicit MainTest(QObject *parent = 0); @@ -21,14 +24,17 @@ private slots: void initTestCase(); void dataScheema(); + void createUser(); void createPost(); void createPost2(); + void join(); void selectPosts(); + void selectScoreAverage(); + void selectFirst(); void selectPostsWithoutTitle(); void selectPostIds(); void testDate(); void selectWithInvalidRelation(); - void select10NewstPosts(); void modifyPost(); void emptyDatabase(); }; diff --git a/test/basic/tst_basic.pro b/test/basic/tst_basic.pro index b072765..a274bdc 100644 --- a/test/basic/tst_basic.pro +++ b/test/basic/tst_basic.pro @@ -12,11 +12,15 @@ SOURCES += \ maintest.cpp \ ../common/comment.cpp \ ../common/post.cpp \ - ../common/weblogdatabase.cpp + ../common/user.cpp \ + ../common/weblogdatabase.cpp \ + ../common/score.cpp HEADERS += \ maintest.h \ ../common/consts.h \ ../common/comment.h \ ../common/post.h \ - ../common/weblogdatabase.h + ../common/user.h \ + ../common/weblogdatabase.h \ + ../common/score.h diff --git a/test/commands/maintest.cpp b/test/commands/maintest.cpp index fab0c86..a5c46fd 100644 --- a/test/commands/maintest.cpp +++ b/test/commands/maintest.cpp @@ -56,4 +56,12 @@ void MainTest::cmd2() qDebug() << q->sqlCommand(); } +void MainTest::join() +{ + auto q = db.posts()->query() + ->join() + ->toList(); + +} + QTEST_MAIN(MainTest) diff --git a/test/commands/maintest.h b/test/commands/maintest.h index e54c53f..b8753b3 100644 --- a/test/commands/maintest.h +++ b/test/commands/maintest.h @@ -23,6 +23,7 @@ private slots: void cmd1(); void cmd2(); + void join(); }; #endif // MAINTEST_H diff --git a/test/commands/tst_commands.pro b/test/commands/tst_commands.pro index 6400e16..a1d0878 100644 --- a/test/commands/tst_commands.pro +++ b/test/commands/tst_commands.pro @@ -12,10 +12,12 @@ SOURCES += \ maintest.cpp \ ../common/comment.cpp \ ../common/post.cpp \ - ../common/weblogdatabase.cpp + ../common/weblogdatabase.cpp \ + ../common/user.cpp HEADERS += \ maintest.h \ ../common/comment.h \ ../common/post.h \ - ../common/weblogdatabase.h + ../common/weblogdatabase.h \ + ../common/user.h diff --git a/test/common/comment.cpp b/test/common/comment.cpp index 87ec017..d732145 100644 --- a/test/common/comment.cpp +++ b/test/common/comment.cpp @@ -1,6 +1,7 @@ #include "comment.h" -Comment::Comment(QObject *parent) : Table(parent) +Comment::Comment(QObject *parent) : Table(parent), + m_author(Q_NULLPTR), m_post(Q_NULLPTR) { } diff --git a/test/common/comment.h b/test/common/comment.h index 4869c35..0fd30cc 100644 --- a/test/common/comment.h +++ b/test/common/comment.h @@ -10,6 +10,7 @@ using namespace NUT_NAMESPACE; #endif class Post; +class User; class Comment : public Table { Q_OBJECT @@ -21,9 +22,12 @@ class Comment : public Table NUT_DECLARE_FIELD(qreal, point, point, setPoint) NUT_FOREGION_KEY(Post, int, post, post, setPost) + NUT_FOREGION_KEY(User, int, author, author, setAuthor) public: - Q_INVOKABLE explicit Comment(QObject *tableSet = 0); + Q_INVOKABLE explicit Comment(QObject *parentTableSet = 0); }; +Q_DECLARE_METATYPE(Comment*) + #endif // COMMENT_H diff --git a/test/common/consts.h b/test/common/consts.h index 9475fa9..40ca178 100644 --- a/test/common/consts.h +++ b/test/common/consts.h @@ -7,7 +7,7 @@ //#define USERNAME "postgres" //#define PASSWORD "856856" -#define DRIVER "QMYSQL" +#define DRIVER "QSQLITE" #define HOST "127.0.0.1" #define DATABASE "nutdb" #define USERNAME "root" diff --git a/test/common/post.cpp b/test/common/post.cpp index e4f6c06..9aa932a 100644 --- a/test/common/post.cpp +++ b/test/common/post.cpp @@ -1,9 +1,15 @@ -#include "comment.h" -#include "tableset.h" #include "post.h" +#include "comment.h" +#include "score.h" +#include "tableset.h" Post::Post(QObject *parent) : Table(parent), - m_comments(new TableSet(this)), m_id(0), m_title("") + m_id(0), m_title(""), + m_comments(new TableSet(this)), + m_scores(new TableSet(this)) { } + +NUT_IMPLEMENT_CHILD_TABLE(Post, Comment, comments) +NUT_IMPLEMENT_CHILD_TABLE(Post, Score, scores) diff --git a/test/common/post.h b/test/common/post.h index de81702..c8e7994 100644 --- a/test/common/post.h +++ b/test/common/post.h @@ -1,16 +1,17 @@ -#ifndef USER_H -#define USER_H +#ifndef POST_H +#define POST_H #include #include "table.h" #include "database.h" -#include "comment.h" #include "databasemodel.h" #ifdef NUT_NAMESPACE using namespace NUT_NAMESPACE; #endif +class Comment; +class Score; class Post : public Table { Q_OBJECT @@ -27,14 +28,16 @@ class Post : public Table NUT_DECLARE_FIELD(QString, body, body, setBody) NUT_DECLARE_CHILD_TABLE(Comment, comments) + NUT_DECLARE_CHILD_TABLE(Score, scores) public: - explicit Post(QObject *tableSet = 0); + Q_INVOKABLE Post(QObject *parentTableSet = 0); signals: public slots: }; -//Q_DECLARE_METATYPE(User*) -#endif // USER_H +Q_DECLARE_METATYPE(Post*) + +#endif // POST_H diff --git a/test/common/score.cpp b/test/common/score.cpp new file mode 100644 index 0000000..08466a2 --- /dev/null +++ b/test/common/score.cpp @@ -0,0 +1,6 @@ +#include "score.h" + +Score::Score(QObject *parent) : Nut::Table(parent) +{ + +} diff --git a/test/common/score.h b/test/common/score.h new file mode 100644 index 0000000..02ce240 --- /dev/null +++ b/test/common/score.h @@ -0,0 +1,24 @@ +#ifndef SCORE_H +#define SCORE_H + +#include "table.h" + +class User; +class Post; +class Score : public Nut::Table +{ + Q_OBJECT + + NUT_PRIMARY_AUTO_INCREMENT(id) + NUT_DECLARE_FIELD(int, id, id, setId) + + NUT_DECLARE_FIELD(int, score, score, setScore) + + NUT_FOREGION_KEY(Post, int, post, post, setPost) + NUT_FOREGION_KEY(User, int, user, user, setUser) + +public: + Q_INVOKABLE Score(QObject *parent = Q_NULLPTR); +}; + +#endif // SCORE_H diff --git a/test/common/user.cpp b/test/common/user.cpp new file mode 100644 index 0000000..b2ee974 --- /dev/null +++ b/test/common/user.cpp @@ -0,0 +1,13 @@ +#include "comment.h" +#include "score.h" + +#include "user.h" + +User::User(QObject *tableSet) : Table(tableSet), + m_comments(new TableSet(this)), + m_scores(new TableSet(this)) +{ + +} + +NUT_IMPLEMENT_CHILD_TABLE(User, Comment, comments) diff --git a/test/common/user.h b/test/common/user.h new file mode 100644 index 0000000..0b98721 --- /dev/null +++ b/test/common/user.h @@ -0,0 +1,40 @@ +#ifndef USER_H +#define USER_H + +#include "table.h" +#include "tableset.h" + +#include +#include + +#ifdef NUT_NAMESPACE +using namespace NUT_NAMESPACE; +#endif + +class Comment; +class Score; +class User : public Nut::Table +{ + Q_OBJECT + + NUT_PRIMARY_AUTO_INCREMENT(id) + NUT_DECLARE_FIELD(int, id, id, setId) + + NUT_NOT_NULL(username) + NUT_LEN(username, 50) + NUT_DECLARE_FIELD(QString, username, username, setUsername) + + NUT_NOT_NULL(password) + NUT_LEN(password, 50) + NUT_DECLARE_FIELD(QString, password, password, setPassword) + + NUT_DECLARE_CHILD_TABLE(Comment, comments) + NUT_DECLARE_CHILD_TABLE(Score, scores) + +public: + Q_INVOKABLE User(QObject *parentTableSet = 0); +}; + +Q_DECLARE_METATYPE(User*) + +#endif // USER_H diff --git a/test/common/weblogdatabase.cpp b/test/common/weblogdatabase.cpp index ef77234..cf459b9 100644 --- a/test/common/weblogdatabase.cpp +++ b/test/common/weblogdatabase.cpp @@ -1,9 +1,16 @@ #include +#include "user.h" #include "post.h" #include "comment.h" +#include "user.h" +#include "score.h" #include "weblogdatabase.h" -WeblogDatabase::WeblogDatabase() : Database(), m_posts(new TableSet(this)), m_comments(new TableSet(this)) +WeblogDatabase::WeblogDatabase() : Database(), + m_posts(new TableSet(this)), + m_comments(new TableSet(this)), + m_users(new TableSet(this)), + m_scores(new TableSet(this)) { } diff --git a/test/common/weblogdatabase.h b/test/common/weblogdatabase.h index 911c0cf..af72442 100644 --- a/test/common/weblogdatabase.h +++ b/test/common/weblogdatabase.h @@ -9,15 +9,18 @@ using namespace NUT_NAMESPACE; class Post; class Comment; +class User; +class Score; class WeblogDatabase : public Database { Q_OBJECT - NUT_DB_VERSION(1, 1) + NUT_DB_VERSION(1) NUT_DECLARE_TABLE(Post, post) - NUT_DECLARE_TABLE(Comment, comment) + NUT_DECLARE_TABLE(User, user) + NUT_DECLARE_TABLE(Score, score) public: WeblogDatabase(); diff --git a/test/join/jointest.cpp b/test/join/jointest.cpp new file mode 100644 index 0000000..05918cb --- /dev/null +++ b/test/join/jointest.cpp @@ -0,0 +1,77 @@ +#include +#include +#include + +#include "consts.h" + +#include "jointest.h" +#include "query.h" +#include "tableset.h" +#include "tablemodel.h" +#include "databasemodel.h" + +#include "user.h" +#include "post.h" +#include "comment.h" +#include "score.h" + +#define PRINT(x) qDebug() << #x "=" << x; +JoinTest::JoinTest(QObject *parent) : QObject(parent) +{ +} + +void JoinTest::initTestCase() +{ + qDebug() << "User type id:" << qRegisterMetaType(); + qDebug() << "Post type id:" << qRegisterMetaType(); + qDebug() << "Comment type id:" << qRegisterMetaType(); + qDebug() << "Score type id:" << qRegisterMetaType(); + qDebug() << "DB type id:" << qRegisterMetaType(); + + db.setDriver(DRIVER); + db.setHostName(HOST); + db.setDatabaseName("nut_tst_join.db"); + db.setUserName(USERNAME); + db.setPassword(PASSWORD); + + bool ok = db.open(); + +// db.comments()->query()->remove(); +// db.posts()->query()->remove(); + + QTEST_ASSERT(ok); +} + +void JoinTest::join() +{ + auto q = db.comments()->query() + ->join() + ->join(); + +// Comment *comment = q->first(); + auto comments = q->toList(); +// Comment *comment = q->toList().first(); +// qDebug() << q->sqlCommand(); + PRINT(comments.length()); + +// QTEST_ASSERT(comments.length()); +// QTEST_ASSERT(comments[0]->author()); +// QTEST_ASSERT(comments[0]->author()->username() == "admin"); +} + +void JoinTest::join2() +{ + auto q = db.users()->query() + ->join() + ->join(); + +// Comment *comment = q->first(); + auto comments = q->toList(); +// Comment *comment = q->toList().first(); +// qDebug() << q->sqlCommand(); +// QTEST_ASSERT(comments.length()); +// QTEST_ASSERT(comments[0]->author()); +// QTEST_ASSERT(comments[0]->author()->username() == "admin"); +} + +QTEST_MAIN(JoinTest) diff --git a/test/join/jointest.h b/test/join/jointest.h new file mode 100644 index 0000000..cddb1cb --- /dev/null +++ b/test/join/jointest.h @@ -0,0 +1,26 @@ +#ifndef JOINTEST_H +#define JOINTEST_H + +#include +#include + +#include "weblogdatabase.h" + +class JoinTest : public QObject +{ + Q_OBJECT + WeblogDatabase db; + +public: + explicit JoinTest(QObject *parent = 0); + +signals: + +private slots: + void initTestCase(); + + void join(); + void join2(); +}; + +#endif // JOINTEST_H diff --git a/test/join/tst_join.pro b/test/join/tst_join.pro new file mode 100644 index 0000000..78533c7 --- /dev/null +++ b/test/join/tst_join.pro @@ -0,0 +1,26 @@ +QT += qml quick testlib sql +QT -= gui + +TARGET = tst_nut +TEMPLATE = app + +CONFIG += warn_on qmltestcase c++11 +INCLUDEPATH += $$PWD/../../src $$PWD/../common +include(../../nut.pri) +IMPORTPATH += $$OUT_PWD/../src/imports +SOURCES += \ + jointest.cpp \ + ../common/comment.cpp \ + ../common/post.cpp \ + ../common/user.cpp \ + ../common/weblogdatabase.cpp \ + ../common/score.cpp + +HEADERS += \ + jointest.h \ + ../common/consts.h \ + ../common/comment.h \ + ../common/post.h \ + ../common/user.h \ + ../common/weblogdatabase.h \ + ../common/score.h