Murl Engine Lua Addon API  Version 1.0 beta
Murl.IPreferencesControl

The IPreferencesControl interface.

The IPreferencesControl implements operating system dependent preferences, limitations to the number of keys and size of the keys should be considered.

  • iOS / tvOS / OSX uses standardUserDefaults from NSUserDefaults
  • Android uses SharedPreferences from Activity
  • Windows uses Registry entries


Table members

Inherited


Murl.IControlable

Methods


Exists(key)

Check if a given key exists in the preferences.

Boolean Exists(String key)

Parameters
keyThe item key to check.
Returns
Boolean true if the key exists.

GetValue(key)

Get the value from a preference item with a given key.

String GetValue(String key)

Parameters
keyThe item key to query.
Returns
String The value of the item, or an empty string if the key does not exist or the key does not contain a string.

GetValue(key, value)

Get the value from a preference item with a given key.

Boolean, String GetValue(String key, String value)

Parameters
keyThe item key to query.
valueThe string return value.
Returns
Boolean true if successful, false if the key does not exist or the key does not contain a string. If false the 'value' return value stays unchanged.
String value The string return value.

SetValue(key, value)

Set the value to a preference item with a given key.

Boolean SetValue(String key, String value)

Parameters
keyThe item key to set.
valueThe item's new value.
Returns
Boolean true if successful.

GetData(key, value)

Get binary data from a preference item with a given key.

Boolean, Murl.Data GetData(String key, Murl.Data value)

Parameters
keyThe item key to query.
valueThe data return value.
Returns
Boolean true if successful, false if the key does not exist or the key does not contain binary data. If false the 'value' return value stays unchanged.
Murl.Data value The data return value.

SetData(key, value)

Set binary data to a preference item with a given key.

Boolean SetData(String key, Murl.Data value)

Parameters
keyThe item key to set.
valueThe item's new binary data.
Returns
Boolean true if successful.

Remove(key)

Remove an preference item for a given key.

Boolean Remove(String key)

Parameters
keyThe item key to reomve.
Returns
Boolean true if successful, false if the key does not exist.