steam_vdf

package
v0.5.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const Ext = ".vdf"

Variables

View Source
var ErrVdfKeyNotFound = errors.New("vdf key not found")

Functions

func CreateBinary added in v0.3.78

func CreateBinary(dstPath string, vdf ValveDataFile, wo ...VdfWriteOptions) error

func CreateText added in v0.3.78

func CreateText(dstPath string, vdf ValveDataFile, wo ...VdfWriteOptions) error

func IsKnownBinaryType

func IsKnownBinaryType(b BinaryType) bool

func WriteBinary

func WriteBinary(writer io.Writer, vdf ValveDataFile) error

func WriteText

func WriteText(writer io.Writer, vdf ValveDataFile, wo ...VdfWriteOptions) error

Types

type BinaryType

type BinaryType byte
const (
	BinaryTypeNone BinaryType = iota
	BinaryTypeString
	BinaryTypeInt
	BinaryTypeFloat
	BinaryTypePtr
	BinaryTypeWString
	BinaryTypeColor
	BinaryTypeUint64
	BinaryTypeNullMarker
	BinaryTypeError BinaryType = 254
	BinaryTypeEOF   BinaryType = 255
)

https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/public/tier1/kvpacker.h

type KeyValues

type KeyValues struct {
	Key        string
	Value      *string
	Type       BinaryType
	TypedValue any
	Values     ValveDataFile
}

func (*KeyValues) WriteBinary

func (kv *KeyValues) WriteBinary(w io.Writer) error

func (*KeyValues) WriteString

func (kv *KeyValues) WriteString(w io.Writer, depth int, wo ...VdfWriteOptions) error

type ValveDataFile added in v0.4.13

type ValveDataFile []*KeyValues

func ReadBinary added in v0.3.78

func ReadBinary(reader io.Reader) (ValveDataFile, error)

func ReadText added in v0.3.78

func ReadText(reader io.Reader) (ValveDataFile, error)

func (ValveDataFile) At added in v0.4.14

func (vdf ValveDataFile) At(pathParts ...string) (*KeyValues, error)

func (ValveDataFile) Val added in v0.4.17

func (vdf ValveDataFile) Val(pathParts ...string) (string, bool)

type VdfWriteOptions added in v0.3.78

type VdfWriteOptions int
const (
	VdfBackupExisting VdfWriteOptions = iota
	VdfTabsIndent
	VdfSpacesIndent
	VdfNewLines
)

func HumanReadable added in v0.4.18

func HumanReadable() []VdfWriteOptions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL