mirror of
https://github.com/geoffleyland/lua-csv.git
synced 2024-11-23 01:34:19 +00:00
Document after that last commit making it more useful
This commit is contained in:
parent
3b28558461
commit
1edff5f4ef
13
lua/csv.lua
13
lua/csv.lua
@ -410,7 +410,18 @@ local buffer_mt =
|
|||||||
buffer_mt.__index = buffer_mt
|
buffer_mt.__index = buffer_mt
|
||||||
|
|
||||||
|
|
||||||
local function use(buffer, parameters)
|
--- Use an existing file or buffer as a stream to read csv from.
|
||||||
|
-- (A buffer is just something that looks like a string in that we can do
|
||||||
|
-- `buffer:sub()` and `buffer:find()`)
|
||||||
|
-- @return a file object
|
||||||
|
local function use(
|
||||||
|
buffer, -- ?string|file|buffer: the buffer to read from. If it's:
|
||||||
|
-- - a string, read from that;
|
||||||
|
-- - a file, turn it into a file_buffer;
|
||||||
|
-- - nil, read from stdin
|
||||||
|
-- otherwise assume it's already a a buffer.
|
||||||
|
parameters) -- ?table: parameters controlling reading the file.
|
||||||
|
-- See README.md
|
||||||
parameters = parameters or {}
|
parameters = parameters or {}
|
||||||
parameters.filename = parameters.filename or "<unknown>"
|
parameters.filename = parameters.filename or "<unknown>"
|
||||||
parameters.column_map = parameters.columns and
|
parameters.column_map = parameters.columns and
|
||||||
|
Loading…
Reference in New Issue
Block a user