Using tclap library, released under MIT. This adds the meson
wrap file along with the minimal custom meson.build for tclap,
all the meson code to get config files generated and the
integration of the tclap parser.
announce-list is very annoyingly a list of lists. I don't
have any useful primitive to manage that case in TorrentRead,
so for now I've done a not-so-elegant implementation where I
step around the visitor, use my knowledge of the variant and
access the outer list directly through boost::get(). I'm not
necessarily convinced that this is bad since on the other hand
the solution consistent with the rest of the implementation
would involve searching for "/[[x]]/[[y]]" which has its own
overhead. I mean, variant contains a vector, I can access it
normally. Visitor is a convenience thing, I don't see why
parser's client code should be obliged to pretend the variant
cannot be accessed directly.
So yeah, while TorrentRead is not compulsory to use,
right now it'd be pretty inconvenient to not use it
as the hash grouping function is fidgety to get right.
I think group_torrent_hashes() eventually should be
moved elsewhere.
This makes the visitor a little bit more complicated but
it allows client code to fetch raw variants. It is useful when
dealing with arrays and maps, so that client code can decide to
cache the intermediate array or map into a variable and then run
subsequent searches on that variant rather than from the start.
It should make looping a bit less expensive.
Directory names are not supported yet so this only works
if all the torrent files exist, are of the correct size and
are directly located in the working directory