From fbbdff47d148d9785affccc5cefb68406bbd72b0 Mon Sep 17 00:00:00 2001 From: Kazik Pogoda Date: Fri, 6 Sep 2024 16:24:53 +0200 Subject: [PATCH] OscTypeTags updated --- .../src/commonMain/kotlin/type/OscTypeTags.kt | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/xemantic-osc-api/src/commonMain/kotlin/type/OscTypeTags.kt b/xemantic-osc-api/src/commonMain/kotlin/type/OscTypeTags.kt index 330e9f8..2dfbe82 100644 --- a/xemantic-osc-api/src/commonMain/kotlin/type/OscTypeTags.kt +++ b/xemantic-osc-api/src/commonMain/kotlin/type/OscTypeTags.kt @@ -43,24 +43,7 @@ public fun List<*>.oscTypeTags(): String = joinToString(separator = "") { * * @throws OscException if this object's type cannot be represented in OSC protocol. */ -public val Any.oscTypeTag: String get() = when (this) { - is Int -> "i" - is Float -> "f" - is String -> "s" - is ByteArray -> "b" - is Boolean -> oscTypeTag - is OscImpulse -> "I" - is OscTimeTag -> "t" - is Long -> "h" - is Double -> "d" - is Char -> "c" - is OscColor -> "r" - is OscMidiMessage -> "m" - is List<*> -> "[${oscTypeTags()}]" - else -> throw OscException( - "Type unsupported in OSC: ${this::class}" - ) -} +public expect val Any.oscTypeTag: String public fun String.toBooleanOscTypeTag(): Boolean = when (this) { "T" -> true