Move PluginMetadata::GetSimpleMessages() to ToSimpleMessages()

It's more versatile and would avoid duplication in LOOT's code.
This commit is contained in:
Oliver Hamlet
2022-02-19 13:45:52 +00:00
parent 5bce0b9e06
commit 77decb26c4
5 changed files with 28 additions and 49 deletions
+13
View File
@@ -154,6 +154,19 @@ LOOT_API bool operator>=(const Message& lhs, const Message& rhs);
LOOT_API std::optional<SimpleMessage> ToSimpleMessage(
const Message& message,
const std::string& language);
/**
* Get the messages as SimpleMessages given a language.
* @param language
* The preferred language for the message content.
* @return A vector of SimpleMessage objects for the preferred language, or for
* English if message text is not available for the given language. The
* order of the input Message objects is preserved, though any messages
* without the preferred language or English content will be omitted.
*/
LOOT_API std::vector<SimpleMessage> ToSimpleMessages(
const std::vector<Message>& message,
const std::string& language);
}
#endif
-9
View File
@@ -144,15 +144,6 @@ public:
*/
LOOT_API std::vector<Location> GetLocations() const;
/**
* Get the plugin's messages as SimpleMessage objects for the given language.
* @param language
* The language to create the SimpleMessage objects for.
* @return The plugin's messages as SimpleMessage objects.
*/
LOOT_API std::vector<SimpleMessage> GetSimpleMessages(
const std::string& language) const;
/**
* Set the plugin's group.
* @param group