insert rows as you go through csv
This commit is contained in:
15
csvreader.h
15
csvreader.h
@@ -5,6 +5,10 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <regex>
|
||||
#include <functional>
|
||||
|
||||
#include "parser.h"
|
||||
#include "table.h"
|
||||
|
||||
namespace usql {
|
||||
|
||||
@@ -20,12 +24,11 @@ namespace usql {
|
||||
bool header_skiped;
|
||||
|
||||
public:
|
||||
CsvReader(bool skip_hdr = false, char field_sep = ',', char quote_ch = '"', char line_sep = '\r',
|
||||
char line_sep2 = '\n');
|
||||
CsvReader(bool skip_hdr = true, char field_sep = ',', char quote_ch = '"', char line_sep = '\r', char line_sep2 = '\n');
|
||||
|
||||
std::vector<std::vector<std::string>> parseCSV(const std::string &csvSource);
|
||||
int parseCSV2(const std::string &csvSource, std::vector<ColDefNode> &cols_def,
|
||||
void (Table::*function)(const std::vector<ColDefNode>&, const std::vector<std::string>&), Table& a);
|
||||
|
||||
private:
|
||||
void add_line(const std::vector<std::string> &line, std::vector<std::vector<std::string>> &lines);
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user