libktorrent  2.2.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
bt::TorrentFileStream Class Reference

#include <torrentfilestream.h>

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

Public Types

typedef QSharedPointer< TorrentFileStreamPtr
 
typedef QWeakPointer< TorrentFileStreamWPtr
 

Public Member Functions

 TorrentFileStream (TorrentControl *tc, ChunkManager *cman, bool streaming_mode, QObject *parent)
 
 TorrentFileStream (TorrentControl *tc, Uint32 file_index, ChunkManager *cman, bool streaming_mode, QObject *parent)
 
bool atEnd () const override
 Are we at the end of the file.
 
qint64 bytesAvailable () const override
 How many bytes are there available.
 
const BitSetchunksBitSet () const
 Get a BitSet of all the chunks of this TorrentFileStream.
 
void close () override
 Close the device.
 
Uint32 currentChunk () const
 Get the current chunk relative to the first chunk of the file.
 
bool isSequential () const override
 The stream is not sequential.
 
bool open (QIODevice::OpenMode mode) override
 Open the device (only readonly access will be allowed)
 
QString path () const
 Get the path of the file.
 
qint64 pos () const override
 Get the current stream position.
 
bool reset () override
 Reset the stream.
 
bool seek (qint64 pos) override
 Seek, will fail if attempting to seek to a point which is not downloaded yet.
 
qint64 size () const override
 Get the total size.
 

Protected Member Functions

void emitReadChannelFinished ()
 
qint64 readData (char *data, qint64 maxlen) override
 
qint64 writeData (const char *data, qint64 len) override
 

Detailed Description

QIODevice which streams a file of a torrent or the whole torrent (for single file torrents) This object should not be manually constructed.

Definition at line 61 of file torrentfilestream.h.


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