aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/importresult.h
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-05-04 10:37:47 +0000
committerIngo Klöcker <[email protected]>2022-05-04 10:37:47 +0000
commitd911a1536488a5645f257a48b4d9cf221c0ed6b6 (patch)
treec0f4f7abd6d1f1bd7fdde6de9652713368d84727 /lang/cpp/src/importresult.h
parentqt: Apply compiler hint (diff)
downloadgpgme-d911a1536488a5645f257a48b4d9cf221c0ed6b6.tar.gz
gpgme-d911a1536488a5645f257a48b4d9cf221c0ed6b6.zip
cpp: Allow merging the results of two imports
* lang/cpp/src/importresult.h, lang/cpp/src/importresult.cpp (class ImportResult): Add member function mergeWith. -- This allows creating a consolidated result of several independent imports. If the import results to merge considered the same keys, then not all counts can be consolidated correctly, but the important numbers like the number of considered keys, the number of imported keys, the number of unchanged keys and the numbers of new user IDs, subkeys, signatures and revocations should be correct. GnuPG-bug-id: 5951
Diffstat (limited to '')
-rw-r--r--lang/cpp/src/importresult.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lang/cpp/src/importresult.h b/lang/cpp/src/importresult.h
index bcd956c3..59366984 100644
--- a/lang/cpp/src/importresult.h
+++ b/lang/cpp/src/importresult.h
@@ -60,6 +60,16 @@ public:
swap(this->d, other.d);
}
+ /**
+ * Merges the result @p other into this result (and all of its copies).
+ *
+ * @note The merge algorithm assumes that @p other is the result of an
+ * import that was performed after the import of this result.
+ * @note Some numbers cannot be consolidated reliably, e.g. the number of
+ * keys without user ID.
+ */
+ void mergeWith(const ImportResult &other);
+
bool isNull() const;
int numConsidered() const;