fix build and add filestandardkeyvaluerepo unsetWithValues realization

This commit is contained in:
InsanusMokrassar 2020-12-05 18:00:27 +06:00
parent 091cb38339
commit 5fc760f4a5
2 changed files with 13 additions and 0 deletions

View File

@ -160,6 +160,18 @@ class FileWriteStandardKeyValueRepo(
} }
} }
} }
override suspend fun unsetWithValues(toUnset: List<File>) {
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") @Warning("Files watching will not correctly works on Android Platform with version of API lower than API 26")

View File

@ -7,6 +7,7 @@ import dev.inmo.micro_utils.repos.*
import io.ktor.client.HttpClient import io.ktor.client.HttpClient
import kotlinx.serialization.* import kotlinx.serialization.*
@Suppress("DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE")
class KtorStandartKeyValueRepo<K, V> ( class KtorStandartKeyValueRepo<K, V> (
baseUrl: String, baseUrl: String,
baseSubpart: String, baseSubpart: String,