Commit Graph
125 Commits
Author SHA1 Message Date
Oliver Hamlet 4574d8751a Specify the minimum supported Rust version 2026-04-03 16:19:47 +01:00
Oliver Hamlet d929ab9dab Set version and changelog for 0.29.2 2026-03-27 13:56:04 +00:00
Oliver Hamlet d869833742 Set version to 0.29.1 2026-03-13 18:40:53 +00:00
Oliver Hamlet 7de8bdb3a8 Set version to v0.29.0 2026-02-04 21:18:04 +00:00
Oliver Hamlet 81388873da Add bits for cross-compiling to Windows using MinGW
Some tests have been updated because UTF-8 is used as the native
path encoding with MinGW/Wine, unlike MSVC/Windows.

Some of the tests fail:

- 4 Rust tests fail because long paths are not enabled and so the
  paths used when creating symlinks and junction paths are too
  long. I've tested them with x86_64-pc-windows-gnu and
  x86_64-pc-windows-gnullvm, and both see the same behaviour. The
  tests pass when the MinGW-built executable is run on Windows, so
  this is a Wine limitation.
- 12 C++ tests fail because directory symlink creation is not
  implemented. They fail whether the MinGW-built executable is run
  in Wine or on Windows, so this is a MinGW limitation.
- 1 C++ filesystem test fails because long paths are not enabled.

The failing tests are skipped at runtime when built with MinGW,
aside from the one test for long paths being enabled, which expects
them to be disabled when built with MinGW.

If long paths are enabled, e.g. by running

wine reg add HKLM\\System\\CurrentControlSet\\Control\\Filesystem /v LongPathsEnabled /t REG_DWORD /d 1 /f

then many more tests fail because the C++ tests create long paths
when that Registry value is set, but it doesn't seem to actually
enable long path support in Wine, so various filesystem operations
fail.
2026-02-03 08:52:23 +00:00
Oliver Hamlet 6fb3c8fb6c Reformat table in cpp/README.md 2026-01-31 16:04:23 +00:00
Oliver Hamlet 45877669f1 Only create links in tests when necessary 2026-01-31 15:29:34 +00:00
Oliver Hamlet 10c6efca16 Use lowercase windows.h include
To fix a MinGW error.
2026-01-31 15:29:33 +00:00
Oliver Hamlet c6c3056d35 Move where Windows libraries are linked
To where they're actually used. The tests don't need them, and MinGW complains if they aren't linked to the first layer of the C++ wrapper.
2026-01-31 15:29:33 +00:00
Oliver Hamlet f606f169a5 Add condition field to plugin cleaning data metadata 2026-01-21 17:55:14 +00:00
Oliver Hamlet 9c59d87f23 Change name of internal CMake custom target
It shows up when using libloot as a FetchContent dependency, and it's a bit confusing to have libloot and libloot-cpp-build when the latter isn't the one that a C++ project should really depend on.

libloot-cargo may still be confusing, but at least indicates what is involved.
2026-01-17 18:08:25 +00:00
Oliver Hamlet d14486433f Add line breaks to first two levels of metadata list output
Aside from the known bash tags list, since they're all short strings.
2026-01-14 19:02:40 +00:00
Oliver Hamlet 84ffe39a37 Use unique_ptr instead of shared_ptr for PluginInterface pointers
unique_ptr is simpler, and can be easily converted to shared_ptr if needed, and makes it obvious that each call will return a new pointer.

This does mean that if I want to hold onto the objects again in the future for some reason, that'll need the API to change back, but that seems unlikely.

unique_ptr not being copyable does make using it a little more awkward, but that only happened in one place in LOOT's code, and there the pointer needs to become shared anyway.
2026-01-03 13:32:57 +00:00
Oliver Hamlet b7363b0a29 Replace WriteMode with MetadataWriteOptions
This is a breaking API change, but the addition of any future options won't be.
2026-01-03 13:26:52 +00:00
Oliver Hamlet 72dde58e43 Preserve plugin metadata insertion order 2026-01-02 18:40:27 +00:00
Oliver Hamlet 96b2ed2373 Add include_user_metadata parameter to Database::general_messages()
The C++ wrapper defaults it to true, so the behaviour hasn't changed for
existing callers that don't pass a value for the evaluateConditions
parameter, i.e. that call GetGeneralMessages().

Since the new parameter comes before evaluateConditions,
existing GetGeneralMessages(true) and GetGeneralMessages(false) calls
need to be replaced with GetGeneralMessages(true, true) and
GetGeneralMessages(true, false) to retain their existing behaviour. The
parameter order was chosen to match that of GetPluginMetadata(), at the
cost of this backwards incompatibility.
2026-01-02 16:41:43 +00:00
Oliver Hamlet f582a513bc Add Database::set_user_general_messages() 2026-01-02 16:41:42 +00:00
Oliver Hamlet 1d123c8b21 Add Database::user_general_messages() 2026-01-02 16:41:42 +00:00
Oliver Hamlet 744586fe96 Add include_user_metadata parameter to Database::known_bash_tags()
The C++ wrapper defaults it to true, so the behaviour hasn't changed for
existing callers.
2026-01-02 16:41:07 +00:00
Oliver Hamlet db97a0786a Add Database::set_user_known_bash_tags() 2026-01-02 15:30:40 +00:00
Oliver Hamlet 2fe107d66b Add Database::user_known_bash_tags() 2026-01-02 15:30:24 +00:00
Oliver Hamlet c322e27e1e Rename CMake target from loot to libloot
On Windows using "loot" causes a name collisions with LOOT itself:

- for the MSVC project name, it clashes with LOOT's own project,
  despite the difference in case. This means that you can't build LOOT
  in Visual Studio when using FetchContent to handle the libloot
  dependency (running CMake on the CLI works though).
- for the PDB file, LOOT has LOOT.pdb and libloot has loot.pdb, which
  appear to be the same due to file paths being case-insensitive. This
  makes it more difficult to debug LOOT with the relevant debug info
  loaded.

Renaming the CMake target adds a "lib" prefix to the Visual Studio
project name and the artifact filenames:

- loot.vcxproj* -> libloot.vcxproj*
- loot.dll -> libloot.dll
- loot.lib -> libloot.lib
- loot.pdb -> libloot.pdb

The Linux build artifact filenames are unchanged, as they already had
the "lib" prefix.
2026-01-02 13:16:46 +00:00
Oliver Hamlet ee4188f917 Get read lock when retrieving general messages
Now that the Database::general_messages() function takes &self instead of &mut self, the wrappers don't need to take a write lock to call it.
2026-01-02 13:07:58 +00:00
Oliver Hamlet 46c3ddc884 Decouple clearing condition cache from evaluating general messages 2026-01-02 10:15:39 +00:00
Oliver Hamlet 364e2d25c0 Prevent copy & move of abstract classes
To prevent slicing, following C++ Core Guidelines C.21 and C.67.
2026-01-01 22:26:09 +00:00