Documentation
¶
Index ¶
- Constants
- type KeyValue
- func (node *KeyValue) AddChild(value *KeyValue) error
- func (node *KeyValue) AsFloat() (float32, error)
- func (node *KeyValue) AsInt() (int32, error)
- func (node *KeyValue) AsString() (string, error)
- func (node *KeyValue) Children() (children []*KeyValue, err error)
- func (node *KeyValue) Find(key string) (*KeyValue, error)
- func (node *KeyValue) FindAll(key string) (children []*KeyValue, err error)
- func (node *KeyValue) HasChildren() bool
- func (node *KeyValue) Key() string
- func (node *KeyValue) Type() ValueType
- type Reader
- type ValueType
Constants ¶
const CHAR_COMMENT = "//"
const CHAR_DISCARD_CUTSET = "\t \r\n"
const CHAR_ENTER_SCOPE = "{"
const CHAR_ESCAPE = "\""
const CHAR_EXIT_SCOPE = "}"
const CHAR_SEPARATOR = " "
const CHAR_TAB = "\t"
const NODE_KEY_ROOT = "$root"
const ValueArray = ValueType("array")
const ValueFloat = ValueType("float")
const ValueInt = ValueType("integer")
const ValuePtr = ValueType("ptr")
const ValueString = ValueType("string")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyValue ¶
type KeyValue struct {
// contains filtered or unexported fields
}
A KeyValue object, that may hold multiple Values
func (*KeyValue) AddChild ¶
Add adds a new KeyValue pair to an existing Key Existing key's value must be an Array type
func (*KeyValue) Children ¶
GetChildren gets all node child values This is used for keys that contain 1 or more children as its value rather than a basic type
func (*KeyValue) Find ¶
Find returns a keyvalue pair where the key matches input It will return the first found KeyValue in cases where the key is defined multiple times
func (*KeyValue) FindAll ¶
FindAll returns all children of a given type for a node. This is different from properties, as a property is a string:<primitive> This will return an array of all KeyValues that match a given key, even though there should be only one.
func (*KeyValue) HasChildren ¶
HasChildren returns if this Key has KeyValues as its own value.