[yast-commit] r52547 - in /trunk/storage/libstorage/src: AppUtil.cc StorageInterface.h
Author: aschnell Date: Sat Oct 25 15:33:30 2008 New Revision: 52547 URL: http://svn.opensuse.org/viewcvs/yast?rev=52547&view=rev Log: - tiny refactoring Modified: trunk/storage/libstorage/src/AppUtil.cc trunk/storage/libstorage/src/StorageInterface.h Modified: trunk/storage/libstorage/src/AppUtil.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/AppUtil.cc?rev=52547&r1=52546&r2=52547&view=diff ============================================================================== --- trunk/storage/libstorage/src/AppUtil.cc (original) +++ trunk/storage/libstorage/src/AppUtil.cc Sat Oct 25 15:33:30 2008 @@ -624,24 +624,13 @@ if (s.fail() || !s.eof() || f < 0.0) return false; - for(int i = 0; i < numSuffixes(); i++) + for (int i = 0; i < numSuffixes(); i++) { - if (classic) + if (boost::equals(suffix, getSuffix(i, classic, false), boost::is_iequal(loc)) || + (!classic && boost::equals(suffix, getSuffix(i, classic, true), boost::is_iequal(loc)))) { - if (boost::equals(suffix, getSuffix(i, true), boost::is_equal())) - { - size = f; - return true; - } - } - else - { - if (boost::equals(suffix, getSuffix(i, false, false), boost::is_iequal(loc)) || - boost::equals(suffix, getSuffix(i, false, true), boost::is_iequal(loc))) - { - size = f; - return true; - } + size = f; + return true; } f *= 1024.0; Modified: trunk/storage/libstorage/src/StorageInterface.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageInterface.h?rev=52547&r1=52546&r2=52547&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageInterface.h (original) +++ trunk/storage/libstorage/src/StorageInterface.h Sat Oct 25 15:33:30 2008 @@ -2111,7 +2111,7 @@ /** * Return a pretty description of a size with required precision - * and using B, kB, MB, GB or TB as unit as appropriate. + * and using B, kB, MB, GB, TB or PB as unit as appropriate. * * @param size size in bytes * @param classic use classic locale @@ -2123,15 +2123,15 @@ bool omit_zeroes) const = 0; /** - * Converts a size description using B, kB, MB, GB or TB into an integer. + * Converts a size description using B, kB, MB, GB, TB or PB into an integer. * * @param str size string * @param classic use classic locale * @param size size in bytes * @return true on successful conversion * - * With classic set to false the conversion is also case-insensitive - * and sloppy concerning omission of 'B'. + * The conversion is always case-insensitive. With classic set to + * false the conversion is also sloppy concerning omission of 'B'. */ virtual bool humanStringToByte(const string& str, bool classic, unsigned long long& size) const = 0; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org