game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
ActualRuntimeInfo Struct Reference

Actual environment and command line read from a running process. More...

#include <game.h>

Public Member Functions

std::vector< std::string > compareWithConfigured (const std::vector< std::string > &configured) const
 Compare configured vs actual environment.
std::map< std::string, std::string > getKeyEnvironment () const
 Get only gaming-related environment variables.

Static Public Member Functions

static const std::vector< std::string > & getKeyEnvVars ()
static ActualRuntimeInfo readFromProcess (int processId)
 Read actual runtime info from a process.

Public Attributes

std::string commandLine
 Full command line from /proc/pid/cmdline.
std::map< std::string, std::string > envVars
 All environment variables.
int pid = -1
 Process ID this info was read from.
bool valid = false
 Whether the read was successful.

Detailed Description

Actual environment and command line read from a running process.

This struct captures the REAL runtime environment of a game process by reading from /proc/{pid}/environ and /proc/{pid}/cmdline. This serves as a "sanity check" to verify what was actually applied vs what was configured.

Definition at line 378 of file game.h.

Member Function Documentation

◆ compareWithConfigured()

std::vector< std::string > ActualRuntimeInfo::compareWithConfigured ( const std::vector< std::string > & configured) const

Compare configured vs actual environment.

Parameters
configuredExpected environment variables (key=value strings)
Returns
Vector of differences: "KEY: expected 'X', actual 'Y'" or "KEY: missing" or "KEY: unexpected 'Y'"

Definition at line 1085 of file game.cpp.

References envVars, and getKeyEnvVars().

Referenced by DetailsPanelManager::Impl::update().

◆ getKeyEnvironment()

std::map< std::string, std::string > ActualRuntimeInfo::getKeyEnvironment ( ) const

Get only gaming-related environment variables.

Returns
Map of key env var name -> value (only if set)

Definition at line 1067 of file game.cpp.

References envVars, and getKeyEnvVars().

Referenced by DetailsPanelManager::Impl::update().

◆ getKeyEnvVars()

const std::vector< std::string > & ActualRuntimeInfo::getKeyEnvVars ( )
inlinestatic

Definition at line 386 of file game.h.

Referenced by compareWithConfigured(), and getKeyEnvironment().

◆ readFromProcess()

ActualRuntimeInfo ActualRuntimeInfo::readFromProcess ( int processId)
static

Read actual runtime info from a process.

Parameters
processIdPID to read from
Returns
Populated ActualRuntimeInfo (check .valid to see if successful)

Definition at line 999 of file game.cpp.

References commandLine, envVars, pid, and valid.

Referenced by DetailsPanelManager::Impl::update().

Member Data Documentation

◆ commandLine

std::string ActualRuntimeInfo::commandLine

Full command line from /proc/pid/cmdline.

Definition at line 381 of file game.h.

Referenced by readFromProcess(), and DetailsPanelManager::Impl::update().

◆ envVars

std::map<std::string, std::string> ActualRuntimeInfo::envVars

All environment variables.

Definition at line 382 of file game.h.

Referenced by compareWithConfigured(), getKeyEnvironment(), and readFromProcess().

◆ pid

int ActualRuntimeInfo::pid = -1

Process ID this info was read from.

Definition at line 380 of file game.h.

Referenced by readFromProcess().

◆ valid

bool ActualRuntimeInfo::valid = false

Whether the read was successful.

Definition at line 383 of file game.h.

Referenced by readFromProcess(), and DetailsPanelManager::Impl::update().


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