argument parser: Add public accessor for callback
This commit is contained in:
parent
4011040e57
commit
6933b7b33e
|
@ -191,6 +191,7 @@ public:
|
||||||
void setImplicit(bool value);
|
void setImplicit(bool value);
|
||||||
bool denotesOperation() const;
|
bool denotesOperation() const;
|
||||||
void setDenotesOperation(bool denotesOperation);
|
void setDenotesOperation(bool denotesOperation);
|
||||||
|
const CallbackFunction &callback() const;
|
||||||
void setCallback(CallbackFunction callback);
|
void setCallback(CallbackFunction callback);
|
||||||
void printInfo(std::ostream &os, unsigned char indentation = 0) const;
|
void printInfo(std::ostream &os, unsigned char indentation = 0) const;
|
||||||
const ArgumentVector &subArguments() const;
|
const ArgumentVector &subArguments() const;
|
||||||
|
@ -649,10 +650,20 @@ inline void Argument::setDenotesOperation(bool denotesOperation)
|
||||||
m_denotesOperation = denotesOperation;
|
m_denotesOperation = denotesOperation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Returns the assigned callback function.
|
||||||
|
* \sa setCallback()
|
||||||
|
*/
|
||||||
|
inline const Argument::CallbackFunction &Argument::callback() const
|
||||||
|
{
|
||||||
|
return m_callbackFunction;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Sets a \a callback function which will be called by the parser if
|
* \brief Sets a \a callback function which will be called by the parser if
|
||||||
* the argument could be found and no parsing errors occured.
|
* the argument could be found and no parsing errors occured.
|
||||||
* \remarks The \a callback will be called for each occurrence of the argument.
|
* \remarks The \a callback will be called for each occurrence of the argument.
|
||||||
|
* \sa callback()
|
||||||
*/
|
*/
|
||||||
inline void Argument::setCallback(Argument::CallbackFunction callback)
|
inline void Argument::setCallback(Argument::CallbackFunction callback)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue