aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/model/GpgSubKey.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-11-07 09:25:13 +0000
committersaturneric <[email protected]>2023-11-07 09:25:13 +0000
commit8f633b806baec5004d99f554c4af95e427b82258 (patch)
tree430e0d0734158d89f1af27dfcbfc0fa9daefb88e /src/core/model/GpgSubKey.cpp
parentrefactor: separate typedef and impl (diff)
downloadGpgFrontend-8f633b806baec5004d99f554c4af95e427b82258.tar.gz
GpgFrontend-8f633b806baec5004d99f554c4af95e427b82258.zip
style: tidy up core/model
Diffstat (limited to 'src/core/model/GpgSubKey.cpp')
-rw-r--r--src/core/model/GpgSubKey.cpp79
1 files changed, 38 insertions, 41 deletions
diff --git a/src/core/model/GpgSubKey.cpp b/src/core/model/GpgSubKey.cpp
index b85df7f3..e4103d50 100644
--- a/src/core/model/GpgSubKey.cpp
+++ b/src/core/model/GpgSubKey.cpp
@@ -25,79 +25,76 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
-#include "core/model/GpgSubKey.h"
+#include "GpgSubKey.h"
-GpgFrontend::GpgSubKey::GpgSubKey() = default;
+namespace GpgFrontend {
-GpgFrontend::GpgSubKey::GpgSubKey(gpgme_subkey_t subkey)
- : _subkey_ref(subkey, [&](gpgme_subkey_t subkey) {}) {}
+GpgSubKey::GpgSubKey() = default;
-GpgFrontend::GpgSubKey::GpgSubKey(GpgSubKey&& o) noexcept {
- swap(_subkey_ref, o._subkey_ref);
+GpgSubKey::GpgSubKey(gpgme_subkey_t subkey)
+ : subkey_ref_(subkey, [&](gpgme_subkey_t subkey) {}) {}
+
+GpgSubKey::GpgSubKey(GpgSubKey&& o) noexcept {
+ swap(subkey_ref_, o.subkey_ref_);
}
-GpgFrontend::GpgSubKey& GpgFrontend::GpgSubKey::operator=(
- GpgSubKey&& o) noexcept {
- swap(_subkey_ref, o._subkey_ref);
+auto GpgSubKey::operator=(GpgSubKey&& o) noexcept -> GpgSubKey& {
+ swap(subkey_ref_, o.subkey_ref_);
return *this;
};
-bool GpgFrontend::GpgSubKey::operator==(const GpgSubKey& o) const {
+auto GpgSubKey::operator==(const GpgSubKey& o) const -> bool {
return GetFingerprint() == o.GetFingerprint();
}
-std::string GpgFrontend::GpgSubKey::GetID() const { return _subkey_ref->keyid; }
+auto GpgSubKey::GetID() const -> std::string { return subkey_ref_->keyid; }
-std::string GpgFrontend::GpgSubKey::GetFingerprint() const {
- return _subkey_ref->fpr;
+auto GpgSubKey::GetFingerprint() const -> std::string {
+ return subkey_ref_->fpr;
}
-std::string GpgFrontend::GpgSubKey::GetPubkeyAlgo() const {
- return gpgme_pubkey_algo_name(_subkey_ref->pubkey_algo);
+auto GpgSubKey::GetPubkeyAlgo() const -> std::string {
+ return gpgme_pubkey_algo_name(subkey_ref_->pubkey_algo);
}
-unsigned int GpgFrontend::GpgSubKey::GetKeyLength() const {
- return _subkey_ref->length;
+auto GpgSubKey::GetKeyLength() const -> unsigned int {
+ return subkey_ref_->length;
}
-bool GpgFrontend::GpgSubKey::IsHasEncryptionCapability() const {
- return _subkey_ref->can_encrypt;
+auto GpgSubKey::IsHasEncryptionCapability() const -> bool {
+ return subkey_ref_->can_encrypt;
}
-bool GpgFrontend::GpgSubKey::IsHasSigningCapability() const {
- return _subkey_ref->can_sign;
+auto GpgSubKey::IsHasSigningCapability() const -> bool {
+ return subkey_ref_->can_sign;
}
-bool GpgFrontend::GpgSubKey::IsHasCertificationCapability() const {
- return _subkey_ref->can_certify;
+auto GpgSubKey::IsHasCertificationCapability() const -> bool {
+ return subkey_ref_->can_certify;
}
-bool GpgFrontend::GpgSubKey::IsHasAuthenticationCapability() const {
- return _subkey_ref->can_authenticate;
+auto GpgSubKey::IsHasAuthenticationCapability() const -> bool {
+ return subkey_ref_->can_authenticate;
}
-bool GpgFrontend::GpgSubKey::IsPrivateKey() const {
- return _subkey_ref->secret;
-}
+auto GpgSubKey::IsPrivateKey() const -> bool { return subkey_ref_->secret; }
-bool GpgFrontend::GpgSubKey::IsExpired() const { return _subkey_ref->expired; }
+auto GpgSubKey::IsExpired() const -> bool { return subkey_ref_->expired; }
-bool GpgFrontend::GpgSubKey::IsRevoked() const { return _subkey_ref->revoked; }
+auto GpgSubKey::IsRevoked() const -> bool { return subkey_ref_->revoked; }
-bool GpgFrontend::GpgSubKey::IsDisabled() const {
- return _subkey_ref->disabled;
-}
+auto GpgSubKey::IsDisabled() const -> bool { return subkey_ref_->disabled; }
-bool GpgFrontend::GpgSubKey::IsSecretKey() const { return _subkey_ref->secret; }
+auto GpgSubKey::IsSecretKey() const -> bool { return subkey_ref_->secret; }
-bool GpgFrontend::GpgSubKey::IsCardKey() const {
- return _subkey_ref->is_cardkey;
-}
+auto GpgSubKey::IsCardKey() const -> bool { return subkey_ref_->is_cardkey; }
-boost::posix_time::ptime GpgFrontend::GpgSubKey::GetCreateTime() const {
- return boost::posix_time::from_time_t(_subkey_ref->timestamp);
+auto GpgSubKey::GetCreateTime() const -> boost::posix_time::ptime {
+ return boost::posix_time::from_time_t(subkey_ref_->timestamp);
}
-boost::posix_time::ptime GpgFrontend::GpgSubKey::GetExpireTime() const {
- return boost::posix_time::from_time_t(_subkey_ref->expires);
+auto GpgSubKey::GetExpireTime() const -> boost::posix_time::ptime {
+ return boost::posix_time::from_time_t(subkey_ref_->expires);
}
+
+} // namespace GpgFrontend