mirror of
https://github.com/koreader/koreader.git
synced 2025-12-18 12:02:09 +01:00
add CreDocument:engineInit() method
This commit is contained in:
@@ -9,10 +9,6 @@ function DocumentRegistry:addProvider(extension, mimetype, provider)
|
||||
table.insert(self.providers, { extension = extension, mimetype = mimetype, provider = provider })
|
||||
end
|
||||
|
||||
function DocumentRegistry:openDocument(file)
|
||||
return self:getProvider(file):new{file = file}
|
||||
end
|
||||
|
||||
function DocumentRegistry:getProvider(file)
|
||||
-- TODO: some implementation based on mime types?
|
||||
local extension = string.lower(string.match(file, ".+%.([^.]+)"))
|
||||
@@ -23,6 +19,10 @@ function DocumentRegistry:getProvider(file)
|
||||
end
|
||||
end
|
||||
|
||||
function DocumentRegistry:openDocument(file)
|
||||
return self:getProvider(file):new{file = file}
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
This is an abstract interface to a document
|
||||
|
||||
Reference in New Issue
Block a user