Skip to content

Commit

Permalink
Adding implementation of Mac native libs (will be refactored later)
Browse files Browse the repository at this point in the history
  • Loading branch information
orchestr7 committed Jun 21, 2022
1 parent 2ecc3ce commit a80a330
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Specific implementation for utilities
*/

package com.akuleshov7.ktoml.utils

@Suppress("MAGIC_NUMBER")
internal actual fun StringBuilder.appendCodePointCompat(codePoint: Int): StringBuilder = when (codePoint) {
in 0 until Char.MIN_SUPPLEMENTARY_CODE_POINT -> append(codePoint.toChar())
in Char.MIN_SUPPLEMENTARY_CODE_POINT..Char.MAX_CODE_POINT -> {
append(Char.MIN_HIGH_SURROGATE + ((codePoint - 0x10000) shr 10))
append(Char.MIN_LOW_SURROGATE + (codePoint and 0x3ff))
}
else -> throw IllegalArgumentException()
}
2 changes: 1 addition & 1 deletion ktoml-file/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ kotlin {
mingwX64()
linuxX64()
macosX64()

macosArm64()
ios()

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* File utils to read files using okio
*/

package com.akuleshov7.ktoml.file

import okio.FileSystem

/**
* Implementation for getting proper file system to read files with okio
*
* @return proper FileSystem
*/
internal actual fun getOsSpecificFileSystem(): FileSystem = FileSystem.SYSTEM

0 comments on commit a80a330

Please sign in to comment.