Documentation
¶
Overview ¶
Package vdf implements Valve Data Format, also known as KeyValues.
VDF is documented on the Valve Developer Community wiki: https://developer.valvesoftware.com/wiki/KeyValues
This package attempts to replicate the functionality of the Source SDK 2013 version of KeyValues.
https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/tier1/KeyValues.cpp https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/tier1/kvpacker.cpp
Index ¶
- type Node
- func (n *Node) Append(c *Node)
- func (n *Node) ClearFormatting()
- func (n *Node) Color() color.NRGBA
- func (n *Node) Condition() string
- func (n *Node) FirstByName(name string) *Node
- func (n *Node) FirstByNameAndCondition(name string, condition string) *Node
- func (n *Node) FirstChild() *Node
- func (n *Node) FirstSubTree() *Node
- func (n *Node) FirstValue() *Node
- func (n *Node) Float() float32
- func (n *Node) GetCustomFormatPrefix() string
- func (n *Node) Int() int32
- func (n *Node) MarshalBinary() ([]byte, error)
- func (n *Node) MarshalText() ([]byte, error)
- func (n *Node) Name() string
- func (n *Node) NextByName(name string) *Node
- func (n *Node) NextChild() *Node
- func (n *Node) NextSubTree() *Node
- func (n *Node) NextValue() *Node
- func (n *Node) Ptr() uint32
- func (n *Node) Remove()
- func (n *Node) SetColor(c color.NRGBA)
- func (n *Node) SetCondition(condition string)
- func (n *Node) SetCustomFormatPrefix(str string)
- func (n *Node) SetFloat(f float32)
- func (n *Node) SetInt(i int32)
- func (n *Node) SetName(name string)
- func (n *Node) SetPtr(i uint32)
- func (n *Node) SetString(s string)
- func (n *Node) SetUint64(i uint64)
- func (n *Node) SetWString(s []uint16)
- func (n *Node) String() string
- func (n *Node) Uint64() uint64
- func (n *Node) UnmarshalBinary(b []byte) error
- func (n *Node) UnmarshalText(b []byte) error
- func (n *Node) WString() []uint16
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is the basic building block of VDF.
All methods on a Node are either an accessor or a mutator. Accessors are safe to call from multiple goroutines at the same time and are safe to call on a nil receiver. Mutators require that the Node and all of its children are only being accessed by the goroutine calling the mutator.
func (*Node) ClearFormatting ¶
func (n *Node) ClearFormatting()
ClearFormatting resets the Node and its children to use standard formatting in MarshalText. The formatting is only set by UnmarshalText.
ClearFormatting is a mutator.
func (*Node) Condition ¶
Condition returns the condition of this Node. A node with no condition is represented by an empty string.
Condition is an accessor.
func (*Node) FirstByName ¶
func (*Node) FirstByNameAndCondition ¶
func (*Node) FirstChild ¶
func (*Node) FirstSubTree ¶
func (*Node) FirstValue ¶
func (*Node) GetCustomFormatPrefix ¶
func (*Node) MarshalBinary ¶
func (*Node) MarshalText ¶
func (*Node) NextByName ¶
func (*Node) NextSubTree ¶
func (*Node) SetCondition ¶
SetCondition sets the condition of this Node. Putting whitespace, double quotes, or curly braces in a condition will panic.
SetCondition is a mutator.