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

kget

Signals | Public Member Functions | List of all members
BTCache Class Reference

#include <btcache.h>

Inheritance diagram for BTCache:
Inheritance graph
[legend]

Signals

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

Public Member Functions

 BTCache (bt::Torrent &tor, const QString &tmpdir, const QString &datadir)
 
 ~BTCache ()
 
virtual void changeOutputPath (const QString &outputpath)
 
virtual void changeTmpDir (const QString &ndir)
 
virtual void close ()
 
virtual void create ()
 
virtual KJob * 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 bt::PieceData * loadPiece (bt::Chunk *, bt::Uint32, bt::Uint32)
 
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 bt::PieceData * preparePiece (bt::Chunk *, bt::Uint32, bt::Uint32)
 
virtual void save (Chunk *c)
 
virtual void saveFileMap ()
 
virtual void savePiece (bt::PieceData *)
 

Detailed Description

Definition at line 33 of file btcache.h.

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)
inlinevirtual

Changes output path.

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

Parameters
outputpathNew output path

Definition at line 69 of file btcache.h.

virtual void BTCache::changeTmpDir ( const QString &  ndir)
inlinevirtual

Changes the tmp dir.

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

Parameters
ndirThe new tmpdir

Definition at line 62 of file btcache.h.

virtual void BTCache::close ( )
inlinevirtual

Close the cache file(s).

Definition at line 113 of file btcache.h.

virtual void BTCache::create ( )
inlinevirtual

Create all the data files to store the data.

Definition at line 108 of file btcache.h.

void BTCache::dataArrived ( const KIO::fileoffset_t &  offset,
const QByteArray &  data 
)
signal
void BTCache::deleteDataFiles ( )
inlinevirtual

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

Definition at line 139 of file btcache.h.

virtual Uint64 BTCache::diskUsage ( )
inlinevirtual

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

Definition at line 147 of file btcache.h.

virtual void BTCache::downloadStatusChanged ( TorrentFile *  ,
bool   
)
inlinevirtual

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

Definition at line 121 of file btcache.h.

virtual QString BTCache::getOutputPath ( ) const
inlinevirtual

Get the actual output path.

Returns
The output path

Definition at line 55 of file btcache.h.

virtual bool BTCache::hasMissingFiles ( QStringList &  sl)
inlinevirtual

Test all files and see if they are not missing.

If so put them in a list

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
cThe Chunk

Definition at line 29 of file btcache.cpp.

virtual void BTCache::loadFileMap ( )
inlinevirtual

Load the file map of a torrent.

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

Definition at line 44 of file btcache.h.

virtual bt::PieceData* BTCache::loadPiece ( bt::Chunk *  ,
bt::Uint32  ,
bt::Uint32   
)
inlinevirtual

Definition at line 140 of file btcache.h.

virtual KJob* BTCache::moveDataFiles ( const QString &  ndir)
inlinevirtual

Move the data files to a new directory.

Parameters
ndirThe directory
Returns
The job doing the move

Definition at line 76 of file btcache.h.

virtual void BTCache::moveDataFilesFinished ( KJob *  job)
inlinevirtual

A move of a bunch of data files has finished.

Parameters
jobThe job doing the move

Definition at line 82 of file btcache.h.

virtual void BTCache::open ( )
inlinevirtual

Open the cache file(s)

Definition at line 118 of file btcache.h.

virtual void BTCache::preallocateDiskSpace ( PreallocationThread *  prealloc)
inlinevirtual

Preallocate diskspace for all files.

Parameters
preallocThe thread doing the preallocation

Definition at line 127 of file btcache.h.

bool BTCache::prep ( Chunk *  c)
virtual

Prepare a chunk for downloading.

Parameters
cThe Chunk
Returns
true if ok, false otherwise

Definition at line 61 of file btcache.cpp.

virtual bt::PieceData* BTCache::preparePiece ( bt::Chunk *  ,
bt::Uint32  ,
bt::Uint32   
)
inlinevirtual

Definition at line 141 of file btcache.h.

void BTCache::save ( Chunk *  c)
virtual

Save a chunk to disk.

If something goes wrong, an Error should be thrown.

Parameters
cThe Chunk

Definition at line 34 of file btcache.cpp.

virtual void BTCache::saveFileMap ( )
inlinevirtual

Save the file map of a torrent.

Definition at line 49 of file btcache.h.

virtual void BTCache::savePiece ( bt::PieceData *  )
inlinevirtual

Definition at line 142 of file btcache.h.


The documentation for this class was generated from the following files:
  • btcache.h
  • btcache.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

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

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal