libktorrent  2.1.1
Public Types | Public Member Functions | Protected Attributes | List of all members
bt::TorrentFileInterface Class Referenceabstract

Interface for a file in a multifile torrent. More...

#include <torrentfileinterface.h>

Inheritance diagram for bt::TorrentFileInterface:
Inheritance graph
[legend]

Public Types

enum  FileType { UNKNOWN, AUDIO, VIDEO, NORMAL }
 

Public Member Functions

 TorrentFileInterface (Uint32 index, const QString &path, Uint64 size)
 
void changeTextCodec (QTextCodec *codec)
 Change the text codec.
 
virtual bool doNotDownload () const =0
 Whether or not we have to not download this file.
 
virtual void emitDownloadStatusChanged ()=0
 Emits signal dlStatusChanged. Use it only with FileSelectDialog!
 
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.
 
virtual Priority getPriority () const
 Gets the current priority of the torrent.
 
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.
 
virtual bool isMultimedia () const =0
 Checks if this file is multimedial.
 
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.
 
virtual void setDoNotDownload (bool dnd)=0
 Set whether we have to not download this file.
 
virtual void setEmitDownloadStatusChanged (bool show)=0
 Wheather to emit signal when dl status changes or not.
 
void setMountPoint (const QString &path)
 Set the mount point.
 
void setPathOnDisk (const QString &p)
 
void setPreExisting (bool pe)
 Set whether this file is preexisting.
 
virtual void setPriority (Priority newpriority=NORMAL_PRIORITY)=0
 Sets the priority of the torrent.
 
void setUnencodedPath (const QList< QByteArray > up)
 Set the unencoded path.
 
void setUserModifiedPath (const QString &p)
 Set the user modified path.
 

Protected Attributes

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
 

Detailed Description

Author
Joris Guisson This class is the interface for a file in a multifile torrent.

Definition at line 39 of file torrentfileinterface.h.

Constructor & Destructor Documentation

◆ TorrentFileInterface()

bt::TorrentFileInterface::TorrentFileInterface ( Uint32  index,
const QString &  path,
Uint64  size 
)

Constructor, set the path and size.

Parameters
indexThe index of the file in the torrent
pathThe path
sizeThe size

Member Function Documentation

◆ setPathOnDisk()

void bt::TorrentFileInterface::setPathOnDisk ( const QString &  p)
inline

Set the actual path of the file on disk.

Parameters
pThe path

Definition at line 79 of file torrentfileinterface.h.


The documentation for this class was generated from the following file: