diff --git a/ChangeLog b/ChangeLog index 8e2b2852..4c8dbd90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-18 Tatsuhiro Tsujikawa + + Show exact file size along in -S option output. + * src/Util.h + * src/bittorrent_helper.cc + * test/UtilTest.cc + 2009-08-18 Tatsuhiro Tsujikawa Avoided unnecessary memory allocation in diff --git a/src/Util.h b/src/Util.h index 6a54de02..3f0a7f31 100644 --- a/src/Util.h +++ b/src/Util.h @@ -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"; } } diff --git a/src/bittorrent_helper.cc b/src/bittorrent_helper.cc index 496c5106..dda7a75f 100644 --- a/src/bittorrent_helper.cc +++ b/src/bittorrent_helper.cc @@ -515,7 +515,8 @@ void print(std::ostream& o, const SharedHandle& 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"; diff --git a/test/UtilTest.cc b/test/UtilTest.cc index ed6524e3..46de1221 100644 --- a/test/UtilTest.cc +++ b/test/UtilTest.cc @@ -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()); }