libscid 0.1.0
Chess applications made easy.
Loading...
Searching...
No Matches
decode.h File Reference

Implements a parser that converts PGN text into SCID's Game objects. More...

#include "scid/core/game.h"
#include "scid/core/movetext_location.h"
#include <cstddef>
#include <string>
+ Include dependency graph for decode.h:

Go to the source code of this file.

Classes

struct  scid::core::pgn::ParseLog
 Format and store errors. More...
 

Functions

bool scid::core::pgn::parseGame (const char *input, size_t inputLen, scid::core::Game &game, ParseLog &log)
 Convert PGN text into a core Game object.
 
bool scid::core::pgn::parseGame (const char *input, size_t inputLen, scid::core::Game &game, scid::core::MovetextLocation &location, ParseLog &log)
 

Detailed Description

Implements a parser that converts PGN text into SCID's Game objects.

Function Documentation

◆ parseGame()

bool scid::core::pgn::parseGame ( const char *  input,
size_t  inputLen,
scid::core::Game game,
ParseLog log 
)

Convert PGN text into a core Game object.

Parameters
inputthe memory containing the PGN text.
inputLenthe number of chars in input.
gamethe Game object where the game will be stored. The object is not automatically cleared so that moves can be added to an already existing one.
logstores eventual parsing error.
Returns
true if a game was parsed successfully (maybe with errors, but without ignoring any part), false otherwise.