75 virtual std::vector<std::string>
getFilenames()
const = 0;
81 virtual std::vector<std::pair<const char*, std::string>>
105 const byte* srcData,
size_t dataLen) = 0;
139 const char*
name) = 0;
virtual errorT addGame(const IndexEntry *srcIe, const NameBase *srcNb, const byte *srcData, size_t dataLen)=0
Add a game to the database.
virtual Codec getType() const =0
Returns the Codec type.
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().
virtual std::vector< std::string > getFilenames() const =0
Returns the full path of the files used by the database.
virtual ~ICodecDatabase()
virtual const byte * getGameData(uint64_t offset, uint32_t length)=0
Fetches the data of a game (excluding index info), encoded in native format.
This class stores the database's names (players, events, sites and rounds).
virtual errorT flush()=0
Writes all pending output to the files.
This interface separates the logic of a database from its representation.
virtual errorT saveGame(Game *game, gamenumT replaced)=0
Replaces a game in the database.
virtual std::pair< errorT, idNumberT > addName(nameT nt, const char *name)=0
Adds a name (player, event, site or round) to the database.
virtual errorT saveIndexEntry(const IndexEntry &ie, gamenumT replaced)=0
Replaces a game's IndexEntry (which contains the header data of a game).
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..)