taco-db  0.1.0
Public Member Functions | Private Attributes | List of all members
taco::FileCSVReader Class Reference

#include <utils/CSVReader.h>

Inheritance diagram for taco::FileCSVReader:
taco::CSVReader

Public Member Functions

 FileCSVReader (bool has_header=false, char delim=',', size_t bufsize=(size_t) 65536)
 
void FeedFile (absl::string_view filename, bool is_last_file=true)
 
bool Next (absl::string_view &field)
 
void SetSchema (const Schema *sch)
 May only be called once. More...
 
const std::vector< Datum > * NextDeserializedRecord ()
 The returned vector points to an internal buffer. More...
 
Record NextSerializedRecord ()
 The returned record points to an internal buffer. More...
 
- Public Member Functions inherited from taco::CSVReader
 CSVReader (bool has_header=false, char delim=',')
 has_header currently only has the effect of skipping the first line. More...
 
 ~CSVReader ()
 
void FeedBuffer (char *buf, size_t n)
 
bool Next (absl::string_view &field)
 
bool AtEOL () const
 
bool AtEOF () const
 
size_t GetCurLineNumber () const
 
size_t GetCurCharNumber () const
 

Private Attributes

bool m_is_last_file
 
std::unique_ptr< FSFilem_fsfile
 
size_t m_fsize
 
size_t m_nbytes_read
 
unique_malloced_ptr m_buf
 
const size_t m_bufsz
 
const Schemam_schema
 
std::vector< FunctionInfom_infuncs
 
std::vector< Datumm_data
 
maxaligned_char_buf m_recbuf
 

Constructor & Destructor Documentation

◆ FileCSVReader()

taco::FileCSVReader::FileCSVReader ( bool  has_header = false,
char  delim = ',',
size_t  bufsize = (size_t) 65536 
)

Member Function Documentation

◆ FeedFile()

void taco::FileCSVReader::FeedFile ( absl::string_view  filename,
bool  is_last_file = true 
)

◆ Next()

bool taco::FileCSVReader::Next ( absl::string_view &  field)

◆ NextDeserializedRecord()

const std::vector< Datum > * taco::FileCSVReader::NextDeserializedRecord ( )

The returned vector points to an internal buffer.

This function only returns a non-null pointer when a complete line is read.

◆ NextSerializedRecord()

Record taco::FileCSVReader::NextSerializedRecord ( )

The returned record points to an internal buffer.

◆ SetSchema()

void taco::FileCSVReader::SetSchema ( const Schema sch)

May only be called once.

Member Data Documentation

◆ m_buf

unique_malloced_ptr taco::FileCSVReader::m_buf
private

◆ m_bufsz

const size_t taco::FileCSVReader::m_bufsz
private

◆ m_data

std::vector<Datum> taco::FileCSVReader::m_data
private

◆ m_fsfile

std::unique_ptr<FSFile> taco::FileCSVReader::m_fsfile
private

◆ m_fsize

size_t taco::FileCSVReader::m_fsize
private

◆ m_infuncs

std::vector<FunctionInfo> taco::FileCSVReader::m_infuncs
private

◆ m_is_last_file

bool taco::FileCSVReader::m_is_last_file
private

◆ m_nbytes_read

size_t taco::FileCSVReader::m_nbytes_read
private

◆ m_recbuf

maxaligned_char_buf taco::FileCSVReader::m_recbuf
private

◆ m_schema

const Schema* taco::FileCSVReader::m_schema
private

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