summaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/common/table.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/common/table.cpp')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/common/table.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/common/table.cpp b/SQLiteStudio3/coreSQLiteStudio/common/table.cpp
new file mode 100644
index 0000000..c590995
--- /dev/null
+++ b/SQLiteStudio3/coreSQLiteStudio/common/table.cpp
@@ -0,0 +1,52 @@
+#include "table.h"
+#include <QHash>
+
+Table::Table()
+{
+}
+
+Table::Table(const QString& database, const QString& table)
+{
+ setDatabase(database);
+ setTable(table);
+}
+
+Table::Table(const Table& other)
+{
+ database = other.database;
+ table = other.table;
+}
+
+Table::~Table()
+{
+}
+
+int Table::operator ==(const Table &other) const
+{
+ return other.database == this->database && other.table == this->table;
+}
+
+QString Table::getTable() const
+{
+ return table;
+}
+
+void Table::setTable(const QString& value)
+{
+ table = value;
+}
+
+QString Table::getDatabase() const
+{
+ return database;
+}
+
+void Table::setDatabase(const QString& value)
+{
+ database = value.isEmpty() ? "main" : value;
+}
+
+int qHash(Table table)
+{
+ return qHash(table.getDatabase() + "." + table.getTable());
+}