steamvdf

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeNone       byte = 0
	TypeString     byte = 1
	TypeInt32      byte = 2
	TypeFloat32    byte = 3
	TypePointer    byte = 4
	TypeWideString byte = 5
	TypeColor      byte = 6
	TypeUint64     byte = 7
	TypeEnd        byte = 8
	TypeInt64      byte = 10
)

Variables

View Source
var (
	ErrWideString = errors.New("WideString not supported")
)

Functions

func IsBinary

func IsBinary(b []byte) bool

Types

type KeyValue

type KeyValue struct {
	Key      string     `json:"key"`
	Value    string     `json:"value"`
	Children []KeyValue `json:"children"`
}

func FromMap

func FromMap(m map[string]interface{}) KeyValue

func ReadBytes

func ReadBytes(b []byte) (kv KeyValue, err error)

func ReadFile

func ReadFile(path string) (kv KeyValue, err error)

func (KeyValue) GetChild

func (kv KeyValue) GetChild(key string) (child KeyValue, found bool)

func (KeyValue) GetChildrenAsMap

func (kv KeyValue) GetChildrenAsMap() (ret map[string]string)

func (KeyValue) GetChildrenAsSlice

func (kv KeyValue) GetChildrenAsSlice() (ret []string)

func (*KeyValue) HasChild

func (kv *KeyValue) HasChild(key string) bool

func (*KeyValue) SetChild

func (kv *KeyValue) SetChild(value KeyValue)

func (*KeyValue) SortChildren

func (kv *KeyValue) SortChildren()

func (KeyValue) String

func (kv KeyValue) String() string

Returns kv.Value or the children in json form

func (KeyValue) ToMapInner

func (kv KeyValue) ToMapInner() (m map[string]interface{})

Transforms to nested maps Does not include top level

func (KeyValue) ToMapOuter

func (kv KeyValue) ToMapOuter() (m map[string]interface{})

Transforms to nested maps Includes top level

type Token

type Token struct {
	Type  TokenType
	Value string
}

type TokenType

type TokenType byte
const (
	TokenTypeString TokenType = iota
	TokenTypeChildStart
	TokenTypeChildEnd
)

Jump to

Keyboard shortcuts

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