libktorrent  2.2.0
Signals | Public Member Functions | Protected Attributes | List of all members
bt::DataChecker Class Referenceabstract

#include <datachecker.h>

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

Signals

void progress (quint32 num, quint32 total)
 
void status (quint32 num_failed, quint32 num_found, quint32 num_downloaded, quint32 num_not_downloaded)
 

Public Member Functions

 DataChecker (bt::Uint32 from, bt::Uint32 to)
 
virtual void check (const QString &path, const Torrent &tor, const QString &dnddir, const BitSet &current_status)=0
 
const BitSetgetResult () const
 
void stop ()
 Stop an ongoing check.
 

Protected Attributes

Uint32 downloaded
 
Uint32 failed
 
Uint32 found
 
bt::Uint32 from
 
bool need_to_stop
 
Uint32 not_downloaded
 
BitSet result
 
bt::Uint32 to
 

Detailed Description

Author
Joris Guisson

Checks which data is downloaded, given a torrent and a file or directory containing files of the torrent.

Definition at line 41 of file datachecker.h.

Member Function Documentation

◆ check()

virtual void bt::DataChecker::check ( const QString &  path,
const Torrent tor,
const QString &  dnddir,
const BitSet current_status 
)
pure virtual

Check to see which chunks have been downloaded of a torrent, and which chunks fail. The corresponding bitsets should be filled with this information. If anything goes wrong and Error should be thrown.

Parameters
pathpath to the file or dir (this needs to end with the name suggestion of the torrent)
torThe torrent
dnddirDND dir, optional argument if we know this
current_statusCurrent status of the torrent

Implemented in bt::SingleDataChecker, and bt::MultiDataChecker.

◆ getResult()

const BitSet& bt::DataChecker::getResult ( ) const
inline

Get the BitSet representing all the downloaded chunks and which is the result of the data check.

Definition at line 62 of file datachecker.h.

◆ progress

void bt::DataChecker::progress ( quint32  num,
quint32  total 
)
signal

Emitted when a chunk has been proccessed.

Parameters
numThe number processed
totalThe total number of pieces to process

◆ status

void bt::DataChecker::status ( quint32  num_failed,
quint32  num_found,
quint32  num_downloaded,
quint32  num_not_downloaded 
)
signal

Emitted when a failed or dowloaded chunk is found.

Parameters
num_failedThe number of failed chunks
num_foundThe number of found chunks
num_downloadedNumber of downloaded chunks
num_not_downloadedNumber of not downloaded chunks

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