Remove findArg

This commit is contained in:
Martchus 2016-07-17 01:27:42 +02:00
parent 23346e1a8e
commit a3e9174476
2 changed files with 0 additions and 29 deletions

View File

@ -354,33 +354,6 @@ void ArgumentParser::printHelp(ostream &os) const
}
}
/*!
* \brief Returns the first argument definition which matches the predicate.
*
* The search includes all assigned main argument definitions and their sub arguments.
*/
Argument *ArgumentParser::findArg(const ArgumentPredicate &predicate) const
{
return findArg(m_mainArgs, predicate);
}
/*!
* \brief Returns the first argument definition which matches the predicate.
*
* The search includes all provided \a arguments and their sub arguments.
*/
Argument *ArgumentParser::findArg(const ArgumentVector &arguments, const ArgumentPredicate &predicate)
{
for(Argument *arg : arguments) {
if(predicate(arg)) {
return arg; // argument matches
} else if(Argument *subarg = findArg(arg->subArguments(), predicate)) {
return subarg; // a secondary argument matches
}
}
return nullptr; // no argument matches
}
/*!
* \brief Parses the specified command line arguments.
* \remarks

View File

@ -208,8 +208,6 @@ public:
void setMainArguments(const ArgumentInitializerList &mainArguments);
void addMainArgument(Argument *argument);
void printHelp(std::ostream &os) const;
Argument *findArg(const ArgumentPredicate &predicate) const;
static Argument *findArg(const ArgumentVector &arguments, const ArgumentPredicate &predicate);
void parseArgs(int argc, const char *const *argv);
unsigned int actualArgumentCount() const;
const char *executable() const;