1 #ifndef CROMBIE_PLOTCONFIG_H 2 #define CROMBIE_PLOTCONFIG_H 13 namespace PlotConfig {
25 const std::string
name;
39 std::vector<Plot>
read(
const std::string& config) {
40 std::vector<Plot> output;
42 std::regex expr {
"'([^']+)',\\s*(\\d+),\\s*(-?[\\d\\.]+),\\s*(-?[\\d\\.]+),\\s*'([^']+)'(,\\s*'([^']+)',\\s*'([^']+)')?"};
45 std::ifstream
input {config};
47 if (std::regex_match(line, matches, expr)) {
48 output.push_back({matches[1],
static_cast<unsigned>(std::stoi(matches[2])),
49 std::stod(matches[3]), std::stod(matches[4]),
50 matches[5], matches[7], matches[8]});