mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Return an optional<string> from PluginMetadata::GetGroup()
It provides a much clearer representation of the field's value.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
#include <optional>
|
||||
#include <regex>
|
||||
#include <set>
|
||||
#include <string>
|
||||
@@ -102,16 +103,11 @@ public:
|
||||
|
||||
/**
|
||||
* Get the plugin's group.
|
||||
* @return The name of the group this plugin belongs to.
|
||||
* @return An optional containing the name of the group this plugin belongs to
|
||||
* if it was explicitly set, otherwise an optional containing no
|
||||
* value.
|
||||
*/
|
||||
LOOT_API std::string GetGroup() const;
|
||||
|
||||
/**
|
||||
* Check if the plugin's group was set explicitly or if the default value was
|
||||
* implied.
|
||||
* @return True if the plugin's group was set explicitly, false otherwise.
|
||||
*/
|
||||
LOOT_API bool IsGroupExplicit() const;
|
||||
LOOT_API std::optional<std::string> GetGroup() const;
|
||||
|
||||
/**
|
||||
* Get the plugins that the plugin must load after.
|
||||
@@ -287,8 +283,7 @@ public:
|
||||
private:
|
||||
std::string name_;
|
||||
bool enabled_;
|
||||
std::string group_;
|
||||
bool isGroupExplicit_;
|
||||
std::optional<std::string> group_;
|
||||
std::set<File> loadAfter_;
|
||||
std::set<File> requirements_;
|
||||
std::set<File> incompatibilities_;
|
||||
|
||||
Reference in New Issue
Block a user