|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Parses Steam's binary appinfo.vdf cache file. More...
#include <steam_appinfo_parser.h>
Public Member Functions | |
| size_t | appCount () const |
| Get the number of indexed apps. | |
| std::optional< SteamAppVdfInfo > | getAppInfo (uint32_t appId) const |
| Get parsed app info for a specific app ID. | |
| bool | hasApp (uint32_t appId) const |
| Check if a specific app ID exists in the cache. | |
| bool | load (const std::filesystem::path &path) |
| Load and index an appinfo.vdf file. | |
Parses Steam's binary appinfo.vdf cache file.
Supports appinfo.vdf format version 29 (0x07564429), which uses a string table at the end of the file for key names (introduced by Steam in June 2024). Older versions 27 (0x07564427) and 28 (0x07564428) use inline key names and are recognised but not fully parsed; load() returns false with an actionable message prompting the user to update their Steam client.
Usage: SteamAppInfoParser parser; if (parser.load("/path/to/appinfo.vdf")) { auto info = parser.getAppInfo(730); // CS2 if (info) { auto launch = info->getProtonLaunchEntry(); } }
Performance: The parser indexes all app record offsets on load (~5ms for typical files) but only fully parses individual app records on demand.
Definition at line 128 of file steam_appinfo_parser.h.
|
inline |
Get the number of indexed apps.
Definition at line 153 of file steam_appinfo_parser.h.
| std::optional< SteamAppVdfInfo > SteamAppInfoParser::getAppInfo | ( | uint32_t | appId | ) | const |
Get parsed app info for a specific app ID.
| appId | Steam App ID |
Definition at line 246 of file steam_appinfo_parser.cpp.
| bool SteamAppInfoParser::hasApp | ( | uint32_t | appId | ) | const |
Check if a specific app ID exists in the cache.
Definition at line 256 of file steam_appinfo_parser.cpp.
| bool SteamAppInfoParser::load | ( | const std::filesystem::path & | path | ) |
Load and index an appinfo.vdf file.
| path | Path to appinfo.vdf |
Definition at line 99 of file steam_appinfo_parser.cpp.
References Logger::error(), Logger::info(), and Logger::warn().
Referenced by SteamLibraryScanner::populateDirectLaunchInfo().