Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
game_library.h File Reference

The games installed in Steam and Lutris, for adding them as apps. More...

#include <algorithm>
#include <cctype>
#include <filesystem>
#include <fstream>
#include <map>
#include <nlohmann/json.hpp>
#include <optional>
#include <set>
#include <sstream>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for game_library.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  platf::game_library::game_t
struct  platf::game_library::vdf_t
 A Valve KeyValues (VDF/ACF) block: quoted keys with a quoted value or a nested block. Keys are case-insensitive, so they are kept lowercase. More...
class  platf::game_library::detail::vdf_parser_t

Functions

std::string platf::game_library::detail::lower (std::string text)
std::string platf::game_library::detail::read_file (const std::filesystem::path &file)
bool platf::game_library::detail::is_tool (std::string_view appid, std::string_view name)
vdf_t platf::game_library::parse_vdf (std::string_view text)
std::vector< std::filesystem::path > platf::game_library::steam_libraries (const std::filesystem::path &root)
 Every Steam library of a Steam installation, itself first.
std::vector< game_t > platf::game_library::steam_games (const std::filesystem::path &root, const std::string &launcher)
 The games fully installed in a Steam installation's libraries.
std::vector< game_t > platf::game_library::lutris_games (std::string_view output, const std::string &launcher)
 Lutris' installed games, from lutris --list-games --installed --json.
std::vector< game_t > platf::game_library::merge (std::vector< game_t > games)
 A game per source and ID, the first seen kept, sorted by name.

Detailed Description

The games installed in Steam and Lutris, for adding them as apps.

Definition in file game_library.h.

Function Documentation

◆ is_tool()

bool platf::game_library::detail::is_tool ( std::string_view appid,
std::string_view name )
inline

Runtimes, Proton and redistributables are installed like games but are not games.

Definition at line 157 of file game_library.h.

◆ lower()

std::string platf::game_library::detail::lower ( std::string text)
inline

Definition at line 52 of file game_library.h.

◆ lutris_games()

std::vector< game_t > platf::game_library::lutris_games ( std::string_view output,
const std::string & launcher )
inline

Lutris' installed games, from lutris --list-games --installed --json.

Games of Lutris' Steam runner are left out: Steam's own list has them.

Parameters
outputWhat the command printed. Anything before the JSON is ignored, as Lutris can print log lines first.
launcherThe command that runs this Lutris.

Definition at line 262 of file game_library.h.

◆ merge()

std::vector< game_t > platf::game_library::merge ( std::vector< game_t > games)
inline

A game per source and ID, the first seen kept, sorted by name.

Definition at line 298 of file game_library.h.

◆ parse_vdf()

vdf_t platf::game_library::parse_vdf ( std::string_view text)
inline

Definition at line 170 of file game_library.h.

◆ read_file()

std::string platf::game_library::detail::read_file ( const std::filesystem::path & file)
inline

Definition at line 148 of file game_library.h.

◆ steam_games()

std::vector< game_t > platf::game_library::steam_games ( const std::filesystem::path & root,
const std::string & launcher )
inline

The games fully installed in a Steam installation's libraries.

Parameters
rootThe Steam directory.
launcherThe command that runs this Steam, such as steam or flatpak run com.valvesoftware.Steam.

Definition at line 218 of file game_library.h.

◆ steam_libraries()

std::vector< std::filesystem::path > platf::game_library::steam_libraries ( const std::filesystem::path & root)
inline

Every Steam library of a Steam installation, itself first.

Parameters
rootThe Steam directory, the one that holds steamapps.

Definition at line 178 of file game_library.h.