1- #ifndef __CDOCSUPPORT_H__
2- #define __CDOCSUPPORT_H__
3-
41/*
5- * QDigiDocCrypto
2+ * QDigiDoc4
63 *
74 * This library is free software; you can redistribute it and/or
85 * modify it under the terms of the GNU Lesser General Public
2017 *
2118 */
2219
20+ #pragma once
21+
2322#include < QtCore/QObject>
2423#include < QtCore/QIODevice>
2524
@@ -52,27 +51,27 @@ struct DDConfiguration : public libcdoc::Configuration {
5251// Bridges to qApp->signer()
5352//
5453
55- struct DDCryptoBackend : public libcdoc ::CryptoBackend {
54+ struct DDCryptoBackend final : public libcdoc::CryptoBackend {
5655 static constexpr int BACKEND_ERROR = -303 ;
5756 static constexpr int PIN_CANCELED = -304 ;
5857 static constexpr int PIN_INCORRECT = -305 ;
5958 static constexpr int PIN_LOCKED = -306 ;
6059 libcdoc::result_t decryptRSA (std::vector<uint8_t > &result,
6160 const std::vector<uint8_t > &data, bool oaep,
62- unsigned int idx) override final ;
61+ unsigned int idx) final ;
6362 libcdoc::result_t deriveConcatKDF (std::vector<uint8_t > &dst,
6463 const std::vector<uint8_t > &publicKey,
6564 const std::string &digest,
6665 const std::vector<uint8_t > &algorithmID,
6766 const std::vector<uint8_t > &partyUInfo,
6867 const std::vector<uint8_t > &partyVInfo,
69- unsigned int idx) override final ;
68+ unsigned int idx) final ;
7069 libcdoc::result_t deriveHMACExtract (std::vector<uint8_t > &dst,
7170 const std::vector<uint8_t > &publicKey,
7271 const std::vector<uint8_t > &salt,
73- unsigned int idx) override final ;
72+ unsigned int idx) final ;
7473 libcdoc::result_t getSecret (std::vector<uint8_t > &secret,
75- unsigned int idx) override final ;
74+ unsigned int idx) final ;
7675 std::string getLastErrorStr (libcdoc::result_t code) const final ;
7776
7877 std::vector<uint8_t > secret;
@@ -86,7 +85,7 @@ struct DDCryptoBackend : public libcdoc::CryptoBackend {
8685// Bridges to QNetworkAccessManager
8786//
8887
89- struct DDNetworkBackend : public libcdoc ::NetworkBackend, private QObject {
88+ struct DDNetworkBackend final : public libcdoc::NetworkBackend, private QObject {
9089 static constexpr int BACKEND_ERROR = -303 ;
9190
9291 std::string getLastErrorStr (libcdoc::result_t code) const final ;
@@ -95,17 +94,17 @@ struct DDNetworkBackend : public libcdoc::NetworkBackend, private QObject {
9594 const std::vector<uint8_t > &rcpt_key,
9695 const std::vector<uint8_t > &key_material,
9796 const std::string &type,
98- uint64_t expiry_ts) override final ;
97+ uint64_t expiry_ts) final ;
9998 libcdoc::result_t
10099 fetchKey (std::vector<uint8_t > &result, const std::string &keyserver_id,
101- const std::string &transaction_id) override final ;
100+ const std::string &transaction_id) final ;
102101
103102 libcdoc::result_t
104- getClientTLSCertificate (std::vector<uint8_t > &dst) override final {
103+ getClientTLSCertificate (std::vector<uint8_t > &dst) final {
105104 return libcdoc::NOT_IMPLEMENTED;
106105 }
107106 libcdoc::result_t getPeerTLSCertificates (
108- std::vector<std::vector<uint8_t >> &dst) override final {
107+ std::vector<std::vector<uint8_t >> &dst) final {
109108 return libcdoc::NOT_IMPLEMENTED;
110109 }
111110
@@ -120,15 +119,15 @@ struct DDNetworkBackend : public libcdoc::NetworkBackend, private QObject {
120119// Bridges to Qt logging system
121120//
122121
123- class DDCDocLogger : private libcdoc ::ILogger {
122+ class DDCDocLogger final : private libcdoc::ILogger {
124123 public:
125124 static void setUpLogger ();
126125
127126 private:
128127 DDCDocLogger () = default ;
129128 ~DDCDocLogger () = default ;
130129 void LogMessage (libcdoc::ILogger::LogLevel level, std::string_view file, int line,
131- std::string_view message) override final ;
130+ std::string_view message) final ;
132131};
133132
134133class CDocSupport {
@@ -147,7 +146,7 @@ struct IOEntry
147146 std::unique_ptr<QIODevice> data;
148147};
149148
150- struct TempListConsumer : public libcdoc ::MultiDataConsumer {
149+ struct TempListConsumer final : public libcdoc::MultiDataConsumer {
151150 static constexpr int64_t MAX_VEC_SIZE = 500L * 1024L * 1024L ;
152151
153152 explicit TempListConsumer (size_t max_memory_size = 500L * 1024L * 1024L )
@@ -158,23 +157,21 @@ struct TempListConsumer : public libcdoc::MultiDataConsumer {
158157 libcdoc::result_t close () noexcept final ;
159158 bool isError () noexcept final ;
160159 libcdoc::result_t open (const std::string &name,
161- int64_t size) override final ;
160+ int64_t size) final ;
162161
163162 size_t _max_memory_size;
164163 std::vector<IOEntry> files;
165164};
166165
167- struct StreamListSource : public libcdoc ::MultiDataSource {
166+ struct StreamListSource final : public libcdoc::MultiDataSource {
168167 StreamListSource (const std::vector<IOEntry> &files);
169168
170169 libcdoc::result_t read (uint8_t *dst, size_t size) noexcept final ;
171170 bool isError () noexcept final ;
172171 bool isEof () noexcept final ;
173- libcdoc::result_t getNumComponents () override final ;
174- libcdoc::result_t next (std::string &name, int64_t &size) override final ;
172+ libcdoc::result_t getNumComponents () final ;
173+ libcdoc::result_t next (std::string &name, int64_t &size) final ;
175174
176175 const std::vector<IOEntry> &_files;
177176 int64_t _current = -1 ;
178177};
179-
180- #endif // __CDOCSUPPORT_H__
0 commit comments