Scid
4.7.0
|
This class stores the pointers to the Index and NameBase objects used by a native codec. More...
#include <codec_native.h>
Public Member Functions | |
errorT | addGame (const IndexEntry *srcIe, const NameBase *srcNb, const byte *srcData, size_t dataLen) override |
Add a game to the database. More... | |
errorT | addGame (Game *game) override |
Add a game to the database. More... | |
errorT | saveGame (Game *game, gamenumT replaced) override |
Replaces a game in the database. More... | |
errorT | saveIndexEntry (const IndexEntry &ie, gamenumT replaced) override |
Replaces a game's IndexEntry (which contains the header data of a game). More... | |
std::pair< errorT, idNumberT > | addName (nameT nt, const char *name) override |
Adds a name (player, event, site or round) to the database. More... | |
![]() | |
virtual | ~ICodecDatabase () |
virtual Codec | getType () const =0 |
Returns the Codec type. More... | |
virtual std::vector< std::string > | getFilenames () const =0 |
Returns the full path of the files used by the database. More... | |
virtual std::vector< std::pair< const char *, std::string > > | getExtraInfo () const =0 |
Returns a vector of tag pairs containing extra information about the database (type, description, autoload, etc..) More... | |
virtual const byte * | getGameData (uint64_t offset, uint32_t length)=0 |
Fetches the data of a game (excluding index info), encoded in native format. More... | |
virtual errorT | flush ()=0 |
Writes all pending output to the files. More... | |
Protected Member Functions | |
CodecNative () | |
Protected Attributes | |
Index * | idx_ |
NameBase * | nb_ |
ByteBuffer | bbuf_ |
Additional Inherited Members | |
![]() | |
enum | Codec { MEMORY, SCID4, PGN } |
![]() | |
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... | |
This class stores the pointers to the Index and NameBase objects used by a native codec.
It also implements the addGame() and saveGame() functions of the ICodecDatabase interface, splitting them into 2 function calls to a derived class (CRTP technique):
Definition at line 43 of file codec_native.h.
|
inlineprotected |
Definition at line 50 of file codec_native.h.
|
inlineoverridevirtual |
Add a game to the database.
srcIe | valid pointer to the header data. |
srcNb | valid pointer to the NameBase containing srcIe's names. |
srcData | valid pointer to a buffer containing the game data (encoded in native format). |
dataLen | length of the game data (in bytes). |
Implements ICodecDatabase.
Definition at line 53 of file codec_native.h.
|
inlineoverridevirtual |
Add a game to the database.
game | valid pointer to a Game object with the data of the game. |
Implements ICodecDatabase.
Definition at line 69 of file codec_native.h.
|
inlineoverridevirtual |
Adds a name (player, event, site or round) to the database.
nt | nameT type of the name to add. |
name | the name to add. |
Implements ICodecDatabase.
Definition at line 92 of file codec_native.h.
|
inlineoverridevirtual |
Replaces a game in the database.
game | valid pointer to a Game object with the new data. |
replaced | valid gamenumT of the game to be replaced |
Implements ICodecDatabase.
Definition at line 77 of file codec_native.h.
|
inlineoverridevirtual |
Replaces a game's IndexEntry (which contains the header data of a game).
ie | reference to the IndexEntry with the new data. |
replaced | valid gamenumT of the game to be replaced |
Implements ICodecDatabase.
Definition at line 88 of file codec_native.h.
|
protected |
Definition at line 47 of file codec_native.h.
|
protected |
Definition at line 45 of file codec_native.h.
|
protected |
Definition at line 46 of file codec_native.h.