return false;
}
vector<string> parts;
- vector<string>::const_iterator i;
stringtok( parts, param->second, ", \t" );
- for( i = parts.begin(); i != parts.end(); ++i ) {
- if( *i == val ) {
+ for (const auto& part: parts) {
+ if (part == val) {
return true;
}
}
prefix="";
string help;
-
- for(map<string,string>::const_iterator i=helpmap.begin();
- i!=helpmap.end();
- ++i)
- {
- if(!prefix.empty() && i->first.find(prefix) != 0) // only print items with prefix
- continue;
+
+ for (const auto& i: helpmap) {
+ if(!prefix.empty() && i.first.find(prefix) != 0) // only print items with prefix
+ continue;
help+=" --";
- help+=i->first;
+ help+=i.first;
- string type=d_typeMap[i->first];
+ string type=d_typeMap[i.first];
if(type=="Parameter")
help+="=...";
else if(type=="Switch")
{
- help+=" | --"+i->first+"=yes";
- help+=" | --"+i->first+"=no";
+ help+=" | --"+i.first+"=yes";
+ help+=" | --"+i.first+"=no";
}
help+="\n\t";
- help+=i->second;
+ help+=i.second;
help+="\n";
}
else
help="# Autogenerated configuration file template\n";
- for(map<string,string>::const_iterator i=helpmap.begin(); i!=helpmap.end(); ++i) {
- if(d_typeMap[i->first]=="Command")
+ for(const auto& i: helpmap) {
+ if(d_typeMap[i.first]=="Command")
continue;
help+="#################################\n";
help+="# ";
- help+=i->first;
+ help+=i.first;
help+="\t";
- help+=i->second;
+ help+=i.second;
help+="\n#\n";
if (current) {
- help+=i->first+"="+params[i->first]+"\n\n";
+ help+=i.first+"="+params[i.first]+"\n\n";
} else {
- help+="# "+i->first+"="+params[i->first]+"\n\n";
+ help+="# "+i.first+"="+params[i.first]+"\n\n";
}
}
return help;