-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding implementation of Mac native libs (will be refactored later)
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
ktoml-core/src/macosArm64Main/kotlin/com/akuleshov7/ktoml/utils/UtilsMacM1.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ kotlin { | |
mingwX64() | ||
linuxX64() | ||
macosX64() | ||
|
||
macosArm64() | ||
ios() | ||
|
||
sourceSets { | ||
|
14 changes: 14 additions & 0 deletions
14
ktoml-file/src/macosArm64Main/kotlin/com/akuleshov7/ktoml/file/FileUtilsMacM1.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |