From bd48a7c83a702cc62566c1d32a7ae421928b5053 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 8 Oct 2016 12:31:18 +0100 Subject: [PATCH] Refactor API include headers --- CMakeLists.txt | 24 +++++++++---------- include/loot/api.h | 4 ++-- include/loot/database_interface.h | 10 ++++---- include/loot/{ => enum}/game_type.h | 0 include/loot/{ => enum}/language_code.h | 0 include/loot/{ => enum}/message_type.h | 0 include/loot/{ => enum}/plugin_cleanliness.h | 0 .../loot/{ => exception}/error_categories.h | 0 include/loot/{ => struct}/masterlist_info.h | 0 include/loot/{ => struct}/plugin_tags.h | 0 include/loot/{ => struct}/simple_message.h | 2 +- src/backend/error_categories.cpp | 2 +- src/backend/game/game_settings.h | 2 +- src/backend/game/load_order_handler.cpp | 2 +- src/backend/helpers/git_helper.cpp | 2 +- src/backend/helpers/language.h | 2 +- src/backend/metadata/message.h | 6 ++--- src/gui/editor_message.h | 2 +- src/gui/yaml_simple_message_helpers.h | 2 +- src/tests/common_game_test_fixture.h | 2 +- 20 files changed, 31 insertions(+), 31 deletions(-) rename include/loot/{ => enum}/game_type.h (100%) rename include/loot/{ => enum}/language_code.h (100%) rename include/loot/{ => enum}/message_type.h (100%) rename include/loot/{ => enum}/plugin_cleanliness.h (100%) rename include/loot/{ => exception}/error_categories.h (100%) rename include/loot/{ => struct}/masterlist_info.h (100%) rename include/loot/{ => struct}/plugin_tags.h (100%) rename include/loot/{ => struct}/simple_message.h (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 283ceaa1..1ba6dace 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,16 +219,16 @@ set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/app/loot_paths.h" "${CMAKE_SOURCE_DIR}/src/backend/helpers/version.h" "${CMAKE_SOURCE_DIR}/src/backend/helpers/yaml_set_helpers.h" "${CMAKE_SOURCE_DIR}/include/loot/api_decorator.h" - "${CMAKE_SOURCE_DIR}/include/loot/error_categories.h" + "${CMAKE_SOURCE_DIR}/include/loot/exception/error_categories.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/condition_syntax_error.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/cyclic_interaction_error.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/file_access_error.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/game_detection_error.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/git_state_error.h" - "${CMAKE_SOURCE_DIR}/include/loot/game_type.h" - "${CMAKE_SOURCE_DIR}/include/loot/language_code.h" + "${CMAKE_SOURCE_DIR}/include/loot/enum/game_type.h" + "${CMAKE_SOURCE_DIR}/include/loot/enum/language_code.h" "${CMAKE_SOURCE_DIR}/include/loot/loot_version.h" - "${CMAKE_SOURCE_DIR}/include/loot/message_type.h") + "${CMAKE_SOURCE_DIR}/include/loot/enum/message_type.h") set (LOOT_GUI_SRC "${CMAKE_SOURCE_DIR}/src/gui/main.cpp" "${CMAKE_SOURCE_DIR}/src/gui/loot_handler.cpp" @@ -282,20 +282,20 @@ set (LOOT_API_SRC "${CMAKE_BINARY_DIR}/generated/loot_version.cpp" set (LOOT_API_HEADERS "${CMAKE_SOURCE_DIR}/include/loot/api.h" "${CMAKE_SOURCE_DIR}/include/loot/api_decorator.h" "${CMAKE_SOURCE_DIR}/include/loot/database_interface.h" - "${CMAKE_SOURCE_DIR}/include/loot/error_categories.h" + "${CMAKE_SOURCE_DIR}/include/loot/exception/error_categories.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/condition_syntax_error.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/cyclic_interaction_error.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/file_access_error.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/game_detection_error.h" "${CMAKE_SOURCE_DIR}/include/loot/exception/git_state_error.h" - "${CMAKE_SOURCE_DIR}/include/loot/game_type.h" - "${CMAKE_SOURCE_DIR}/include/loot/language_code.h" + "${CMAKE_SOURCE_DIR}/include/loot/enum/game_type.h" + "${CMAKE_SOURCE_DIR}/include/loot/enum/language_code.h" "${CMAKE_SOURCE_DIR}/include/loot/loot_version.h" - "${CMAKE_SOURCE_DIR}/include/loot/masterlist_info.h" - "${CMAKE_SOURCE_DIR}/include/loot/message_type.h" - "${CMAKE_SOURCE_DIR}/include/loot/plugin_cleanliness.h" - "${CMAKE_SOURCE_DIR}/include/loot/plugin_tags.h" - "${CMAKE_SOURCE_DIR}/include/loot/simple_message.h" + "${CMAKE_SOURCE_DIR}/include/loot/struct/masterlist_info.h" + "${CMAKE_SOURCE_DIR}/include/loot/enum/message_type.h" + "${CMAKE_SOURCE_DIR}/include/loot/enum/plugin_cleanliness.h" + "${CMAKE_SOURCE_DIR}/include/loot/struct/plugin_tags.h" + "${CMAKE_SOURCE_DIR}/include/loot/struct/simple_message.h" "${CMAKE_SOURCE_DIR}/src/api/api_database.h") set (LOOT_VALIDATOR_SRC "${CMAKE_SOURCE_DIR}/src/validator/main.cpp") diff --git a/include/loot/api.h b/include/loot/api.h index 8f6fc8dd..528f3166 100644 --- a/include/loot/api.h +++ b/include/loot/api.h @@ -30,13 +30,13 @@ #include "loot/api_decorator.h" #include "loot/database_interface.h" -#include "loot/error_categories.h" +#include "loot/exception/error_categories.h" #include "loot/exception/condition_syntax_error.h" #include "loot/exception/cyclic_interaction_error.h" #include "loot/exception/file_access_error.h" #include "loot/exception/game_detection_error.h" #include "loot/exception/git_state_error.h" -#include "loot/game_type.h" +#include "loot/enum/game_type.h" #include "loot/loot_version.h" namespace loot { diff --git a/include/loot/database_interface.h b/include/loot/database_interface.h index d44018e2..4e5b0701 100644 --- a/include/loot/database_interface.h +++ b/include/loot/database_interface.h @@ -27,11 +27,11 @@ #include #include -#include "loot/language_code.h" -#include "loot/masterlist_info.h" -#include "loot/plugin_cleanliness.h" -#include "loot/plugin_tags.h" -#include "loot/simple_message.h" +#include "loot/enum/language_code.h" +#include "loot/struct/masterlist_info.h" +#include "loot/enum/plugin_cleanliness.h" +#include "loot/struct/plugin_tags.h" +#include "loot/struct/simple_message.h" namespace loot { /** @brief The interface provided by API's database handle. */ diff --git a/include/loot/game_type.h b/include/loot/enum/game_type.h similarity index 100% rename from include/loot/game_type.h rename to include/loot/enum/game_type.h diff --git a/include/loot/language_code.h b/include/loot/enum/language_code.h similarity index 100% rename from include/loot/language_code.h rename to include/loot/enum/language_code.h diff --git a/include/loot/message_type.h b/include/loot/enum/message_type.h similarity index 100% rename from include/loot/message_type.h rename to include/loot/enum/message_type.h diff --git a/include/loot/plugin_cleanliness.h b/include/loot/enum/plugin_cleanliness.h similarity index 100% rename from include/loot/plugin_cleanliness.h rename to include/loot/enum/plugin_cleanliness.h diff --git a/include/loot/error_categories.h b/include/loot/exception/error_categories.h similarity index 100% rename from include/loot/error_categories.h rename to include/loot/exception/error_categories.h diff --git a/include/loot/masterlist_info.h b/include/loot/struct/masterlist_info.h similarity index 100% rename from include/loot/masterlist_info.h rename to include/loot/struct/masterlist_info.h diff --git a/include/loot/plugin_tags.h b/include/loot/struct/plugin_tags.h similarity index 100% rename from include/loot/plugin_tags.h rename to include/loot/struct/plugin_tags.h diff --git a/include/loot/simple_message.h b/include/loot/struct/simple_message.h similarity index 97% rename from include/loot/simple_message.h rename to include/loot/struct/simple_message.h index 3aaca1e1..11060899 100644 --- a/include/loot/simple_message.h +++ b/include/loot/struct/simple_message.h @@ -24,7 +24,7 @@ #ifndef LOOT_SIMPLE_MESSAGE #define LOOT_SIMPLE_MESSAGE -#include "loot/message_type.h" +#include "loot/enum/message_type.h" namespace loot { /** @brief A structure that holds the type of a message and the message string itself. */ diff --git a/src/backend/error_categories.cpp b/src/backend/error_categories.cpp index 965207c8..3ea9c212 100644 --- a/src/backend/error_categories.cpp +++ b/src/backend/error_categories.cpp @@ -22,7 +22,7 @@ . */ -#include "loot/error_categories.h" +#include "loot/exception/error_categories.h" namespace loot { namespace detail { diff --git a/src/backend/game/game_settings.h b/src/backend/game/game_settings.h index 322d1504..3576ebc1 100644 --- a/src/backend/game/game_settings.h +++ b/src/backend/game/game_settings.h @@ -32,7 +32,7 @@ #include #include -#include "loot/game_type.h" +#include "loot/enum/game_type.h" namespace loot { class GameSettings { diff --git a/src/backend/game/load_order_handler.cpp b/src/backend/game/load_order_handler.cpp index da33fc10..8b1a5931 100644 --- a/src/backend/game/load_order_handler.cpp +++ b/src/backend/game/load_order_handler.cpp @@ -28,7 +28,7 @@ #include #include -#include "loot/error_categories.h" +#include "loot/exception/error_categories.h" using boost::locale::translate; using std::string; diff --git a/src/backend/helpers/git_helper.cpp b/src/backend/helpers/git_helper.cpp index d865f27f..ce5e2452 100644 --- a/src/backend/helpers/git_helper.cpp +++ b/src/backend/helpers/git_helper.cpp @@ -28,7 +28,7 @@ #include #include -#include "loot/error_categories.h" +#include "loot/exception/error_categories.h" #include "loot/exception/git_state_error.h" using boost::locale::translate; diff --git a/src/backend/helpers/language.h b/src/backend/helpers/language.h index 2dffbd89..e5f17c52 100644 --- a/src/backend/helpers/language.h +++ b/src/backend/helpers/language.h @@ -28,7 +28,7 @@ #include #include -#include "loot/language_code.h" +#include "loot/enum/language_code.h" namespace loot { //Language class for simpler language support. diff --git a/src/backend/metadata/message.h b/src/backend/metadata/message.h index cf30814d..6e58efe8 100644 --- a/src/backend/metadata/message.h +++ b/src/backend/metadata/message.h @@ -33,9 +33,9 @@ #include "backend/metadata/conditional_metadata.h" #include "backend/metadata/message_content.h" -#include "loot/language_code.h" -#include "loot/message_type.h" -#include "loot/simple_message.h" +#include "loot/enum/language_code.h" +#include "loot/enum/message_type.h" +#include "loot/struct/simple_message.h" namespace loot { class Message : public ConditionalMetadata { diff --git a/src/gui/editor_message.h b/src/gui/editor_message.h index 739f834c..c1178673 100644 --- a/src/gui/editor_message.h +++ b/src/gui/editor_message.h @@ -25,7 +25,7 @@ #define LOOT_GUI_EDITOR_MESSAGE #include "backend/metadata/message.h" -#include "loot/simple_message.h" +#include "loot/struct/simple_message.h" namespace loot { struct EditorMessage : public SimpleMessage { diff --git a/src/gui/yaml_simple_message_helpers.h b/src/gui/yaml_simple_message_helpers.h index b5c771aa..7aa4d538 100644 --- a/src/gui/yaml_simple_message_helpers.h +++ b/src/gui/yaml_simple_message_helpers.h @@ -27,7 +27,7 @@ #include -#include "loot/simple_message.h" +#include "loot/struct/simple_message.h" namespace YAML { template<> diff --git a/src/tests/common_game_test_fixture.h b/src/tests/common_game_test_fixture.h index f381eabc..0574e684 100644 --- a/src/tests/common_game_test_fixture.h +++ b/src/tests/common_game_test_fixture.h @@ -33,7 +33,7 @@ along with LOOT. If not, see #include #include -#include "loot/game_type.h" +#include "loot/enum/game_type.h" namespace loot { namespace test {