game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
SteamAppInfoParser Class Reference

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.

Detailed Description

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.

Member Function Documentation

◆ appCount()

size_t SteamAppInfoParser::appCount ( ) const
inline

Get the number of indexed apps.

Definition at line 153 of file steam_appinfo_parser.h.

◆ getAppInfo()

std::optional< SteamAppVdfInfo > SteamAppInfoParser::getAppInfo ( uint32_t appId) const

Get parsed app info for a specific app ID.

Parameters
appIdSteam App ID
Returns
Parsed app info, or nullopt if not found

Definition at line 246 of file steam_appinfo_parser.cpp.

◆ hasApp()

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.

◆ load()

bool SteamAppInfoParser::load ( const std::filesystem::path & path)

Load and index an appinfo.vdf file.

Parameters
pathPath to appinfo.vdf
Returns
true if the file was loaded and indexed successfully

Definition at line 99 of file steam_appinfo_parser.cpp.

References Logger::error(), Logger::info(), and Logger::warn().

Referenced by SteamLibraryScanner::populateDirectLaunchInfo().


The documentation for this class was generated from the following files: