pulsatrix
Loading...
Searching...
No Matches
csv_reader.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <string>
8#include <vector>
9
10namespace pulsatrix {
11
13struct CsvTable {
14 std::vector<std::string> header; // empty if the file has no header row
15 std::vector<std::vector<std::string>> rows; // raw string cells, one vector per row
16};
17
28class CsvReader {
29public:
41 [[nodiscard]] static CsvTable Load(const std::string& path, bool has_header = true);
42};
43
44} // namespace pulsatrix
Minimal RFC-4180-ish CSV parser: comma-delimited, double-quote-quoted fields, "" as an escaped quote,...
Definition csv_reader.hpp:28
static CsvTable Load(const std::string &path, bool has_header=true)
Definition acquisition_functions.hpp:16
One parsed CSV file's contents: raw string cells, row-major, plus an optional header.
Definition csv_reader.hpp:13
std::vector< std::string > header
Definition csv_reader.hpp:14
std::vector< std::vector< std::string > > rows
Definition csv_reader.hpp:15