Add extension list to mapping
This commit is contained in:
parent
24af2b56e0
commit
d30a0e462b
|
|
@ -4,6 +4,7 @@ function ExtMap:new (o)
|
||||||
o = o or {}
|
o = o or {}
|
||||||
setmetatable(o, self)
|
setmetatable(o, self)
|
||||||
self.__index = self
|
self.__index = self
|
||||||
|
self["list"] = {}
|
||||||
return o
|
return o
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -23,6 +24,21 @@ function ExtMap:add_single (in_ext, out_ext)
|
||||||
self[in_ext] = {out_ext}
|
self[in_ext] = {out_ext}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local in_exists = false
|
||||||
|
for _, exts in pairs(self["list"]) do
|
||||||
|
if exts == in_ext then
|
||||||
|
in_exists = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if in_exists == false then
|
||||||
|
table.insert(self["list"], in_ext)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExtMap:list_exts()
|
||||||
|
return self["list"]
|
||||||
end
|
end
|
||||||
|
|
||||||
function ExtMap:add (in_exts, out_exts)
|
function ExtMap:add (in_exts, out_exts)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user