Data & serialization

data.h

Read CSV headers and rows, or convert a complete CSV document into values.

C++23 mc/data.h
#include <mc/data.h>

The parser supports quoted fields, escaped quotes, embedded line breaks, and CRLF. Row width must match the header.

Jump to a declaration · 4

Free functions & types

Functions

cCSVHeader

template<class S = CVector<cstr>, CString T> S cCSVHeader(T&& text, size_t& offset, size_t& line);

Reads a header, advances the byte offset, and updates the physical line count.

cCSVLine

template<class S, CString T> size_t cCSVLine(T&& text, size_t& offset, CVector<S>& v);

Reads a row into a destination already sized to the header width. Returns the number of physical lines consumed.

cFromCSV

template<class S, CString T> inline cvec cFromCSV(T&& text, CVector<S>& header);

Returns a vector of rows and writes the header separately. Complete numeric fields become numeric values; other fields remain strings.