KlipManager

object KlipManager

A helper class to assist in reading and writing persisted klips

Functions

klip
Link copied to clipboard
common
fun klip(context: KlipContext, source: () -> String): String

Writes or returns klip depending on the working mode.

readKlip
Link copied to clipboard
common
fun readKlip(path: String, key: String, source: () -> String): String

Reads a klip from a klip file specified by path under given key. If such klip is not found, a value provided by source is persisted and returned instead.

stringifyKlip
Link copied to clipboard
common
fun stringifyKlip(key: String, source: () -> String): String

Converts a key and a klip provided by source to a writable form that's safe to append to klip file.

writeKlip
Link copied to clipboard
common
fun writeKlip(path: String, key: String, source: () -> String): String

Writes and returns a klip provided by source to a klip file specified by path under given key.