219 Commits
Author SHA1 Message Date
Oliver Hamlet 15d98c9c20 Add a new Filename class to the API
It'll be used to represent filenames that get compared
case-insensitively.
2020-07-11 19:14:05 +01:00
Oliver Hamlet 14bdbe1fdf Make PluginMetadata::GetLocations() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:05 +01:00
Oliver Hamlet d5881047cc Make PluginMetadata::GetCleanInfo() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:04 +01:00
Oliver Hamlet 88a1c6f6d1 Make PluginMetadata::GetDirtyInfo() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:04 +01:00
Oliver Hamlet eeff7a9283 Make PluginMetadata::GetTags() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:04 +01:00
Oliver Hamlet 8dbbb55ecc Make PluginMetadata::GetIncompatibilities() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:04 +01:00
Oliver Hamlet 2bfc38358b Make PluginMetadata::GetRequirements() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:03 +01:00
Oliver Hamlet 998b70d698 Make PluginMetadata::GetLoadAfterFiles() return a std::vector
The collection is only ever iterated over, and the uniqueness and
ordering don't matter.
2020-07-11 19:14:03 +01:00
Oliver Hamlet 547a49d454 Make GameInterface::GetLoadedPlugins() return a std::vector
The plugin set is only ever iterated over, and the ordering of elements
is meaningless.
2020-07-11 19:14:01 +01:00
Oliver Hamlet d2a33d436e Make DatabaseInterface::GetKnownBashTags() 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.
2020-07-11 19:13:14 +01:00
Oliver Hamlet 4e48d085cc 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.
2020-07-11 19:13:13 +01:00
Oliver Hamlet e85ec7b1ce Overhaul Group APIs
- Group equality now compares all fields
- All other comparison operators are now overridden for Group
- Group "after" metadata is now stored as a vector of strings instead of
  an unordered set, to preserve source metadata ordering and simplify
  implementing the comparison operator  overloads
- std::hash is no longer specialised for Group
- DatabaseInterface::GetGroups() and DatabaseInterface::GetUserGroups()
  now return vectors of Groups instead of unordered sets.
- DatabaseInterface::SetUserGroups() now takes a vector of Groups
  instead of an unordered set.
2020-07-11 19:13:13 +01:00
Oliver Hamlet 83ba085a6d Add missing comparison operators for plugin metadata classes
This does not include the Group class, as that still needs its existing operator implementations updated.
2020-07-11 19:13:13 +01:00
Oliver Hamlet d9788b70fc Remove enabled field from PluginMetadata
It doesn't actually do anything, and fixing that turns out to be
very complicated. Since nobody appears to have noticed, just remove
the field entirely.
2020-07-11 19:13:13 +01:00
Oliver Hamlet 15076a6d26 Overhaul plugin metadata types' comparison operators
Change their implementations to check full object equality, with case insensitivity for filename strings.

The filename case insensitivity doesn't extend to filenames in condition strings, as conditions are compared as strings, but the risk of duplicates due to that is much less than the risk of treating non-duplicate objects as duplicates.
2020-07-11 19:13:07 +01:00
Oliver Hamlet 2bdb847e6f Fix header comment indendation 2020-07-11 18:27:37 +01:00
Oliver Hamlet 06617c2706 Use the order of plugins given when sorting as the current load order
To allow for more flexibility when sorting, e.g. to use a load order
that isn't the current load order as if it was (e.g. sorting from a
backed-up load order).
2019-11-05 20:46:48 +00:00
Oliver Hamlet 8f690e8579 Make all constructors explicit 2019-11-05 20:46:38 +00:00
Oliver Hamlet 8b0c057ca3 Remove InitialiseLocale()
Setting the global locale is no longer needed, as Boost.Filesystem and
Boost.Locale are no longer used. All Boost dependencies are now
header-only.

Install language packs on Travis to ensure that the Turkish and Greek
locales exist for testing. Now that only header-only Boost libraries
are used, just download and extract the Boost archive on Travis.

change boost url
2019-11-05 20:46:38 +00:00
Oliver Hamlet 6a1184c8da Remove GetLowercasedName(), GetNormalizedName() from PluginMetadata
Also remove the std::hash specialisation for PluginMetadata from the
public API.
2019-11-05 20:46:32 +00:00
Oliver Hamlet a301369868 Fix filename comparison on Windows
boost::locale::to_lower uses locale-dependent lowercasing, which doesn't
match filesystem case insensitivity when running in the Turkish locale,
as then lowercase "I" is not "i", and uppercase "i" is not "I". To avoid
this issue on Windows, use CompareStringOrdinal to use the same rules
as the filesystem when comparing strings, and CharUpperBuffW to
uppercase strings before comparing hashes. It's less clear that
CharUpperBuffW uses the same rules as the filesystem, but that's what I
understand from reading around.

I haven't figured out how to get similar behaviour on Linux, though it
probably involves using ICU. For now, boost::locale::to_upper is used
before comparison. This is inaccurate, but at least avoids the problem
of some characters not round-tripping when lowercased.
2019-05-25 10:45:59 +01:00
Oliver Hamlet 80d9f8be43 Add support for Morrowind
Sorting doesn't work as for other games, because esplugin can't tell if
a plugin contains override records, so returns 0 for their count, so no
overlap edges get added.
2019-04-24 21:35:17 +01:00
Oliver Hamlet 1b67c79aed Add PluginMetadata::UnsetGroup()
The postcondition is that GetGroup returns nullopt.
2019-01-27 18:07:20 +00:00
Oliver Hamlet 5bb20daa82 Rename "LOOT API" to "libloot"
To avoid confusion when talking about the library vs. its API. The GitHub
repository has not yet been renamed, so all references to it are
unchanged.
2018-11-17 18:43:07 +00:00
Oliver Hamlet 1fe8f901f0 Revert making GameInterface::GetPlugin() return an optional
It doesn't add anything as std::shared_ptr can already represent a null
state, and just makes handling values more complicated.
2018-10-20 12:48:24 +01:00