-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlua-xml.lua
More file actions
30 lines (28 loc) · 884 Bytes
/
lua-xml.lua
File metadata and controls
30 lines (28 loc) · 884 Bytes
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
package.path =".\\?.lua;" .. package.path;
local M = {};
------------------------------------------------------------------------------
local Reader = require('src.Reader');
local Writer = require('src.Writer');
------------------------------------------------------------------------------
function M.Load(arg)
--f = f or function() end;
local file = io.open(arg, 'r');
if (file) then
local data = Reader.Read(file);
file:flush();
return data;
else
return Reader.Read(arg);
end
end
------------------------------------------------------------------------------
function M.typeof(o)
if (type(o) == "table") then
if (getmetatable(o)) then
return getmetatable(o).__type;
end
end
return type(o);
end
------------------------------------------------------------------------------
return M;