[KLIB] Add ZIP file system accessor

The accessor interface is used for reading klib archives in place.
This commit is contained in:
Alexander Korepanov
2023-02-27 15:56:51 +01:00
committed by Space Team
parent af1f3a102b
commit e4406638bd
3 changed files with 38 additions and 16 deletions
@@ -0,0 +1,18 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.konan.file
import java.nio.file.FileSystem
interface ZipFileSystemAccessor {
fun <T> withZipFileSystem(zipFile: File, action: (FileSystem) -> T): T
}
object ZipFileSystemInPlaceAccessor : ZipFileSystemAccessor {
override fun <T> withZipFileSystem(zipFile: File, action: (FileSystem) -> T): T {
return zipFile.withZipFileSystem(action)
}
}