103 Commits
Author SHA1 Message Date
Oliver Hamlet 761cdf555b Reintroduce on-demand condition evaluation
Extend the API to optionally allow it when getting plugin metadata and
general messages.
2017-02-08 20:47:30 +00:00
Oliver Hamlet 9a0338a681 Don't include YAML support headers in API headers
They're not necessary to use the API, and pull in Boost and yaml-cpp
dependencies if included.
2017-02-06 18:03:18 +00:00
Oliver Hamlet 26a6b42cad Document the new API headers 2017-02-06 18:03:18 +00:00
Oliver Hamlet 0ed8226189 Rename API metadata class functions 2017-02-06 18:03:17 +00:00
Oliver Hamlet 46133d56ed Remove obsolete PluginTags from the API 2017-02-06 18:03:17 +00:00
Oliver Hamlet 49315aea94 Refactor GameDetectionError into GUI code 2017-02-06 18:03:17 +00:00
Oliver Hamlet 5e69108fc6 Fix documentation for LogVerbosity 2017-02-06 18:03:17 +00:00
Oliver Hamlet 74a01c4cf9 Update LanguageCode documentation
Language isn't specified during metadata evaluation.
2017-02-06 18:03:17 +00:00
Oliver Hamlet f353cc7bda Add logging controls to the API
Control verbosity and choose a file to output to.
2017-02-06 18:03:17 +00:00
Oliver Hamlet 5dae27ce87 Merge API's loot::api::Game into loot::Game
Make a few API functions const in the process.
2017-02-06 18:03:17 +00:00
Oliver Hamlet 972298599a Remove obsolete DatabaseInterface methods 2017-02-06 18:03:17 +00:00
Oliver Hamlet 1ce48392fe Make some DatabaseInterface methods const 2017-02-06 18:03:16 +00:00
Oliver Hamlet 5887600c1d Update header guards to match new file paths 2017-02-06 18:03:16 +00:00
Oliver Hamlet f79d2d271d Merge loot_common and loot_api build targets 2017-02-06 18:02:55 +00:00
Oliver Hamlet fc626ced24 Add getting only masterlist metadata to the API 2017-02-06 18:02:31 +00:00
Oliver Hamlet 2efa47f03f Add plugin data access functions to API
Plugin now inherits from PluginInterface, and Plugin objects are now
immutable and cached in shared_ptr objects. The Plugin class no longer
inherits from PluginMetadata, so file data and metadata are kept
separate and only brought together temporarily when sorting.

Sorting no longer evaluates conditions and checks install validity, so
such actions need to be performed before sorting (the validity checking
isn't, as the data gets reloaded just before sorting) or after it.

It should now be possible to reimplement the GUI using the API, though
there are probably still a few holes in the API.
2017-02-06 18:02:18 +00:00
Oliver Hamlet 83f0caa68e Add GameInterface to API
DatabaseInterface is now accessed through it, and IdentifyMainMasterFile
and SortPlugins have moved to it. GameInterface also deals with load
order access.

This is obviously a breaking change, but it's a cleaner structure than
just continuing to stuff everything in DatabaseInterface, and there
needs to be some relation between GameInterface and it.
2017-02-06 18:02:18 +00:00
Oliver Hamlet 2ef78a7743 Add new API functions for reading and writing metadata 2017-02-06 18:02:18 +00:00
Oliver Hamlet 174dea8b8d Move condition evaluation out of metadata classes
So that the API doesn't expose any references to the Game class.
Evaluation is now done in the ConditionEvaluator class. This complicates
evaluating conditions for Plugin objects, these have been checked to
ensure that metadata is only merged into them after evaluation.
2017-02-06 18:02:18 +00:00
Oliver Hamlet 15c1c91750 Remove unused PluginMetadata::DiffMetadata function 2017-02-06 18:02:17 +00:00
Oliver Hamlet be18a78dcf Split backend helpers.h up
windows_encoding_converters.h contains the ToWinWide/FromWinWide
functions shared by the API and GUI, and crc.h contains GetCrc32().
2017-02-06 18:02:17 +00:00
Oliver Hamlet ff575e107e Move GameSettings into GUI code and split Game
GameSettings is only needed by the LOOT GUI, and many functions in Game
could also be GUI-specific, so they were moved to a new loot::gui::Game
class (the namespace is temporary, to prevent conflicts until the
loot::Game class is hidden inside the API).

This also involved minor modifications to LoadOrderHandler, the removal
of Masterlist::Update(Game& game), and the (re)addition of a new API
function for specifying the game's main master file.
2017-02-06 18:02:17 +00:00
Oliver Hamlet 52382ddb20 Refactor metadata class headers
This is unfinished, as there are a couple of classes that have
methods that take Game objects to eval metadata, and these will
probably not end up exposed in the API. None of the classes are
documented either.

YAML encode/decode code is now stored in separate headers that
depend on yaml-cpp and boost, and which will not be part of the
API proper.
2017-02-06 18:02:17 +00:00
Oliver Hamlet 7d7bbc0f29 Document CyclicInteractionError methods 2016-12-24 19:55:56 +00:00
Oliver Hamlet 318e69af7d Don't translate exception messages
Since they're not translated, they don't need to be logged when
they're thrown, either. For most previously-translated exception
messages, display a generic "something went wrong" message
instead as they're generally pretty unusal and severe errors.

There are a few exceptions to this (pun intended):

- The masterlist revision / date "N/A" and "Unknown" messages are
  displayed in the General Information tab, so they've been
  reimplemented without using the exception message content.
- The cyclic interaction error message is now created on catching
  the CyclicInteractionError exception.
- The metadata syntax errors are still displayed in general and
  plugin messages, so they'll just be displayed in English. This
  is for consistency with third-party e.what() handling, as they
  contain technical detail that should be logged but which is
  (unusually) also useful to display in the UI, because the user
  can fix the issue there too.

Closes #658.
2016-12-15 17:24:28 +00:00