libktorrent
2.1.1
|
#include <torrentfile.h>
Public Member Functions | |
TorrentFile (const TorrentFile &tf) | |
TorrentFile (Torrent *tor, Uint32 index, const QString &path, Uint64 off, Uint64 size, Uint64 chunk_size) | |
TorrentFile (Torrent *tor=0) | |
bool | doNotDownload () const override |
Check if this file doesn't have to be downloaded. | |
void | emitDownloadStatusChanged () override |
emits signal. | |
Uint64 | fileOffset (Uint32 cindex, Uint64 chunk_size) const |
Uint64 | getCacheOffset () const |
Get the offset into the torrent. | |
Uint64 | getFirstChunkOffset () const |
Get the offset at which the file starts in the first chunk. | |
Uint64 | getLastChunkSize () const |
Get how many bytes the files takes up of the last chunk. | |
Priority | getOldPriority () const |
Get the previous priority value. | |
Priority | getPriority () const override |
Gets the priority of the file. | |
bool | isMissing () const |
See if the file is missing. | |
bool | isMultimedia () const override |
Checks if this file is multimedial. | |
TorrentFile & | operator= (const TorrentFile &tf) |
void | setDoNotDownload (bool dnd) override |
Set whether we have to not download this file. | |
void | setEmitDownloadStatusChanged (bool show) override |
Wheather to emit signal when dl status changes or not. | |
void | setMissing (bool m) |
Set the file to be missing or not. | |
void | setPriority (Priority newpriority=NORMAL_PRIORITY) override |
Sets the priority of the file. | |
void | updateNumDownloadedChunks (ChunkManager &cman) |
![]() | |
TorrentFileInterface (Uint32 index, const QString &path, Uint64 size) | |
void | changeTextCodec (QTextCodec *codec) |
Change the text codec. | |
float | getDownloadPercentage () const |
Get the % of the file which is downloaded. | |
Uint32 | getFirstChunk () const |
Get the index of the first chunk in which this file lies. | |
Uint64 | getFirstChunkOffset () const |
Get the offset at which the file starts in the first chunk. | |
Uint32 | getIndex () const |
Get the index of the file. | |
Uint32 | getLastChunk () const |
Get the last chunk of the file. | |
Uint64 | getLastChunkSize () const |
Get how many bytes the files takes up of the last chunk. | |
QString | getMountPoint () const |
Get the mount point of the file on disk. | |
QString | getPath () const |
Get the path of the file. | |
QString | getPathOnDisk () const |
Get the path of a file on disk. | |
Uint64 | getSize () const |
Get the size of the file. | |
QString | getUserModifiedPath () const |
Get user modified path (if isn't changed, the normal path is returned) | |
bool | isAudio () const |
Is this an audio file. | |
bool | isNull () const |
See if the TorrentFile is null. | |
bool | isPreExistingFile () const |
Did this file exist before the torrent was loaded by KT. | |
bool | isPreviewAvailable () const |
See if preview is available. | |
bool | isVideo () const |
Is this a video. | |
void | setMountPoint (const QString &path) |
Set the mount point. | |
void | setPathOnDisk (const QString &p) |
void | setPreExisting (bool pe) |
Set whether this file is preexisting. | |
void | setUnencodedPath (const QList< QByteArray > up) |
Set the unencoded path. | |
void | setUserModifiedPath (const QString &p) |
Set the user modified path. | |
Static Public Attributes | |
static TorrentFile | null |
Additional Inherited Members | |
![]() | |
enum | FileType { UNKNOWN, AUDIO, VIDEO, NORMAL } |
![]() | |
bool | emit_status_changed |
FileType | filetype |
Uint32 | first_chunk |
Uint64 | first_chunk_off |
Uint32 | index |
Uint32 | last_chunk |
Uint64 | last_chunk_size |
QString | mount_point |
Uint32 | num_chunks_downloaded |
QString | path |
QString | path_on_disk |
bool | preexisting |
bool | preview |
Priority | priority |
Uint64 | size |
QList< QByteArray > | unencoded_path |
QString | user_modified_path |
File in a multi file torrent. Keeps track of the path of the file, it's size, offset into the cache and between which chunks it lies.
Definition at line 60 of file torrentfile.h.
bt::TorrentFile::TorrentFile | ( | Torrent * | tor = 0 | ) |
Default constructor. Creates a null TorrentFile.
bt::TorrentFile::TorrentFile | ( | Torrent * | tor, |
Uint32 | index, | ||
const QString & | path, | ||
Uint64 | off, | ||
Uint64 | size, | ||
Uint64 | chunk_size | ||
) |
Constructor.
index | Index number of the file |
path | Path of the file |
off | Offset into the torrent (i.e. how many bytes were all the previous files in the torrent combined) |
size | Size of the file |
chunk_size | Size of each chunk |
bt::TorrentFile::TorrentFile | ( | const TorrentFile & | tf | ) |
Copy constructor.
tf | The TorrentFile to copy |
Uint64 bt::TorrentFile::fileOffset | ( | Uint32 | cindex, |
Uint64 | chunk_size | ||
) | const |
Calculate the offset of a chunk in the file
cindex | Index of chunk |
chunk_size | Size of each chunk |
TorrentFile& bt::TorrentFile::operator= | ( | const TorrentFile & | tf | ) |
Assignment operator
tf | The file to copy |
void bt::TorrentFile::updateNumDownloadedChunks | ( | ChunkManager & | cman | ) |
Update the number of downloaded chunks for this file.
cman | The ChunkManager |