comservatory
Strict validation of CSV files in C++
Loading...
Searching...
No Matches
Public Member Functions | List of all members
comservatory::FieldCreator Struct Referenceabstract

Virtual base class for a Field creator. More...

#include <Creator.hpp>

Public Member Functions

virtual Fieldcreate (Type t, size_t n, bool dummy) const =0
 

Detailed Description

Virtual base class for a Field creator.

Applications may define concrete subclasses to control how Fields are created during parsing of the CSV. This involves specializing the create() method, possibly with custom Field subclasses backed by a different memory mechanism. In this manner, developers can directly stream the CSV into their memory layout rather than going through a FilledField intermediate.

Member Function Documentation

◆ create()

virtual Field * comservatory::FieldCreator::create ( Type  t,
size_t  n,
bool  dummy 
) const
pure virtual
Parameters
tType of the field.
nNumber of existing (missing) records in the field. This should be used to specify that the first n values of the field's contents are missing.
dummyWhether to create a dummy field. This is used to create placeholders for fields that are not of interest when ReadOptions::keep_subset is set, i.e., not in ReadOptions::keep_subset_names or ReadOptions::keep_subset_indices.
Returns
An appropriate instance of a Field subclass.

The documentation for this struct was generated from the following file: