diff --git a/CMakeLists.txt b/CMakeLists.txt index f557f2c1..1d94122f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,8 +249,8 @@ set (LOOT_API_HEADERS "${CMAKE_SOURCE_DIR}/include/loot/api.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_message.h" "${CMAKE_SOURCE_DIR}/include/loot/plugin_tags.h" + "${CMAKE_SOURCE_DIR}/include/loot/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/docs/api/reference.rst b/docs/api/reference.rst index 2c3e6ce7..c90ad33e 100644 --- a/docs/api/reference.rst +++ b/docs/api/reference.rst @@ -21,7 +21,7 @@ Public-Field Data Structures .. doxygenstruct:: loot::MasterlistInfo :members: -.. doxygenstruct:: loot::PluginMessage +.. doxygenstruct:: loot::SimpleMessage :members: .. doxygenstruct:: loot::PluginTags diff --git a/include/loot/database_interface.h b/include/loot/database_interface.h index 6cd2c11a..1dac7470 100644 --- a/include/loot/database_interface.h +++ b/include/loot/database_interface.h @@ -30,8 +30,8 @@ #include "loot/language_code.h" #include "loot/masterlist_info.h" #include "loot/plugin_cleanliness.h" -#include "loot/plugin_message.h" #include "loot/plugin_tags.h" +#include "loot/simple_message.h" /** * @file @@ -174,7 +174,7 @@ public: * @returns A vector of messages associated with the specified plugin. Empty * if the plugin has no messages associated with it. */ - virtual std::vector GetPluginMessages(const std::string& plugin, + virtual std::vector GetPluginMessages(const std::string& plugin, const LanguageCode language) = 0; /** diff --git a/include/loot/message_type.h b/include/loot/message_type.h index baa70125..7ef7aaa5 100644 --- a/include/loot/message_type.h +++ b/include/loot/message_type.h @@ -27,7 +27,7 @@ along with LOOT. If not, see /** * @file - * @brief Contains the message type codes used by the PluginMessage structure. + * @brief Contains the message type codes used by the SimpleMessage structure. */ /** diff --git a/include/loot/plugin_message.h b/include/loot/simple_message.h similarity index 91% rename from include/loot/plugin_message.h rename to include/loot/simple_message.h index d0c5f85c..3ab1197d 100644 --- a/include/loot/plugin_message.h +++ b/include/loot/simple_message.h @@ -21,19 +21,19 @@ along with LOOT. If not, see . */ -#ifndef LOOT_PLUGIN_MESSAGE -#define LOOT_PLUGIN_MESSAGE +#ifndef LOOT_SIMPLE_MESSAGE +#define LOOT_SIMPLE_MESSAGE #include "loot/message_type.h" /** * @file - * @brief Contains the PluginMessage structure. + * @brief Contains the SimpleMessage structure. */ namespace loot { /** @brief A structure that holds the type of a message and the message string itself. */ -struct PluginMessage { +struct SimpleMessage { /** @brief The type of the message. */ MessageType type; diff --git a/src/api/api_database.cpp b/src/api/api_database.cpp index 24827149..ec957f75 100644 --- a/src/api/api_database.cpp +++ b/src/api/api_database.cpp @@ -163,9 +163,9 @@ PluginTags ApiDatabase::GetPluginTags(const std::string& plugin) { return tags; } -std::vector ApiDatabase::GetPluginMessages(const std::string& plugin, +std::vector ApiDatabase::GetPluginMessages(const std::string& plugin, const LanguageCode language) { - std::vector messages; + std::vector messages; PluginMetadata pluginMetadata = game_.GetMasterlist().FindPlugin(PluginMetadata(plugin)); for (const auto& message : pluginMetadata.Messages()) { @@ -243,8 +243,8 @@ void ApiDatabase::WriteMinimalList(const std::string& outputFile, const bool ove out << yout.c_str(); out.close(); } -PluginMessage ApiDatabase::convertMessage(const Message& message, const LanguageCode language) { - PluginMessage pluginMessage; +SimpleMessage ApiDatabase::convertMessage(const Message& message, const LanguageCode language) { + SimpleMessage pluginMessage; MessageContent content = message.GetContent(language); pluginMessage.type = message.GetType(); diff --git a/src/api/api_database.h b/src/api/api_database.h index f0104d5c..42e2ac12 100644 --- a/src/api/api_database.h +++ b/src/api/api_database.h @@ -54,7 +54,7 @@ struct ApiDatabase : public DatabaseInterface { PluginTags GetPluginTags(const std::string& plugin); - std::vector GetPluginMessages(const std::string& plugin, + std::vector GetPluginMessages(const std::string& plugin, const LanguageCode language); PluginCleanliness GetPluginCleanliness(const std::string& plugin); @@ -62,7 +62,7 @@ struct ApiDatabase : public DatabaseInterface { void WriteMinimalList(const std::string& outputFile, const bool overwrite); private: - PluginMessage convertMessage(const Message& message, const LanguageCode language); + SimpleMessage convertMessage(const Message& message, const LanguageCode language); Game game_; diff --git a/src/tests/api/database_interface_test.h b/src/tests/api/database_interface_test.h index dbe84e34..6fa028b1 100644 --- a/src/tests/api/database_interface_test.h +++ b/src/tests/api/database_interface_test.h @@ -329,7 +329,7 @@ TEST_P(DatabaseInterfaceTest, getPluginTagsShouldOutputTheCorrectBashTagsForPlug } TEST_P(DatabaseInterfaceTest, getPluginMessagesShouldReturnOkAndOutputANullArrayIfAPluginWithNoMessagesIsQueried) { - std::vector messages; + std::vector messages; EXPECT_NO_THROW(messages = db_->GetPluginMessages(blankEsp, LanguageCode::english)); EXPECT_TRUE(messages.empty()); } @@ -338,7 +338,7 @@ TEST_P(DatabaseInterfaceTest, getPluginMessagesShouldReturnOkAndOutputANoteIfAPl ASSERT_NO_THROW(GenerateMasterlist()); ASSERT_NO_THROW(db_->LoadLists(masterlistPath.string(), "")); - std::vector messages; + std::vector messages; EXPECT_NO_THROW(messages = db_->GetPluginMessages(blankEsm, LanguageCode::english)); ASSERT_EQ(1, messages.size()); EXPECT_EQ(MessageType::say, messages[0].type); @@ -350,7 +350,7 @@ TEST_P(DatabaseInterfaceTest, getPluginMessagesShouldReturnOkAndOutputAWarningIf ASSERT_NO_THROW(GenerateMasterlist()); ASSERT_NO_THROW(db_->LoadLists(masterlistPath.string(), "")); - std::vector messages; + std::vector messages; EXPECT_NO_THROW(messages = db_->GetPluginMessages(blankDifferentEsm, LanguageCode::english)); ASSERT_EQ(1, messages.size()); EXPECT_EQ(MessageType::warn, messages[0].type); @@ -362,7 +362,7 @@ TEST_P(DatabaseInterfaceTest, getPluginMessagesShouldReturnOkAndOutputAnErrorIfA ASSERT_NO_THROW(GenerateMasterlist()); ASSERT_NO_THROW(db_->LoadLists(masterlistPath.string(), "")); - std::vector messages; + std::vector messages; EXPECT_NO_THROW(messages = db_->GetPluginMessages(blankDifferentEsp, LanguageCode::english)); ASSERT_EQ(1, messages.size()); EXPECT_EQ(MessageType::error, messages[0].type); @@ -374,7 +374,7 @@ TEST_P(DatabaseInterfaceTest, getPluginMessagesShouldReturnOkAndOutputMultipleMe ASSERT_NO_THROW(GenerateMasterlist()); ASSERT_NO_THROW(db_->LoadLists(masterlistPath.string(), "")); - std::vector messages; + std::vector messages; EXPECT_NO_THROW(messages = db_->GetPluginMessages(blankDifferentMasterDependentEsp, LanguageCode::english)); ASSERT_EQ(3, messages.size()); EXPECT_EQ(MessageType::say, messages[0].type);