StorageUtil
| Kind | class |
| Package | mobile |
| Full name | mobile.StorageUtil |
| Source | source/mobile/StorageUtil.hx |
A storage class for mobile. @author Karim Akra and Homura Akemi (HomuHomu833)
Public methods
getStorageDirectory
static function getStorageDirectory():String
Only compiled when #if sys.
initStorageDirectory
static function initStorageDirectory():Bool
Only compiled when #if sys.
Prepares app-owned storage before any relative asset/mod access. Android's getExternalFilesDir needs no storage or media permission on our API-21+ targets. SAF handles access to user-selected files elsewhere. Returns false after showing an error so Main can stop startup safely.
saveContent
static function saveContent(fileName:String, fileData:String, alert:Bool = true):Void
Only compiled when #if sys + #if android ensureModsDirectory(); #end.
| Parameter | Type | Default |
|---|---|---|
fileName | String | — |
fileData | String | — |
alert (optional) | Bool | true |
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
getExternalFilesDirJNI | Dynamic | yes |
| Method |
|---|
static function getAndroidStorageDirectory():String |
static function ensureModsDirectory():Void |