GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgCommandExecutor.h
1 
29 #pragma once
30 
31 #include "core/module/Module.h"
32 
33 namespace GpgFrontend {
34 
35 using GpgCommandExecutorCallback = std::function<void(int, QString, QString)>;
36 using GpgCommandExecutorInteractor = std::function<void(QProcess *)>;
37 
42 class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor {
43  public:
44  struct GPGFRONTEND_CORE_EXPORT ExecuteContext {
45  QString cmd;
46  QStringList arguments;
47  GpgCommandExecutorCallback cb_func;
48  GpgCommandExecutorInteractor int_func;
49  Module::TaskRunnerPtr task_runner = nullptr;
50 
52  QString cmd, QStringList arguments,
53  GpgCommandExecutorCallback callback = [](int, const QString &,
54  const QString &) {},
55  Module::TaskRunnerPtr task_runner = nullptr,
56  GpgCommandExecutorInteractor int_func = [](QProcess *) {});
57  };
58 
59  using ExecuteContexts = QList<ExecuteContext>;
60 
67  static void ExecuteSync(ExecuteContext);
68 
69  static void ExecuteConcurrentlyAsync(ExecuteContexts);
70 
71  static void ExecuteConcurrentlySync(ExecuteContexts);
72 };
73 
74 } // namespace GpgFrontend
Extra commands related to GPG.
Definition: GpgCommandExecutor.h:42
Definition: app.cpp:39
Definition: GpgCommandExecutor.h:44