ByteCount: add KiB,..,TiB units (same as K,...T)
authorMichael Andres <ma@suse.de>
Thu, 26 Nov 2009 15:50:30 +0000 (16:50 +0100)
committerMichael Andres <ma@suse.de>
Thu, 26 Nov 2009 15:50:30 +0000 (16:50 +0100)
zypp/ByteCount.cc
zypp/ByteCount.h

index 138693f..bae1e7d 100644 (file)
@@ -20,10 +20,15 @@ namespace zypp
 { /////////////////////////////////////////////////////////////////
 
   const ByteCount::Unit ByteCount::B( 1LL, "B", 0 );
+
   const ByteCount::Unit ByteCount::K( 1024LL, "KiB", 1 );
+  const ByteCount::Unit ByteCount::KiB( K );
   const ByteCount::Unit ByteCount::M( 1048576LL, "MiB", 1 );
+  const ByteCount::Unit ByteCount::MiB( M );
   const ByteCount::Unit ByteCount::G( 1073741824LL, "GiB", 2 );
+  const ByteCount::Unit ByteCount::GiB( G );
   const ByteCount::Unit ByteCount::T( 1099511627776LL, "TiB", 3 );
+  const ByteCount::Unit ByteCount::TiB( T );
 
   const ByteCount::Unit ByteCount::kB( 1000LL, "kB", 1 );
   const ByteCount::Unit ByteCount::MB( 1000000LL, "MB", 1 );
index 753ff9c..657c5f5 100644 (file)
@@ -40,14 +40,20 @@ namespace zypp
     //@{
     /** 1 Byte */
     static const Unit B;
+
     /** 1024 Byte */
     static const Unit K;
+    static const Unit KiB;
     /** 1024^2 Byte */
     static const Unit M;
+    static const Unit MiB;
     /** 1024^3 Byte */
     static const Unit G;
+    static const Unit GiB;
     /** 1024^4 Byte */
     static const Unit T;
+    static const Unit TiB;
+
     /** 1000 Byte */
     static const Unit kB;
     /** 1000^2 Byte */
@@ -73,7 +79,7 @@ namespace zypp
     : _count( count_r * unit_r.factor() )
     {}
 
 public:
+ public:
 
     /** Conversion to SizeType. */
     operator SizeType() const