blob: e8cd783ba50a945c9549dc43f7001aa4091eefec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
local mt = {}
mt.__index = mt
mt.type = 'file'
mt._uri = ''
mt._text = ''
mt._open = false
function mt:setText(buf)
self._text = buf
end
function mt:getText()
return self._text
end
function mt:open()
self._open = true
end
function mt:close()
self._open = false
end
function mt:isOpen()
return self._open
end
return function (uri)
local self = setmetatable({
_uri = uri,
}, mt)
return self
end
|