steam-min-cpp
Loading...
Searching...
No Matches
vdf.hpp File Reference

Minimal representation and parser for Valve Data Format (VDF). More...

#include <string>
#include <unordered_map>
#include <variant>
#include <vector>
#include <cstdint>

Go to the source code of this file.

Classes

struct  Steam::Utils::VDF::VDFNode
 Node in a VDF tree. More...

Typedefs

using Steam::Utils::VDF::Object = std::unordered_map<std::string, VDFNode>
 Object node type.
using Steam::Utils::VDF::Value
 Value stored in a VDF node.

Functions

Object Steam::Utils::VDF::parse_text (std::string_view text)
 Parse VDF text into an object tree.
Object Steam::Utils::VDF::parse_binary (const uint8_t *data, size_t size)
 Parse binary VDF data.
std::string Steam::Utils::VDF::stringify (const Object &obj)
 Convert a VDF object into a human-readable string.

Detailed Description

Minimal representation and parser for Valve Data Format (VDF).

Provides a lightweight tree structure for reading VDF data used by various Steam APIs such as appinfo and package metadata.

Typedef Documentation

◆ Object

using Steam::Utils::VDF::Object = std::unordered_map<std::string, VDFNode>

Object node type.

Represents a dictionary of string keys mapped to VDF nodes.

◆ Value

Initial value:
std::variant<
std::string,
int32_t,
uint64_t,
float,
>
std::unordered_map< std::string, VDFNode > Object
Object node type.
Definition vdf.hpp:22

Value stored in a VDF node.

VDF values may be primitive types or nested objects.

Function Documentation

◆ parse_binary()

Object Steam::Utils::VDF::parse_binary ( const uint8_t * data,
size_t size )

Parse binary VDF data.

Parameters
dataPointer to binary VDF buffer.
sizeSize of the buffer in bytes.
Returns
Parsed root object.

◆ parse_text()

Object Steam::Utils::VDF::parse_text ( std::string_view text)

Parse VDF text into an object tree.

Parameters
textVDF formatted text.
Returns
Parsed root object.

◆ stringify()

std::string Steam::Utils::VDF::stringify ( const Object & obj)
inline

Convert a VDF object into a human-readable string.

Useful for debugging or logging VDF structures.