Documentation
¶
Index ¶
- Constants
- Variables
- func CreateBinary(dstPath string, vdf ValveDataFile, wo ...VdfWriteOptions) error
- func CreateText(dstPath string, vdf ValveDataFile, wo ...VdfWriteOptions) error
- func IsKnownBinaryType(b BinaryType) bool
- func WriteBinary(writer io.Writer, vdf ValveDataFile) error
- func WriteText(writer io.Writer, vdf ValveDataFile, wo ...VdfWriteOptions) error
- type BinaryType
- type KeyValues
- type ValveDataFile
- type VdfWriteOptions
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) WriteString ¶
type ValveDataFile ¶ added in v0.4.13
type ValveDataFile []*KeyValues
func ReadBinary ¶ added in v0.3.78
func ReadBinary(reader io.Reader) (ValveDataFile, error)
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
Click to show internal directories.
Click to hide internal directories.