vdf-parser
A Rust library for parsing Steam's VDF (Valve Data Format) files, including appinfo.vdf and shortcuts.vdf. This crate provides parsers and utilities for working with Steam's file formats, which are used to store application information and shortcuts in the Steam client.
Features
- Parse appinfo.vdf files
- Parse shortcuts.vdf files
- Read and write VDF data structures
- Binary VDF parsing
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
Examples
Reading appinfo.vdf
You can see an in-context example in SARM
use open_appinfo_vdf;
use ;
use ;
/// Gets the steam appinfo.vdf path.
let steam_path: String = "your/steam/path".toString;
let appinfo_path: PathBuf = from;
let appinfo_vdf: = open_appinfo_vdf;
let pretty_str: String = to_string.expect;
println!;
Reading shortcuts.vdf
You can see an in-context example in SARM
use open_shortcuts_vdf;
use ;
use ;
/// Gets the steam shortcuts.vdf path.
let steam_path: String = "your/steam/path".toString;
let steam_active_user_id: String = "your_steam_id".toString;
let shortcuts_path = from;
// Not all users will have a shortcuts.vdf file on their machine.
if shortcuts_path.as_path.exists
Writing shortcuts.vdf
You can see an in-context example in SARM
use open_appinfo_vdf;
use ;
use ;
let shortcuts_str: String = "..."; // This is a JSON string of the data to write to the shortcuts.vdf file
/// Example:
/// {
/// "shortcuts": {
/// "0":{
/// "AllowDesktopConfig": 1,
/// "AllowOverlay": 1,
/// "AppName":"Firefox",
/// "Devkit": 0,
/// "DevkitGameID": "",
/// "DevkitOverrideAppID": 0,
/// "Exe": "\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\"",
/// "FlatpakAppID": "",
/// "IsHidden": 0,
/// "LastPlayTime": 0,
/// "LaunchOptions": "",
/// "OpenVR": 0,
/// "ShortcutPath": "",
/// "StartDir": "C:\\Program Files\\Mozilla Firefox\\",
/// "appid": 3071491651,
/// "icon": "",
/// "sortas": "",
/// "tags": {}
/// },
/// }
/// }
let steam_path: str = "your/steam/path";
let shortcuts_vdf_path: PathBuf = from;
let shortcuts_data: Value = from_str.expect;
write_shortcuts_vdf;
License
This project is licensed under the GNU Lesser General Public License v2.1 - see the LICENSE file for details.
Copyright
Copyright (C) Travis Lane (Tormak9970)