Package-level declarations

Types

Link copied to clipboard
expect object Platform

This singleton class provides information about the current platform.

actual object Platform
actual object Platform
actual data object Platform
actual object Platform
actual object Platform
actual object Platform
actual object Platform
actual object Platform
actual object Platform
actual object Platform
Link copied to clipboard
data object Tooling

This singleton class provides some easy tooling methods, useful for most applications.

Properties

Link copied to clipboard

Provides the last existing index of any Collection

Functions

Link copied to clipboard

Apply title to the Application, this fixes appearance on some targets.

Link copied to clipboard
fun <Error class: unknown class>.canReadSafely(default: Boolean = false): Boolean

Extension method to check if a file can be read without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.canWriteSafely(default: Boolean = false): Boolean

Extension method to check if a file can be written without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun Iterable<String>.contains(element: String, ignoreCase: Boolean = false): Boolean

Check if a String-Iterable contains a specific element with the option to ignore case-sensitivity.

Link copied to clipboard
fun <Error class: unknown class>.createAsFileSafely(default: Boolean = false): Boolean

Extension method to create a file without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.deleteSafely(): Boolean

Extension method to delete a file safely without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>?.existsRSafely(default: Boolean = false): Boolean

Extension method to check if a file exists and can be read without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>?.existsRWSafely(default: Boolean = false): Boolean

Extension method to check if a file exists and can be written without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>?.existsSafely(default: Boolean = false): Boolean

Extension method to check if a file exists without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun Tooling.findSystemRoots(): Set<<Error class: unknown class>>

Provides all root directories available in the system.

Link copied to clipboard
fun Tooling.getApplicationWriteableRootFolder(appName: String, appVersion: String? = null, appAuthor: String? = null, multiPath: Boolean = false): File?

Get a read-write able folder for (a compose) application to store user unrelated data.

Link copied to clipboard

Get all numbers of a given String. This does not include floating points.

Link copied to clipboard
fun <Error class: unknown class>.getOriginalFile(): <Error class: unknown class>

Extension method to get the real file of a symlink without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun Tooling.getRWSiteDataFile(child: String?, appName: String, appVersion: String? = null, appAuthor: String? = null, multiPath: Boolean = false, createIfNotExists: Boolean = false): File

Get a read-write able file in the application site data directory (platform dependent).

Link copied to clipboard
fun Tooling.getRWUserConfigFile(child: String?, appName: String, appVersion: String? = null, appAuthor: String? = null, roaming: Boolean = false, createIfNotExists: Boolean = false): File

Get a read-write able file in the application user config directory (platform dependent).

Link copied to clipboard
fun Tooling.getRWUserDataFile(child: String?, appName: String, appVersion: String? = null, appAuthor: String? = null, roaming: Boolean = false, createIfNotExists: Boolean = false): File

Get a read-write able file in the application user data directory (platform dependent).

Link copied to clipboard
fun Tooling.homeDirectory(): <Error class: unknown class>?

Get the home directory of the user. Falls back to HOME system environment variable if JVM property user.home could not be found.

Link copied to clipboard
fun <Error class: unknown class>.isDirectorySafely(default: Boolean = false): Boolean

Extension method to check if a file is a directory without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.isSame(file: <Error class: unknown class>?, default: Boolean = false): Boolean

Extension method to check if two files are the same (symlink aware) without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.isSymlinkSafely(default: Boolean = false): Boolean

Extension method to check if a file is a symlink without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.listFilesSafely(): List<<Error class: unknown class>>

Extension method to get all children without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <T> listFrom(vararg list: Iterable<T>): List<T>

Combine any Iterable of the same type to one List.

Link copied to clipboard
fun <Error class: unknown class>.mkdirsSafely(default: Boolean = false): Boolean

Extension method to create this and all parent directories without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <T> mutableListFrom(vararg list: Iterable<T>): MutableList<T>

Combine any Iterable of the same type to one MutableList.

Link copied to clipboard
fun <T> mutableSetFrom(vararg list: Iterable<T>): MutableSet<T>

Combine any Iterable of the same type to one MutableSet.

Link copied to clipboard
fun Iterable<<Error class: unknown class>>.normalize(): Set<<Error class: unknown class>>

Extension method to get a normalized Set of Files (symlink aware) without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.parentExistsOrCreateSafely(fallbackParent: <Error class: unknown class>? = null): Boolean

Extension method to check if a parent file exists and creates if not without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.parentExistsROrCreateSafely(fallbackParent: <Error class: unknown class>? = null): Boolean

Extension method to check if a parent file exists readable and creates if not without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.parentExistsRWOrCreateSafely(fallbackParent: <Error class: unknown class>? = null): Boolean

Extension method to check if a parent file exists read-write able and creates if not without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.parentSafely(): <Error class: unknown class>?

Extension method to get the parent of a file exists without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.readChannel(block: (<Error class: unknown class>) -> Unit)

Extension method to read a file as is without converting it to UTF-8 or anything else. Useful for reading files on a byte level.

Link copied to clipboard
fun <T> safeCast(block: () -> T?): T?

Cast any object within without throwing any exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
inline fun <T> Any?.safeCast(): T?

Cast any object to the wanted type without throwing any exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <T> Collection<T>.safeSubList(from: Int, to: Int): List<T>

Run List.subList on any Collection safely without throwing any exception if the provided start/end values do not exist.

Link copied to clipboard
fun <T> Collection<T>.safeSubSet(from: Int, to: Int): Set<T>

Run List.subList on any Collection safely without throwing any exception if the provided start/end values do not exist.

Link copied to clipboard
fun <T> scopeCatching(block: () -> T): Result<T>

Equivalent of runCatching but able to throw CancellationException to cancel parent jobs.

Link copied to clipboard
fun <T> setFrom(vararg list: Iterable<T>): Set<T>

Combine any Iterable of the same type to one Set.

Link copied to clipboard
fun systemEnv(key: String): String?

Run System.getenv without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard

Run System.getProperty without throwing an exception, except CancellationException to cancel parent jobs.

fun systemProperty(key: String, value: String): String?

Run System.setProperty without throwing an exception, except CancellationException to cancel parent jobs.

Link copied to clipboard
fun <Error class: unknown class>.writeChannel(block: (<Error class: unknown class>) -> Unit)

Extension method to write a file as is without converting it to UTF-8 or anything else. Useful for writing files on a byte level.