Go to the documentation of this file.
32 int rows_count, cols_count;
39 static Stream * debug_serial;
41 bool whole_csv_supplied;
51 char * parseStringValue(
const char *,
int * chars_occupied);
52 void saveNewValue(
const char * val,
char type_specifier,
int row,
int col);
54 static int8_t getTypeSize(
char type_specifier);
55 static const char * getTypeName(
char type_specifier);
62 void supplyChunk(
const char *s);
79 CSV_Parser(
const char * s,
const char * fmt,
bool has_header=
true,
char delimiter=
',',
char quote_char=
'"');
84 CSV_Parser(
const char * s,
const char * fmt,
bool hh,
char d,
const char * qc) :
CSV_Parser(s, fmt, hh, d, qc[0]) {}
129 void print(Stream &ser = Serial);
~CSV_Parser()
Releases all dynamically allocated memory. Making values unusable once the CSV_Parser goes out of s...
Definition: CSV_Parser.cpp:34
CSV_Parser & operator<<(const char *s)
It's the same as supplyChunk(s) but allows to use operator instead of method call,...
Definition: CSV_Parser.cpp:308
void * getValues(const char *key)
Gets values given the column key name.
CSV_Parser(const char *fmt_, bool hh, char d, const char *qc)
Definition: CSV_Parser.h:88
int getRowsCount()
Excluding header (if it was part of supplied CSV).
Definition: CSV_Parser.cpp:180
void print(Stream &ser=Serial)
Prints whole parsed content including:
Definition: CSV_Parser.cpp:195
void parseLeftover()
Forces the previously supplied (but not parsed) chunks to be parsed despite not ending with "\n" or "...
Definition: CSV_Parser.cpp:321
CSV_Parser(const char *s, const char *fmt, bool has_header=true, char delimiter=',', char quote_char='"')
Definition: CSV_Parser.cpp:10
void * operator[](const char *key)
It's the same as GetValues(key) but allows to use operator instead of method call,...
Definition: CSV_Parser.cpp:183
void * getValues(int col_index)
Gets values given the column index.
Definition: CSV_Parser.h:26
int getColumnsCount()
Definition: CSV_Parser.cpp:179
CSV_Parser(const char *s, const char *fmt, bool hh, char d, const char *qc)
Additional constructor to allow supplying quote char as a string. Why? Because supplied quote char ...
Definition: CSV_Parser.h:84
CSV_Parser(const char *fmt_, bool hh=true, char d=',', char qc='"')
Constructor for supplying csv string by chunks.
Definition: CSV_Parser.h:87
void printKeys(Stream &ser=Serial)
Definition: CSV_Parser.cpp:173