diff --git a/CMakeLists.txt b/CMakeLists.txt index 166edb00..200ceab5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,73 +162,86 @@ set(CEF_PRECOMPILED_BINARIES_DIR "${SOURCE_DIR}/Release") # General Settings ############################## -set (LOOT_SRC "${CMAKE_BINARY_DIR}/generated/loot_version.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/error_categories.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_evaluator.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/file.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/location.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/message.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/message_content.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/plugin_cleaning_data.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/plugin_metadata.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/priority.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/tag.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/game/game.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/game/game_cache.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/game/load_order_handler.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/metadata_list.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/masterlist.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin_sorter.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/helpers/crc.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/helpers/git_helper.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/helpers/language.cpp" - "${CMAKE_SOURCE_DIR}/src/backend/helpers/version.cpp") -set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_evaluator.h" - "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_grammar.h" - "${CMAKE_SOURCE_DIR}/src/backend/game/game.h" - "${CMAKE_SOURCE_DIR}/src/backend/game/game_cache.h" - "${CMAKE_SOURCE_DIR}/src/backend/game/load_order_handler.h" - "${CMAKE_SOURCE_DIR}/src/backend/metadata_list.h" - "${CMAKE_SOURCE_DIR}/src/backend/masterlist.h" - "${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin.h" - "${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin_sorter.h" - "${CMAKE_SOURCE_DIR}/src/backend/helpers/git_helper.h" - "${CMAKE_SOURCE_DIR}/src/backend/helpers/crc.h" - "${CMAKE_SOURCE_DIR}/src/backend/helpers/version.h" - "${CMAKE_SOURCE_DIR}/include/loot/api_decorator.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/enum/game_type.h" - "${CMAKE_SOURCE_DIR}/include/loot/enum/language_code.h" - "${CMAKE_SOURCE_DIR}/include/loot/enum/message_type.h" - "${CMAKE_SOURCE_DIR}/include/loot/metadata/conditional_metadata.h" - "${CMAKE_SOURCE_DIR}/include/loot/metadata/file.h" - "${CMAKE_SOURCE_DIR}/include/loot/metadata/location.h" - "${CMAKE_SOURCE_DIR}/include/loot/metadata/message.h" - "${CMAKE_SOURCE_DIR}/include/loot/metadata/message_content.h" - "${CMAKE_SOURCE_DIR}/include/loot/metadata/plugin_cleaning_data.h" - "${CMAKE_SOURCE_DIR}/include/loot/metadata/plugin_metadata.h" - "${CMAKE_SOURCE_DIR}/include/loot/metadata/priority.h" - "${CMAKE_SOURCE_DIR}/include/loot/metadata/tag.h" - "${CMAKE_SOURCE_DIR}/include/loot/yaml/file.h" - "${CMAKE_SOURCE_DIR}/include/loot/yaml/location.h" - "${CMAKE_SOURCE_DIR}/include/loot/yaml/message.h" - "${CMAKE_SOURCE_DIR}/include/loot/yaml/message_content.h" - "${CMAKE_SOURCE_DIR}/include/loot/yaml/plugin_cleaning_data.h" - "${CMAKE_SOURCE_DIR}/include/loot/yaml/plugin_metadata.h" - "${CMAKE_SOURCE_DIR}/include/loot/yaml/set.h" - "${CMAKE_SOURCE_DIR}/include/loot/yaml/tag.h" - "${CMAKE_SOURCE_DIR}/include/loot/windows_encoding_converters.h" - "${CMAKE_SOURCE_DIR}/include/loot/language.h" - "${CMAKE_SOURCE_DIR}/include/loot/loot_version.h" - "${CMAKE_SOURCE_DIR}/include/loot/plugin_interface.h") +set (LOOT_API_SRC "${CMAKE_BINARY_DIR}/generated/loot_version.cpp" + "${CMAKE_SOURCE_DIR}/src/api/api.cpp" + "${CMAKE_SOURCE_DIR}/src/api/api_database.cpp" + "${CMAKE_SOURCE_DIR}/src/api/game.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/error_categories.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_evaluator.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/file.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/location.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/message.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/message_content.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/plugin_cleaning_data.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/plugin_metadata.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/priority.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/tag.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/game/game.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/game/game_cache.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/game/load_order_handler.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/metadata_list.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/masterlist.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin_sorter.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/helpers/crc.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/helpers/git_helper.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/helpers/language.cpp" + "${CMAKE_SOURCE_DIR}/src/backend/helpers/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/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/enum/game_type.h" + "${CMAKE_SOURCE_DIR}/include/loot/enum/language_code.h" + "${CMAKE_SOURCE_DIR}/include/loot/enum/message_type.h" + "${CMAKE_SOURCE_DIR}/include/loot/enum/plugin_cleanliness.h" + "${CMAKE_SOURCE_DIR}/include/loot/game_interface.h" + "${CMAKE_SOURCE_DIR}/include/loot/language.h" + "${CMAKE_SOURCE_DIR}/include/loot/loot_version.h" + "${CMAKE_SOURCE_DIR}/include/loot/metadata/conditional_metadata.h" + "${CMAKE_SOURCE_DIR}/include/loot/metadata/file.h" + "${CMAKE_SOURCE_DIR}/include/loot/metadata/location.h" + "${CMAKE_SOURCE_DIR}/include/loot/metadata/message.h" + "${CMAKE_SOURCE_DIR}/include/loot/metadata/message_content.h" + "${CMAKE_SOURCE_DIR}/include/loot/metadata/plugin_cleaning_data.h" + "${CMAKE_SOURCE_DIR}/include/loot/metadata/plugin_metadata.h" + "${CMAKE_SOURCE_DIR}/include/loot/metadata/priority.h" + "${CMAKE_SOURCE_DIR}/include/loot/metadata/tag.h" + "${CMAKE_SOURCE_DIR}/include/loot/yaml/file.h" + "${CMAKE_SOURCE_DIR}/include/loot/yaml/location.h" + "${CMAKE_SOURCE_DIR}/include/loot/yaml/message.h" + "${CMAKE_SOURCE_DIR}/include/loot/yaml/message_content.h" + "${CMAKE_SOURCE_DIR}/include/loot/yaml/plugin_cleaning_data.h" + "${CMAKE_SOURCE_DIR}/include/loot/yaml/plugin_metadata.h" + "${CMAKE_SOURCE_DIR}/include/loot/yaml/set.h" + "${CMAKE_SOURCE_DIR}/include/loot/yaml/tag.h" + "${CMAKE_SOURCE_DIR}/include/loot/plugin_interface.h" + "${CMAKE_SOURCE_DIR}/include/loot/struct/masterlist_info.h" + "${CMAKE_SOURCE_DIR}/include/loot/struct/plugin_tags.h" + "${CMAKE_SOURCE_DIR}/include/loot/struct/simple_message.h" + "${CMAKE_SOURCE_DIR}/include/loot/windows_encoding_converters.h" + "${CMAKE_SOURCE_DIR}/src/api/api_database.h" + "${CMAKE_SOURCE_DIR}/src/api/game.h" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_evaluator.h" + "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_grammar.h" + "${CMAKE_SOURCE_DIR}/src/backend/game/game.h" + "${CMAKE_SOURCE_DIR}/src/backend/game/game_cache.h" + "${CMAKE_SOURCE_DIR}/src/backend/game/load_order_handler.h" + "${CMAKE_SOURCE_DIR}/src/backend/metadata_list.h" + "${CMAKE_SOURCE_DIR}/src/backend/masterlist.h" + "${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin.h" + "${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin_sorter.h" + "${CMAKE_SOURCE_DIR}/src/backend/helpers/git_helper.h" + "${CMAKE_SOURCE_DIR}/src/backend/helpers/crc.h" + "${CMAKE_SOURCE_DIR}/src/backend/helpers/version.h") set (LOOT_GUI_SRC "${CMAKE_SOURCE_DIR}/src/gui/main.cpp" "${CMAKE_SOURCE_DIR}/src/gui/helpers.cpp" @@ -288,33 +301,6 @@ set (LOOT_GUI_HEADERS "${CMAKE_SOURCE_DIR}/src/gui/editor_message.h" "${CMAKE_SOURCE_DIR}/src/gui/resource.h" "${CMAKE_SOURCE_DIR}/src/gui/yaml_simple_message_helpers.h") -set (LOOT_API_SRC "${CMAKE_BINARY_DIR}/generated/loot_version.cpp" - "${CMAKE_SOURCE_DIR}/src/api/api.cpp" - "${CMAKE_SOURCE_DIR}/src/api/api_database.cpp" - "${CMAKE_SOURCE_DIR}/src/api/game.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/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/enum/game_type.h" - "${CMAKE_SOURCE_DIR}/include/loot/enum/language_code.h" - "${CMAKE_SOURCE_DIR}/include/loot/game_interface.h" - "${CMAKE_SOURCE_DIR}/include/loot/loot_version.h" - "${CMAKE_SOURCE_DIR}/include/loot/plugin_interface.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" - "${CMAKE_SOURCE_DIR}/src/api/game.h") - set (LOOT_TESTS_SRC "${CMAKE_SOURCE_DIR}/src/tests/backend/main.cpp") set (LOOT_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/tests/backend/game/game_test.h" @@ -370,14 +356,12 @@ set (LOOT_GUI_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/gui/state/game.h" "${CMAKE_SOURCE_DIR}/src/tests/gui/state/loot_settings_test.h" "${CMAKE_SOURCE_DIR}/src/tests/gui/state/loot_state_test.h") -source_group("Header Files\\backend" FILES ${LOOT_HEADERS}) source_group("Header Files\\gui" FILES ${LOOT_GUI_HEADERS}) source_group("Header Files\\api" FILES ${LOOT_API_HEADERS}) source_group("Header Files\\tests" FILES ${LOOT_TESTS_HEADERS}) source_group("Header Files\\tests" FILES ${LOOT_API_TESTS_HEADERS}) source_group("Header Files\\tests" FILES ${LOOT_GUI_TESTS_HEADERS}) -source_group("Source Files\\backend" FILES ${LOOT_SRC}) source_group("Source Files\\gui" FILES ${LOOT_GUI_SRC}) source_group("Source Files\\api" FILES ${LOOT_API_SRC}) source_group("Source Files\\tests" FILES ${LOOT_TESTS_SRC}) @@ -451,20 +435,15 @@ ENDIF () # Define Targets ############################## -# Common library. -add_library (loot_common STATIC ${LOOT_SRC} ${LOOT_HEADERS}) -add_dependencies (loot_common libespm libgit2 libloadorder pseudosem yaml-cpp) -target_link_libraries(loot_common ${Boost_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBLOADORDER_LIBRARIES} ${LOOT_LIBS} ${YAML_CPP_LIBRARIES}) - # Build tests. -add_executable (tests ${LOOT_TESTS_SRC} ${LOOT_TESTS_HEADERS}) -add_dependencies (tests loot_common GTest testing-metadata testing-plugins) -target_link_libraries(tests loot_common ${GTEST_LIBRARIES} ${LIBLOADORDER_LIBRARIES}) +add_executable (tests ${LOOT_API_SRC} ${LOOT_API_HEADERS} ${LOOT_TESTS_SRC} ${LOOT_TESTS_HEADERS}) +add_dependencies (tests libespm libgit2 libloadorder pseudosem yaml-cpp GTest testing-metadata testing-plugins) +target_link_libraries(tests ${Boost_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBLOADORDER_LIBRARIES} ${LOOT_LIBS} ${YAML_CPP_LIBRARIES} ${GTEST_LIBRARIES} ${LIBLOADORDER_LIBRARIES}) # Build API. add_library (loot_api ${LOOT_API_SRC} ${LOOT_API_HEADERS}) -add_dependencies (loot_api loot_common) -target_link_libraries(loot_api loot_common) +add_dependencies (loot_api libespm libgit2 libloadorder pseudosem yaml-cpp) +target_link_libraries(loot_api ${Boost_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBLOADORDER_LIBRARIES} ${LOOT_LIBS} ${YAML_CPP_LIBRARIES}) # Build API tests. add_executable (api-tests ${LOOT_API_TESTS_SRC} ${LOOT_API_TESTS_HEADERS}) @@ -496,7 +475,6 @@ ENDIF () IF (CMAKE_SYSTEM_NAME MATCHES "Windows") - set_target_properties (loot_common PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC") set_target_properties (tests PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC") IF (BUILD_SHARED_LIBS) set_target_properties (loot_api PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_EXPORT") diff --git a/include/loot/language.h b/include/loot/language.h index 918f8b94..f8aea71f 100644 --- a/include/loot/language.h +++ b/include/loot/language.h @@ -28,20 +28,20 @@ #include #include +#include "loot/api_decorator.h" #include "loot/enum/language_code.h" namespace loot { class Language { public: + LOOT_API static const std::vector codes; - static const std::vector codes; + LOOT_API Language(const LanguageCode code); + LOOT_API Language(const std::string& locale); - Language(const LanguageCode code); - Language(const std::string& locale); - - LanguageCode GetCode() const; - std::string GetName() const; - std::string GetLocale() const; + LOOT_API LanguageCode GetCode() const; + LOOT_API std::string GetName() const; + LOOT_API std::string GetLocale() const; private: static LanguageCode GetCode(const std::string& locale); diff --git a/include/loot/metadata/conditional_metadata.h b/include/loot/metadata/conditional_metadata.h index 05c69904..c76e456b 100644 --- a/include/loot/metadata/conditional_metadata.h +++ b/include/loot/metadata/conditional_metadata.h @@ -26,16 +26,18 @@ #include +#include "loot/api_decorator.h" + namespace loot { class ConditionalMetadata { public: - ConditionalMetadata(); - ConditionalMetadata(const std::string& condition); + LOOT_API ConditionalMetadata(); + LOOT_API ConditionalMetadata(const std::string& condition); - bool IsConditional() const; - void ParseCondition() const; + LOOT_API bool IsConditional() const; + LOOT_API void ParseCondition() const; - std::string Condition() const; + LOOT_API std::string Condition() const; private: std::string condition_; }; diff --git a/include/loot/metadata/file.h b/include/loot/metadata/file.h index c6082f9e..4dea2466 100644 --- a/include/loot/metadata/file.h +++ b/include/loot/metadata/file.h @@ -26,20 +26,21 @@ #include +#include "loot/api_decorator.h" #include "loot/metadata/conditional_metadata.h" namespace loot { class File : public ConditionalMetadata { public: - File(); - File(const std::string& name, const std::string& display = "", - const std::string& condition = ""); + LOOT_API File(); + LOOT_API File(const std::string& name, const std::string& display = "", + const std::string& condition = ""); - bool operator < (const File& rhs) const; - bool operator == (const File& rhs) const; + LOOT_API bool operator < (const File& rhs) const; + LOOT_API bool operator == (const File& rhs) const; - std::string Name() const; - std::string DisplayName() const; + LOOT_API std::string Name() const; + LOOT_API std::string DisplayName() const; private: std::string name_; std::string display_; diff --git a/include/loot/metadata/location.h b/include/loot/metadata/location.h index 39af217f..aafb9f38 100644 --- a/include/loot/metadata/location.h +++ b/include/loot/metadata/location.h @@ -27,17 +27,19 @@ #include #include +#include "loot/api_decorator.h" + namespace loot { class Location { public: - Location(); - Location(const std::string& url, const std::string& name = ""); + LOOT_API Location(); + LOOT_API Location(const std::string& url, const std::string& name = ""); - bool operator < (const Location& rhs) const; - bool operator == (const Location& rhs) const; + LOOT_API bool operator < (const Location& rhs) const; + LOOT_API bool operator == (const Location& rhs) const; - std::string URL() const; - std::string Name() const; + LOOT_API std::string URL() const; + LOOT_API std::string Name() const; private: std::string url_; std::string name_; diff --git a/include/loot/metadata/message.h b/include/loot/metadata/message.h index a72b1774..7caae54c 100644 --- a/include/loot/metadata/message.h +++ b/include/loot/metadata/message.h @@ -27,6 +27,7 @@ #include #include +#include "loot/api_decorator.h" #include "loot/metadata/conditional_metadata.h" #include "loot/metadata/message_content.h" #include "loot/enum/language_code.h" @@ -36,20 +37,20 @@ namespace loot { class Message : public ConditionalMetadata { public: - Message(); - Message(const MessageType type, const std::string& content, - const std::string& condition = ""); - Message(const MessageType type, const std::vector& content, - const std::string& condition = ""); + LOOT_API Message(); + LOOT_API Message(const MessageType type, const std::string& content, + const std::string& condition = ""); + LOOT_API Message(const MessageType type, const std::vector& content, + const std::string& condition = ""); - bool operator < (const Message& rhs) const; - bool operator == (const Message& rhs) const; + LOOT_API bool operator < (const Message& rhs) const; + LOOT_API bool operator == (const Message& rhs) const; - MessageType GetType() const; - std::vector GetContent() const; - MessageContent GetContent(const LanguageCode language) const; + LOOT_API MessageType GetType() const; + LOOT_API std::vector GetContent() const; + LOOT_API MessageContent GetContent(const LanguageCode language) const; - SimpleMessage ToSimpleMessage(const LanguageCode language) const; + LOOT_API SimpleMessage ToSimpleMessage(const LanguageCode language) const; private: MessageType type_; std::vector content_; diff --git a/include/loot/metadata/message_content.h b/include/loot/metadata/message_content.h index 276ed07c..63d00599 100644 --- a/include/loot/metadata/message_content.h +++ b/include/loot/metadata/message_content.h @@ -26,22 +26,23 @@ #include +#include "loot/api_decorator.h" #include "loot/language.h" namespace loot { class MessageContent { public: - MessageContent(); - MessageContent(const std::string& text, const LanguageCode language); + LOOT_API MessageContent(); + LOOT_API MessageContent(const std::string& text, const LanguageCode language); - std::string GetText() const; - LanguageCode GetLanguage() const; + LOOT_API std::string GetText() const; + LOOT_API LanguageCode GetLanguage() const; - bool operator < (const MessageContent& rhs) const; - bool operator == (const MessageContent& rhs) const; + LOOT_API bool operator < (const MessageContent& rhs) const; + LOOT_API bool operator == (const MessageContent& rhs) const; - static MessageContent Choose(const std::vector content, - const LanguageCode language); + LOOT_API static MessageContent Choose(const std::vector content, + const LanguageCode language); private: std::string text_; LanguageCode language_; diff --git a/include/loot/metadata/plugin_cleaning_data.h b/include/loot/metadata/plugin_cleaning_data.h index 9686cdc4..8c800aa0 100644 --- a/include/loot/metadata/plugin_cleaning_data.h +++ b/include/loot/metadata/plugin_cleaning_data.h @@ -28,32 +28,33 @@ #include #include +#include "loot/api_decorator.h" #include "loot/metadata/message.h" namespace loot { class PluginCleaningData { public: - PluginCleaningData(); - PluginCleaningData(uint32_t crc, const std::string& utility); - PluginCleaningData(uint32_t crc, - const std::string& utility, - const std::vector& info, - unsigned int itm, - unsigned int ref, - unsigned int nav); + LOOT_API PluginCleaningData(); + LOOT_API PluginCleaningData(uint32_t crc, const std::string& utility); + LOOT_API PluginCleaningData(uint32_t crc, + const std::string& utility, + const std::vector& info, + unsigned int itm, + unsigned int ref, + unsigned int nav); - bool operator < (const PluginCleaningData& rhs) const; - bool operator == (const PluginCleaningData& rhs) const; + LOOT_API bool operator < (const PluginCleaningData& rhs) const; + LOOT_API bool operator == (const PluginCleaningData& rhs) const; - uint32_t CRC() const; - unsigned int ITMs() const; - unsigned int DeletedRefs() const; - unsigned int DeletedNavmeshes() const; - std::string CleaningUtility() const; - std::vector Info() const; + LOOT_API uint32_t CRC() const; + LOOT_API unsigned int ITMs() const; + LOOT_API unsigned int DeletedRefs() const; + LOOT_API unsigned int DeletedNavmeshes() const; + LOOT_API std::string CleaningUtility() const; + LOOT_API std::vector Info() const; - MessageContent ChooseInfo(const LanguageCode language) const; - Message AsMessage() const; + LOOT_API MessageContent ChooseInfo(const LanguageCode language) const; + LOOT_API Message AsMessage() const; private: uint32_t crc_; unsigned int itm_; diff --git a/include/loot/metadata/plugin_metadata.h b/include/loot/metadata/plugin_metadata.h index b7bbc3bd..90f377fa 100644 --- a/include/loot/metadata/plugin_metadata.h +++ b/include/loot/metadata/plugin_metadata.h @@ -31,6 +31,7 @@ #include #include +#include "loot/api_decorator.h" #include "loot/yaml/set.h" #include "loot/metadata/file.h" #include "loot/metadata/location.h" @@ -42,56 +43,56 @@ namespace loot { class PluginMetadata { public: - PluginMetadata(); - PluginMetadata(const std::string& name); + LOOT_API PluginMetadata(); + LOOT_API PluginMetadata(const std::string& name); //Merges from the given plugin into this one, unless there is already equal metadata present. //For 'enabled' and 'priority' metadata, use the given plugin's values, but if the 'priority' user value is zero, ignore it. - void MergeMetadata(const PluginMetadata& plugin); + LOOT_API void MergeMetadata(const PluginMetadata& plugin); // Returns metadata in this plugin not in the given plugin. //For 'enabled', use this plugin's value. //For 'priority', use 0 if the two plugin priorities are equal, and make it not explicit. Otherwise use this plugin's value. - PluginMetadata NewMetadata(const PluginMetadata& plugin) const; + LOOT_API PluginMetadata NewMetadata(const PluginMetadata& plugin) const; - std::string Name() const; - std::string LowercasedName() const; - bool Enabled() const; - Priority LocalPriority() const; - Priority GlobalPriority() const; - std::set LoadAfter() const; - std::set Reqs() const; - std::set Incs() const; - std::vector Messages() const; - std::set Tags() const; - std::set DirtyInfo() const; - std::set CleanInfo() const; - std::set Locations() const; + LOOT_API std::string Name() const; + LOOT_API std::string LowercasedName() const; + LOOT_API bool Enabled() const; + LOOT_API Priority LocalPriority() const; + LOOT_API Priority GlobalPriority() const; + LOOT_API std::set LoadAfter() const; + LOOT_API std::set Reqs() const; + LOOT_API std::set Incs() const; + LOOT_API std::vector Messages() const; + LOOT_API std::set Tags() const; + LOOT_API std::set DirtyInfo() const; + LOOT_API std::set CleanInfo() const; + LOOT_API std::set Locations() const; - std::vector SimpleMessages(const LanguageCode language) const; + LOOT_API std::vector SimpleMessages(const LanguageCode language) const; - void Enabled(const bool enabled); - void LocalPriority(const Priority& priority); - void GlobalPriority(const Priority& priority); - void LoadAfter(const std::set& after); - void Reqs(const std::set& reqs); - void Incs(const std::set& incs); - void Messages(const std::vector& messages); - void Tags(const std::set& tags); - void DirtyInfo(const std::set& info); - void CleanInfo(const std::set& info); - void Locations(const std::set& locations); + LOOT_API void Enabled(const bool enabled); + LOOT_API void LocalPriority(const Priority& priority); + LOOT_API void GlobalPriority(const Priority& priority); + LOOT_API void LoadAfter(const std::set& after); + LOOT_API void Reqs(const std::set& reqs); + LOOT_API void Incs(const std::set& incs); + LOOT_API void Messages(const std::vector& messages); + LOOT_API void Tags(const std::set& tags); + LOOT_API void DirtyInfo(const std::set& info); + LOOT_API void CleanInfo(const std::set& info); + LOOT_API void Locations(const std::set& locations); - bool HasNameOnly() const; - bool IsRegexPlugin() const; + LOOT_API bool HasNameOnly() const; + LOOT_API bool IsRegexPlugin() const; //Compare name strings. - bool operator == (const PluginMetadata& rhs) const; - bool operator != (const PluginMetadata& rhs) const; + LOOT_API bool operator == (const PluginMetadata& rhs) const; + LOOT_API bool operator != (const PluginMetadata& rhs) const; //Compare name string. - bool operator == (const std::string& rhs) const; - bool operator != (const std::string& rhs) const; + LOOT_API bool operator == (const std::string& rhs) const; + LOOT_API bool operator != (const std::string& rhs) const; private: std::string name_; bool enabled_; diff --git a/include/loot/metadata/priority.h b/include/loot/metadata/priority.h index eb6dc307..1891e89f 100644 --- a/include/loot/metadata/priority.h +++ b/include/loot/metadata/priority.h @@ -26,25 +26,27 @@ #include +#include "loot/api_decorator.h" + namespace loot { class Priority { public: - Priority(); + LOOT_API Priority(); // Take an int to prevent literals that are too large for one byte from // wrapping around to negative values. - explicit Priority(const int value); + LOOT_API explicit Priority(const int value); // Doesn't return an int8_t because it is commonly signed char, which // yaml-cpp interprets as a character rather than an integer. - short getValue() const; - bool isExplicit() const; + LOOT_API short getValue() const; + LOOT_API bool isExplicit() const; - bool operator < (const Priority& rhs) const; - bool operator > (const Priority& rhs) const; - bool operator >= (const Priority& rhs) const; - bool operator == (const Priority& rhs) const; + LOOT_API bool operator < (const Priority& rhs) const; + LOOT_API bool operator > (const Priority& rhs) const; + LOOT_API bool operator >= (const Priority& rhs) const; + LOOT_API bool operator == (const Priority& rhs) const; - bool operator > (const uint8_t rhs) const; + LOOT_API bool operator > (const uint8_t rhs) const; private: bool isExplicitZeroValue_; diff --git a/include/loot/metadata/tag.h b/include/loot/metadata/tag.h index f666ee71..697031d3 100644 --- a/include/loot/metadata/tag.h +++ b/include/loot/metadata/tag.h @@ -26,21 +26,22 @@ #include +#include "loot/api_decorator.h" #include "loot/metadata/conditional_metadata.h" namespace loot { class Tag : public ConditionalMetadata { public: - Tag(); - Tag(const std::string& tag, - const bool isAddition = true, - const std::string& condition = ""); + LOOT_API Tag(); + LOOT_API Tag(const std::string& tag, + const bool isAddition = true, + const std::string& condition = ""); - bool operator < (const Tag& rhs) const; - bool operator == (const Tag& rhs) const; + LOOT_API bool operator < (const Tag& rhs) const; + LOOT_API bool operator == (const Tag& rhs) const; - bool IsAddition() const; - std::string Name() const; + LOOT_API bool IsAddition() const; + LOOT_API std::string Name() const; private: std::string name_; bool addTag_;