vdf

package module
v0.0.0-...-7fdcbaf Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2017 License: MIT Imports: 10 Imported by: 1

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

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) Append

func (n *Node) Append(c *Node)

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) Color

func (n *Node) Color() color.NRGBA

func (*Node) Condition

func (n *Node) Condition() string

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 (n *Node) FirstByName(name string) *Node

func (*Node) FirstChild

func (n *Node) FirstChild() *Node

func (*Node) FirstSubTree

func (n *Node) FirstSubTree() *Node

func (*Node) FirstValue

func (n *Node) FirstValue() *Node

func (*Node) Float

func (n *Node) Float() float32

func (*Node) Int

func (n *Node) Int() int32

func (*Node) MarshalBinary

func (n *Node) MarshalBinary() ([]byte, error)

func (*Node) MarshalText

func (n *Node) MarshalText() ([]byte, error)

func (*Node) Name

func (n *Node) Name() string

Name returns the name of this Node.

Name is an accessor.

func (*Node) NextByName

func (n *Node) NextByName(name string) *Node

func (*Node) NextChild

func (n *Node) NextChild() *Node

func (*Node) NextSubTree

func (n *Node) NextSubTree() *Node

func (*Node) NextValue

func (n *Node) NextValue() *Node

func (*Node) Ptr

func (n *Node) Ptr() uint32

func (*Node) Remove

func (n *Node) Remove()

func (*Node) SetColor

func (n *Node) SetColor(c color.NRGBA)

func (*Node) SetCondition

func (n *Node) SetCondition(condition string)

SetCondition sets the condition of this Node. Putting whitespace, double quotes, or curly braces in a condition will panic.

SetCondition is a mutator.

func (*Node) SetFloat

func (n *Node) SetFloat(f float32)

func (*Node) SetInt

func (n *Node) SetInt(i int32)

func (*Node) SetName

func (n *Node) SetName(name string)

SetName sets the name of this node.

SetName is a mutator.

func (*Node) SetPtr

func (n *Node) SetPtr(i uint32)

func (*Node) SetString

func (n *Node) SetString(s string)

func (*Node) SetUint64

func (n *Node) SetUint64(i uint64)

func (*Node) SetWString

func (n *Node) SetWString(s []uint16)

func (*Node) String

func (n *Node) String() string

func (*Node) Uint64

func (n *Node) Uint64() uint64

func (*Node) UnmarshalBinary

func (n *Node) UnmarshalBinary(b []byte) error

func (*Node) UnmarshalText

func (n *Node) UnmarshalText(b []byte) error

func (*Node) WString

func (n *Node) WString() []uint16

Jump to

Keyboard shortcuts

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