Commit 282f9a62 authored by maximilianlohoefer's avatar maximilianlohoefer
Browse files

Added feature to parser to check for unused parameters


git-svn-id: https://svn.rwth-aachen.de/repos/sw440870_load_leveller/trunk@44 36cca2a8-63f0-4188-8a56-663e3b0d1cf3
parent 4b39c3fe
...@@ -156,18 +156,27 @@ void parser :: get_all_with_one_from_specified_array(std::string sfai, int fai, ...@@ -156,18 +156,27 @@ void parser :: get_all_with_one_from_specified_array(std::string sfai, int fai,
std::vector<std::string> parser::unused_parameters() { std::vector<std::string> parser::unused_parameters() {
std::vector<std::string> unused; std::vector<std::string> unused;
std::vector<std::string>::iterator re; std::vector<std::string>::iterator re;
bool in;
for (std::map<std::string, std::string>::iterator va = vars.begin(); va != vars.end(); ++va) { for (std::map<std::string, std::string>::iterator va = vars.begin(); va != vars.end(); ++va) {
in = false;
for (re = readVals.begin(); re != readVals.end(); ++re) { for (re = readVals.begin(); re != readVals.end(); ++re) {
if (va->first == (*re)) if (va->first == (*re)) {
in = true;
break; break;
} }
}
if (!in)
unused.push_back(va->first); unused.push_back(va->first);
} }
for (std::map<std::string, std::vector<std::string> >::iterator va = arrs.begin(); va != arrs.end(); ++va) { for (std::map<std::string, std::vector<std::string> >::iterator va = arrs.begin(); va != arrs.end(); ++va) {
in = false;
for (re = readVals.begin(); re != readVals.end(); ++re) { for (re = readVals.begin(); re != readVals.end(); ++re) {
if (va->first == (*re)) if (va->first == (*re)) {
in = true;
break; break;
} }
}
if (!in)
unused.push_back(va->first); unused.push_back(va->first);
} }
return unused; return unused;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment