File indexing completed on 2025-01-05 04:37:17

0001 /*
0002     SPDX-FileCopyrightText: 2008 Joris Guisson <joris.guisson@gmail.com>
0003     SPDX-FileCopyrightText: 2008 Ivan Vasic <ivasic@gmail.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 #ifndef BTCACHEFACTORY_H
0008 #define BTCACHEFACTORY_H
0009 
0010 #include <QString>
0011 #include <ktorrent_export.h>
0012 
0013 namespace bt
0014 {
0015 class Cache;
0016 class Torrent;
0017 
0018 /**
0019  * Factory to create Cache objects. If you want a custom Cache you need to derive from this class
0020  * and implement the create method to create your own custom Caches.
0021  * @author Joris Guisson
0022  */
0023 class KTORRENT_EXPORT CacheFactory
0024 {
0025 public:
0026     CacheFactory();
0027     virtual ~CacheFactory();
0028 
0029     /**
0030      * Create a custom Cache
0031      * @param tor The Torrent
0032      * @param tmpdir The temporary directory (should be used to store information about the torrent)
0033      * @param datadir The data directory, where to store the data
0034      * @return
0035      */
0036     virtual Cache *create(Torrent &tor, const QString &tmpdir, const QString &datadir) = 0;
0037 };
0038 
0039 }
0040 
0041 #endif