Basic Torrent/TorrentParser implementation is done

Hi Peter,

I’ve done the basic Torrent and TorrentParser implementation (only an optional field named 'private' is currently missing) and I’d like to ask you to have a look at it (rev. 125). I’ll describe here major changes:

I’ve made Torrent::FileInfo a nested class with getters because I think it’s better abstraction than a “bare” struct. I’ve used the same idea with TorrentParser as a friend class so we don’t have to validate it’s data in setters (there are currently no setters). The rest of the Torrent class changes are very like the same we have discussed yesterday.

There are many new functions in the TorrentParser that are providing files info parsing and loading. I’ve added more unit tests and everything seems to be working fine. I hope that I’ve managed to create these tests according to your remarks - but if there is something that could be improved just tell me and I’ll improve it!

Parsed strings (QByteArray) are now converted into utf8 before they’re assigned to a QString - as you have suggested.

I’ve transformed torrent file dictionary key names into TorrentParser static constants (better abstraction, for example there is no "md5sum" when searching for a checksum but only ChecksumKeyName).

So that would be everything I wanted to write - I’m now (ok, not “now” but it the near future) going to implement that 'private' flag/key so the Torrent and TorrentParser class will be complete and then I’ll maybe add some more unit tests that may be currently missing. Then I’m going to read over the code and possibly make some refactoring.

Regards, Petr

Would you like to post a relpy?


This post starts a thread.
Follow-ups:
Re: Basic Torrent/TorrentParser implementation is done
Hi Petr, I’ve done the basic Torrent and TorrentParser implementation (only an optional field named 'private' is currently missing) and I’d like to ask you to have a look at it (more...)