From 7167ce41b61d2ba2cdb526777a4233eb84a3b66a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 6 Dec 2014 17:33:25 -0500 Subject: Imported Upstream version 2.99.6 --- SQLiteStudio3/coreSQLiteStudio/common/table.cpp | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 SQLiteStudio3/coreSQLiteStudio/common/table.cpp (limited to 'SQLiteStudio3/coreSQLiteStudio/common/table.cpp') 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 + +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()); +} -- cgit v1.2.3