Function parseFileLine(std::string, const std::string&)

Function Documentation

std::vector<double> parseFileLine(std::string str, const std::string &fileName)

Parses a line from a file and converts it into a vector of double values.

It can handle data separated by a space, a comma(CSV), a semicolon(;) or a tab.

Parameters:
  • str – The string to parse.

  • fileName – The name of the file from which the string was read. Used for error reporting.

Throws:

FileContentError – if a token cannot be converted to a double.

Returns:

A vector of double values parsed from the string.