mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Make PluginInterface::GetBashTags() return a std::vector
Instead of a std::set. The tags are only iterated over, and uniqueness and ordering are more of a concern for the UI. Part of #68.
This commit is contained in:
@@ -75,7 +75,7 @@ public:
|
||||
* @return A set of Bash Tags. The order of elements in the set holds no
|
||||
* semantics.
|
||||
*/
|
||||
virtual std::set<Tag> GetBashTags() const = 0;
|
||||
virtual std::vector<Tag> GetBashTags() const = 0;
|
||||
|
||||
/**
|
||||
* Get the plugin's CRC-32 checksum.
|
||||
|
||||
@@ -71,8 +71,8 @@ const std::vector<regex> versionRegexes({
|
||||
regex::ECMAScript | regex::icase),
|
||||
});
|
||||
|
||||
std::set<Tag> ExtractBashTags(const std::string& description) {
|
||||
std::set<Tag> tags;
|
||||
std::vector<Tag> ExtractBashTags(const std::string& description) {
|
||||
std::vector<Tag> tags;
|
||||
|
||||
size_t startPos = description.find("{{BASH:");
|
||||
if (startPos == std::string::npos || startPos + 7 >= description.length()) {
|
||||
@@ -92,7 +92,7 @@ std::set<Tag> ExtractBashTags(const std::string& description) {
|
||||
|
||||
for (auto& tag : bashTags) {
|
||||
boost::trim(tag);
|
||||
tags.insert(Tag(tag));
|
||||
tags.push_back(Tag(tag));
|
||||
}
|
||||
|
||||
return tags;
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
#define LOOT_API_HELPERS_TEXT
|
||||
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "loot/metadata/tag.h"
|
||||
|
||||
namespace loot {
|
||||
std::set<Tag> ExtractBashTags(const std::string& description);
|
||||
std::vector<Tag> ExtractBashTags(const std::string& description);
|
||||
|
||||
std::optional<std::string> ExtractVersion(const std::string& text);
|
||||
|
||||
|
||||
+2
-2
@@ -120,7 +120,7 @@ std::vector<std::string> Plugin::GetMasters() const {
|
||||
return mastersVec;
|
||||
}
|
||||
|
||||
std::set<Tag> Plugin::GetBashTags() const { return tags_; }
|
||||
std::vector<Tag> Plugin::GetBashTags() const { return tags_; }
|
||||
|
||||
std::optional<uint32_t> Plugin::GetCRC() const { return crc_; }
|
||||
|
||||
@@ -210,7 +210,7 @@ size_t Plugin::GetOverlapSize(
|
||||
|
||||
size_t Plugin::NumOverrideFormIDs() const { return numOverrideRecords_; }
|
||||
|
||||
uint32_t Plugin::GetRecordAndGroupCount() const {
|
||||
uint32_t Plugin::GetRecordAndGroupCount() const {
|
||||
uint32_t recordAndGroupCount = 0;
|
||||
auto ret =
|
||||
esp_plugin_record_and_group_count(esPlugin.get(), &recordAndGroupCount);
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ public:
|
||||
float GetHeaderVersion() const;
|
||||
std::optional<std::string> GetVersion() const;
|
||||
std::vector<std::string> GetMasters() const;
|
||||
std::set<Tag> GetBashTags() const;
|
||||
std::vector<Tag> GetBashTags() const;
|
||||
std::optional<uint32_t> GetCRC() const;
|
||||
|
||||
bool IsMaster() const;
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
const std::string name_;
|
||||
std::optional<std::string> version_; // Obtained from description field.
|
||||
std::optional<uint32_t> crc_;
|
||||
std::set<Tag> tags_;
|
||||
std::vector<Tag> tags_;
|
||||
|
||||
// Useful caches.
|
||||
size_t numOverrideRecords_;
|
||||
|
||||
@@ -46,7 +46,7 @@ Requires Skyrim Special Edition 1.5.39 or greater.
|
||||
|
||||
auto tags = ExtractBashTags(description);
|
||||
|
||||
std::set<Tag> expectedTags({
|
||||
std::vector<Tag> expectedTags({
|
||||
Tag("C.Climate"),
|
||||
Tag("C.Encounter"),
|
||||
Tag("C.ImageSpace"),
|
||||
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
std::vector<std::string> GetMasters() const {
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
std::set<Tag> GetBashTags() const { return std::set<Tag>(); }
|
||||
std::vector<Tag> GetBashTags() const { return std::vector<Tag>(); }
|
||||
std::optional<uint32_t> GetCRC() const { return std::nullopt; }
|
||||
|
||||
bool IsMaster() const { return false; }
|
||||
|
||||
Reference in New Issue
Block a user