-
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.
### What's done: - Added iOS and macosArm64 targets
- Loading branch information
1 parent
3126f03
commit dfabe14
Showing
10 changed files
with
92 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
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
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
15 changes: 15 additions & 0 deletions
15
ktoml-core/src/iosMain/kotlin/com/akuleshov7/ktoml/utils/UtilsIos.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() | ||
} |
17 changes: 17 additions & 0 deletions
17
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,17 @@ | ||
/** | ||
* Specific implementation for utilities | ||
*/ | ||
|
||
@file:Suppress("PACKAGE_NAME_INCORRECT_PATH") | ||
|
||
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
14 changes: 14 additions & 0 deletions
14
ktoml-file/src/iosMain/kotlin/com/akuleshov7/ktoml/file/FileUtilsIos.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 |
16 changes: 16 additions & 0 deletions
16
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,16 @@ | ||
/** | ||
* File utils to read files using okio | ||
*/ | ||
|
||
@file:Suppress("PACKAGE_NAME_INCORRECT_PATH") | ||
|
||
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 |