dough-core and all of that

This commit is contained in:
2023-02-16 19:31:01 -08:00
parent 77f37f5660
commit d9b02c847f
19 changed files with 184 additions and 7 deletions

View File

@ -1,10 +1,12 @@
package gay.pizza.dough.fs
import gay.pizza.dough.core.time.UnixTime
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerializationStrategy
interface FsOperations {
fun exists(path: FsPath): Boolean
fun isDirectory(path: FsPath): Boolean
fun isRegularFile(path: FsPath): Boolean
fun isSymbolicLink(path: FsPath): Boolean
@ -12,6 +14,8 @@ interface FsOperations {
fun isWritable(path: FsPath): Boolean
fun isExecutable(path: FsPath): Boolean
fun lastModified(path: FsPath): UnixTime
fun list(path: FsPath): Sequence<FsPath>
fun walk(path: FsPath): Sequence<FsPath>

View File

@ -0,0 +1,8 @@
package gay.pizza.dough.fs
interface FsProvider {
val currentWorkingDirectory: FsPath
val operations: FsOperations
fun resolve(path: String): FsPath
}

View File

@ -1,3 +1,3 @@
package gay.pizza.dough.fs
expect fun FsPath(path: String): FsPath
expect val PlatformFsProvider: FsProvider