EnigmaMachineCore 0.1.0
A modular Enigma Machine simulation in C++20
Loading...
Searching...
No Matches
Classes | Functions
main.cpp File Reference
#include <CLI/CLI.hpp>
#include <cctype>
#include <filesystem>
#include <iostream>
#include <string>
#include "EnigmaCore.hpp"
#include "config.hpp"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Classes

struct  AppConfig
 
class  ConsoleObserver
 Observer that logs Enigma machine events and engine messages to the console. More...
 

Functions

std::string resolveDefaultAssetPath ()
 Resolves the default asset path based on execution context. Checks for a local 'assets/' folder first, otherwise falls back to the path defined during installation.
 
std::string processMessage (EnigmaMachine &machine, const std::string &input, bool)
 Processes a message through the Enigma Machine. Transforms each character and optionally prints debug info.
 
AppConfig parseArguments (int argc, char **argv)
 Parses command line arguments and populates the AppConfig struct. Exits the program (via CLI11::Exit) if help is requested or parsing fails.
 
void runApplication (const AppConfig &config)
 
int main (int argc, char **argv)
 Main entry point.
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Main entry point.

Definition at line 187 of file main.cpp.

References parseArguments(), and runApplication().

+ Here is the call graph for this function:

◆ parseArguments()

AppConfig parseArguments ( int  argc,
char **  argv 
)

Parses command line arguments and populates the AppConfig struct. Exits the program (via CLI11::Exit) if help is requested or parsing fails.

Definition at line 100 of file main.cpp.

References AppConfig::assetPath, AppConfig::configPath, AppConfig::debug, AppConfig::decode, AppConfig::encode, and AppConfig::message.

Referenced by main().

+ Here is the caller graph for this function:

◆ processMessage()

std::string processMessage ( EnigmaMachine machine,
const std::string &  input,
bool   
)

Processes a message through the Enigma Machine. Transforms each character and optionally prints debug info.

Definition at line 83 of file main.cpp.

References EnigmaMachine::keyTransform().

Referenced by runApplication().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveDefaultAssetPath()

std::string resolveDefaultAssetPath ( )

Resolves the default asset path based on execution context. Checks for a local 'assets/' folder first, otherwise falls back to the path defined during installation.

Definition at line 18 of file main.cpp.

References assetsDir.

◆ runApplication()

void runApplication ( const AppConfig config)

Definition at line 131 of file main.cpp.

References AppConfig::assetPath, AppConfig::configPath, AppConfig::debug, AppConfig::decode, AppConfig::encode, AppConfig::message, processMessage(), and EnigmaMachine::registerObserver().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: