From 7279035237c9cf59198734ca605bc02ee670696f Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 15 May 2021 13:54:28 +0200 Subject: [PATCH] Moved the database related classes in core to a subfolder aswell. --- core/SCsub | 1 + core/{ => database}/database.cpp | 0 core/{ => database}/database.h | 0 core/{ => database}/database_manager.cpp | 0 core/{ => database}/database_manager.h | 0 core/{ => database}/query_builder.cpp | 0 core/{ => database}/query_builder.h | 0 core/{ => database}/query_result.cpp | 0 core/{ => database}/query_result.h | 0 core/{ => database}/table_builder.cpp | 0 core/{ => database}/table_builder.h | 0 core/object.cpp | 2 +- database/mysql/mysql_database.cpp | 2 +- database/mysql/mysql_database.h | 2 +- database/mysql/mysql_query_builder.h | 2 +- database/mysql/mysql_query_result.h | 2 +- database/mysql/mysql_table_builder.h | 2 +- database/postgres/pgsql_database.cpp | 2 +- database/postgres/pgsql_database.h | 2 +- database/sqlite/sqlite3_database.cpp | 2 +- database/sqlite/sqlite3_database.h | 2 +- database/sqlite/sqlite3_query_result.h | 2 +- modules/list_page/list_page.cpp | 6 +++--- modules/message_page/message_page.cpp | 8 ++++---- modules/paged_article/paged_article.cpp | 6 +++--- 25 files changed, 22 insertions(+), 21 deletions(-) rename core/{ => database}/database.cpp (100%) rename core/{ => database}/database.h (100%) rename core/{ => database}/database_manager.cpp (100%) rename core/{ => database}/database_manager.h (100%) rename core/{ => database}/query_builder.cpp (100%) rename core/{ => database}/query_builder.h (100%) rename core/{ => database}/query_result.cpp (100%) rename core/{ => database}/query_result.h (100%) rename core/{ => database}/table_builder.cpp (100%) rename core/{ => database}/table_builder.h (100%) diff --git a/core/SCsub b/core/SCsub index 21daf46..15864bd 100644 --- a/core/SCsub +++ b/core/SCsub @@ -6,6 +6,7 @@ env.core_sources = [] env.add_source_files(env.core_sources, "*.cpp") env.add_source_files(env.core_sources, "./http/*.cpp") +env.add_source_files(env.core_sources, "./database/*.cpp") # Build it all as a library lib = env.add_library("core", env.core_sources) diff --git a/core/database.cpp b/core/database/database.cpp similarity index 100% rename from core/database.cpp rename to core/database/database.cpp diff --git a/core/database.h b/core/database/database.h similarity index 100% rename from core/database.h rename to core/database/database.h diff --git a/core/database_manager.cpp b/core/database/database_manager.cpp similarity index 100% rename from core/database_manager.cpp rename to core/database/database_manager.cpp diff --git a/core/database_manager.h b/core/database/database_manager.h similarity index 100% rename from core/database_manager.h rename to core/database/database_manager.h diff --git a/core/query_builder.cpp b/core/database/query_builder.cpp similarity index 100% rename from core/query_builder.cpp rename to core/database/query_builder.cpp diff --git a/core/query_builder.h b/core/database/query_builder.h similarity index 100% rename from core/query_builder.h rename to core/database/query_builder.h diff --git a/core/query_result.cpp b/core/database/query_result.cpp similarity index 100% rename from core/query_result.cpp rename to core/database/query_result.cpp diff --git a/core/query_result.h b/core/database/query_result.h similarity index 100% rename from core/query_result.h rename to core/database/query_result.h diff --git a/core/table_builder.cpp b/core/database/table_builder.cpp similarity index 100% rename from core/table_builder.cpp rename to core/database/table_builder.cpp diff --git a/core/table_builder.h b/core/database/table_builder.h similarity index 100% rename from core/table_builder.h rename to core/database/table_builder.h diff --git a/core/object.cpp b/core/object.cpp index 2bfeb66..b196a80 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1,6 +1,6 @@ #include "object.h" -#include "database.h" +#include "core/database/database.h" void Object::migrate() { diff --git a/database/mysql/mysql_database.cpp b/database/mysql/mysql_database.cpp index 023f64c..a71c729 100644 --- a/database/mysql/mysql_database.cpp +++ b/database/mysql/mysql_database.cpp @@ -2,7 +2,7 @@ #include -#include "core/database_manager.h" +#include "core/database/database_manager.h" #include "mysql_query_builder.h" #include "mysql_table_builder.h" diff --git a/database/mysql/mysql_database.h b/database/mysql/mysql_database.h index b7bd7c4..66d89f1 100644 --- a/database/mysql/mysql_database.h +++ b/database/mysql/mysql_database.h @@ -1,7 +1,7 @@ #ifndef MYSQL_CONNECTION #define MYSQL_CONNECTION -#include "core/database.h" +#include "core/database/database.h" #include diff --git a/database/mysql/mysql_query_builder.h b/database/mysql/mysql_query_builder.h index 5ae288a..dea88e8 100644 --- a/database/mysql/mysql_query_builder.h +++ b/database/mysql/mysql_query_builder.h @@ -4,7 +4,7 @@ #include #include -#include "core/query_builder.h" +#include "core/database/query_builder.h" class MysqlQueryBuilder : public QueryBuilder { public: diff --git a/database/mysql/mysql_query_result.h b/database/mysql/mysql_query_result.h index cfc447f..97ec04e 100644 --- a/database/mysql/mysql_query_result.h +++ b/database/mysql/mysql_query_result.h @@ -1,7 +1,7 @@ #ifndef MYSQL_QUERY_RESULT_H #define MYSQL_QUERY_RESULT_H -#include "core/query_result.h" +#include "core/database/query_result.h" #include diff --git a/database/mysql/mysql_table_builder.h b/database/mysql/mysql_table_builder.h index 55e7880..6cf4e54 100644 --- a/database/mysql/mysql_table_builder.h +++ b/database/mysql/mysql_table_builder.h @@ -3,7 +3,7 @@ #include -#include "core/table_builder.h" +#include "core/database/table_builder.h" class MysqlTableBuilder : public TableBuilder { public: diff --git a/database/postgres/pgsql_database.cpp b/database/postgres/pgsql_database.cpp index 466f883..220c58c 100644 --- a/database/postgres/pgsql_database.cpp +++ b/database/postgres/pgsql_database.cpp @@ -1,6 +1,6 @@ #include "pgsql_database.h" -#include "core/database_manager.h" +#include "core/database/database_manager.h" Database *PGSQLDatabase::_creation_func() { return new PGSQLDatabase(); diff --git a/database/postgres/pgsql_database.h b/database/postgres/pgsql_database.h index dfd21ad..d05552a 100644 --- a/database/postgres/pgsql_database.h +++ b/database/postgres/pgsql_database.h @@ -1,7 +1,7 @@ #ifndef PGSQL_CONNECTION #define PGSQL_CONNECTION -#include "core/database.h" +#include "core/database/database.h" //Brynet has it aswell, and because of using namespace it is defined here aswell //later this will be fixed better diff --git a/database/sqlite/sqlite3_database.cpp b/database/sqlite/sqlite3_database.cpp index 27ba92e..ebdb4df 100644 --- a/database/sqlite/sqlite3_database.cpp +++ b/database/sqlite/sqlite3_database.cpp @@ -1,6 +1,6 @@ #include "sqlite3_database.h" -#include "core/database_manager.h" +#include "core/database/database_manager.h" #include "sqlite3_query_result.h" diff --git a/database/sqlite/sqlite3_database.h b/database/sqlite/sqlite3_database.h index e87a016..d23814a 100644 --- a/database/sqlite/sqlite3_database.h +++ b/database/sqlite/sqlite3_database.h @@ -1,7 +1,7 @@ #ifndef SQLITE3_CONNECTION #define SQLITE3_CONNECTION -#include "core/database.h" +#include "core/database/database.h" //Brynet has it aswell, and because of using namespace it is defined here aswell //later this will be fixed better diff --git a/database/sqlite/sqlite3_query_result.h b/database/sqlite/sqlite3_query_result.h index ff4dbd9..a931912 100644 --- a/database/sqlite/sqlite3_query_result.h +++ b/database/sqlite/sqlite3_query_result.h @@ -4,7 +4,7 @@ #include #include -#include "core/query_result.h" +#include "core/database/query_result.h" #include "./sqlite/sqlite3.h" diff --git a/modules/list_page/list_page.cpp b/modules/list_page/list_page.cpp index cf1b519..fec36ba 100644 --- a/modules/list_page/list_page.cpp +++ b/modules/list_page/list_page.cpp @@ -1,8 +1,8 @@ #include "list_page.h" -#include "core/query_builder.h" -#include "core/query_result.h" -#include "core/table_builder.h" +#include "core/database/query_builder.h" +#include "core/database/query_result.h" +#include "core/database/table_builder.h" #include "core/utils.h" #include diff --git a/modules/message_page/message_page.cpp b/modules/message_page/message_page.cpp index fefd1cb..e2e07f0 100644 --- a/modules/message_page/message_page.cpp +++ b/modules/message_page/message_page.cpp @@ -1,10 +1,10 @@ #include "message_page.h" -#include "core/database.h" +#include "core/database/database.h" -#include "core/query_builder.h" -#include "core/table_builder.h" -#include "core/query_result.h" +#include "core/database/query_builder.h" +#include "core/database/table_builder.h" +#include "core/database/query_result.h" void MessagePage::index(Request *request) { QueryBuilder *b = db->get_query_builder(); diff --git a/modules/paged_article/paged_article.cpp b/modules/paged_article/paged_article.cpp index d043f9c..28175b5 100644 --- a/modules/paged_article/paged_article.cpp +++ b/modules/paged_article/paged_article.cpp @@ -1,8 +1,8 @@ #include "paged_article.h" -#include "core/query_builder.h" -#include "core/query_result.h" -#include "core/table_builder.h" +#include "core/database/query_builder.h" +#include "core/database/query_result.h" +#include "core/database/table_builder.h" #include "core/utils.h" #include