Murl Engine Lua Addon API  Version 1.0 beta
Murl.ICloudRecord

The ICloudRecord interface.

ICloud records can be created by the ICloudControl interface.


Table members

Enumerations


Status

Enumeration of the record states. Use GetStatus() to get the current status.

Murl.ICloudRecord.STATUS_IDLEThe record is idle.
Murl.ICloudRecord.STATUS_READYThe record is ready to set/get key/values.
Murl.ICloudRecord.STATUS_LOADINGThe record is loading.
Murl.ICloudRecord.STATUS_SAVINGThe record is saving.
Murl.ICloudRecord.STATUS_DELETINGThe record is deleting.
Murl.ICloudRecord.STATUS_ERRORThe record has an error.


Functions



Methods


GetStatus()

Get the cloud record status. LoadRecord(), SaveRecord() and DeleteRecord() operation works asynchronously, the application can check the current status to operate correctly.

Murl.ICloudRecord.Status GetStatus()

Returns
Murl.ICloudRecord.Status The cloud record status.

LoadRecord()

Load the record. After creating an ICloudRecord object or deleting a record, the status is ICloudRecord::STATUS_IDLE. First of all this method must be called to get the record ready. If the status is ICloudRecord::STATUS_ERROR this method can be called to re-load the record.
When start loading, the status changes to ICloudRecord::STATUS_LOADING immediately. When the loading is finished, the status changes to ICloudRecord::STATUS_READY. In case of any error the status changes to ICloudRecord::STATUS_ERROR.

Boolean LoadRecord()

Returns
Boolean true if loading was started, false if the record is ready or a load / save / delete operation is running.

SaveRecord()

Save the record. When start saving, the status changes to ICloudRecord::STATUS_SAVING immediately. When the saving is finished, the status changes to ICloudRecord::STATUS_READY. In case of any error the status changes to ICloudRecord::STATUS_ERROR.

Boolean SaveRecord()

Returns
Boolean true if saving was started, false if the record status is not ready.

DeleteRecord()

Delete the record. When start deleting, the status changes to ICloudRecord::STATUS_DELETING immediately. When the deletion is finished, the status changes to ICloudRecord::STATUS_IDLE.

In case of any error the status changes to ICloudRecord::STATUS_ERROR.

Boolean DeleteRecord()

Returns
Boolean true if deletion was started, false if the record status is not ready.

KeyExists(key)

Check if a key exists.

Boolean KeyExists(String key)

Parameters
keyThe key name string.
Returns
Boolean true if the key exists, false if the key does not exist or the record status is not ICloudRecord::STATUS_READY.

DeleteKey(key)

Delete a key.

Boolean DeleteKey(String key)

Parameters
keyThe key name string.
Returns
Boolean true if successful, false if the record status is not ICloudRecord::STATUS_READY.

GetStringValue(key, value)

Get a string value by a key.

Boolean, String GetStringValue(String key, String value)

Parameters
keyThe key name string.
valueThe string return value.
Returns
Boolean true if successful, false if the key does not exist or the record status is not ICloudRecord::STATUS_READY.
String value The string return value.

SetStringValue(key, value)

Set a string value for a key.

Boolean SetStringValue(String key, String value)

Parameters
keyThe key name string.
valueThe string value to set.
Returns
Boolean true if successful, false if the record status is not ICloudRecord::STATUS_READY.

GetDoubleValue(key, value)

Get a double value by a key.

Boolean, Number GetDoubleValue(String key, Number value)

Parameters
keyThe key name string.
valueThe double return value.
Returns
Boolean true if successful, false if the key does not exist or the record status is not ICloudRecord::STATUS_READY.
Number value The double return value.

SetDoubleValue(key, value)

Set a double value for a key.

Boolean SetDoubleValue(String key, Number value)

Parameters
keyThe key name string.
valueThe double value to set.
Returns
Boolean true if successful, false if the record status is not ICloudRecord::STATUS_READY.

GetIntValue(key, value)

Get an integer value by a key.

Boolean, Integer GetIntValue(String key, Integer value)

Parameters
keyThe key name string.
valueThe integer return value.
Returns
Boolean true if successful, false if the key does not exist or the record status is not ICloudRecord::STATUS_READY.
Integer value The integer return value.

SetIntValue(key, value)

Set an integer value for a key.

Boolean SetIntValue(String key, Integer value)

Parameters
keyThe key name string.
valueThe integer value to set.
Returns
Boolean true if successful, false if the record status is not ICloudRecord::STATUS_READY.

GetDataValue(key, value)

Get a data value by a key.

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

Parameters
keyThe key name string.
valueThe data return value.
Returns
Boolean true if successful, false if the key does not exist or the record status is not ICloudRecord::STATUS_READY.
Murl.Data value The data return value.

SetDataValue(key, value)

Set a data value for a key.

Boolean SetDataValue(String key, Murl.Data value)

Parameters
keyThe key name string.
valueThe data value to set.
Returns
Boolean true if successful, false if the record status is not ICloudRecord::STATUS_READY.