JvmVfs

class JvmVfs(val context: Context, val logger: Logger, storageBaseDir: String, assetsBaseDir: String) : Vfs

Author

Colton Daily

Constructors

Link copied to clipboard
fun JvmVfs(context: Context, logger: Logger, storageBaseDir: String, assetsBaseDir: String)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
@Serializable
data class KeyValueEntry(val k: String, val v: String)
Link copied to clipboard
@Serializable
data class KeyValueStore(val keyValues: List<JvmVfs.KeyValueEntry>)

Functions

Link copied to clipboard
open fun close()

Cancels this vfs job.

Link copied to clipboard
operator fun get(path: String): VfsFile
Link copied to clipboard
open fun getAbsolutePath(path: String): String

Get the absolute path of the queried path based off the Vfs path.

Link copied to clipboard
fun launch(block: suspend Vfs.() -> Unit)

Launches a new coroutine using the this vfs coroutine context. Use this to load assets asynchronously.

Link copied to clipboard
open override fun load(key: String): ByteBuffer?

Load an array of bytes from the storage directory based on the key.

Link copied to clipboard
open override fun loadString(key: String): String?

Load a string from the storage directory based on the key.

Link copied to clipboard
suspend fun readBytes(assetPath: String): ByteBuffer

Loads a raw file into a ByteBuffer

Link copied to clipboard
suspend fun readStream(assetPath: String): ByteSequenceStream

Opens a stream to a file into a ByteSequenceStream.

Link copied to clipboard
open override fun store(key: String, data: ByteArray): Boolean

Store array of bytes in the storage directory based on the key.

open override fun store(key: String, data: String): Boolean

Store a string in the storage directory based on the key.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The root VfsFile that this Vfs starts from.

Extensions

Link copied to clipboard
expect fun CoroutineScope.isOnRenderingThread(): Boolean

Returns true if the coroutine was launched from the rendering thread dispatcher.

actual fun CoroutineScope.isOnRenderingThread(): Boolean
actual fun CoroutineScope.isOnRenderingThread(): Boolean