All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.it.unibo.tuprolog.Os.kt Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package it.unibo.tuprolog

enum class Os(val isPosix: Boolean) {
    WINDOWS(false),
    LINUX(true),
    MAC(true),
    ANDROID(true),
    UNKNOWN_POSIX(true);

    companion object {
        fun detect(description: String): Os? = when {
            description.contains("android", ignoreCase = true) -> ANDROID
            description.contains("dalvik", ignoreCase = true) -> ANDROID
            description.contains("win", ignoreCase = true) -> WINDOWS
            description.contains("mac", ignoreCase = true) -> MAC
            description.contains("mac", ignoreCase = true) -> MAC
            description.contains("linux", ignoreCase = true) -> LINUX
            else -> null
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy