ASAPCabinetFE
 
Loading...
Searching...
No Matches
ProcessHandler Class Reference

Manages launching and terminating VPX processes. More...

#include <process_handler.h>

+ Collaboration diagram for ProcessHandler:

Public Member Functions

 ProcessHandler (const std::string &exeDir, IConfigService *configManager)
 Constructs a ProcessHandler instance.
 
bool launchVPX (const std::string &vpxFile)
 Launches a VPX process.
 
void terminateVPX ()
 Terminates the running VPX process.
 
std::string shellEscape (const std::string &str)
 Escapes a string for safe shell usage.
 

Detailed Description

Manages launching and terminating VPX processes.

This class handles the execution of VPX files (e.g., for screenshot mode or gameplay), tracking the process ID and terminating the process when needed. It integrates with IConfigService for settings and uses the executable directory for path resolution.

Constructor & Destructor Documentation

◆ ProcessHandler()

ProcessHandler::ProcessHandler ( const std::string &  exeDir,
IConfigService configManager 
)

Constructs a ProcessHandler instance.

Initializes the handler with the executable directory and configuration service.

Parameters
exeDirThe executable directory for resolving file paths.
configManagerThe configuration service for settings.

Member Function Documentation

◆ launchVPX()

bool ProcessHandler::launchVPX ( const std::string &  vpxFile)

Launches a VPX process.

Starts a VPX process for the specified VPX file.

Parameters
vpxFileThe path to the VPX file to launch.
Returns
True if the process launches successfully, false otherwise.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shellEscape()

std::string ProcessHandler::shellEscape ( const std::string &  str)

Escapes a string for safe shell usage.

Escapes special characters in the string to prevent shell injection.

Parameters
strThe input string to escape.
Returns
The escaped string.
+ Here is the caller graph for this function:

◆ terminateVPX()

void ProcessHandler::terminateVPX ( )

Terminates the running VPX process.

Stops the VPX process if it is running.

+ Here is the caller graph for this function:

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