| 6 | namespace duckdb { |
| 7 | |
| 8 | bool SQLLogicParser::OpenFile(const string &path) { |
| 9 | this->file_name = path; |
| 10 | |
| 11 | std::ifstream infile(file_name); |
| 12 | if (infile.bad() || infile.fail()) { |
| 13 | return false; |
| 14 | } |
| 15 | |
| 16 | string line; |
| 17 | while (std::getline(infile, line)) { |
| 18 | lines.push_back(StringUtil::Replace(line, "\r", "")); |
| 19 | } |
| 20 | return !infile.bad(); |
| 21 | } |
| 22 | |
| 23 | bool SQLLogicParser::EmptyOrComment(const string &line) { |
| 24 | return line.empty() || StringUtil::StartsWith(line, "#"); |