UXCSVRow
UXCSVRow is one line of a UXCSV table: an
ordered list of fields, already unquoted.
#use <UXKit> // or #import "UXCSV.xc"Overview
Section titled “Overview”class UXCSVRow : Object { Array<UXCSVField>* fields;}
row.count(); // how many fieldsrow.field(1); // the field's text, unwrappedrow.add((u8*)"hello"); // append, boxing for youWith these three methods you never need to name
UXCSVField: field unwraps and add
boxes.
Reading one
Section titled “Reading one”for (u16 r = 0; r < rows.count(); r = r + 1) { UXCSVRow* row = (UXCSVRow* ?)rows.get(r); for (i32 c = 0; c < row.count(); c = c + 1) { Stdio.printf(" [%s]", row.field(c)); }}Fields are in file order, and the text is what the field meant: quotes stripped, doubled quotes collapsed, embedded newlines intact.
Building one to write
Section titled “Building one to write”UXCSVRow* r = new UXCSVRow();r.add((u8*)"greeting");r.add((u8*)"hello, world"); // no quoting needed hererows.add(r);Add the field’s real text, not a pre-quoted version.
serialize decides what needs quoting
and quotes it. If you quote it yourself, the file gets """hello, world""",
with the quotes as data.
Inside the toolkit, text is plain. The format’s syntax exists only in the
serialised bytes. The same rule applies to
UXJSONValue.str.
Topics
Section titled “Topics”i32 count(void)Fields in this row. 0 is possible: a blank line parses as a row with one
empty field, but a row you built and never added to has none.
u8* field(i32 i)One field’s text, unwrapped from its
UXCSVField box. No bounds check.
void add(u8* s)Append a field, boxing the string.
Fields
Section titled “Fields”fields
Section titled “fields”Array<UXCSVField>* fieldsThe boxed fields, held strongly. Never null.
Conforms to
Section titled “Conforms to”- Inherits
Object
See also
Section titled “See also”UXCSV: parse and serializeUXCSVField: the boxUXTableView: displaying rows like these