libktorrent  2.2.0
Public Member Functions | List of all members
bt::TorrentCreator Class Reference

Class to generate torrent files. More...

#include <torrentcreator.h>

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

Public Member Functions

 TorrentCreator (const QString &target, const QStringList &trackers, const QList< QUrl > &webseeds, Uint32 chunk_size, const QString &name, const QString &comments, bool priv, bool decentralized)
 
Uint32 getCurrentChunk () const
 
Uint32 getNumChunks () const
 Get the number of chunks.
 
TorrentControlmakeTC (const QString &data_dir)
 
void saveTorrent (const QString &url)
 
void stop ()
 Stop the thread.
 

Detailed Description

Author
Joris Guisson This class generates torrent files. It also allows to create a TorrentControl object, so that we immediately can start to share the torrent.

Definition at line 60 of file torrentcreator.h.

Constructor & Destructor Documentation

◆ TorrentCreator()

bt::TorrentCreator::TorrentCreator ( const QString &  target,
const QStringList &  trackers,
const QList< QUrl > &  webseeds,
Uint32  chunk_size,
const QString &  name,
const QString &  comments,
bool  priv,
bool  decentralized 
)

Constructor.

Parameters
targetThe file or directory to make a torrent of
trackersA list of tracker urls
webseedsA list of webseed urls
chunk_sizeThe size of each chunk
nameThe name suggestion
commentsThe comments field of the torrent
privPrivate torrent or not

Member Function Documentation

◆ makeTC()

TorrentControl* bt::TorrentCreator::makeTC ( const QString &  data_dir)

Make a TorrentControl object for this torrent. This will also create the files : data_dir/index data_dir/torrent data_dir/cache (symlink to target)

Parameters
data_dirThe data directory
Exceptions
Errorif something goes wrong
Returns
The newly created object

◆ saveTorrent()

void bt::TorrentCreator::saveTorrent ( const QString &  url)

Save the torrent file.

Parameters
urlFilename
Exceptions
Errorif something goes wrong

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