app/game_store.h

the board-local archive of finished games (PLAN §3.1).

One JSON file per game under a games directory (default: $XDG_DATA_HOME/kirin/games, else ~/.local/share/kirin/games). The directory listing is the index — records are 1–5 KB, so thousands cost nothing, and there is no index file to fall out of sync with the files it describes.

This store is the SOURCE OF TRUTH for solo games. A game played with no network, no account and no linked board is still fully recorded here, and stays browsable and reviewable in the GUI. Uploading is a later, optional step (the pendingUpload flag on the record) — never a precondition.

namespace kirin
class GameStore
#include <game_store.h>

Public Functions

explicit GameStore(std::string dir = "")
inline const std::string &dir() const
bool save(const GameRecord &rec)
bool load(const std::string &id, GameRecord &out) const
bool remove(const std::string &id)
std::vector<GameRecord> list() const
std::vector<GameRecord> pendingUploads() const
std::vector<GameRecord> pendingAnalysisUploads() const
bool saveAnalysis(const std::string &gameId, const GameAnalysis &analysis)
bool loadAnalysis(const std::string &gameId, GameAnalysis &out) const
bool hasAnalysis(const std::string &gameId) const

Public Static Functions

static std::string defaultDir()

Private Functions

std::string pathFor(const std::string &id) const
std::string analysisPathFor(const std::string &id) const

Private Members

std::string dir_