minilua::io::FileHandle class

Base class for file handles used by the io implementation.

Contents

Currently all files opened by io.open use CFileHandle.

The following methods have to be provided by a derived class:

  • is_open
  • have the same behaviour described in https://www.lua.org/manual/5.3/manual.html#6.8
    • close
    • flush
  • arguments will be parsed by the base class but you have to implement the behaviour
    • seek_impl
    • setvbuf_impl
  • These methods are used by read and correspond to the format arguments. Note these may be called multiple times for one read if there are multiple format arguments.
    • read_all
    • read_num
    • read_line
    • read_line_with_newline
    • read_count
  • these method will be used by write
    • write_string

Public functions

auto seek_impl(SeekWhence whence, long offset) -> long -> auto pure virtual
auto setvbuf_impl(SetvbufMode mode, size_t size) -> bool -> auto pure virtual

Function documentation

auto minilua::io::FileHandle::seek_impl(SeekWhence whence, long offset) -> long pure virtual

Returns the current position after the seek.

auto minilua::io::FileHandle::setvbuf_impl(SetvbufMode mode, size_t size) -> bool pure virtual

Returns true on success.