Module luadata
Handles append-mostly data such as KOReader's bookmarks and dictionary search history.
Functions
LuaData:open (file_path, name) | Creates a new LuaData instance. |
LuaData:saveSetting (key, value) | Saves a setting. |
LuaData:delSetting (key) | Deletes a setting. |
LuaData:addTableItem (table_name, value) | Adds item to table. |
LuaData:removeTableItem (key, index) | Removes index from table. |
LuaData:append (data) | Appends settings to disk. |
LuaData:reset (table) | Replaces existing settings with table. |
LuaData:flush () | Writes all settings to disk (does not append). |
Functions
- LuaData:open (file_path, name)
-
Creates a new LuaData instance.
Parameters:
- file_path
- name Backwards compat, just in case...
- LuaData:saveSetting (key, value)
-
Saves a setting.
Parameters:
- key
- value
- LuaData:delSetting (key)
-
Deletes a setting.
Parameters:
- key
- LuaData:addTableItem (table_name, value)
-
Adds item to table.
Parameters:
- table_name
- value
- LuaData:removeTableItem (key, index)
-
Removes index from table.
Parameters:
- key
- index
- LuaData:append (data)
-
Appends settings to disk.
Parameters:
- data
- LuaData:reset (table)
-
Replaces existing settings with table.
Parameters:
- table
- LuaData:flush ()
- Writes all settings to disk (does not append).