kget
bt::MultiFileCache Class Reference
#include <multifilecache.h>

Detailed Description
Cache for multi file torrents
This class manages a multi file torrent cache. Everything gets stored in the correct files immediately.
Definition at line 39 of file multifilecache.h.
Public Member Functions | |
| virtual void | changeOutputPath (const QString &outputpath) |
| virtual void | changeTmpDir (const QString &ndir) |
| virtual void | close () |
| virtual void | create () |
| virtual void | deleteDataFiles () |
| virtual Uint64 | diskUsage () |
| virtual QString | getOutputPath () const |
| virtual bool | hasMissingFiles (QStringList &sl) |
| virtual void | load (Chunk *c) |
| virtual void | loadFileMap () |
| virtual KJob * | moveDataFiles (const QMap< TorrentFileInterface *, QString > &files) |
| virtual KJob * | moveDataFiles (const QString &ndir) |
| virtual void | moveDataFilesFinished (const QMap< TorrentFileInterface *, QString > &files, KJob *job) |
| virtual void | moveDataFilesFinished (KJob *job) |
| MultiFileCache (Torrent &tor, const QString &tmpdir, const QString &datadir, bool custom_output_name) | |
| virtual void | open () |
| virtual void | preallocateDiskSpace (PreallocationThread *prealloc) |
| virtual bool | prep (Chunk *c) |
| virtual void | save (Chunk *c) |
| virtual void | saveFileMap () |
| virtual | ~MultiFileCache () |
Constructor & Destructor Documentation
| bt::MultiFileCache::MultiFileCache | ( | Torrent & | tor, | |
| const QString & | tmpdir, | |||
| const QString & | datadir, | |||
| bool | custom_output_name | |||
| ) |
Definition at line 67 of file multifilecache.cpp.
| bt::MultiFileCache::~MultiFileCache | ( | ) | [virtual] |
Definition at line 79 of file multifilecache.cpp.
Member Function Documentation
| void bt::MultiFileCache::changeOutputPath | ( | const QString & | outputpath | ) | [virtual] |
Changes output path.
All data files should already been moved. This just modifies the datadir variable.
- Parameters:
-
outputpath New output path
Implements bt::Cache.
Definition at line 205 of file multifilecache.cpp.
| void bt::MultiFileCache::changeTmpDir | ( | const QString & | ndir | ) | [virtual] |
Changes the tmp dir.
All data files should already been moved. This just modifies the tmpdir variable.
- Parameters:
-
ndir The new tmpdir
Reimplemented from bt::Cache.
Definition at line 186 of file multifilecache.cpp.
| void bt::MultiFileCache::close | ( | ) | [virtual] |
| void bt::MultiFileCache::create | ( | ) | [virtual] |
Create all the data files to store the data.
Implements bt::Cache.
Definition at line 332 of file multifilecache.cpp.
| void bt::MultiFileCache::deleteDataFiles | ( | ) | [virtual] |
Delete all data files, in case of multi file torrents empty directories should also be deleted.
Implements bt::Cache.
Definition at line 828 of file multifilecache.cpp.
| Uint64 bt::MultiFileCache::diskUsage | ( | ) | [virtual] |
Get the number of bytes all the files of this torrent are currently using on disk.
Implements bt::Cache.
Definition at line 845 of file multifilecache.cpp.
| QString bt::MultiFileCache::getOutputPath | ( | ) | const [virtual] |
Get the actual output path.
- Returns:
- The output path
Implements bt::Cache.
Definition at line 135 of file multifilecache.cpp.
| bool bt::MultiFileCache::hasMissingFiles | ( | QStringList & | sl | ) | [virtual] |
Test all files and see if they are not missing.
If so put them in a list
Implements bt::Cache.
Definition at line 762 of file multifilecache.cpp.
| void bt::MultiFileCache::load | ( | Chunk * | c | ) | [virtual] |
Load a chunk into memory.
If something goes wrong, an Error should be thrown.
- Parameters:
-
c The Chunk
Implements bt::Cache.
Definition at line 374 of file multifilecache.cpp.
| void bt::MultiFileCache::loadFileMap | ( | ) | [virtual] |
Load the file map of a torrent.
If it doesn't exist, it needs to be created.
Implements bt::Cache.
Definition at line 82 of file multifilecache.cpp.
| KJob * bt::MultiFileCache::moveDataFiles | ( | const QMap< TorrentFileInterface *, QString > & | files | ) | [virtual] |
Move some files to a new location.
- Parameters:
-
files Map of files to move and their new location
- Returns:
- KJob The job doing the move
Reimplemented from bt::Cache.
Definition at line 272 of file multifilecache.cpp.
Move the data files to a new directory.
- Parameters:
-
ndir The directory
- Returns:
- The job doing the move
Implements bt::Cache.
Definition at line 225 of file multifilecache.cpp.
| void bt::MultiFileCache::moveDataFilesFinished | ( | const QMap< TorrentFileInterface *, QString > & | files, | |
| KJob * | job | |||
| ) | [virtual] |
The job doing moveDataFiles (with the map parameter) has finished.
- Parameters:
-
files The files map with all the moves job The job doing the move
Reimplemented from bt::Cache.
Definition at line 301 of file multifilecache.cpp.
| void bt::MultiFileCache::moveDataFilesFinished | ( | KJob * | job | ) | [virtual] |
A move of a bunch of data files has finished.
- Parameters:
-
job The job doing the move
Implements bt::Cache.
Definition at line 255 of file multifilecache.cpp.
| void bt::MultiFileCache::open | ( | ) | [virtual] |
| void bt::MultiFileCache::preallocateDiskSpace | ( | PreallocationThread * | prealloc | ) | [virtual] |
Preallocate diskspace for all files.
- Parameters:
-
prealloc The thread doing the preallocation
Implements bt::Cache.
Definition at line 741 of file multifilecache.cpp.
| bool bt::MultiFileCache::prep | ( | Chunk * | c | ) | [virtual] |
Prepare a chunk for downloading.
- Parameters:
-
c The Chunk
- Returns:
- true if ok, false otherwise
Implements bt::Cache.
Definition at line 452 of file multifilecache.cpp.
| void bt::MultiFileCache::save | ( | Chunk * | c | ) | [virtual] |
Save a chunk to disk.
If something goes wrong, an Error should be thrown.
- Parameters:
-
c The Chunk
Implements bt::Cache.
Definition at line 492 of file multifilecache.cpp.
| void bt::MultiFileCache::saveFileMap | ( | ) | [virtual] |
Save the file map of a torrent.
Implements bt::Cache.
Definition at line 117 of file multifilecache.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference