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"
namespace GpgFrontend {
class GPGFRONTEND_CORE_EXPORT GpgCommandExecutor
: public SingletonFunctionObject<GpgCommandExecutor> {
public:
explicit GpgCommandExecutor(
int channel = SingletonFunctionObject::GetDefaultChannel());
#ifndef WINDOWS
void Execute(StringArgsRef arguments,
const std::function<void(boost::process::async_pipe &in,
boost::process::async_pipe &out)>
&interact_func);
#endif
private:
GpgContext &ctx_ = GpgContext::GetInstance(
SingletonFunctionObject::GetChannel());
};
} // namespace GpgFrontend
#endif // GPGFRONTEND_ZH_CN_TS_GPGCOMMANDEXECUTOR_H
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:148
GpgFrontend::GpgCommandExecutor
Extra commands related to GPG.
Definition: GpgCommandExecutor.h:45
GpgFrontend
Definition: CoreCommonUtil.cpp:29
GpgFrontend::SingletonFunctionObject< GpgContext >::GetInstance
static GpgContext & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:170
GpgFrontend::SingletonFunctionObject::GetChannel
int GetChannel() const
Get the Channel object.
Definition: GpgFunctionObject.h:239
GpgFrontend::GpgContext
Definition: GpgContext.h:59
GpgFrontend::GpgCommandExecutor::GpgCommandExecutor
GpgCommandExecutor(int channel=SingletonFunctionObject::GetDefaultChannel())
Construct a new Gpg Command Executor object.
Definition: GpgCommandExecutor.cpp:30
GpgFrontend::SingletonFunctionObject::GetDefaultChannel
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:232
GpgFrontend::GpgCommandExecutor::Execute
void Execute(StringArgsRef arguments, const std::function< void(boost::process::async_pipe &in, boost::process::async_pipe &out)> &interact_func)
Excuting an order.
Definition: GpgCommandExecutor.cpp:41