cgv
Loading...
Searching...
No Matches
cgv::utils::csv_reader_base Class Reference

base class of csv parser responsible for splitting file into lines and tokens More...

#include <csv_reader.h>

Inheritance diagram for cgv::utils::csv_reader_base:
cgv::utils::csv_matrix_reader cgv::utils::csv_reader< T >

Public Member Functions

bool fail () const
 

Protected Member Functions

const char * get_ws () const
 
const char * get_sep () const
 
bool has_heading () const
 
bool find_column_index (const std::string &col_name, size_t &col_index) const
 
 csv_reader_base (const std::string &file_name, CSV_Flags _flags=CSV_DEFAULT)
 
bool parse_next_line (std::vector< cgv::utils::token > &tokens) const
 

Protected Attributes

std::string last_error
 
bool failed = false
 
size_t li = 0
 
size_t nr_cols = 0
 
CSV_Flags flags
 
std::string content
 
std::vector< std::string > col_names
 
std::vector< cgv::utils::linelines
 

Detailed Description

base class of csv parser responsible for splitting file into lines and tokens

Definition at line 27 of file csv_reader.h.

Constructor & Destructor Documentation

◆ csv_reader_base()

cgv::utils::csv_reader_base::csv_reader_base ( const std::string &  file_name,
CSV_Flags  _flags = CSV_DEFAULT 
)
protected

Definition at line 40 of file csv_reader.cxx.

Member Function Documentation

◆ fail()

bool cgv::utils::csv_reader_base::fail ( ) const

Definition at line 28 of file csv_reader.cxx.

◆ find_column_index()

bool cgv::utils::csv_reader_base::find_column_index ( const std::string &  col_name,
size_t &  col_index 
) const
protected

Definition at line 32 of file csv_reader.cxx.

◆ get_sep()

const char * cgv::utils::csv_reader_base::get_sep ( ) const
protected

Definition at line 11 of file csv_reader.cxx.

◆ get_ws()

const char * cgv::utils::csv_reader_base::get_ws ( ) const
protected

Definition at line 7 of file csv_reader.cxx.

◆ has_heading()

bool cgv::utils::csv_reader_base::has_heading ( ) const
protected

Definition at line 24 of file csv_reader.cxx.

◆ parse_next_line()

bool cgv::utils::csv_reader_base::parse_next_line ( std::vector< cgv::utils::token > &  tokens) const
protected

Definition at line 69 of file csv_reader.cxx.

Member Data Documentation

◆ col_names

std::vector<std::string> cgv::utils::csv_reader_base::col_names
protected

Definition at line 37 of file csv_reader.h.

◆ content

std::string cgv::utils::csv_reader_base::content
protected

Definition at line 36 of file csv_reader.h.

◆ failed

bool cgv::utils::csv_reader_base::failed = false
mutableprotected

Definition at line 31 of file csv_reader.h.

◆ flags

CSV_Flags cgv::utils::csv_reader_base::flags
protected

Definition at line 35 of file csv_reader.h.

◆ last_error

std::string cgv::utils::csv_reader_base::last_error
mutableprotected

Definition at line 30 of file csv_reader.h.

◆ li

size_t cgv::utils::csv_reader_base::li = 0
mutableprotected

Definition at line 32 of file csv_reader.h.

◆ lines

std::vector<cgv::utils::line> cgv::utils::csv_reader_base::lines
protected

Definition at line 38 of file csv_reader.h.

◆ nr_cols

size_t cgv::utils::csv_reader_base::nr_cols = 0
mutableprotected

Definition at line 33 of file csv_reader.h.


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