aboutsummaryrefslogtreecommitdiff
path: root/nerv/io/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nerv/io/init.lua')
-rw-r--r--nerv/io/init.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/nerv/io/init.lua b/nerv/io/init.lua
index 647ff93..eb2e3e5 100644
--- a/nerv/io/init.lua
+++ b/nerv/io/init.lua
@@ -3,7 +3,7 @@ function nerv.ChunkFile:write_chunkdata(metadata, writer)
nerv.error("metadata should be a Lua table")
return
end
- return self:_write_chunkdata(table.tostring(metadata), writer)
+ return self._write_chunkdata(self.handle, table.tostring(metadata), writer)
end
function nerv.ChunkFile:write_chunk(chunk)
@@ -28,10 +28,14 @@ function nerv.ChunkFile:read_chunk(id, global_conf)
local chunk_type = nerv.get_type(metadata.type)
local chunk = chunk_type(id, global_conf)
chunk:set_info(metadata.info)
- chunk:read(self:get_chunkdata(id))
+ chunk:read(self._get_chunkdata(self.handle, metadata._chunk_info))
return chunk
end
+function nerv.ChunkFile:close()
+ self._close(self.handle)
+end
+
local DataReader = nerv.class("nerv.DataReader")
function DataReader:__init(global_conf, reader_conf)