hxn

Storage

Bundled read-only files and application-scoped saves and preferences.

Constructor

function new(application:String, ?options:Null<StorageOptions>)

Methods

function readAsset(path:String):Future<Bytes>

Reads a path relative to the application's bundled asset root.

function readSave(path:String):Future<Bytes>

Missing saves reject the future.

function writeSave(path:String, bytes:Bytes):Future<Unit>

Copies bytes before returning and replaces the whole save atomically.

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 close():Void

Already-started operations retain their state and complete normally.