Skip to content

Commit 6b62996

Browse files
committed
Initial commit
0 parents  commit 6b62996

27 files changed

+1479
-0
lines changed

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Based on https://go.sebastiano.dev/gitignore
2+
3+
# This is where cketti keeps local notes
4+
/TODO*
5+
6+
/kotlin-js-store
7+
8+
### JetBrains template
9+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
10+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
11+
12+
*.iml
13+
*.ipr
14+
*.iws
15+
/.idea/*
16+
17+
# Exclude non-user-specific stuff
18+
!.idea/.name
19+
!.idea/codeInsightSettings.xml
20+
!.idea/codeStyles/
21+
!.idea/copyright/
22+
!.idea/dataSources.xml
23+
!.idea/detekt.xml
24+
!.idea/encodings.xml
25+
!.idea/externalDependencies.xml
26+
!.idea/file.template.settings.xml
27+
!.idea/fileTemplates/
28+
!.idea/icon.svg
29+
!.idea/inspectionProfiles/
30+
!.idea/runConfigurations/
31+
!.idea/scopes/
32+
!.idea/vcs.xml
33+
34+
### Kotlin template
35+
# Compiled class file
36+
*.class
37+
38+
# Log file
39+
*.log
40+
41+
# Package Files #
42+
*.jar
43+
*.war
44+
*.nar
45+
*.ear
46+
*.zip
47+
*.tar.gz
48+
*.rar
49+
50+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
51+
hs_err_pid*
52+
53+
### Gradle template
54+
.gradle
55+
56+
# Note that you may need to exclude by hand other folders
57+
# named build if necessary (e.g., in src/)
58+
**/build/
59+
60+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
61+
!gradle/wrapper/gradle-wrapper.jar

.idea/codeStyles/Project.xml

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 cketti
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# kotlin-codepoints
2+
3+
Kotlin Multiplatform (KMP) library that adds basic support for Unicode code points.
4+
5+
**Note:** This library is a side project and work in progress. When evaluating whether to use this in production, please
6+
consider this project unmaintained. That being said, contributions are welcome. But don't expect fast responses.
7+
8+
9+
## Features
10+
11+
This library aims to make some methods of the Java standard library available to Kotlin multiplatform projects.
12+
13+
Methods found in `java.lang.String`:
14+
* `String.codePointAt(index)`
15+
* `String.codePointBefore(index)`
16+
* `String.codePointCount(beginIndex, endIndex)`
17+
* `String.offsetByCodePoints(index, codePointOffset)`
18+
19+
Methods found in `java.lang.Character`:
20+
* `CodePoints.isValidCodePoint(codePoint)`
21+
* `CodePoints.isBmpCodePoint(codePoint)`
22+
* `CodePoints.isSupplementaryCodePoint(codePoint)`
23+
* `CodePoints.charCount(codePoint)`
24+
* `CodePoints.isSurrogate(char)`
25+
* `CodePoints.isHighSurrogate(char)`
26+
* `CodePoints.isLowSurrogate(char)`
27+
* `CodePoints.isSurrogatePair(highSurrogate, lowSurrogate)`
28+
* `CodePoints.highSurrogate(codePoint)`
29+
* `CodePoints.lowSurrogate(codePoint)`
30+
* `CodePoints.toCodePoint(highSurrogate, lowSurrogate)`
31+
32+
On the JVM the platform implementation is used. On all other platforms the
33+
[implementation in this library](src/commonImplementation/kotlin) is used.
34+
35+
36+
## License
37+
38+
```text
39+
MIT License
40+
41+
Copyright (c) 2023 cketti
42+
43+
Permission is hereby granted, free of charge, to any person obtaining a copy
44+
of this software and associated documentation files (the "Software"), to deal
45+
in the Software without restriction, including without limitation the rights
46+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
47+
copies of the Software, and to permit persons to whom the Software is
48+
furnished to do so, subject to the following conditions:
49+
50+
The above copyright notice and this permission notice shall be included in all
51+
copies or substantial portions of the Software.
52+
53+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59+
SOFTWARE.
60+
```

build.gradle.kts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
plugins {
2+
kotlin("multiplatform") version "1.8.0"
3+
}
4+
5+
group = "de.cketti.unicode"
6+
version = "0.1.0-SNAPSHOT"
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
kotlin {
13+
jvm {
14+
compilations.all {
15+
kotlinOptions.jvmTarget = "11"
16+
}
17+
withJava()
18+
testRuns["test"].executionTask.configure {
19+
useJUnitPlatform()
20+
}
21+
}
22+
23+
js(IR) {
24+
browser {}
25+
}
26+
27+
val hostOs = System.getProperty("os.name")
28+
val isMingwX64 = hostOs.startsWith("Windows")
29+
val nativeTarget = when {
30+
hostOs == "Mac OS X" -> macosX64("native")
31+
hostOs == "Linux" -> linuxX64("native")
32+
isMingwX64 -> mingwX64("native")
33+
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
34+
}
35+
36+
sourceSets {
37+
val commonImplementation by creating
38+
39+
val commonMain by getting
40+
val commonTest by getting {
41+
dependencies {
42+
implementation(kotlin("test"))
43+
}
44+
}
45+
46+
val jvmMain by getting
47+
val jvmTest by getting {
48+
dependsOn(commonImplementation)
49+
}
50+
51+
val jsMain by getting {
52+
dependsOn(commonImplementation)
53+
}
54+
val jsTest by getting
55+
56+
val nativeMain by getting {
57+
dependsOn(commonImplementation)
58+
}
59+
val nativeTest by getting
60+
}
61+
}

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kotlin.code.style=official
2+
kotlin.mpp.stability.nowarn=true
3+
kotlin.js.generate.executable.default=false

gradle/wrapper/gradle-wrapper.jar

60.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)