FileSize

sealed interface FileSize(source)

Provides human-readable file size information.

Represents sizes as Bytes (in bytes, kibibytes, or mebibyte) or as Lines (a count of text lines). Use of to create the appropriate instances for a file.

Inheritors

Types

Link copied to clipboard
data class Bytes(val bytes: Long) : FileSize

Represents a file's size in bytes with automatic unit selection for display.

Link copied to clipboard
object Companion

Provides utility methods and constants for file size handling

Link copied to clipboard
data class Lines(val lines: Int) : FileSize

Represents a file's size as line count.

Functions

Link copied to clipboard
abstract fun display(): String

Returns a formatted string representation of the file size