51 return type.empty() ||
type ==
"default" ||
type ==
"none";
55 return oslist.empty() ||
oslist.find(
"windows") != std::string::npos;
59 return oslist.find(
"linux") != std::string::npos;
94 return type ==
"Game" ||
type ==
"game";
98 return type ==
"Tool" ||
type ==
"tool";
136 bool load(
const std::filesystem::path& path);
143 std::optional<SteamAppVdfInfo>
getAppInfo(uint32_t appId)
const;
148 bool hasApp(uint32_t appId)
const;
155 return appOffsets_.size();
160 enum class VdfType : uint8_t
169 Int64Unsigned = 0x0A,
175 using VdfMap = std::map<std::string, VdfValue>;
188 uint64_t int64Val = 0;
191 const VdfMap* asMap()
const
193 return type == MAP ? &mapVal :
nullptr;
195 const std::string& asString()
const
199 uint32_t asInt()
const
205 bool loadStringTable(
size_t offset);
206 bool indexAppRecords();
207 VdfMap parseVdfBinary(
size_t offset,
size_t endOffset)
const;
208 VdfMap parseVdfBinaryRecursive(
size_t& offset,
size_t endOffset,
int depth)
const;
210 SteamAppVdfInfo parseAppRecord(
size_t offset,
size_t size)
const;
211 SteamLaunchEntry parseLaunchEntry(
const VdfMap& data,
int index)
const;
214 const VdfMap* getNestedMap(
const VdfMap& root,
const std::string& key)
const;
215 std::string getNestedString(
const VdfMap& map,
const std::string& key)
const;
216 uint32_t getNestedInt(
const VdfMap& map,
const std::string& key)
const;
218 std::string getStringByIndex(uint32_t index)
const;
220 std::vector<uint8_t> data_;
221 std::vector<std::string> stringTable_;
222 std::map<uint32_t, std::pair<size_t, size_t>> appOffsets_;
223 uint32_t version_ = 0;
225 static constexpr uint32_t MAGIC_V27 = 0x07564427;
226 static constexpr uint32_t MAGIC_V28 = 0x07564428;
227 static constexpr uint32_t MAGIC_V29 = 0x07564429;
228 static constexpr size_t APP_RECORD_HEADER_SIZE =
Parses Steam's binary appinfo.vdf cache file.
std::optional< SteamAppVdfInfo > getAppInfo(uint32_t appId) const
Get parsed app info for a specific app ID.
bool load(const std::filesystem::path &path)
Load and index an appinfo.vdf file.
size_t appCount() const
Get the number of indexed apps.
bool hasApp(uint32_t appId) const
Check if a specific app ID exists in the cache.
Parsed metadata for a single Steam app from appinfo.vdf.
std::string name
App name from common section.
std::optional< SteamLaunchEntry > getProtonLaunchEntry() const
Get the best launch entry for running under Proton.
std::vector< SteamLaunchEntry > launchEntries
All launch configurations.
std::string type
App type: "Game", "Tool", "DLC", "Demo", etc.
std::optional< SteamLaunchEntry > getNativeLaunchEntry() const
Get the best launch entry for native Linux execution.
A single launch configuration from appinfo.vdf.
bool supportsLinux() const
int index
Launch entry index (0, 1, 2, ...).
std::string description
User-facing description (e.g., "DirectX 12 mode").
std::string osarch
Architecture: "32", "64", or empty.
std::string executable
Executable path relative to install dir (e.g., "game.exe").
std::string type
Launch type: "default", "none", "option1", "option2", etc.
bool supportsWindows() const
std::string arguments
Default launch arguments.
std::string oslist
Comma-separated OS list: "windows", "linux", "macos".