hxn

StorageBackend

Platform implementation used by hxn.file.Storage.

Constructor

function new(application:String, assets:String, data:String)

Static methods

function hxnAdopt(hxnRaw:Handle):StorageBackend

An object for a value the library returned.

Properties

var hxnRaw:Handle

Methods

function readAsset(path:String):Future<Bytes>
function readSave(path:String):Future<Bytes>
function writeSave(path:String, bytes:Bytes):Future<Unit>
function deleteSave(path:String):Future<Bool>
function getPreference(key:String):Future<Preference>
function setPreference(key:String, value:String):Future<Unit>
function deletePreference(key:String):Future<Bool>
function same(other:Null<StorageBackend>):Bool

Whether other holds the value this does. Two objects can: each time the library returns the value, a new object gets a share of it.

function weak():StorageBackendWeak

A reference to the value that does not keep it alive.

function close():Void

Gives up this object's share of the value now. The collector does it otherwise. The value lives while anything else holds a share. Using this object afterwards throws.