|
EnigmaMachineCore 0.1.0
A modular Enigma Machine simulation in C++20
|
Factory class for loading Enigma Machine configurations. Handles the parsing of TOML files and the creation of configuration objects. This class is stateless (static methods) and relies on IAssetProvider for IO. More...
#include <EnigmaConfigLoader.hpp>
Classes | |
| struct | AssetPath |
| Strongly typed wrapper for asset paths. Used to distinguish between general file names and base asset directories. More... | |
| struct | FileName |
| Strongly typed wrapper for file names. Used to distinguish between general file names and base asset directories. More... | |
Static Public Member Functions | |
| static EnigmaMachineConfig | load (const IAssetProvider &provider, const FileName &fileName, const AssetPath &assetPath=AssetPath()) |
| Loads the complete Enigma Machine configuration from a TOML file. | |
| static RotorConfig | loadRotor (const IAssetProvider &provider, const FileName &fileName) |
| Loads a single rotor configuration from a TOML file. | |
| static ReflectorConfig | loadReflector (const IAssetProvider &provider, const FileName &fileName) |
| Loads a single reflector configuration from a TOML file. | |
Factory class for loading Enigma Machine configurations. Handles the parsing of TOML files and the creation of configuration objects. This class is stateless (static methods) and relies on IAssetProvider for IO.
Definition at line 15 of file EnigmaConfigLoader.hpp.
|
static |
Loads the complete Enigma Machine configuration from a TOML file.
| provider | The asset provider to load files from. |
| fileName | The path to the main configuration TOML file. |
| assetPath | An optional base directory path to prepend to relative paths found in the config file. |
| std::runtime_error | If parsing fails or validation checks fail. |
Definition at line 61 of file EnigmaConfigLoader.cpp.
References IAssetProvider::loadAsset(), loadReflector(), loadRotor(), PLUGBOARD_MAX_PAIRS, EnigmaMachineConfig::plugBoardPairs, EnigmaMachineConfig::reflector, EnigmaMachineConfig::rotorCount, EnigmaMachineConfig::rotorPositions, and EnigmaMachineConfig::rotors.
Here is the call graph for this function:
|
static |
Loads a single reflector configuration from a TOML file.
| provider | The asset provider to load files from. |
| fileName | The path to the reflector configuration file. |
Definition at line 51 of file EnigmaConfigLoader.cpp.
References IAssetProvider::loadAsset(), and ReflectorConfig::wiring.
Referenced by EnigmaMachine::EnigmaMachine(), and load().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Loads a single rotor configuration from a TOML file.
| provider | The asset provider to load files from. |
| fileName | The path to the rotor configuration file. |
Definition at line 39 of file EnigmaConfigLoader.cpp.
References IAssetProvider::loadAsset(), RotorConfig::notchPosition, and RotorConfig::wiring.
Referenced by EnigmaMachine::EnigmaMachine(), and load().
Here is the call graph for this function:
Here is the caller graph for this function: