From 5fc760f4a5a4c91951d665b3e2d5319f8c0b92b5 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 5 Dec 2020 18:00:27 +0600 Subject: [PATCH] fix build and add filestandardkeyvaluerepo unsetWithValues realization --- .../micro_utils/repos/FileStandardKeyValueRepo.kt | 12 ++++++++++++ .../client/key_value/KtorStandartKeyValueRepo.kt | 1 + 2 files changed, 13 insertions(+) diff --git a/repos/common/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/FileStandardKeyValueRepo.kt b/repos/common/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/FileStandardKeyValueRepo.kt index 99553103c5a..9afb05be768 100644 --- a/repos/common/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/FileStandardKeyValueRepo.kt +++ b/repos/common/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/FileStandardKeyValueRepo.kt @@ -160,6 +160,18 @@ class FileWriteStandardKeyValueRepo( } } } + + override suspend fun unsetWithValues(toUnset: List) { + val keys = toUnset.mapNotNull { v -> + val key = v.absolutePath.removePrefix(folder.absolutePath) + if (key != v.absolutePath) { + key + } else { + null + } + } + unset(keys) + } } @Warning("Files watching will not correctly works on Android Platform with version of API lower than API 26") diff --git a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/key_value/KtorStandartKeyValueRepo.kt b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/key_value/KtorStandartKeyValueRepo.kt index c3faa058790..0dc7952970b 100644 --- a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/key_value/KtorStandartKeyValueRepo.kt +++ b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/key_value/KtorStandartKeyValueRepo.kt @@ -7,6 +7,7 @@ import dev.inmo.micro_utils.repos.* import io.ktor.client.HttpClient import kotlinx.serialization.* +@Suppress("DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE") class KtorStandartKeyValueRepo ( baseUrl: String, baseSubpart: String,