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

commonMain.io.ktor.util.PlatformUtils.kt Maven / Gradle / Ivy

Go to download

Ktor is a framework for quickly creating web applications in Kotlin with minimal effort.

There is a newer version: 3.0.0-rc-1
Show newest version
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

package io.ktor.util

public object PlatformUtils {
    public val IS_BROWSER: Boolean = platform == Platform.Browser
    public val IS_NODE: Boolean = platform == Platform.Node
    public val IS_JVM: Boolean = platform == Platform.Jvm
    public val IS_NATIVE: Boolean = platform == Platform.Native

    public val IS_DEVELOPMENT_MODE: Boolean = isDevelopmentMode

    public val IS_NEW_MM_ENABLED: Boolean = isNewMemoryModel
}

internal expect val PlatformUtils.isDevelopmentMode: Boolean
internal expect val PlatformUtils.isNewMemoryModel: Boolean

public expect val PlatformUtils.platform: Platform

public enum class Platform {
    Jvm, Native, Browser, Node
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy