PartialCsvParser  0.1.2
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Public Member Functions | List of all members
PCP::CsvConfig Class Reference

Parses CSV file. More...

#include <PartialCsvParser.hpp>

Inheritance diagram for PCP::CsvConfig:
PCP::Memory::CsvConfig

Public Member Functions

 CsvConfig (const char *const filepath, bool has_header_line=true, char field_terminator= ',', char line_terminator= '\n') throw (PCPError)
 Constructor. More...
 
 ~CsvConfig ()
 
- Public Member Functions inherited from PCP::Memory::CsvConfig
 CsvConfig (const char *const str_with_null_terminator, bool has_header_line=true, char field_terminator= ',', char line_terminator= '\n', bool _lazy_initialization=false)
 Constructor to parse CSV from null-terminated C string. More...
 
 CsvConfig (size_t str_length, const char *const str, bool has_header_line=true, char field_terminator= ',', char line_terminator= '\n')
 Constructor to parse CSV from string with length. More...
 
size_t filesize () const
 Return the size of CSV from file. More...
 
const char *const content () const
 Return the pointer of CSV content. More...
 
size_t get_n_columns () const
 Return the number of columns in first line. More...
 
size_t body_offset () const
 Return the offset where CSV body (excluding header line) starts from. More...
 
std::vector< std::string > get_headers () const
 Return header string array. More...
 
const char get_field_terminator () const
 Return a character to separate columns. More...
 
const char get_line_terminator () const
 Return a character to separate rows. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PCP::Memory::CsvConfig
void init ()
 
- Protected Attributes inherited from PCP::Memory::CsvConfig
const bool has_header_line
 
const char field_terminator
 
const char line_terminator
 
size_t csv_size
 
const char * csv_text
 
std::vector< std::string > headers
 
size_t header_length
 
size_t n_columns
 

Detailed Description

Parses CSV file.

Constructor & Destructor Documentation

PCP::CsvConfig::CsvConfig ( const char *const  filepath,
bool  has_header_line = true,
char  field_terminator = ',',
char  line_terminator = '\n' 
)
throw (PCPError
)
inline

Constructor.

Parameters
filepathPath to CSV file to read.
has_header_lineIf CSV file has header at first line, set true.
field_terminatorCharacter to separate columns. For UTF-8 compatibility, only 0 ~ 127 are allowed.
line_terminatorCharacter to separate rows. For UTF-8 compatibility, only 0 ~ 127 are allowed.
PCP::CsvConfig::~CsvConfig ( )
inlinevirtual

Reimplemented from PCP::Memory::CsvConfig.


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