algernon: github.com/xyproto/algernon/lua/convert Index | Files

package convert

import "github.com/xyproto/algernon/lua/convert"

Package convert provides functions for converting to and from Lua structures

Index

Package Files

convert.go

func Arguments2buffer Uses

func Arguments2buffer(L *lua.LState, addNewline bool) bytes.Buffer

Arguments2buffer retrieves all the arguments given to a Lua function and gather the strings in a buffer.

func Map2table Uses

func Map2table(L *lua.LState, m map[string]string) *lua.LTable

Map2table converts a map[string]string to a Lua table

func PprintToWriter Uses

func PprintToWriter(w io.Writer, value lua.LValue)

PprintToWriter outputs more informative information than the memory location. Attempt to extract and print the values of the given lua.LValue. Does not add a newline at the end.

func Strings2table Uses

func Strings2table(L *lua.LState, sl []string) *lua.LTable

Strings2table converts a string slice to a Lua table

func Table2interfacemap Uses

func Table2interfacemap(luaTable *lua.LTable) map[string]interface{}

Table2interfacemap converts a Lua table to a map[string]interface{}

func Table2map Uses

func Table2map(luaTable *lua.LTable, preferInt bool) (interface{}, bool)

Table2map converts a Lua table to **one** of the following types, depending on the content:

map[string]string
map[string]int
map[int]string
map[int]int

If no suitable keys and values are found, a nil interface is returned. If several different types are found, it returns true.

func Table2mapinterface Uses

func Table2mapinterface(luaTable *lua.LTable) (retmap map[interface{}]interface{}, isArray bool, err error)

Table2mapinterface converts a Lua table to a map by using gluamapper. If the map really is an array (all the keys are indices), return true.

func Table2maps Uses

func Table2maps(luaTable *lua.LTable) (map[string]string, map[string]int, map[int]string, map[int]int)

Table2maps converts a Lua table to **all** of the following types, depending on the content:

map[string]string
map[string]int
map[int]string
map[int]int

Package convert imports 8 packages (graph) and is imported by 4 packages. Updated 2017-10-12. Refresh now. Tools for package owners.