Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CardDatabaseCache Namespace Reference

Functions

bool write (const QString &cachePath, const CardDatabaseData &data, const QByteArray &sourceHash)
 Writes a fully-built database snapshot to a binary cache file.
bool read (const QString &cachePath, CardDatabaseData &data, const QByteArray &sourceHash, ICardSetPriorityController *priorityController)
 Reads a database snapshot from a binary cache file.

Function Documentation

◆ read()

bool CardDatabaseCache::read ( const QString & cachePath,
CardDatabaseData & data,
const QByteArray & sourceHash,
ICardSetPriorityController * priorityController )

Reads a database snapshot from a binary cache file.

Parameters
cachePathPath of the cache file to read.
dataSnapshot to populate.
sourceHashExpected hash of the source XML; read fails if it differs.
priorityControllerController used to reconstruct CardSet state.
Returns
True if a valid, up-to-date cache was read.
Here is the caller graph for this function:

◆ write()

bool CardDatabaseCache::write ( const QString & cachePath,
const CardDatabaseData & data,
const QByteArray & sourceHash )

Writes a fully-built database snapshot to a binary cache file.

Parameters
cachePathPath of the cache file to write.
dataThe snapshot to serialize.
sourceHashHash of the source XML used to validate the cache later.
Returns
True if the cache was written successfully.
Here is the caller graph for this function: