Registry support:
Facility to read and write to the Windows registry.
See: http://en.wikipedia.org/wiki/Windows_Registry
| list = registry.ListKeys(HKEY, szSubKey) | List keys. |
| table = registry.ListValues(HKEY, szKey) | List values under a key. |
| string = registry.GetValue(HKEY, szSubKey, lpValueName) | Get value. Always returns string, but the string can be converted into a numerical value if needed. |
| registry.SetValue(HKEY, szSubKey, lpValueName, Value) | Set registry value. |
| registry.DeleteValue(HKEY, szSubKey, lpValueName) | Delete individual values. |
| registry.DeleteKey(HKEY, szSubKey) | Delete sub-key including all values. |
Handle/key constants:
registry.HKEY_CLASSES_ROOT
registry.HKEY_CURRENT_USER
registry.HKEY_LOCAL_MACHINE
registry.HKEY_USERS
registry.HKEY_CURRENT_CONFIG
INI File support:
Facility to read and write to INI (Initialization) files.
See: http://en.wikipedia.org/wiki/Ini_file
list = ini.ListSections(szFileName) Create a table of all section by name in ini file..
Example:
list = ini.ListSections("test.ini")
for i,v in ipairs(list) do print(i.." "..v) end
| section = ini.ListKeys(szSection, szFileName) | Load all the keys and values for the specified section into a table. |
| string = ini.GetValue(szSection, szKey, szFileName) | Get value by section and key. Returns nil if value not found.<>Returns a string value only, but can be put in to direct numerical form by using tonumber(). |
Example:
print(tonumber(ini.GetValue("SECTIONONE", “Scale”, “test.ini”)))
bool = ini.SetValue(szSection, szKey, szValue, szFileName) Write string value by section and key. Returns true if successful.
ini.DeleteKey(szSection, szKey, szFileName) Delete key.
ini.DeleteSection(szSection, szFileName) Delete the entire specified section.
XML File Support:
Support to read and write XML (Extensible Markup Language) files.
See: http://en.wikipedia.org/wiki/XML
LuaExpat:
Integrated in table name “lxp”.
The basis of which is a “parser” object. Parsing is done by feeding it a single or multiple strings via method :parse().
The actual parsing is done by a series of callbacks. There is no direct support in LuaExpat to save XML files.
See: http://www.keplerproject.org/luaexpat/manual.html
LuaXml:
Integrated in table name “xml”, with support module “LuaXml.mms”.
LuxXml operates along with support module by loading XML files directly into a table.
Tags are uniquely located in tables at index 0. LuxXml supports modifying and direct saving of XML files.
Note: Currently LuxXml looses any comments if the file is written back out.
See: http://www.viremo.de/LuaXML