# GpgFrontend Project: src/core/function/gpg/GpgCommandExecutor.h Source File

GpgCommandExecutor.h
#ifndef GPGFRONTEND_ZH_CN_TS_GPGCOMMANDEXECUTOR_H
#define GPGFRONTEND_ZH_CN_TS_GPGCOMMANDEXECUTOR_H
#ifndef WINDOWS
#include <boost/process.hpp>
#endif
#include "core/GpgContext.h"
#include "core/GpgFunctionObject.h"
#include "core/thread/Task.h"
namespace GpgFrontend {
class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor
: public SingletonFunctionObject<GpgCommandExecutor> {
public:
explicit GpgCommandExecutor(
int channel = SingletonFunctionObject::GetDefaultChannel());
void Execute(
std::string cmd, std::vector<std::string> arguments,
std::function<void(int, std::string, std::string)> callback =
[](int, std::string, std::string) {},
std::function<void(QProcess *)> interact_func = [](QProcess *) {});
void ExecuteConcurrently(
std::string cmd, std::vector<std::string> arguments,
std::function<void(int, std::string, std::string)> callback,
std::function<void(QProcess *)> interact_func = [](QProcess *) {});
private:
GpgContext &ctx_ = GpgContext::GetInstance(
SingletonFunctionObject::GetChannel());
};
} // namespace GpgFrontend
#endif // GPGFRONTEND_ZH_CN_TS_GPGCOMMANDEXECUTOR_H
GpgFrontend::GpgCommandExecutor
Extra commands related to GPG.
Definition: GpgCommandExecutor.h:47
GpgFrontend::GpgContext
Definition: GpgContext.h:64
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:150
GpgFrontend::SingletonFunctionObject::GetDefaultChannel
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:251
GpgFrontend::SingletonFunctionObject< GpgContext >::GetInstance
static GpgContext & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:172
GpgFrontend::SingletonFunctionObject::GetChannel
int GetChannel() const
Get the Channel object.
Definition: GpgFunctionObject.h:258
GpgFrontend
Definition: CoreCommonUtil.cpp:31