Module document.documentregistry

This is a registry for document providers

Functions

DocumentRegistry:hasProvider (file) Returns true if file has provider.
DocumentRegistry:getProvider (file) Returns the preferred registered document handler.
DocumentRegistry:getProviders (file) Returns the registered document handlers.
DocumentRegistry:getExtensions () Get mapping of file extensions to providers
DocumentRegistry:setProvider (file, all) Sets the preferred registered document handler.
DocumentRegistry:openDocument (file, provider) Returns a new Document instance on success
DocumentRegistry:closeDocument (file) Does NOT finalize a Document instance, call its :close() instead if that's what you're looking for! (i.e., nothing but Document:close should call this!)
DocumentRegistry:getReferenceCount (file) Queries the current refcount for a given file

Issues

DocumentRegistry:getProviders-todo5 some implementation based on mime types?


Functions

DocumentRegistry:hasProvider (file)
Returns true if file has provider.

Parameters:

Returns:

    boolean
DocumentRegistry:getProvider (file)
Returns the preferred registered document handler.

Parameters:

Returns:

    table provider, or nil
DocumentRegistry:getProviders (file)
Returns the registered document handlers.

Parameters:

Returns:

    table providers, or nil
DocumentRegistry:getExtensions ()
Get mapping of file extensions to providers

Returns:

    table mapping file extensions to a list of providers
DocumentRegistry:setProvider (file, all)
Sets the preferred registered document handler.

Parameters:

DocumentRegistry:openDocument (file, provider)
Returns a new Document instance on success

Parameters:

  • file
  • provider force a GC, so that any previous document used memory can be reused immediately by this new document without having to wait for the next regular gc. The second call may help reclaming more memory.
DocumentRegistry:closeDocument (file)
Does NOT finalize a Document instance, call its :close() instead if that's what you're looking for! (i.e., nothing but Document:close should call this!)

Parameters:

  • file
DocumentRegistry:getReferenceCount (file)
Queries the current refcount for a given file

Parameters:

  • file

Issues

DocumentRegistry:getProviders-todo5
some implementation based on mime types?
generated by LDoc 1.4.6 Last updated 2021-09-20 13:36:42