some more TODOs resolved
This commit is contained in:
@@ -18,27 +18,27 @@ namespace usql {
|
||||
}
|
||||
|
||||
|
||||
int CsvReader::parseCSV(const std::string &filename, std::vector<ColDefNode> &cols_def, Table& table) {
|
||||
int CsvReader::parseCSV(const std::string &filename, std::vector<ColDefNode> &cols_def, Table &table) {
|
||||
|
||||
std::vector<ColDefNode> cdefs;
|
||||
cdefs.reserve(cols_def.size());
|
||||
for(auto & cd : cols_def) {
|
||||
for (auto &cd : cols_def) {
|
||||
cdefs.emplace_back(table.get_column_def(cd.name));
|
||||
}
|
||||
|
||||
int row_cnt = 0;
|
||||
bool inQuote(false);
|
||||
std::string field;
|
||||
std::string csvSource;
|
||||
int row_cnt = 0;
|
||||
bool inQuote(false);
|
||||
std::string field;
|
||||
std::string csvSource;
|
||||
|
||||
std::vector<std::string> line;
|
||||
line.reserve(32);
|
||||
|
||||
std::fstream newfile;
|
||||
newfile.open(filename, std::ios::in);
|
||||
/// if (newfile.is_open()){ //checking whether the file is open
|
||||
/// if (newfile.is_open()){ //checking whether the file is open
|
||||
|
||||
while(getline(newfile, csvSource)){
|
||||
while (getline(newfile, csvSource)) {
|
||||
if (skip_header && !header_skiped) {
|
||||
header_skiped = true;
|
||||
continue;
|
||||
@@ -69,13 +69,13 @@ namespace usql {
|
||||
|
||||
field.clear();
|
||||
line.clear();
|
||||
|
||||
// DEBUG if (row_cnt > 1000) break;
|
||||
}
|
||||
|
||||
newfile.close();
|
||||
newfile.close();
|
||||
|
||||
return row_cnt;
|
||||
}
|
||||
}
|
||||
|
||||
int CsvReader::parseCSV2(const std::string &csvSource, std::vector<ColDefNode> &cols_def, Table& table) {
|
||||
int row_cnt = 0;
|
||||
|
||||
Reference in New Issue
Block a user