2009-08-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Show exact file size along in -S option output.
	* src/Util.h
	* src/bittorrent_helper.cc
	* test/UtilTest.cc
This commit is contained in:
Tatsuhiro Tsujikawa 2009-08-18 14:36:52 +00:00
parent c1f4af537a
commit 376e39a1f4
4 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2009-08-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Show exact file size along in -S option output.
* src/Util.h
* src/bittorrent_helper.cc
* test/UtilTest.cc
2009-08-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Avoided unnecessary memory allocation in

View File

@ -255,7 +255,8 @@ public:
int32_t count = 1;
for(; first != last; ++first, ++count) {
os << std::setw(3) << count << "|" << (*first)->getPath() << "\n";
os << " |" << Util::abbrevSize((*first)->getLength()) << "B" << "\n";
os << " |" << Util::abbrevSize((*first)->getLength()) << "B ("
<< Util::uitos((*first)->getLength(), true) << ")\n";
os << "---+---------------------------------------------------------------------------" << "\n";
}
}

View File

@ -515,7 +515,8 @@ void print(std::ostream& o, const SharedHandle<DownloadContext>& dctx)
o << "Info Hash: " << Util::toHex(torrentAttrs[INFO_HASH].s()) << "\n";
o << "Piece Length: " << Util::abbrevSize(dctx->getPieceLength()) << "B\n";
o << "The Number of Pieces: " << dctx->getNumPieces() << "\n";
o << "Total Length: " << Util::abbrevSize(dctx->getTotalLength()) << "B\n";
o << "Total Length: " << Util::abbrevSize(dctx->getTotalLength()) << "B ("
<< Util::uitos(dctx->getTotalLength(), true) << ")\n";
if(!torrentAttrs[URL_LIST].empty()) {
const BDE& urlList = torrentAttrs[URL_LIST];
o << "URL List: " << "\n";

View File

@ -397,10 +397,10 @@ void UtilTest::testToStream()
"idx|path/length\n"
"===+===========================================================================\n"
" 1|aria2.tar.bz2\n"
" |12.0KiB\n"
" |12.0KiB (12,300)\n"
"---+---------------------------------------------------------------------------\n"
" 2|aria2.txt\n"
" |556B\n"
" |556B (556)\n"
"---+---------------------------------------------------------------------------\n"),
os.str());
}