Two things about torrents to discuss

Hi everybody, I’ve got two things about torrents which I’d like to discuss. First I’ll present “problems” and then my suggestions. Feel free to write down your ideas.

1. BInt class (Protocols/BitTorrent/Torrents) is now operating with standard int data type (e.g int value_; and int value() const;). But the size of the standard int is platform dependant and on 32b systems we won’t be able to address large files (size > 4 GiB). I suggest we should use int64 instead (should be available in Qt). Then we won’t be limited by the file size event on 32b (or possibly 16b, who knows) architectures.

2. Files info implementation - specification: . There are two modes (single file and multiple file mode) and my variant how to implement it without needing to distinct between these two modes is following:


struct FileInfo
{
int64 length; // File length in bytes
QString checksum; // File checksum
QStringList path; // For example ["dir1", "dir2", "file"] for dir1/dir2/file
};

typedef QList FileInfoList; // There can be more files

QString directoryName; // Will be empty in the single file mode
FileInfoList files; // It will contain only one item in the single file mode

Another question is whether FileInfo and FileInfoList should be declared public in the Torrent class or private and provide another way to get info about files (e.g some kind of an iterator etc.).

Any other ideas? Thanks.

Petr

Would you like to post a relpy?


This post starts a thread.
No follow-ups yet.