• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kget

BTCache Class Reference

#include <btcache.h>

Inheritance diagram for BTCache:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 33 of file btcache.h.


Signals

void dataArrived (const KIO::fileoffset_t &offset, const QByteArray &data)

Public Member Functions

 BTCache (bt::Torrent &tor, const QString &tmpdir, const QString &datadir)
virtual void changeOutputPath (const QString &outputpath)
virtual void changeTmpDir (const QString &ndir)
virtual void close ()
virtual void create ()
virtual void deleteDataFiles ()
virtual Uint64 diskUsage ()
virtual void downloadStatusChanged (TorrentFile *, bool)
virtual QString getOutputPath () const
virtual bool hasMissingFiles (QStringList &sl)
virtual void load (Chunk *c)
virtual void loadFileMap ()
virtual KJob * moveDataFiles (const QString &ndir)
virtual void moveDataFilesFinished (KJob *job)
virtual void open ()
virtual void preallocateDiskSpace (PreallocationThread *prealloc)
virtual bool prep (Chunk *c)
virtual void save (Chunk *c)
virtual void saveFileMap ()
 ~BTCache ()

Constructor & Destructor Documentation

BTCache::BTCache ( bt::Torrent &  tor,
const QString &  tmpdir,
const QString &  datadir 
)

Definition at line 19 of file btcache.cpp.

BTCache::~BTCache (  ) 

Definition at line 25 of file btcache.cpp.


Member Function Documentation

virtual void BTCache::changeOutputPath ( const QString &  outputpath  )  [inline, virtual]

Changes output path.

All data files should already been moved. This just modifies the datadir variable.

Parameters:
outputpath New output path

Implements bt::Cache.

Definition at line 69 of file btcache.h.

virtual void BTCache::changeTmpDir ( const QString &  ndir  )  [inline, virtual]

Changes the tmp dir.

All data files should already been moved. This just modifies the tmpdir variable.

Parameters:
ndir The new tmpdir

Reimplemented from bt::Cache.

Definition at line 62 of file btcache.h.

virtual void BTCache::close (  )  [inline, virtual]

Close the cache file(s).

Implements bt::Cache.

Definition at line 113 of file btcache.h.

virtual void BTCache::create (  )  [inline, virtual]

Create all the data files to store the data.

Implements bt::Cache.

Definition at line 108 of file btcache.h.

void BTCache::dataArrived ( const KIO::fileoffset_t &  offset,
const QByteArray &  data 
) [signal]

void BTCache::deleteDataFiles (  )  [virtual]

Delete all data files, in case of multi file torrents empty directories should also be deleted.

Implements bt::Cache.

Definition at line 67 of file btcache.cpp.

virtual Uint64 BTCache::diskUsage (  )  [inline, virtual]

Get the number of bytes all the files of this torrent are currently using on disk.

Implements bt::Cache.

Definition at line 144 of file btcache.h.

virtual void BTCache::downloadStatusChanged ( TorrentFile *  ,
bool   
) [inline, virtual]

Does nothing, can be overridden to be alerted of download status changes of a TorrentFile.

Reimplemented from bt::Cache.

Definition at line 121 of file btcache.h.

virtual QString BTCache::getOutputPath (  )  const [inline, virtual]

Get the actual output path.

Returns:
The output path

Implements bt::Cache.

Definition at line 55 of file btcache.h.

virtual bool BTCache::hasMissingFiles ( QStringList &  sl  )  [inline, virtual]

Test all files and see if they are not missing.

If so put them in a list

Implements bt::Cache.

Definition at line 133 of file btcache.h.

void BTCache::load ( Chunk *  c  )  [virtual]

Load a chunk into memory.

If something goes wrong, an Error should be thrown.

Parameters:
c The Chunk

Implements bt::Cache.

Definition at line 29 of file btcache.cpp.

virtual void BTCache::loadFileMap (  )  [inline, virtual]

Load the file map of a torrent.

If it doesn't exist, it needs to be created.

Implements bt::Cache.

Definition at line 44 of file btcache.h.

virtual KJob* BTCache::moveDataFiles ( const QString &  ndir  )  [inline, virtual]

Move the data files to a new directory.

Parameters:
ndir The directory
Returns:
The job doing the move

Implements bt::Cache.

Definition at line 76 of file btcache.h.

virtual void BTCache::moveDataFilesFinished ( KJob *  job  )  [inline, virtual]

A move of a bunch of data files has finished.

Parameters:
job The job doing the move

Implements bt::Cache.

Definition at line 82 of file btcache.h.

virtual void BTCache::open (  )  [inline, virtual]

Open the cache file(s).

Implements bt::Cache.

Definition at line 118 of file btcache.h.

virtual void BTCache::preallocateDiskSpace ( PreallocationThread *  prealloc  )  [inline, virtual]

Preallocate diskspace for all files.

Parameters:
prealloc The thread doing the preallocation

Implements bt::Cache.

Definition at line 127 of file btcache.h.

bool BTCache::prep ( Chunk *  c  )  [virtual]

Prepare a chunk for downloading.

Parameters:
c The Chunk
Returns:
true if ok, false otherwise

Implements bt::Cache.

Definition at line 61 of file btcache.cpp.

void BTCache::save ( Chunk *  c  )  [virtual]

Save a chunk to disk.

If something goes wrong, an Error should be thrown.

Parameters:
c The Chunk

Implements bt::Cache.

Definition at line 34 of file btcache.cpp.

virtual void BTCache::saveFileMap (  )  [inline, virtual]

Save the file map of a torrent.

Implements bt::Cache.

Definition at line 49 of file btcache.h.


The documentation for this class was generated from the following files:
  • btcache.h
  • btcache.cpp

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal