23 std::ifstream inputfile(inputfilename);
25 bool b = inputfile.is_open();
28 std::cerr <<
"Unable to open file: " << inputfilename << std::endl;
32 std::regex pattern(R
"(\((\w+): ([^)]+)\))");
36 while (std::getline(inputfile, line))
38 auto textBegin = std::sregex_iterator(line.begin(), line.end(), pattern);
39 auto textEnd = std::sregex_iterator();
42 for (std::sregex_iterator i = textBegin; i != textEnd; ++i)
44 std::smatch match = *i;
45 std::string attribute = match[1];
46 std::string value = match[2];
47 std::string group_string;
48 std::string param_string;
50 if (attribute ==
"group")
54 else if (attribute ==
"name")
58 else if (attribute ==
"type")
62 else if (attribute ==
"required")
64 if (value ==
"Yes" || value ==
"yes" || value ==
"True" || value ==
"true" || value ==
"1")
67 else if (attribute ==
"units")
71 else if (attribute ==
"defaultValue")
75 else if (attribute ==
"description")
79 else if (attribute ==
"notes")
83 else if (attribute ==
"optionalVariableName")
89 std::cout <<
"Syntax error in attribute:" << attribute << std::endl;
95 std::string fully_scoped_param_name;
96 if (!group_string.empty())
98 fully_scoped_param_name = group_string + std::string(
"::") + param_string;
102 fully_scoped_param_name = param_string;