27 #include <util/sha1hash.h>
28 #include <util/constants.h>
29 #include <interfaces/torrentinterface.h>
30 #include <peer/peerid.h>
31 #include <ktorrent_export.h>
32 #include "torrentfile.h"
68 virtual void downloadPriorityChanged(
TorrentFile* tf,Priority newpriority,Priority oldpriority) = 0;
120 void load(
const QByteArray & data,
bool verbose);
122 void debugPrintInfo();
252 void loadTrackerURL(
const QString & s);
256 void loadAnnounceList(
BNode* node);
258 bool checkPathForDirectoryTraversal(
const QString & p);
261 QString name_suggestion;
262 QByteArray unencoded_name;
267 QVector<SHA1Hash> hash_pieces;
268 QVector<TorrentFile> files;
269 QVector<DHTNode> nodes;
270 QList<QUrl> web_seeds;
275 Uint64 last_chunk_size;
277 QTextCodec* text_codec;
279 mutable Uint32 pos_cache_chunk;
280 mutable Uint32 pos_cache_file;
bool isPrivate() const
See if the torrent is private.
QString getNameSuggestion() const
Get the suggested name.
Uint32 getNumChunks() const
Get the number of chunks.
unsigned int getNumTrackerURLs() const
Get the number of tracker URL's.
Uint32 getNumFiles() const
Base class for a node in a b-encoded piece of data.
bool isLoaded() const
Is the torrent loaded.
const SHA1Hash & getHash(Uint32 idx) const
void calcChunkPos(Uint32 chunk, QList< Uint32 > &file_list) const
void load(const QByteArray &data, bool verbose)
void setFilePriorityListener(FilePriorityListener *l)
void updateFilePercentage(Uint32 chunk, ChunkManager &cman)
bool isMultimedia() const
void updateFilePercentage(ChunkManager &cman)
const QList< QUrl > & getWebSeeds() const
const TrackerTier * getTrackerList() const
Gets a pointer to AnnounceList.
QString getComments() const
Return the comments in the torrent.
const QByteArray & getMetaData() const
Get the metadata.
Uint64 getLastChunkSize() const
Get the size of the last chunk.
TorrentFile & getFile(Uint32 idx)
bool verifyHash(const SHA1Hash &h, Uint32 index)
Interface for classes who want to monitor a TorrentInterface.
void changeTextCodec(QTextCodec *codec)
Change the text codec.
const QTextCodec * getTextCodec()
Get the text codec.
void downloadPriorityChanged(TorrentFile *tf, Priority newpriority, Priority oldpriority)
Uint64 getChunkSize() const
Get the size of a chunk.
void filePreviewChanged(TorrentFile *tf, bool preview)
Represents a list in bencoded data.
Uint64 getTotalSize() const
Get the file size in number of bytes.
const DHTNode & getDHTNode(Uint32 i)
Get a DHT node.
Uint32 getNumDHTNodes() const
Get the number of initial DHT nodes.
bool isMultiFile() const
See if we have a multi file torrent.
void filePercentageChanged(TorrentFile *tf, float perc)
Represents a dictionary in bencoded data.
void setMonitor(MonitorInterface *m)
Set the monitor.
const SHA1Hash & getInfoHash() const
Get the info_hash.
const PeerID & getPeerID() const
Get our peer_id.
const TorrentFile & getFile(Uint32 idx) const