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:
Oliver Hamlet
2020-07-11 19:13:13 +01:00
parent e85ec7b1ce
commit 4e48d085cc
7 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -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.
+3 -3
View File
@@ -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;
+2 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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_;
+1 -1
View File
@@ -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"),
+1 -1
View File
@@ -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; }