Added missing documentation to the source code in the Playdate bindings target.
CI / Build & test (macOS) (push) Has been cancelled
CI / Embedded Swift cross-compile (push) Has been cancelled
Documentation / deploy (push) Has been cancelled

This commit is contained in:
2026-07-25 12:55:53 +02:00
parent b435a6e8bd
commit 91783deb7b
63 changed files with 259 additions and 3 deletions
@@ -1,8 +1,11 @@
extension File {
/// The origin used by `Handle.seek(to:from:)`.
public enum SeekOrigin: Int32, Sendable {
/// Relative to the beginning of the file.
case start = 0
/// Relative to the current offset.
case current = 1
/// Relative to the end of the file.
case end = 2
}
}
+4
View File
@@ -1,5 +1,6 @@
internal import CPlaydate
/// The cached `playdate->file` C API table.
var fileAPI: UnsafePointer<playdate_file> { Playdate.fileAPI.unsafelyUnwrapped }
/// The most recent file system error as a thrown error.
@@ -8,6 +9,9 @@ func lastFileError() -> PlaydateError {
}
/// The file API: access to the game's Data directory and pdx contents.
///
/// Paths are relative to the game's Data directory (read/write) or the
/// game's pdx (read-only), depending on the mode used to open them.
public enum File {}
extension File {
@@ -1,8 +1,11 @@
extension File {
/// Information about a file or directory, mirroring `FileStat`.
public struct Stat: Sendable {
/// Whether the path is a directory.
public let isDirectory: Bool
/// The file's size, in bytes.
public let size: UInt32
/// The time the file was last modified.
public let modified: System.DateTime
}
}