CSV::Table< Record > Class Template Reference

Class template for accessing CSV file as set of records. More...

#include <Table.h>

Inheritance diagram for CSV::Table< Record >:
Collaboration diagram for CSV::Table< Record >:

Classes

class  Iterator
 

Public Member Functions

Record next ()
 Fetch next record. More...
 
Iterator begin ()
 
Iterator end ()
 
 Reader (IDataSourceStream *source, const Options &options, const CStringArray &headings=nullptr)
 Construct a CSV reader. More...
 
 Reader (IDataSourceStream *source, char fieldSeparator=',', const CStringArray &headings=nullptr, uint16_t maxLineLength=2048)
 Construct a CSV reader. More...
 
- Public Member Functions inherited from CSV::Reader
 Reader (IDataSourceStream *source, const Options &options, const CStringArray &headings=nullptr)
 Construct a CSV reader. More...
 
 Reader (IDataSourceStream *source, char fieldSeparator=',', const CStringArray &headings=nullptr, uint16_t maxLineLength=2048)
 Construct a CSV reader. More...
 
void reset ()
 Reset reader to start of CSV file. More...
 
bool next ()
 Seek to next record. More...
 
unsigned count () const
 Get number of columns. More...
 
const char * getValue (unsigned index) const
 Get a value from the current row. More...
 
const char * getValue (const char *name) const
 Get a value from the current row. More...
 
int getColumn (const char *name) const
 Get index of column given its name. More...
 
 operator bool () const
 Determine if reader is valid. More...
 
const CStringArraygetHeadings () const
 Get headings. More...
 
bool seek (int offset)
 Set reader to previously noted position. More...
 
bool seek (const Cursor &cursor)
 
const CStringArraygetRow () const
 Get current row. More...
 
const CursorgetCursor () const
 Get cursor position for current row. More...
 
int tell () const
 Get cursor position for current row. More...
 

Detailed Description

template<class Record = Record>
class CSV::Table< Record >

Class template for accessing CSV file as set of records.

Template Parameters
RecordClass inherited from Record

Member Function Documentation

◆ begin()

template<class Record = Record>
Iterator CSV::Table< Record >::begin ( )
inline

◆ end()

template<class Record = Record>
Iterator CSV::Table< Record >::end ( )
inline

◆ next()

template<class Record = Record>
Record CSV::Table< Record >::next ( )
inline

Fetch next record.

◆ Reader() [1/2]

template<class Record = Record>
CSV::Reader::Reader
inline

Construct a CSV reader.

Parameters
sourceStream to read CSV text from
fieldSeparator
headingsRequired if source data does not contain field headings as first row
maxLineLengthLimit size of buffer to guard against malformed data

◆ Reader() [2/2]

template<class Record = Record>
CSV::Reader::Reader

Construct a CSV reader.

Parameters
sourceStream to read CSV text from, reader takes ownership
options
headingsRequired if source data does not contain field headings as first row

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