ASAPCabinetFE
 
Loading...
Searching...
No Matches
vps_database_client.h
Go to the documentation of this file.
1
12#ifndef VPS_DATABASE_CLIENT_H
13#define VPS_DATABASE_CLIENT_H // Header guard to prevent multiple inclusions
14
15#include <string> // For std::string to handle file paths
16#include "tables/table_data.h" // Structure for storing table data
17#include "vps_database_loader.h" // Class for loading the VPS database
18#include "vps_database_scanner.h" // Class for matchmaking table data with VPS data
19#include "vps_database_updater.h" // Class for updating the VPS database
20#include "core/ui/loading_progress.h" // Structure for tracking progress
21
33public:
43 VpsDatabaseClient(const std::string& vpsDbPath);
44
55 bool load(LoadingProgress* progress = nullptr);
56
69 bool matchMetadata(const nlohmann::json& vpxTable, TableData& tableData, LoadingProgress* progress = nullptr) const;
70
83 bool fetchIfNeeded(const std::string& lastUpdatedPath, const std::string& updateFrequency, LoadingProgress* progress = nullptr);
84
85private:
86 std::string vpsDbPath_;
87 VpsDatabaseLoader loader_;
88 VpsDataScanner matchmaker_;
89 VpsDatabaseUpdater updater_;
90};
91
92#endif // VPS_DATABASE_CLIENT_H
Matches VPX table metadata to VPS database entries in ASAPCabinetFE.
Definition vps_database_scanner.h:19
Manages the VPS database and its integration with table data in ASAPCabinetFE.
Definition vps_database_client.h:32
bool fetchIfNeeded(const std::string &lastUpdatedPath, const std::string &updateFrequency, LoadingProgress *progress=nullptr)
Fetches the VPS database if an update is needed.
Definition vps_database_client.cpp:30
bool matchMetadata(const nlohmann::json &vpxTable, TableData &tableData, LoadingProgress *progress=nullptr) const
Enriches a TableData object with VPS database data.
Definition vps_database_client.cpp:26
bool load(LoadingProgress *progress=nullptr)
Loads the VPS database from the specified file path.
Definition vps_database_client.cpp:22
Loads the VPS database file in ASAPCabinetFE.
Definition vps_database_loader.h:29
Updates the VPS database file in ASAPCabinetFE.
Definition vps_database_updater.h:30
Defines the LoadingProgress struct for tracking loading state in ASAPCabinetFE.
Tracks the loading progress state for ASAPCabinetFE.
Definition loading_progress.h:33
Stores metadata and media paths for a VPX table.
Definition table_data.h:29
Defines the TableData struct for storing VPX table metadata and media paths.
Defines the VpsDatabaseLoader class for loading the VPS database in ASAPCabinetFE.
Defines the VpsDatabaseUpdater class for updating the VPS database in ASAPCabinetFE.