added first and last piece to dump_torrent

This commit is contained in:
Arvid Norberg 2007-08-03 08:43:22 +00:00
parent be1faccd1d
commit 52a2df2d3f
1 changed files with 6 additions and 2 deletions

View File

@ -87,11 +87,15 @@ int main(int argc, char* argv[])
std::cout << "comment: " << t.comment() << "\n";
std::cout << "created by: " << t.creator() << "\n";
std::cout << "files:\n";
int index = 0;
for (torrent_info::file_iterator i = t.begin_files();
i != t.end_files(); ++i)
i != t.end_files(); ++i, ++index)
{
int first = t.map_file(index, 0, 1).piece;
int last = t.map_file(index, i->size - 1, 1).piece;
std::cout << " " << std::setw(11) << i->size
<< " " << i->path.string() << "\n";
<< " " << i->path.string() << "[ " << first << ", "
<< last << " ]\n";
}
}