| 1 | /* |
| 2 | * Bittorrent Client using Qt and libtorrent. |
| 3 | * Copyright (C) 2021-2025 Vladimir Golovnev <[email protected]> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | * |
| 19 | * In addition, as a special exception, the copyright holders give permission to |
| 20 | * link this program with the OpenSSL project's "OpenSSL" library (or with |
| 21 | * modified versions of it that use the same license as the "OpenSSL" library), |
| 22 | * and distribute the linked executables. You must obey the GNU General Public |
| 23 | * License in all respects for all of the code used other than "OpenSSL". If you |
| 24 | * modify file(s), you may extend this exception to your version of the file(s), |
| 25 | * but you are not obligated to do so. If you do not wish to do so, delete this |
| 26 | * exception statement from your version. |
| 27 | */ |
| 28 | |
| 29 | #pragma once |
| 30 | |
| 31 | #include <QReadWriteLock> |
| 32 | |
| 33 | #include "base/pathfwd.h"cxx . . $ `<file>/src/base/pathfwd.h`/ |
| 34 | #include "resumedatastorage.h"cxx . . $ `<file>/src/base/bittorrent/resumedatastorage.h`/ |
| 35 | |
| 36 | class QSqlQuerycxx . . $ QSqlQuery#; |
| 37 | |
| 38 | namespace BitTorrentcxx . . $ BitTorrent/ |
| 39 | { |
| 40 | class DBResumeDataStoragecxx . . $ BitTorrent/DBResumeDataStorage# final : public ResumeDataStoragecxx . . $ BitTorrent/ResumeDataStorage# |
| 41 | { |
| 42 | Q_OBJECTcxx . . $ BitTorrent/DBResumeDataStorage#tr(75d9f1c324b4579d). |
| 43 | Q_DISABLE_COPY_MOVEcxx . . $ BitTorrent/DBResumeDataStorage#`operator=`(83670fc40f7b753f).(DBResumeDataStorage) |
| 44 | |
| 45 | public: |
| 46 | explicit DBResumeDataStoragecxx . . $ BitTorrent/DBResumeDataStorage#DBResumeDataStorage(adc859682798efc7).(const Pathcxx . . $ Path# &dbPath, QObjectcxx . . $ QObject# *parent = nullptr); |
| 47 | ~cxx . . $ BitTorrent/DBResumeDataStorage#`~DBResumeDataStorage`(ced63f7c635d850d).DBResumeDataStoragecxx . . $ BitTorrent/DBResumeDataStorage#() override; |
| 48 | |
| 49 | QListcxx . . $ QList#<TorrentIDcxx . . $ BitTorrent/TorrentID#> registeredTorrentscxx . . $ BitTorrent/DBResumeDataStorage#registeredTorrents(ca01f0d338acf10a).() const override; |
| 50 | LoadResumeDataResultcxx . . $ BitTorrent/LoadResumeDataResult# loadcxx . . $ BitTorrent/DBResumeDataStorage#load(47da3ebeb0daad2d).(const TorrentIDcxx . . $ BitTorrent/TorrentID# &id) const override; |
| 51 | |
| 52 | void storecxx . . $ BitTorrent/DBResumeDataStorage#store(e63345e922333e54).(const TorrentIDcxx . . $ BitTorrent/TorrentID# &id, LoadTorrentParamscxx . . $ BitTorrent/LoadTorrentParams# resumeData) const override; |
| 53 | void removecxx . . $ BitTorrent/DBResumeDataStorage#remove(6a2f985110bf9e3f).(const TorrentIDcxx . . $ BitTorrent/TorrentID# &id) const override; |
| 54 | void storeQueuecxx . . $ BitTorrent/DBResumeDataStorage#storeQueue(89b24b36becac9b3).(const QListcxx . . $ QList#<TorrentIDcxx . . $ BitTorrent/TorrentID#> &queue) const override; |
| 55 | |
| 56 | private: |
| 57 | void doLoadAllcxx . . $ BitTorrent/DBResumeDataStorage#doLoadAll(83f5f38750778ac8).() const override; |
| 58 | int currentDBVersioncxx . . $ BitTorrent/DBResumeDataStorage#currentDBVersion(455f465bc33b4cdf).() const; |
| 59 | void createDBcxx . . $ BitTorrent/DBResumeDataStorage#createDB(83f5f38750778ac8).() const; |
| 60 | void updateDBcxx . . $ BitTorrent/DBResumeDataStorage#updateDB(d76a70202c25db1).(int fromVersion) const; |
| 61 | void enableWALModecxx . . $ BitTorrent/DBResumeDataStorage#enableWALMode(83f5f38750778ac8).() const; |
| 62 | LoadResumeDataResultcxx . . $ BitTorrent/LoadResumeDataResult# parseQueryResultRowcxx . . $ BitTorrent/DBResumeDataStorage#parseQueryResultRow(dcab57c055185f03).(const QSqlQuerycxx . . $ QSqlQuery# &query) const; |
| 63 | |
| 64 | class Workercxx . . $ BitTorrent/DBResumeDataStorage#Worker#; |
| 65 | Workercxx . . $ BitTorrent/DBResumeDataStorage#Worker# *m_asyncWorkercxx . . $ BitTorrent/DBResumeDataStorage#m_asyncWorker. = nullptr; |
| 66 | |
| 67 | mutable QReadWriteLockcxx . . $ QReadWriteLock# m_dbLockcxx . . $ BitTorrent/DBResumeDataStorage#m_dbLock.; |
| 68 | }; |
| 69 | } |