37 static std::vector<std::ctype_base::mask>
38 rc(table_size, std::ctype_base::mask());
40 rc[
'\n'] = std::ctype_base::space;
41 rc[
'\r'] = std::ctype_base::space;
42 rc[
','] = std::ctype_base::space;
43 rc[
' '] = std::ctype_base::space;
44 rc[
';'] = std::ctype_base::space;
45 rc[
'\t'] = std::ctype_base::space;
57 static std::vector<T>
get_data(std::string filepath)
59 std::vector<T> result;
62 std::ifstream inputfile;
63 inputfile.open(filepath);
64 if(inputfile.is_open())
66 std::string firstline;
67 std::getline(inputfile,firstline);
71 while(inputfile >> value)
73 result.push_back(value);
78 std::cerr <<
"ERROR opening csv file " << filepath <<
'\n';
82 catch(
const std::exception& e)
84 std::cerr <<
"ERROR processing csv file " << filepath <<
'\n' << e.what() <<
'\n';
static std::vector< T > get_data(std::string filepath)
A simple csv reader function which just gets all data T from a file as a vector of T,...
Definition: csv_reader.h:57
Definition: areaofeffectconverter.h:20
a helper construct to facilitate reading csv files
Definition: csv_reader.h:32
csv_reader_facet()
Definition: csv_reader.h:34
static std::ctype_base::mask const * get_table()
Definition: csv_reader.h:36