csvpp 1.2.0
CSV parsing / writing libraries
|
A dynamic array of strings. More...
Typedefs | |
typedef struct CSV_row | CSV_row |
Functions | |
CSV_row * | CSV_row_init (void) |
Create a new CSV_row. | |
void | CSV_row_free (CSV_row *rec) |
Free a CSV_row. | |
void | CSV_row_append (CSV_row *rec, char *field) |
Append a new field. | |
size_t | CSV_row_size (const CSV_row *rec) |
Get CSV_Record array size. | |
const char * | CSV_row_get (const CSV_row *rec, size_t i) |
CSV_row array element access. | |
CSV_status | CSV_row_read_v (CSV_row *rec,...) |
Reads fields into variadic arguments. | |
const char *const * | CSV_row_arr (const CSV_row *rec) |
CSV_row array access. | |
A dynamic array of strings.
Used as input to CSV_writer_write_row() and output from CSV_reader_read_row()
void CSV_row_append | ( | CSV_row * | rec, |
char * | field ) |
Append a new field.
field | String to append to the array. rec will take ownership of the field and will free it when CSV_row_free() is called on it |
const char *const * CSV_row_arr | ( | const CSV_row * | rec | ) |
CSV_row array access.
char *
array within CSV_row (read only). May be useful for passing to other libraries void CSV_row_free | ( | CSV_row * | rec | ) |
Free a CSV_row.
Will also free all strings added by CSV_row_append()
const char * CSV_row_get | ( | const CSV_row * | rec, |
size_t | i ) |
CSV_row array element access.
i | index to access |
i
(read-only - use CSV_strdup if you need a permanent copy) CSV_row * CSV_row_init | ( | void | ) |
Create a new CSV_row.
CSV_status CSV_row_read_v | ( | CSV_row * | rec, |
... ) |
Reads fields into variadic arguments.
[out] | ... | char** variables to read into(read only). Last argument must be NULL If more parameters are passed than there are fields in the row, the remaining parameters will be set to NULL. Fewer parameters than contained in the row may be passed, resulting in only the first fields being copied The char *'s written out are owned by the CSV_row object, and shouldn't be freed |
size_t CSV_row_size | ( | const CSV_row * | rec | ) |
Get CSV_Record array size.