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 (rev. 125). I’ll describe here major changes:
Wow! You’ve done a a great amount of work, and what is even better, it all looks really good! I didn’t look at all the code in much detail (would take me some more time) but my overall impression is great!
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.
OK!
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!
The small functions are totally fine, the tests too. I haven’t seen anything that needs improving so far. :-)
Parsed strings (QByteArray) are now converted into utf8 before they’re assigned to a QString - as you have suggested.
I saw that, great!
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).
That’s nice too!
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.
That all sounds really good!
Would you please also have a look at my dev branch and do some code review of the code in Protocol/Generics when you have some time? I’d especially love to get feedback about the tests and syntax of CalitkoMocks!
We could then probably start thinking how to read traker responses.
Best regards,
Peter
