game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
steam_finder.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2#pragma once
3
4#include <cstdint>
5#include <filesystem>
6#include <memory>
7#include <optional>
8#include <vector>
9
10namespace platform
11{
12
14{
15 std::filesystem::path path;
16 std::string label;
17 uint64_t totalSize = 0;
18};
19
21{
22 public:
23 virtual ~SteamFinder() = default;
24
25 // Find Steam installation root
26 virtual std::optional<std::filesystem::path> findSteamRoot() const = 0;
27
28 // Get all Steam library folders
29 virtual std::vector<SteamLibraryFolder> getLibraryFolders() const = 0;
30
31 // Find compatibility tools directory (Proton, etc.)
32 virtual std::vector<std::filesystem::path> getCompatToolsDirs() const = 0;
33
34 // Find a specific game's installation
35 virtual std::optional<std::filesystem::path> findGameInstall(uint32_t appId) const = 0;
36
37 // Steam process management
38 virtual bool isSteamRunning() const = 0;
39 virtual bool startSteam(bool silent = true) const = 0;
40 virtual bool shutdownSteam() const = 0;
41
42 // Game launching
43 virtual bool launchGame(uint32_t appId) const = 0;
44 virtual bool launchGameWithArgs(uint32_t appId, const std::string& args) const = 0;
45
46 // Get Steam executable path
47 virtual std::optional<std::filesystem::path> getSteamExecutable() const = 0;
48
49 // Check if Steam is installed
50 virtual bool isSteamInstalled() const = 0;
51
52 // Factory - creates platform-specific implementation
53 static std::unique_ptr<SteamFinder> create();
54
55 // Singleton access for convenience
56 static SteamFinder& instance();
57};
58
59} // namespace platform
virtual bool isSteamInstalled() const =0
virtual bool isSteamRunning() const =0
virtual std::optional< std::filesystem::path > findSteamRoot() const =0
virtual ~SteamFinder()=default
static SteamFinder & instance()
virtual bool shutdownSteam() const =0
virtual bool launchGame(uint32_t appId) const =0
virtual std::optional< std::filesystem::path > findGameInstall(uint32_t appId) const =0
virtual bool launchGameWithArgs(uint32_t appId, const std::string &args) const =0
virtual std::vector< SteamLibraryFolder > getLibraryFolders() const =0
virtual bool startSteam(bool silent=true) const =0
static std::unique_ptr< SteamFinder > create()
virtual std::optional< std::filesystem::path > getSteamExecutable() const =0
virtual std::vector< std::filesystem::path > getCompatToolsDirs() const =0
std::filesystem::path path