Top100
Your Personal Movie List (C++17 CLI + library)
|
Classes | |
struct | AppConfig |
Persistent application configuration stored in a single JSON file. More... | |
Functions | |
std::string | getConfigPath () |
Resolve the configuration file path for this run. | |
std::string | getDefaultDataPath () |
Compute the default data file path for movies JSON. | |
AppConfig | loadConfig () |
Load configuration from disk, creating defaults if missing. | |
void | saveConfig (const AppConfig &cfg) |
Persist configuration to disk. | |
bool | configureOmdb (AppConfig &cfg, const std::string &key, const std::function< bool(const std::string &)> &verify) |
Configure OMDb credentials in the active config. | |
bool configureOmdb | ( | AppConfig & | cfg, |
const std::string & | key, | ||
const std::function< bool(const std::string &)> & | verify | ||
) |
Configure OMDb credentials in the active config.
cfg | Active configuration (modified in-place and persisted on success) |
key | Candidate OMDb API key |
verify | Function that returns true if the key is valid |
std::string getConfigPath | ( | ) |
Resolve the configuration file path for this run.
std::string getDefaultDataPath | ( | ) |
Compute the default data file path for movies JSON.
AppConfig loadConfig | ( | ) |
Load configuration from disk, creating defaults if missing.
std::runtime_error | on unrecoverable I/O errors (e.g., permission issues). |
void saveConfig | ( | const AppConfig & | cfg | ) |
Persist configuration to disk.
cfg | Configuration to save. |