|
HooverChessUtils_PgnReader 0.9.0
|
The PGN reader interface. More...
#include <pgnreader.h>
Static Public Member Functions | |
| static void | readFromMemory (std::string_view pgn, PgnReaderActions &actions, PgnReaderActionFilter filter) |
| Reads and processes a PGN from memory. | |
The PGN reader interface.
|
static |
Reads and processes a PGN from memory.
| [in] | pgn | PGN contents |
| [in] | actions | Semantic action callbacks |
| [in] | filter | Filter of enabled action classes |
| PgnError | PGN processing failed |
This function reads and processes a PGN. Action callbacks of actions are invoked based on the action class filter and the PGN contents. For instance, after a move is processed, PgnReaderActions::afterMove() is invoked if PgnReaderActionClass::Move is enabled filter.
The moves of the PGN are validated only when PgnReaderActionClass::Move is enabled.
Disabling unused callbacks may improve performance.
In case an error occurs when reading the PGN, PgnReaderActions::onError() is invoked. The return value of the caller-provided error handler specifies whether an attempt is made to continue. See the onError() documentation for details.