Package-level declarations

Types

Link copied to clipboard
abstract class Csv(val allRows: List<CsvRow>)

Base class for CSV data, containing all rows of the CSV file.

Link copied to clipboard
Link copied to clipboard
data class CsvColumn(val index: Int, val name: String)

Represents a column in a CsvHeaderRow of a CSV file.

Link copied to clipboard
Link copied to clipboard
typealias CsvDataRow = List<String>

Represents a data row in a CSV file, excluding the header row.

Link copied to clipboard
Link copied to clipboard
annotation class CsvDsl
Link copied to clipboard
data class CsvHeaderRow(columns: List<CsvColumn>) : List<CsvColumn>

Represents the header row of a CSV file, containing column definitions.

Link copied to clipboard
data class CsvNoHeader(val data: List<CsvDataRow>) : Csv

Represents CSV data without a header row.

Link copied to clipboard
typealias CsvRow = List<String>

Represents a single row in a CSV file as a list of string values.

Link copied to clipboard
data class CsvWithHeader(val header: CsvHeaderRow, val data: List<CsvDataRow>) : Csv

Represents CSV data with a header row.

Link copied to clipboard

Specifies the line separator used in CSV output.

Functions

Link copied to clipboard
inline fun buildCsv(block: CsvBuilder.() -> Unit): Csv
Link copied to clipboard
operator fun CsvDataRow.get(column: CsvColumn): String

Same as getOrEmpty

Link copied to clipboard
inline fun CsvDataRow.getOrElse(column: CsvColumn, defaultValue: (CsvColumn) -> String): String

Returns the value from this row for the given column, or computes a default value if not present.

Link copied to clipboard

Returns the value from this row for the given column, or an empty string if not present.

Link copied to clipboard

Returns the value from this row for the given column, or null if the index is out of bounds.

Link copied to clipboard
inline fun CsvDataRow.mapValueOf(column: CsvColumn, transform: (String) -> String): List<String>

Applies transform to the value at the given column, returning a new list with the transformed value.