aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-common-types/src
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-12-18 18:54:27 +0100
committerRobert Jaros <rjaros@finn.pl>2018-12-18 18:54:27 +0100
commit161264957dc1b41cd6716ee7777139c5e29589f5 (patch)
treec7977850428319b17888f2c7ceffc2557e68a360 /kvision-modules/kvision-common-types/src
parent1fbd940e57b6917ab6677ff285f632f0d10f4809 (diff)
downloadkvision-161264957dc1b41cd6716ee7777139c5e29589f5.tar.gz
kvision-161264957dc1b41cd6716ee7777139c5e29589f5.tar.bz2
kvision-161264957dc1b41cd6716ee7777139c5e29589f5.zip
Refactor modules.
Diffstat (limited to 'kvision-modules/kvision-common-types/src')
-rw-r--r--kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/Date.kt28
-rw-r--r--kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/KFile.kt34
2 files changed, 62 insertions, 0 deletions
diff --git a/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/Date.kt b/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
new file mode 100644
index 00000000..86a72b33
--- /dev/null
+++ b/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/Date.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package pl.treksoft.kvision.types
+
+expect class Date
+
+expect fun String.toDateF(format: String = "YYYY-MM-DD HH:mm:ss"): Date
+
+expect fun Date.toStringF(format: String = "YYYY-MM-DD HH:mm:ss"): String
diff --git a/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/KFile.kt b/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/KFile.kt
new file mode 100644
index 00000000..ce4adca4
--- /dev/null
+++ b/kvision-modules/kvision-common-types/src/main/kotlin/pl/treksoft/kvision/types/KFile.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017-present Robert Jaros
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package pl.treksoft.kvision.types
+
+import kotlinx.serialization.Serializable
+
+/**
+ * A serializable class for a multiplatform File type.
+ */
+@Serializable
+data class KFile(
+ val name: String,
+ val size: Int,
+ val content: String? = null
+)