import ddn.data.csv;
FieldView a; a.data = "42";
auto ia = fromCsv!int(a);
assert(ia.isOk && ia.value == 42);
FieldView b; b.data = "3.14";
auto db = fromCsv!double(b);
assert(db.isOk && db.value > 3.0 && db.value < 3.2);
FieldView c; c.data = "TRUE";
auto bc = fromCsv!bool(c);
assert(bc.isOk && bc.value);fromCsv
Convert a FieldView to the requested type T lazily, without allocations.
Supported targets:
- Integral types (e.g.,
int,long,ubyte, ...) - Floating point types (
float,double,real) — decimal with optional exponent bool— acceptstrue/false(case-insensitive) and1/0enumtypes — by name (exact, case-sensitive) or by numeric value of the base type
On success returns CsvResult!T with isOk == true. On failure returns CsvResult!T with err.code == CsvErrorCode.INVALID_CONVERSION.