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

kget

bt::SingleFileCache

bt::SingleFileCache Class Reference

#include <singlefilecache.h>

Inheritance diagram for bt::SingleFileCache:

Inheritance graph
[legend]

List of all members.


Detailed Description

Author:
Joris Guisson

Cache for single file torrents

This class implements Cache for a single file torrent

Definition at line 36 of file singlefilecache.h.


Public Member Functions

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 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 ()
 SingleFileCache (Torrent &tor, const QString &tmpdir, const QString &datadir)
virtual ~SingleFileCache ()

Constructor & Destructor Documentation

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

Definition at line 40 of file singlefilecache.cpp.

bt::SingleFileCache::~SingleFileCache (  )  [virtual]

Definition at line 52 of file singlefilecache.cpp.


Member Function Documentation

void bt::SingleFileCache::changeOutputPath ( const QString &  outputpath  )  [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 88 of file singlefilecache.cpp.

void bt::SingleFileCache::changeTmpDir ( const QString &  ndir  )  [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 82 of file singlefilecache.cpp.

void bt::SingleFileCache::close (  )  [virtual]

Close the cache file(s).

Implements bt::Cache.

Definition at line 202 of file singlefilecache.cpp.

void bt::SingleFileCache::create (  )  [virtual]

Create all the data files to store the data.

Implements bt::Cache.

Definition at line 194 of file singlefilecache.cpp.

void bt::SingleFileCache::deleteDataFiles (  )  [virtual]

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

Implements bt::Cache.

Definition at line 252 of file singlefilecache.cpp.

Uint64 bt::SingleFileCache::diskUsage (  )  [virtual]

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

Implements bt::Cache.

Definition at line 257 of file singlefilecache.cpp.

virtual QString bt::SingleFileCache::getOutputPath (  )  const [inline, virtual]

Get the actual output path.

Returns:
The output path

Implements bt::Cache.

Definition at line 56 of file singlefilecache.h.

bool bt::SingleFileCache::hasMissingFiles ( QStringList &  sl  )  [virtual]

Test all files and see if they are not missing.

If so put them in a list

Implements bt::Cache.

Definition at line 242 of file singlefilecache.cpp.

void bt::SingleFileCache::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 152 of file singlefilecache.cpp.

void bt::SingleFileCache::loadFileMap (  )  [virtual]

Load the file map of a torrent.

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

Implements bt::Cache.

Definition at line 55 of file singlefilecache.cpp.

KJob * bt::SingleFileCache::moveDataFiles ( const QString &  ndir  )  [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 96 of file singlefilecache.cpp.

void bt::SingleFileCache::moveDataFilesFinished ( KJob *  job  )  [virtual]

A move of a bunch of data files has finished.

Parameters:
job The job doing the move

Implements bt::Cache.

Definition at line 107 of file singlefilecache.cpp.

void bt::SingleFileCache::open (  )  [virtual]

Open the cache file(s).

Implements bt::Cache.

Definition at line 212 of file singlefilecache.cpp.

void bt::SingleFileCache::preallocateDiskSpace ( PreallocationThread *  prealloc  )  [virtual]

Preallocate diskspace for all files.

Parameters:
prealloc The thread doing the preallocation

Implements bt::Cache.

Definition at line 231 of file singlefilecache.cpp.

bool bt::SingleFileCache::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 121 of file singlefilecache.cpp.

void bt::SingleFileCache::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 173 of file singlefilecache.cpp.

void bt::SingleFileCache::saveFileMap (  )  [virtual]

Save the file map of a torrent.

Implements bt::Cache.

Definition at line 71 of file singlefilecache.cpp.


The documentation for this class was generated from the following files:
  • singlefilecache.h
  • singlefilecache.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