Protocols::BitTorrent::Torrents::Torrent::FileInfo Class Reference

#include <Torrent.h> [code]

Collaboration diagram for Protocols::BitTorrent::Torrents::Torrent::FileInfo:

Collaboration graph
[legend]
List of all members.

Detailed Description

Information about a single file.

It provides value semantics (objects copying allowed), however object creation is not publicly possible (there is no need for that and parsing + validation is done by TorrentParser).

Todo:
Use something like Md5HashDigest for storing file checksum.

Definition at line 112 of file Torrent.h.

Public Types

typedef FixedSizeByteArray< 32 > Checksum
 32-byte MD5 hash for storing file checksum.

Public Member Functions

 FileInfo (const FileInfo &)
 Copy constructor.
FileInfooperator= (const FileInfo &)
 Assignment operator.
bool operator== (const FileInfo &) const
 FileInfo equality comparison.
bool operator!= (const FileInfo &) const
 FileInfo non-equality comparison.
 ~FileInfo ()
 Destructor.
void swap (FileInfo &other)
 Swap the contents of this object with the other object.
QString path () const
 Returns complete file path including directories.
qint64 length () const
 Returns file length.
Checksum checksum () const
 Returns file checksum.

Private Member Functions

 FileInfo ()
 Default constructor.

Private Attributes

QString filePath
 Complete file path.
qint64 fileLength
 File length in bytes.
Checksum fileChecksum
 File checksum.

Friends

class TorrentParser


Member Typedef Documentation

typedef FixedSizeByteArray<32> Protocols::BitTorrent::Torrents::Torrent::FileInfo::Checksum
 

32-byte MD5 hash for storing file checksum.

Definition at line 119 of file Torrent.h.


Constructor & Destructor Documentation

Torrent::FileInfo::FileInfo const FileInfo other  ) 
 

Copy constructor.

Parameters:
other Object that will be used as a model in the object creation.
Constructs a copy of the other object.

Definition at line 50 of file Torrent.cpp.

Torrent::FileInfo::~FileInfo  ) 
 

Destructor.

Destroys a FileInfo object.

Definition at line 40 of file Torrent.cpp.

Torrent::FileInfo::FileInfo  )  [private]
 

Default constructor.

Constructs an empty FileInfo object.

Definition at line 31 of file Torrent.cpp.


Member Function Documentation

Torrent::FileInfo::Checksum Protocols::BitTorrent::Torrents::Torrent::FileInfo::checksum  )  const [inline]
 

Returns file checksum.

Definition at line 191 of file Torrent.h.

qint64 Protocols::BitTorrent::Torrents::Torrent::FileInfo::length  )  const [inline]
 

Returns file length.

Definition at line 187 of file Torrent.h.

bool Torrent::FileInfo::operator!= const FileInfo other  )  const
 

FileInfo non-equality comparison.

Returns true if this FileInfo object is not equal to the other object.

Definition at line 85 of file Torrent.cpp.

Torrent::FileInfo & Torrent::FileInfo::operator= const FileInfo other  ) 
 

Assignment operator.

Parameters:
other Object that will be assigned to this object.
Returns:
Reference to this object.

Definition at line 62 of file Torrent.cpp.

bool Torrent::FileInfo::operator== const FileInfo other  )  const
 

FileInfo equality comparison.

Returns true if this FileInfo object is equal to the other object.

Definition at line 74 of file Torrent.cpp.

QString Protocols::BitTorrent::Torrents::Torrent::FileInfo::path  )  const [inline]
 

Returns complete file path including directories.

Definition at line 183 of file Torrent.h.

void Torrent::FileInfo::swap FileInfo other  ) 
 

Swap the contents of this object with the other object.

Parameters:
other Object that will be swapped with this object.
Guarantees nothrow exceptions safety.

Definition at line 96 of file Torrent.cpp.


Friends And Related Function Documentation

friend class TorrentParser [friend]
 

Definition at line 131 of file Torrent.h.


Member Data Documentation

Checksum Protocols::BitTorrent::Torrents::Torrent::FileInfo::fileChecksum [private]
 

File checksum.

Definition at line 137 of file Torrent.h.

qint64 Protocols::BitTorrent::Torrents::Torrent::FileInfo::fileLength [private]
 

File length in bytes.

Definition at line 136 of file Torrent.h.

QString Protocols::BitTorrent::Torrents::Torrent::FileInfo::filePath [private]
 

Complete file path.

Definition at line 135 of file Torrent.h.


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