ASAPCabinetFE
 
Loading...
Searching...
No Matches
TableOverrideManager Class Reference
+ Collaboration diagram for TableOverrideManager:

Public Member Functions

 TableOverrideManager ()=default
 Constructs a TableOverrideManager instance.
 
void applyOverrides (TableData &table) const
 Applies overrides from the table's JSON file to the TableData object.
 
void reloadOverrides (TableData &table) const
 Reloads overrides for a table (placeholder for dynamic reloading).
 
void saveOverride (const TableData &table, const std::map< std::string, std::string > &overrides) const
 Saves overrides to the table's JSON file.
 
void deleteOverride (const TableData &table) const
 Deletes the override JSON file for a table if it exists.
 
bool overrideFileExists (const TableData &table) const
 Checks if the override JSON file exists for a table.
 

Constructor & Destructor Documentation

◆ TableOverrideManager()

TableOverrideManager::TableOverrideManager ( )
default

Constructs a TableOverrideManager instance.

Initializes the manager without dependencies, relying on TableData::vpxFile for override paths.

Member Function Documentation

◆ applyOverrides()

void TableOverrideManager::applyOverrides ( TableData table) const

Applies overrides from the table's JSON file to the TableData object.

Loads the JSON file (<table_name>.json) from the same directory as table.vpxFile and merges specified fields (e.g., title, playfieldVideo) into the TableData object. Only user-overrideable fields are updated. Logs errors if the file is missing or invalid.

Parameters
tableThe TableData object to modify with override values.
+ Here is the caller graph for this function:

◆ deleteOverride()

void TableOverrideManager::deleteOverride ( const TableData table) const

Deletes the override JSON file for a table if it exists.

Removes <table_name>.json from the same directory as table.vpxFile.

Parameters
tableThe TableData object containing vpxFile.
+ Here is the caller graph for this function:

◆ overrideFileExists()

bool TableOverrideManager::overrideFileExists ( const TableData table) const

Checks if the override JSON file exists for a table.

Parameters
tableThe TableData object containing vpxFile.
Returns
True if <table_name>.json exists, false otherwise.

◆ reloadOverrides()

void TableOverrideManager::reloadOverrides ( TableData table) const

Reloads overrides for a table (placeholder for dynamic reloading).

Future implementation will reload overrides during runtime if the JSON file changes.

Parameters
tableThe TableData object to reload overrides for.

◆ saveOverride()

void TableOverrideManager::saveOverride ( const TableData table,
const std::map< std::string, std::string > &  overrides 
) const

Saves overrides to the table's JSON file.

Writes user-edited fields to <table_name>.json, merging with existing fields to preserve unedited ones. Logs errors if the file cannot be written.

Parameters
tableThe TableData object containing vpxFile for the file path.
overridesMap of field names to edited values.
+ Here is the call graph for this function:

The documentation for this class was generated from the following files: