mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Remove GetLowercasedName(), GetNormalizedName() from PluginMetadata
Also remove the std::hash specialisation for PluginMetadata from the public API.
This commit is contained in:
@@ -89,19 +89,6 @@ public:
|
||||
*/
|
||||
LOOT_API std::string GetName() const;
|
||||
|
||||
/**
|
||||
* Get the lowercased plugin name.
|
||||
* @return The lowercased plugin name.
|
||||
*/
|
||||
LOOT_API std::string GetLowercasedName() const;
|
||||
|
||||
/**
|
||||
* Get the plugin name, normalized to be suitable for case-insensitive
|
||||
* filename comparison.
|
||||
* @return The normalized plugin name.
|
||||
*/
|
||||
LOOT_API std::string GetNormalizedName() const;
|
||||
|
||||
/**
|
||||
* Check if the plugin metadata is enabled for use during sorting.
|
||||
* @return True if the metadata will be used during sorting, false otherwise.
|
||||
@@ -307,21 +294,4 @@ private:
|
||||
};
|
||||
}
|
||||
|
||||
namespace std {
|
||||
/**
|
||||
* A specialisation of std::hash for loot::PluginMetadata.
|
||||
*/
|
||||
template<>
|
||||
struct hash<loot::PluginMetadata> {
|
||||
/**
|
||||
* Calculate a hash value for an object of a class that implements
|
||||
* loot::PluginMetadata.
|
||||
* @return The hash generated from the plugin's lowercased filename.
|
||||
*/
|
||||
size_t operator()(const loot::PluginMetadata& plugin) const {
|
||||
return hash<string>()(plugin.GetNormalizedName());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -172,14 +172,6 @@ PluginMetadata PluginMetadata::NewMetadata(const PluginMetadata& plugin) const {
|
||||
|
||||
std::string PluginMetadata::GetName() const { return name_; }
|
||||
|
||||
std::string PluginMetadata::GetLowercasedName() const {
|
||||
return boost::locale::to_lower(name_);
|
||||
}
|
||||
|
||||
std::string PluginMetadata::GetNormalizedName() const {
|
||||
return NormalizeFilename(name_);
|
||||
}
|
||||
|
||||
bool PluginMetadata::IsEnabled() const { return enabled_; }
|
||||
|
||||
std::optional<std::string> PluginMetadata::GetGroup() const { return group_; }
|
||||
|
||||
@@ -31,10 +31,28 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include "api/helpers/text.h"
|
||||
#include "api/metadata/condition_evaluator.h"
|
||||
#include "loot/metadata/group.h"
|
||||
#include "loot/metadata/plugin_metadata.h"
|
||||
|
||||
namespace std {
|
||||
/**
|
||||
* A specialisation of std::hash for loot::PluginMetadata.
|
||||
*/
|
||||
template<>
|
||||
struct hash<loot::PluginMetadata> {
|
||||
/**
|
||||
* Calculate a hash value for an object of a class that implements
|
||||
* loot::PluginMetadata.
|
||||
* @return The hash generated from the plugin's normalized filename.
|
||||
*/
|
||||
size_t operator()(const loot::PluginMetadata& plugin) const {
|
||||
return hash<string>()(loot::NormalizeFilename(plugin.GetName()));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
namespace loot {
|
||||
class MetadataList {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user