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
10
namespace
platform
11
{
12
13
struct
SteamLibraryFolder
14
{
15
std::filesystem::path
path
;
16
std::string
label
;
17
uint64_t
totalSize
= 0;
18
};
19
20
class
SteamFinder
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
platform::SteamFinder
Definition
steam_finder.h:21
platform::SteamFinder::isSteamInstalled
virtual bool isSteamInstalled() const =0
platform::SteamFinder::isSteamRunning
virtual bool isSteamRunning() const =0
platform::SteamFinder::findSteamRoot
virtual std::optional< std::filesystem::path > findSteamRoot() const =0
platform::SteamFinder::~SteamFinder
virtual ~SteamFinder()=default
platform::SteamFinder::instance
static SteamFinder & instance()
Definition
platform_common.cpp:42
platform::SteamFinder::shutdownSteam
virtual bool shutdownSteam() const =0
platform::SteamFinder::launchGame
virtual bool launchGame(uint32_t appId) const =0
platform::SteamFinder::findGameInstall
virtual std::optional< std::filesystem::path > findGameInstall(uint32_t appId) const =0
platform::SteamFinder::launchGameWithArgs
virtual bool launchGameWithArgs(uint32_t appId, const std::string &args) const =0
platform::SteamFinder::getLibraryFolders
virtual std::vector< SteamLibraryFolder > getLibraryFolders() const =0
platform::SteamFinder::startSteam
virtual bool startSteam(bool silent=true) const =0
platform::SteamFinder::create
static std::unique_ptr< SteamFinder > create()
platform::SteamFinder::getSteamExecutable
virtual std::optional< std::filesystem::path > getSteamExecutable() const =0
platform::SteamFinder::getCompatToolsDirs
virtual std::vector< std::filesystem::path > getCompatToolsDirs() const =0
platform
Definition
paths.h:9
platform::SteamLibraryFolder
Definition
steam_finder.h:14
platform::SteamLibraryFolder::totalSize
uint64_t totalSize
Definition
steam_finder.h:17
platform::SteamLibraryFolder::label
std::string label
Definition
steam_finder.h:16
platform::SteamLibraryFolder::path
std::filesystem::path path
Definition
steam_finder.h:15
core
include
platform
steam_finder.h
Generated by
1.16.1