diff options
Diffstat (limited to 'src/core/function/gpg/GpgCommandExecutor.h')
-rw-r--r-- | src/core/function/gpg/GpgCommandExecutor.h | 70 |
1 files changed, 66 insertions, 4 deletions
diff --git a/src/core/function/gpg/GpgCommandExecutor.h b/src/core/function/gpg/GpgCommandExecutor.h index fd2181d3..046b61e4 100644 --- a/src/core/function/gpg/GpgCommandExecutor.h +++ b/src/core/function/gpg/GpgCommandExecutor.h @@ -51,12 +51,42 @@ class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor GpgCommandExecutorInterator int_func; Module::TaskRunnerPtr task_runner = nullptr; + /** + * @brief Construct a new Execute Context object + * + */ + ExecuteContext() = default; + + /** + * @brief Construct a new Execute Context object + * + * @param cmd + * @param arguments + * @param callback + * @param task_runner + * @param int_func + */ ExecuteContext( QString cmd, QStringList arguments, GpgCommandExecutorCallback callback = [](int, const QString &, const QString &) {}, Module::TaskRunnerPtr task_runner = nullptr, GpgCommandExecutorInterator int_func = [](QProcess *) {}); + + /** + * @brief Construct a new Execute Context object + * + * @param arguments + * @param callback + * @param task_runner + * @param int_func + */ + ExecuteContext( + QStringList arguments, + GpgCommandExecutorCallback callback = [](int, const QString &, + const QString &) {}, + Module::TaskRunnerPtr task_runner = nullptr, + GpgCommandExecutorInterator int_func = [](QProcess *) {}); }; using ExecuteContexts = QContainer<ExecuteContext>; @@ -69,13 +99,45 @@ class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor * @param arguments Command parameters * @param interact_func Command answering function */ - static void ExecuteSync(ExecuteContext); + static void ExecuteSync(const ExecuteContext &); + + /** + * @brief + * + */ + static void ExecuteConcurrentlyAsync(const ExecuteContexts &); + + /** + * @brief + * + */ + static void ExecuteConcurrentlySync(const ExecuteContexts &); - static void ExecuteConcurrentlyAsync(ExecuteContexts); + /** + * @brief + * + */ + auto GpgExecuteSync(const ExecuteContext &) -> std::tuple<int, QString>; + + /** + * @brief + * + */ + auto GpgConfExecuteSync(const ExecuteContext &) -> std::tuple<int, QString>; - static void ExecuteConcurrentlySync(ExecuteContexts); + /** + * @brief + * + * @param context + */ + void GpgExecuteAsync(const ExecuteContext &); - void GpgExecuteSync(const ExecuteContext &); + /** + * @brief + * + * @param context + */ + void GpgConfExecuteAsync(const ExecuteContext &); private: GpgContext &ctx_ = |