194 Commits
Author SHA1 Message Date
Oliver Hamlet ce7d9c21cd Update version and changelog for v0.18.3 release 2022-12-13 20:51:45 +00:00
Oliver Hamlet b1a9e317b3 Update version and changelog for v0.18.2 release 2022-10-11 22:22:53 +01:00
Oliver Hamlet c4cdfbbdf8 Update version and changelog for v0.18.1 release 2022-10-01 15:08:05 +01:00
Oliver Hamlet 632b85ce78 Update version and changelogs for v0.18.0 release 2022-02-27 10:20:29 +00:00
Oliver Hamlet cc3c63dd0a Remove PluginMetadata::NewMetadata()
It's unused by LOOT.
2022-02-27 10:20:29 +00:00
Oliver Hamlet 00b93526b2 Rework how libloot's version is exposed in the API
- Don't use a class, it doesn't add anything.
- Use constexpr for the individual version numbers
- Use a function to get the revision string, for consistency with the
  version string.
2022-02-23 16:50:58 +00:00
Oliver Hamlet 412f5f5e60 Remove an unnecessary use of the LOOT_API definition 2022-02-23 16:47:56 +00:00
Oliver Hamlet bc76e83357 Add GameInterface::IsLoadOrderAmbiguous()
It exposes libloadorder's lo_is_ambiguous() function.
2022-02-23 16:45:26 +00:00
Oliver Hamlet 14479b2289 Make const data members non-const
As recommended by C++ Core Guidelines C.12.

Plugin and Game are still non-copy-constructable or assignable due to
having members that are non-copy-constructable/assignable, but
consistency is still good.
2022-02-19 13:55:03 +00:00
Oliver Hamlet 0907f91b6f Move overloaded symmetric operators out of File class 2022-02-19 13:45:53 +00:00
Oliver Hamlet d4de531de5 Make File::GetDisplayName() a trivial accessor
Don't escape any markdown characters or return the name field if the
display name is empty. They're really presentation issues so are left to
the UI.
2022-02-19 13:45:53 +00:00
Oliver Hamlet 77decb26c4 Move PluginMetadata::GetSimpleMessages() to ToSimpleMessages()
It's more versatile and would avoid duplication in LOOT's code.
2022-02-19 13:45:52 +00:00
Oliver Hamlet 5bce0b9e06 Move ToSimpleMessage out of Message
It doesn't need access to any private members.
2022-02-19 13:45:52 +00:00
Oliver Hamlet a239aae888 Move overloaded symmetric operators out of classes
This follows the advice of C++ Core Guidelines C.161 and C.168.

The File equality and less than comparison operators have not been
moved because File::GetDisplayName() is not a trivial accessor.
2022-02-19 13:45:51 +00:00
Oliver Hamlet fb147ec787 Move and rename MessageContent::Choose()
Also remove the File::ChooseDetail(), Message::GetContent() and
PluginCleaningData::ChooseDetail() functions that just call it.
2022-02-19 13:45:51 +00:00
Oliver Hamlet ad197d89ff Replace MessageContent::defaultLanguage
With a static constexpr C string.
2022-02-19 12:13:56 +00:00
Oliver Hamlet 855eed4731 Remove ConditionalMetadata::ParseCondition()
It's not used by LOOT.
2022-02-19 12:11:56 +00:00
Oliver Hamlet c7aafbe487 Remove unnecessary explicit default constructor definitions
This follows the advice of C++ Core Guidelines C.45 and C.80.
2022-02-19 11:59:20 +00:00
Oliver Hamlet 8e859f7408 Remove obsolete FileRevision class 2022-02-19 11:42:56 +00:00
Oliver Hamlet 44c6746a44 Add a couple of missing default virtual destructors 2022-02-19 11:31:39 +00:00
Oliver Hamlet b97424435f Add Group::DEFAULT_NAME
So that the constant is accessible to LOOT at compile time.
2022-02-18 23:01:42 +00:00
Oliver Hamlet bfb168907c Replace unnecessary usage of std::shared_ptr
- CreateGameHandle() should return a unique_ptr because it transfers
  ownership.
- GameInterface::GetDatabase() should return a reference because it
  returns an existing object that will always be valid at call time.
- GameInterface::GetPlugin() and GameInterface::GetLoadedPlugins()
  return raw pointers because they do not transfer or share ownership.
  It's unfortunately that references can't be used instead (ignoring
  std::reference_wrapper), as std::optional<const Plugin&> and
  std::vector<const Plugin&> would be more meaningful return types.

Internally, there were a few uses of shared_ptr that could be unique_ptr
and a few that could be non-pointer types.

A few uses of shared_ptr remain:

- Game and ApiDatabase share a ConditionEvaluator, so it's kept inside a
  shared_ptr. Technically ApiDatabase is used such that the
  ConditionEvaluator it uses will always outlive it, but that's not
  guaranteed, so shared_ptr is used for safety.
- Plugin objects are cached inside shared_ptr so that the map of
  them can be iterated over. Ideally they'd be stored in unique_ptr,
  but unique_ptr not being copyable means the map entries can't be
  iterated over.
2022-02-18 22:29:08 +00:00
Oliver Hamlet 4393dd0e66 Add cppcoreguidelines-pro-type-member-init clang-tidy check
Fix the warnings it emits.
2022-02-07 20:25:13 +00:00
Oliver Hamlet 7204e37721 Fix PluginMetadata::NameMatches() performance
This reverts 15781c9b6b in favour of a
more complete fix that breaks ABI stability.
2022-02-06 19:06:17 +00:00
Oliver Hamlet 9443135dbe Fix malformatted API documentation 2022-02-06 18:31:42 +00:00