Author: aschnell
Date: Mon Jul 14 15:21:06 2008
New Revision: 49049
URL: http://svn.opensuse.org/viewcvs/yast?rev=49049&view=rev
Log:
- added convenience functions
Modified:
branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp
branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp
Modified: branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp?rev=49049&r1=49048&r2=49049&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp Mon Jul 14 15:21:06 2008
@@ -326,20 +326,43 @@
}
+global string KByteToHumanString(integer kbytes)
+{
+ return LibStorage::StorageInterface::byteToHumanString(sint, kbytes * 1024, false, 2, false);
+}
+
+
global string ByteToHumanStringWithPrecision(integer bytes, integer precision, boolean omit_zeroes)
{
return LibStorage::StorageInterface::byteToHumanString(sint, bytes, false, precision, omit_zeroes);
}
+global string KByteToHumanStringWithPrecision(integer kbytes, integer precision, boolean omit_zeroes)
+{
+ return LibStorage::StorageInterface::byteToHumanString(sint, kbytes * 1024, false, precision, omit_zeroes);
+}
+
+
global boolean HumanStringToByte(string str, integer& bytes)
{
+ integer i = 0; bytes = i; // bnc #408829 and #408891
boolean ret = LibStorage::StorageInterface::humanStringToByte(sint, str, false, bytes);
y2milestone("HumanStringToByte ret:%1 str:%2 bytes:%3", ret, str, bytes);
return ret;
}
+global boolean HumanStringToKByte(string str, integer& kbytes)
+{
+ integer bytes = 0; // bnc #408829
+ boolean ret = LibStorage::StorageInterface::humanStringToByte(sint, str, false, bytes);
+ kbytes = bytes / 1024;
+ y2milestone("HumanStringToKByte ret:%1 str:%2 kbytes:%3", ret, str, kbytes);
+ return ret;
+}
+
+
global define map