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

Namespaces

namespace  anonymous_namespace{atomic_write.cpp}
namespace  anonymous_namespace{image_service.cpp}
namespace  anonymous_namespace{notification_service.cpp}

Classes

class  AppController
struct  AppSettings
struct  CloudSaveEvent
struct  DependencyEvent
struct  FilterOptions
struct  GameAddedEvent
class  GameLibraryController
struct  GameRemovedEvent
struct  GameUpdatedEvent
class  IImageService
 Abstract interface for image loading operations. More...
class  ImageService
 Singleton accessor for the image service. More...
class  INotificationService
class  LaunchController
struct  LaunchErrorEvent
struct  LaunchStateChangedEvent
struct  LibraryLoadedEvent
struct  Notification
class  NotificationService
class  NullImageService
 No-op implementation for headless/testing scenarios. More...
class  NullNotificationService
struct  ProcessExitedEvent
struct  ProcessStartedEvent
struct  ProtonVersionInfo
struct  RunningGameInfo
struct  SettingsChangedEvent
class  SettingsController
struct  SortOptions
class  SteamController
struct  SteamGameImportedEvent
struct  SteamGameInfo
struct  SteamLibraryInfo
struct  SteamScanCompleteEvent
struct  SteamScanProgressEvent
class  StoreIntegrationController
struct  StoreStatus
struct  StoreSyncEvent

Enumerations

enum class  LaunchState {
  Idle , PreparingLaunch , WaitingForSteam , Launching ,
  VerifyingStart , Running , Stopping , Killing ,
  Failed , Completed
}
enum class  NotificationType { Info , Success , Warning , Error }
enum class  SortField {
  Name , LastPlayed , PlayTime , DateAdded ,
  Status
}
enum class  SortOrder { Ascending , Descending }
enum class  StoreType {
  Steam , GOG , Epic , Lutris ,
  Manual
}

Functions

bool atomicWriteFile (const std::filesystem::path &targetPath, std::string_view contents, std::string *errOut=nullptr)
 Atomically and durably write contents to targetPath.
static bool readBoolSettingFromDisk (const char *key, bool defaultValue)
template<typename E>
constexpr E safeEnumCast (int v, E def, int kMax) noexcept
 Bounds-checked cast from int to enum.
static std::vector< std::string > settingsFileSearchPaths ()
std::string storeTypeName (StoreType type)
 Get human-readable store name.

Enumeration Type Documentation

◆ LaunchState

enum class core::LaunchState
strong
Enumerator
Idle 
PreparingLaunch 
WaitingForSteam 
Launching 
VerifyingStart 
Running 
Stopping 
Killing 
Failed 
Completed 

Definition at line 28 of file launch_controller.h.

◆ NotificationType

enum class core::NotificationType
strong
Enumerator
Info 
Success 
Warning 
Error 

Definition at line 22 of file notification_service.h.

◆ SortField

enum class core::SortField
strong
Enumerator
Name 
LastPlayed 
PlayTime 
DateAdded 
Status 

Definition at line 60 of file game_library_controller.h.

◆ SortOrder

enum class core::SortOrder
strong
Enumerator
Ascending 
Descending 

Definition at line 69 of file game_library_controller.h.

◆ StoreType

enum class core::StoreType
strong
Enumerator
Steam 
GOG 
Epic 
Lutris 
Manual 

Definition at line 45 of file store_integration_controller.h.

Function Documentation

◆ atomicWriteFile()

bool core::atomicWriteFile ( const std::filesystem::path & targetPath,
std::string_view contents,
std::string * errOut = nullptr )

Atomically and durably write contents to targetPath.

Returns true on success. On failure, leaves targetPath unchanged (any temp file is removed). If errOut is non-null, a human-readable reason is written there.

Implementation notes:

  • The temp file is <targetPath>.tmp.<pid> to avoid clashes between concurrent writers in the same process or across launcher instances. Two writers landing on the same target end with last-writer-wins, which is the documented contract for atomic file replace.
  • The parent directory must already exist; the helper does NOT mkdir -p, since most callers want to fail loud if the path is wrong (e.g. user pointed XDG_DATA_HOME at a non-existent dir).
  • Permissions: the temp file is created with mode 0600 so a world-readable inherited-umask doesn't briefly expose secrets (e.g. tokens cached alongside ETags).

Definition at line 130 of file atomic_write.cpp.

Referenced by anonymous_namespace{runner_download_service.cpp}::saveGitHubCache(), and core::SettingsController::saveSettings().

◆ readBoolSettingFromDisk()

◆ safeEnumCast()

template<typename E>
E core::safeEnumCast ( int v,
E def,
int kMax )
constexprnoexcept

Bounds-checked cast from int to enum.

Template Parameters
ETarget enum type (scoped or unscoped).
Parameters
vSource integer (typically from SQLite/JSON/IPC).
defDefault value to return when v is out of range.
kMaxMaximum valid integer value for E (inclusive). Non-negative integers in [0, kMax] are accepted.
Returns
Either static_cast<E>(v) or def.

Most enums in this codebase start at 0 and run consecutively. If you have a sparse / non-zero-based enum, this helper isn't appropriate — fall back to a hand-written switch.

Definition at line 44 of file safe_enum_cast.h.

◆ settingsFileSearchPaths()

std::vector< std::string > core::settingsFileSearchPaths ( )
static

Definition at line 887 of file settings_controller.cpp.

Referenced by readBoolSettingFromDisk().

◆ storeTypeName()

std::string core::storeTypeName ( StoreType type)

Get human-readable store name.

Definition at line 24 of file store_integration_controller.cpp.

References Epic, GOG, Lutris, Manual, and Steam.