Packages

builtin
cbindgen
core
core.alloc
core.alloc.arena
core.alloc.atomic
core.alloc.fixed
core.alloc.gc
core.alloc.heap
core.alloc.log
core.alloc.memdebug
core.alloc.pool
core.alloc.ring
core.arg_parse
core.array
core.avl_tree
core.bucket_array
core.conv
core.doc
core.encoding
core.encoding.base64
core.encoding.csv
core.encoding.hex
core.encoding.json
core.encoding.kdl
core.encoding.osad
core.encoding.utf8
core.hash
core.hash.md5
core.hash.sha1
core.hash.sha256
core.heap
core.intrinsics
core.intrinsics.atomics
core.intrinsics.onyx
core.intrinsics.types
core.intrinsics.wasm
core.io
core.io.binary
core.iter
core.js
core.list
core.map
core.math
core.memory
core.misc
core.net
core.os
core.random
core.set
core.slice
core.string
core.sync
core.test
core.thread
core.time
main
runtime
runtime.info
runtime.platform
runtime.vars
simd

package core.encoding.csv

CSV
CSV :: struct (Output_Type: type_expr) {
    entries: [..] Output_Type;
}

Represents data from a CSV file of a particular type.

Methods
CSV.delete
CSV.delete :: (csv: &CSV) -> void

Frees all data in a CSV.

CSV.egress
CSV.egress :: (csv: &CSV, writer: &Writer, include_headers) -> void

Outputs data from a CSV into a Writer. When include_headers is true, the first line outputted will be the headers of the CSV, according to the CSV_Column tag information.

CSV.ingress
CSV.ingress :: (csv: &CSV, reader: &Reader, headers_present) -> bool

Ingests data from a Reader containing CSV data. Uses the type of the CSV to know what columns should be expectd.

CSV.ingress_string
CSV.ingress_string :: (csv: &CSV, contents: [] u8, headers_present) -> bool

Ingests data from a string representing CSV data. Uses the type of the CSV to know what columns should be expected. If headers_presents is true, the first line will be treated as headers, and cross checked with the CSV_Column tag information. Use this when the columns from your CSV have a different order from the order of fields in the structure.

CSV.make
CSV.make :: ($T: type_expr) -> #auto

Create and initialize a CSV with no elements.

CSV_Column
CSV_Column :: struct {
    name: [] u8;
}

Tag-type used to tell the ingress and egress methods what the column name of a particular data element should be.

Data :: struct {
    @CSV_Column.{"Actual Column Name"}
    variable_name: str;
}