From 6933b7b33e3671f6c82ed73f588664147f632d6e Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 16 Oct 2017 23:46:21 +0200 Subject: [PATCH] argument parser: Add public accessor for callback --- application/argumentparser.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/application/argumentparser.h b/application/argumentparser.h index b438655..00a8275 100644 --- a/application/argumentparser.h +++ b/application/argumentparser.h @@ -191,6 +191,7 @@ public: void setImplicit(bool value); bool denotesOperation() const; void setDenotesOperation(bool denotesOperation); + const CallbackFunction &callback() const; void setCallback(CallbackFunction callback); void printInfo(std::ostream &os, unsigned char indentation = 0) const; const ArgumentVector &subArguments() const; @@ -649,10 +650,20 @@ inline void Argument::setDenotesOperation(bool 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 * the argument could be found and no parsing errors occured. * \remarks The \a callback will be called for each occurrence of the argument. + * \sa callback() */ inline void Argument::setCallback(Argument::CallbackFunction callback) {