瀏覽代碼

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
Tatsuhiro Tsujikawa 16 年之前
父節點
當前提交
376e39a1f4
共有 4 個文件被更改,包括 13 次插入4 次删除
  1. 7 0
      ChangeLog
  2. 2 1
      src/Util.h
  3. 2 1
      src/bittorrent_helper.cc
  4. 2 2
      test/UtilTest.cc

+ 7 - 0
ChangeLog

@@ -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

+ 2 - 1
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";
     }
   }

+ 2 - 1
src/bittorrent_helper.cc

@@ -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";

+ 2 - 2
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());
 }