Scid
4.7.0
|
#include <codec_pgn.h>
Public Member Functions | |
Codec | getType () const final |
Returns the Codec type. More... | |
std::vector< std::string > | getFilenames () const final |
Returns the full path of the files used by the database. More... | |
errorT | flush () final |
Writes all pending output to the files. More... | |
errorT | open (const char *filename, fileModeT fmode) |
Opens/creates a PGN database. More... | |
errorT | parseNext (Game &game) |
Reads the next game. More... | |
std::pair< size_t, size_t > | parseProgress () |
Returns info about the parsing progress. More... | |
const char * | parseErrors () |
Returns the list of errors produced by parseNext() calls. More... | |
errorT | gameAdd (Game *game) |
Add a game into the database. More... | |
![]() | |
errorT | open (const char *filename, fileModeT fMode) |
Opens/creates a database encoded in a non-native format. More... | |
errorT | parseNext (Game &) |
Reads the next game. More... | |
std::pair< size_t, size_t > | parseProgress () |
Returns info about the parsing progress. More... | |
const char * | parseErrors () |
Returns the list of errors produced by parseNext() calls. More... | |
errorT | gameAdd (Game *) |
Adds a game into the database. More... | |
errorT | gameSave (Game *, gamenumT) |
Replaces a game in the database. More... | |
![]() | |
std::vector< std::pair< const char *, std::string > > | getExtraInfo () const override |
Returns a vector of tag pairs containing extra information about the database (type, description, autoload, etc..) More... | |
const byte * | getGameData (uint64_t offset, uint32_t length) override |
Fetches the data of a game (excluding index info), encoded in native format. More... | |
std::pair< errorT, uint64_t > | dyn_addGameData (const byte *src, size_t length) |
Stores the data of a game into memory. More... | |
std::pair< errorT, idNumberT > | dyn_addName (nameT nt, const char *name) |
Given a name (string), retrieve the corresponding ID. More... | |
errorT | dyn_addIndexEntry (const IndexEntry &ie) |
Add an IndexEntry to idx_. More... | |
errorT | dyn_saveIndexEntry (const IndexEntry &ie, gamenumT replaced) |
Replace an IndexEntry. More... | |
![]() | |
virtual | ~ICodecDatabase () |
Static Public Member Functions | |
template<typename TCont > | |
static size_t | encode (Game &game, TCont &dest) |
Encode a game into PGN format. More... | |
template<typename TCont > | |
static size_t | encodeTags (Game &game, TCont &dest) |
![]() | |
static errorT | parseGames (const TProgress &progress, TSource &src, TDestFn destFn) |
![]() | |
static std::pair< ICodecDatabase *, errorT > | open (Codec codec, fileModeT fMode, const char *filename, const Progress &progress, Index *idx, NameBase *nb) |
Creates a new object and calls the virtual function dyn_open(). More... | |
Additional Inherited Members | |
![]() | |
enum | Codec { MEMORY, SCID4, PGN } |
![]() | |
CodecNative () | |
![]() | |
Index * | idx_ |
NameBase * | nb_ |
ByteBuffer | bbuf_ |
Definition at line 36 of file codec_pgn.h.
|
inlinestatic |
Encode a game into PGN format.
Definition at line 180 of file codec_pgn.h.
|
inlinestatic |
Definition at line 197 of file codec_pgn.h.
|
inlinefinalvirtual |
Writes all pending output to the files.
Reimplemented from CodecMemory.
Definition at line 52 of file codec_pgn.h.
Add a game into the database.
The game is encoded in pgn format and appended at the end of file_.
game | valid pointer to a Game object with the new data. |
Definition at line 152 of file codec_pgn.h.
|
inlinefinalvirtual |
Returns the full path of the files used by the database.
The order of the filenames must be consistent for objects of the same Codec type.
Reimplemented from CodecMemory.
Definition at line 48 of file codec_pgn.h.
|
inlinefinalvirtual |
Opens/creates a PGN database.
After successfully opening/creating the file, the object is ready for parseNext() calls.
filename | full path of the pgn file to be opened. |
fmode | valid file access mode. |
Definition at line 66 of file codec_pgn.h.
|
inline |
Returns the list of errors produced by parseNext() calls.
Definition at line 144 of file codec_pgn.h.
Reads the next game.
game | the Game object where the data will be stored. |
Definition at line 95 of file codec_pgn.h.
|
inline |
Returns info about the parsing progress.
Definition at line 137 of file codec_pgn.h.