aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/function/GpgKeyImportExporter.h
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-12-25 01:54:57 +0000
committerSaturneric <[email protected]>2021-12-25 01:54:57 +0000
commitb5cd5eac82b6bbd8a00fb39c045d473d6517b5f4 (patch)
treef8ce246cb98222a24b8f59640d48a633464d333b /src/gpg/function/GpgKeyImportExporter.h
parentContinue to add Standalone Support. (diff)
downloadGpgFrontend-b5cd5eac82b6bbd8a00fb39c045d473d6517b5f4.tar.gz
GpgFrontend-b5cd5eac82b6bbd8a00fb39c045d473d6517b5f4.zip
<refactor, test>(core, test): core improved and test gpg alone mode
1. let modules known their channels. 2. let factory create a channel. 3. reduce dumplicate code. 4. add type check for function object. 5. test gpg alone mode. 6. remove some asserts. 7. rename importexportor to importexporter. 8. move args in gpg context constructor to a struct.
Diffstat (limited to '')
-rw-r--r--src/gpg/function/GpgKeyImportExporter.h (renamed from src/gpg/function/GpgKeyImportExportor.h)10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gpg/function/GpgKeyImportExportor.h b/src/gpg/function/GpgKeyImportExporter.h
index ad43d539..b6c91303 100644
--- a/src/gpg/function/GpgKeyImportExportor.h
+++ b/src/gpg/function/GpgKeyImportExporter.h
@@ -79,9 +79,13 @@ class GpgImportInformation {
GpgImportedKeyList importedKeys;
};
-class GpgKeyImportExportor
- : public SingletonFunctionObject<GpgKeyImportExportor> {
+class GpgKeyImportExporter
+ : public SingletonFunctionObject<GpgKeyImportExporter> {
public:
+ explicit GpgKeyImportExporter(
+ int channel = SingletonFunctionObject::GetDefaultChannel())
+ : SingletonFunctionObject<GpgKeyImportExporter>(channel) {}
+
GpgImportInformation ImportKey(StdBypeArrayPtr inBuffer);
bool ExportKeys(KeyIdArgsListPtr& uid_list, ByteArrayPtr& out_buffer) const;
@@ -99,7 +103,7 @@ class GpgKeyImportExportor
private:
GpgContext& ctx =
- GpgContext::GetInstance(SingletonFunctionObject::GetDefaultChannel());
+ GpgContext::GetInstance(SingletonFunctionObject::GetChannel());
};
} // namespace GpgFrontend