return false;
}
vector<string> parts;
-
+
stringtok(parts, param->second, ", \t");
for (const auto& part: parts) {
if (part == val) {
{
if(prefix=="no")
prefix="";
-
+
string help;
for (const auto& i: helpmap) {
help+=" --";
help+=i.first;
-
+
string type=d_typeMap[i.first];
if(type=="Parameter")
help+=" | --"+i.first+"=yes";
help+=" | --"+i.first+"=no";
}
-
+
help+="\n\t";
help+=i.second;
return d_params[arg];
}
-mode_t ArgvMap::asMode(const string &arg)
+mode_t ArgvMap::asMode(const string &arg)
{
mode_t mode;
const char *cptr_orig;
cptr_orig = d_params[arg].c_str();
mode = static_cast<mode_t>(strtol(cptr_orig, &cptr_ret, 8));
- if (mode == 0 && cptr_ret == cptr_orig)
+ if (mode == 0 && cptr_ret == cptr_orig)
throw ArgException("'" + arg + string("' contains invalid octal mode"));
return mode;
}
return retval;
}
-bool ArgvMap::isEmpty(const string &arg)
+bool ArgvMap::isEmpty(const string &arg)
{
if(!parmIsset(arg))
return true;
cptr_orig = d_params[arg].c_str();
retval = strtod(cptr_orig, &cptr_ret);
-
+
if (retval == 0 && cptr_ret == cptr_orig)
throw ArgException("'"+arg+string("' is not valid double"));
}
else // command
d_cmds.push_back(arg);
-
+
boost::trim(var);
if(var!="" && (parseOnly.empty() || var==parseOnly)) {
while(getline(f,pline)) {
boost::trim_right(pline);
-
+
if(!pline.empty() && pline[pline.size()-1]=='\\') {
line+=pline.substr(0,pline.length()-1);
continue;