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

#include <dndfile.h>

Public Types

typedef QSharedPointer< DNDFilePtr
 

Public Member Functions

 DNDFile (const QString &path, const TorrentFile *tf, Uint32 chunk_size)
 
void changePath (const QString &npath)
 Change the path of the file.
 
void checkIntegrity ()
 
Uint32 readFirstChunk (Uint8 *buf, Uint32 off, Uint32 size)
 
Uint32 readLastChunk (Uint8 *buf, Uint32 off, Uint32 size)
 
void writeFirstChunk (const Uint8 *buf, Uint32 off, Uint32 size)
 
void writeLastChunk (const Uint8 *buf, Uint32 off, Uint32 size)
 

Detailed Description

Author
Joris Guisson joris.nosp@m..gui.nosp@m.sson@.nosp@m.gmai.nosp@m.l.com

Special file where we keep the first and last chunk of a file which is marked as do not download. THe first and last chunk of a file will most certainly be partial chunks.

Definition at line 37 of file dndfile.h.

Member Function Documentation

◆ checkIntegrity()

void bt::DNDFile::checkIntegrity ( )

CHeck integrity of the file, create it if it doesn't exist.

◆ readFirstChunk()

Uint32 bt::DNDFile::readFirstChunk ( Uint8 *  buf,
Uint32  off,
Uint32  size 
)

Read the (partial)first chunk into a buffer.

Parameters
bufThe buffer
offOffset off chunk
sizeHow many bytes to read of the first chunk

◆ readLastChunk()

Uint32 bt::DNDFile::readLastChunk ( Uint8 *  buf,
Uint32  off,
Uint32  size 
)

Read the (partial)last chunk into a buffer.

Parameters
bufThe buffer
offOffset off chunk
sizeHow many bytes to read of the last chunk

◆ writeFirstChunk()

void bt::DNDFile::writeFirstChunk ( const Uint8 *  buf,
Uint32  off,
Uint32  size 
)

Write the partial first chunk.

Parameters
bufThe buffer
offOffset into partial chunk
sizeSize to write

◆ writeLastChunk()

void bt::DNDFile::writeLastChunk ( const Uint8 *  buf,
Uint32  off,
Uint32  size 
)

Write the partial last chunk.

Parameters
bufThe buffer
offOffset into partial chunk
sizeSize to write

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