|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Centralized management of all Steam-related filesystem paths. More...
#include <steam_paths.h>
Static Public Member Functions | |
| static std::vector< std::filesystem::path > | getAllSteamRoots () |
| Get all possible Steam installation directories. | |
| static std::filesystem::path | getAppManifestPath (const std::filesystem::path &libraryRoot, uint32_t appId) |
| Get path to an appmanifest file. | |
| static std::filesystem::path | getCompatDataPath (const std::filesystem::path &libraryRoot, uint32_t appId) |
| Get path to game's compatdata directory (Proton prefix). | |
| static std::vector< std::filesystem::path > | getCompatToolsPaths () |
| Get all compatibility tools directories. | |
| static std::filesystem::path | getConfigPath () |
| Get path to global config.vdf. | |
| static std::filesystem::path | getGameInstallPath (const std::filesystem::path &libraryRoot, const std::string &installDir) |
| Get path to game's installation directory. | |
| static std::filesystem::path | getHomeDirectory () |
| Get user's home directory. | |
| static std::filesystem::path | getLibraryFoldersPath () |
| Get path to libraryfolders.vdf. | |
| static std::filesystem::path | getLocalConfigPath (const std::string &userId) |
| Get path to user's localconfig.vdf. | |
| static std::filesystem::path | getLoginUsersPath () |
| Get path to loginusers.vdf. | |
| static std::filesystem::path | getPrimarySteamRoot () |
| Get primary Steam installation directory. | |
| static std::vector< std::filesystem::path > | getProtonInstallPaths () |
| Get paths where official Proton versions are installed. | |
| static std::filesystem::path | getSteamAppsPath (const std::filesystem::path &libraryRoot) |
| Get steamapps directory for a library. | |
| static std::filesystem::path | getUserDataDirectory () |
| Get Steam userdata directory. | |
| static void | invalidateCache () |
| Invalidate cached paths. | |
| static bool | isCacheValid () |
| Check if path cache is initialized. | |
| static bool | isFlatpakSteam () |
| Check if Steam is installed via Flatpak. | |
| static bool | isSnapSteam () |
| Check if Steam is installed via Snap. | |
| static bool | isSteamInstalled () |
| Check if Steam is installed (any method). | |
Centralized management of all Steam-related filesystem paths.
Provides thread-safe, cached access to Steam paths across different installation types (standard, Flatpak, Snap).
All methods are thread-safe. Internal caching uses mutex protection.
Steam root paths are cached on first access for performance. Call invalidateCache() if Steam is reinstalled or moved.
Definition at line 38 of file steam_paths.h.
|
static |
Get all possible Steam installation directories.
Checks in order:
Definition at line 44 of file steam_paths.cpp.
References SteamConstants::FLATPAK_STEAM_PATH, getHomeDirectory(), SteamConstants::SNAP_STEAM_PATH, SteamConstants::STEAM_ROOT_ALT1, SteamConstants::STEAM_ROOT_ALT2, and SteamConstants::STEAM_ROOT_PATH.
Referenced by getPrimarySteamRoot(), getProtonInstallPaths(), and SteamLibraryScanner::scanProtonVersions().
|
static |
Get path to an appmanifest file.
| libraryRoot | Root directory of Steam library |
| appId | Steam App ID |
Definition at line 183 of file steam_paths.cpp.
References SteamConstants::APPMANIFEST_PREFIX, and getSteamAppsPath().
|
static |
Get path to game's compatdata directory (Proton prefix).
| libraryRoot | Root directory of Steam library |
| appId | Steam App ID |
Definition at line 191 of file steam_paths.cpp.
References SteamConstants::COMPATDATA_DIR, and getSteamAppsPath().
|
static |
Get all compatibility tools directories.
Returns paths in priority order:
Definition at line 207 of file steam_paths.cpp.
References SteamConstants::COMPAT_TOOLS_DIR, SteamConstants::FLATPAK_STEAM_PATH, getHomeDirectory(), getPrimarySteamRoot(), isFlatpakSteam(), isSnapSteam(), SteamConstants::SNAP_STEAM_PATH, SteamConstants::SYSTEM_COMPAT_TOOLS_PATH1, and SteamConstants::SYSTEM_COMPAT_TOOLS_PATH2.
|
static |
Get path to global config.vdf.
Example: ~/.local/share/Steam/config/config.vdf
Definition at line 141 of file steam_paths.cpp.
References SteamConstants::CONFIG_DIR, SteamConstants::CONFIG_VDF, and getPrimarySteamRoot().
|
static |
Get path to game's installation directory.
| libraryRoot | Root directory of Steam library |
| installDir | Install directory name from appmanifest (e.g., "Half-Life 2") |
Definition at line 197 of file steam_paths.cpp.
References SteamConstants::COMMON_DIR, and getSteamAppsPath().
|
static |
Get user's home directory.
Aligns with the rest of this API: failures yield empty paths/vectors rather than exceptions, and callers gate on the empty result.
Definition at line 25 of file steam_paths.cpp.
Referenced by getAllSteamRoots(), getCompatToolsPaths(), isFlatpakSteam(), and isSnapSteam().
|
static |
Get path to libraryfolders.vdf.
Example: ~/.local/share/Steam/steamapps/libraryfolders.vdf
Definition at line 167 of file steam_paths.cpp.
References getPrimarySteamRoot(), SteamConstants::LIBRARY_FOLDERS_VDF, and SteamConstants::STEAMAPPS_DIR.
|
static |
Get path to user's localconfig.vdf.
| userId | Steam user ID (as string) |
Example: ~/.local/share/Steam/userdata/12345678/config/localconfig.vdf
Definition at line 130 of file steam_paths.cpp.
References SteamConstants::CONFIG_DIR, getUserDataDirectory(), and SteamConstants::LOCAL_CONFIG_VDF.
|
static |
Get path to loginusers.vdf.
Definition at line 152 of file steam_paths.cpp.
References SteamConstants::CONFIG_DIR, getPrimarySteamRoot(), and SteamConstants::LOGIN_USERS_VDF.
|
static |
Get primary Steam installation directory.
Returns the first valid Steam installation found. Cached after first call.
Definition at line 90 of file steam_paths.cpp.
References getAllSteamRoots().
Referenced by GameLibrary::discoverImagesForGame(), GameLibrary::discoverMissingImages(), SteamGame::downloadCoverArt(), getActiveUserId(), getCompatToolsPaths(), getConfigPath(), getLibraryFoldersPath(), getLoginUsersPath(), getUserDataDirectory(), SteamProcessMonitor::isSteamFullyInitialized(), isSteamInstalled(), SteamLibraryScanner::loadAppNameCache(), SteamLibraryScanner::populateDirectLaunchInfo(), SteamLibraryScanner::readAllCloudSaveInfo(), SteamLibraryScanner::readAllUserCategories(), SteamLibraryScanner::readSteamCloudSaveInfo(), SteamLibraryScanner::readSteamLaunchOptions(), SteamLibraryScanner::readSteamPlaytimeData(), SteamLibraryScanner::readSteamProtonVersion(), SteamLibraryScanner::readSteamUserCategories(), GameLibrary::refreshStaleImages(), SteamLibraryScanner::scanAllOwnedGames(), SteamLibraryScanner::scanProtonVersions(), SteamGame::toGame(), SteamLibraryScanner::writeSteamLaunchOptions(), and SteamLibraryScanner::writeSteamProtonVersion().
|
static |
Get paths where official Proton versions are installed.
Official Proton versions are in steamapps/common/Proton* directories.
Definition at line 268 of file steam_paths.cpp.
References SteamConstants::COMMON_DIR, getAllSteamRoots(), and SteamConstants::STEAMAPPS_DIR.
|
static |
Get steamapps directory for a library.
| libraryRoot | Root directory of a Steam library |
Definition at line 178 of file steam_paths.cpp.
References SteamConstants::STEAMAPPS_DIR.
Referenced by getAppManifestPath(), getCompatDataPath(), and getGameInstallPath().
|
static |
Get Steam userdata directory.
Definition at line 119 of file steam_paths.cpp.
References getPrimarySteamRoot(), and SteamConstants::USERDATA_DIR.
Referenced by getActiveUserId(), getLocalConfigPath(), and SteamLibraryScanner::scanAllOwnedGames().
|
static |
Invalidate cached paths.
Call this if Steam is reinstalled, moved, or switched between Flatpak/Snap/native installations.
Definition at line 325 of file steam_paths.cpp.
|
static |
Check if path cache is initialized.
Definition at line 333 of file steam_paths.cpp.
|
static |
Check if Steam is installed via Flatpak.
Definition at line 295 of file steam_paths.cpp.
References SteamConstants::FLATPAK_STEAM_PATH, and getHomeDirectory().
Referenced by getCompatToolsPaths().
|
static |
Check if Steam is installed via Snap.
Definition at line 305 of file steam_paths.cpp.
References getHomeDirectory(), and SteamConstants::SNAP_STEAM_PATH.
Referenced by getCompatToolsPaths().
|
static |
Check if Steam is installed (any method).
Definition at line 315 of file steam_paths.cpp.
References getPrimarySteamRoot().