/* and finally terminate execution when finish */
int terminate(bpContext *ctx, bool raise_error = true);
- inline POOL_MEM &get_error() noexcept { return m_errmsg; }
- inline char *get_error_str() noexcept { return m_errmsg.c_str(); }
+ inline POOL_MEM &get_error() { return m_errmsg; }
+ inline char *get_error_str() { return m_errmsg.c_str(); }
/* direct pipe management */
inline int close_wpipe() { return ::close_wpipe(bpipe); }
int m_listing_top_nr; ///
int m_listing_func; ///
- virtual bRC parse_plugin_config(bpContext *ctx, restore_object_pkt *rop) { return bRC_OK; }
+ virtual bRC parse_plugin_config(bpContext *ctx, restore_object_pkt *rop);
virtual bRC parse_plugin_command(bpContext *ctx, const char *command);
virtual bRC parse_plugin_restore_object(bpContext *ctx, restore_object_pkt *rop);
+ virtual bRC handle_plugin_config(bpContext *ctx, restore_object_pkt *rop) { return bRC_OK; }
virtual bRC handle_plugin_restore_object(bpContext *ctx, restore_object_pkt *rop) { return bRC_OK; }
virtual bRC prepare_estimate(bpContext *ctx, char *command) { return bRC_OK; }
virtual bRC perform_end_restore_file(bpContext *ctx) { return bRC_OK; }
virtual bRC perform_cancel_command(bpContext *ctx) { return bRC_OK; }
- virtual const char **get_listing_top_struct() noexcept { return NULL; }
+ virtual const char **get_listing_top_struct() { return NULL; }
virtual void pluginctx_switch_command(const char *command) {}
+ virtual bool pluginctx_check_command(const char *command) { return false; }
+ virtual bool pluginctx_are_parameters_parsed() const { return false; }
+ virtual void pluginctx_set_parameters_parsed() {}
virtual void pluginctx_clear_abort_on_error() {}
virtual void pluginctx_set_abort_on_error() {}
virtual bRC pluginctx_parse_parameter(bpContext *ctx, const char *argk, const char *argv) { return bRC_Error; }
COMMCTX<CTX> pluginctx; /// the current plugin execution context
virtual void pluginctx_switch_command(const char *command) { pluginctx.switch_command(command); }
+ virtual bool pluginctx_check_command(const char *command) { return pluginctx.check_command(command); }
+ virtual bool pluginctx_are_parameters_parsed() { return pluginctx->are_parameters_parsed(); }
+ virtual void pluginctx_set_parameters_parsed() { pluginctx->set_parameters_parsed(); }
virtual void pluginctx_clear_abort_on_error() { pluginctx->clear_abort_on_error(); }
virtual void pluginctx_set_abort_on_error() { pluginctx->set_abort_on_error(); }
virtual bRC pluginctx_parse_parameter(bpContext *ctx, const char *argk, const char *argv) { return pluginctx->parse_parameter(ctx, argk, argv); }
f_fatal(false),
abort_on_error(false),
f_debug(false),
+ m_parameters_parsed(false),
ini(),
preg()
{ pm_strcpy(cmd, command); }
* @return true when is error
* @return false when no error
*/
- inline bool is_error() { return f_error || f_fatal; }
+ inline bool is_error() const { return f_error || f_fatal; }
/**
* @brief Checks if plugin context operation is flagged on f_fatal.
* @return true when is fatal error
* @return false when no fatal error
*/
- inline bool is_fatal() { return f_fatal || (f_error && abort_on_error); }
+ inline bool is_fatal() const { return f_fatal || (f_error && abort_on_error); }
/**
* @brief Return a Job Message error level based on context
*
* @return int
*/
- inline int jmsg_err_level() { return is_fatal() ? M_FATAL : M_ERROR; }
+ inline int jmsg_err_level() const { return is_fatal() ? M_FATAL : M_ERROR; }
/**
* @brief Set the abort on error flag
* @return true if flag is set
* @return false if flag is not set
*/
- bool is_abort_on_error() { return abort_on_error; }
+ inline bool is_abort_on_error() const { return abort_on_error; }
+
+ inline bool are_parameters_parsed() const { return m_parameters_parsed; }
+ inline void set_parameters_parsed() { m_parameters_parsed = true; }
protected:
POOL_MEM cmd; /// plugin command for this context
bool f_fatal; /// the plugin signaled a fatal error
bool abort_on_error; /// abort on error flag
bool f_debug; /// when additional debugging required
+ bool m_parameters_parsed;
ConfigFile ini; /// Restore ini file handler
regex_t preg; /// this is a regex context for include/exclude
}
return *this;
}
+#if __cplusplus >= 201104
// This is a simple move operator
inline smart_alist<T> &operator=(smart_alist<T> &&other)
{
}
return *this;
}
+#endif
};
#endif /* _SMARTALIST_H_ */