Top100
Your Personal Movie List (C++17 CLI + library)
Loading...
Searching...
No Matches
config.h
1// SPDX-License-Identifier: Apache-2.0
2//-------------------------------------------------------------------------------
3// Top100 — Your Personal Movie List
4//
5// File: lib/config.h
6// Purpose: AppConfig struct and JSON (de)serialization declarations.
7// Language: C++17 (header)
8//
9// Author: Andy McCall, mailme@andymccall.co.uk
10// Date: September 18, 2025
11//-------------------------------------------------------------------------------
12#pragma once
13
14#include <string>
15
39struct AppConfig {
40 std::string dataFile;
41 bool omdbEnabled = false;
42 std::string omdbApiKey;
43
44 // BlueSky integration
45 bool blueSkyEnabled = false;
46 std::string blueSkyIdentifier;
47 std::string blueSkyAppPassword;
48 std::string blueSkyService;
49
50 // Social post customization
51 std::string postHeaderText;
52 std::string postFooterText;
53
54 // Mastodon integration
55 bool mastodonEnabled = false;
56 std::string mastodonInstance;
57 std::string mastodonAccessToken;
58
59 // UI preferences
60 int uiSortOrder = 0;
61};
62
69std::string getConfigPath();
70
76std::string getDefaultDataPath();
77
85
92void saveConfig(const AppConfig& cfg);
std::string getConfigPath()
Resolve the configuration file path for this run.
Definition config.cpp:30
AppConfig loadConfig()
Load configuration from disk, creating defaults if missing.
Definition config.cpp:81
void saveConfig(const AppConfig &cfg)
Persist configuration to disk.
Definition config.cpp:111
std::string getDefaultDataPath()
Compute the default data file path for movies JSON.
Definition config.cpp:37
Persistent application configuration stored in a single JSON file.
Definition config.h:39
bool mastodonEnabled
Whether Mastodon posting is enabled.
Definition config.h:55
std::string postFooterText
Footer shown at bottom of social posts (may be empty)
Definition config.h:52
int uiSortOrder
Persisted sort order (matches SortOrder enum values)
Definition config.h:60
std::string omdbApiKey
OMDb API key (empty if not configured)
Definition config.h:42
std::string postHeaderText
Header shown at top of social posts (may be empty)
Definition config.h:51
std::string blueSkyAppPassword
App password (keep private)
Definition config.h:47
std::string dataFile
Absolute path to your movie data JSON.
Definition config.h:40
std::string mastodonAccessToken
User access token (keep private)
Definition config.h:57
bool blueSkyEnabled
Whether BlueSky posting is enabled.
Definition config.h:45
std::string blueSkyIdentifier
Handle or email used to login.
Definition config.h:46
std::string mastodonInstance
Instance base URL (e.g., https://mastodon.social)
Definition config.h:56
bool omdbEnabled
Whether OMDb features are enabled in the UI.
Definition config.h:41
std::string blueSkyService
Service base URL (default https://bsky.social)
Definition config.h:48