HooverChessUtils_PgnReader 0.9.0
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
hoover_chess_utils::pgn_reader::PgnReader Class Reference

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.
 

Detailed Description

The PGN reader interface.

Member Function Documentation

◆ readFromMemory()

static void hoover_chess_utils::pgn_reader::PgnReader::readFromMemory ( std::string_view  pgn,
PgnReaderActions actions,
PgnReaderActionFilter  filter 
)
static

Reads and processes a PGN from memory.

Parameters
[in]pgnPGN contents
[in]actionsSemantic action callbacks
[in]filterFilter of enabled action classes
Exceptions
PgnErrorPGN 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.


The documentation for this class was generated from the following file: