Documentation ¶
Index ¶
- func CheckIOReader(L *lua.LState, n int) io.Reader
- func CheckIOWriter(L *lua.LState, n int) io.Writer
- func IOReaderClose(L *lua.LState) int
- func IOReaderRead(L *lua.LState) int
- func IOWriterClose(L *lua.LState) int
- func IOWriterWrite(L *lua.LState) int
- func NewLuaIOWrapper(L *lua.LState, io lua.LValue) *luaIOWrapper
- func ReadLine(reader io.Reader) (string, error)
- func ReaderFuncTable(L *lua.LState) *lua.LTable
- func ToRuneReader(reader io.Reader) io.RuneReader
- func WriterFuncTable(L *lua.LState) *lua.LTable
- type UnbufferedRuneReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIOReader ¶
CheckIOReader tries to cast to UserData and to io.Reader, otherwise it wraps and checks for "read" method
func CheckIOWriter ¶
CheckIOWriter tries to cast to UserData and to io.Writer, otherwise it wraps and checks for "write" method
func IOReaderClose ¶
func IOReaderRead ¶
func IOWriterClose ¶
func IOWriterWrite ¶
func NewLuaIOWrapper ¶
NewLuaIOWrapper creates a new luaIOWrapper atop the lua io object
func ToRuneReader ¶
func ToRuneReader(reader io.Reader) io.RuneReader
ToRuneReader Converts reader to an io.RuneReader
Types ¶
type UnbufferedRuneReader ¶
type UnbufferedRuneReader struct {
// contains filtered or unexported fields
}
UnbufferedRuneReader doesn't attempt to buffer the underlying reader, but does buffer enough to decode utf8 runes.
func (*UnbufferedRuneReader) ReadRune ¶
func (u *UnbufferedRuneReader) ReadRune() (r rune, size int, err error)
ReadRune reads a single rune, and returns the rune, its byte-length, and possibly an error. see the code for fmt.Scanln - which is not public, but which does, but tokenizing on space, which is not desirable. The implementation in fmt.Scanln also implements io.RuneScanner, which is not needed here as newlines are discarded.