libzypp
10.5.0
|
Simple handling of Units. More...
#include <Unit.h>
Public Types | |
typedef long long | ValueType |
Public Member Functions | |
Unit () | |
Default ctor. | |
Unit (ValueType factor_r, std::string symbol_r, unsigned prec_r) | |
ctor | |
ValueType | factor () const |
const std::string & | symbol () const |
unsigned | prec () const |
std::string | form (ValueType val_r, unsigned field_width_r=0, unsigned unit_width_r=1) const |
Build string representation of val_r. | |
std::string | form (ValueType val_r, unsigned field_width_r, unsigned unit_width_r, unsigned prec_r) const |
Static Public Member Functions | |
static std::string | form (double val_r, const std::string &symbol_r, unsigned field_width_r, unsigned unit_width_r, unsigned prec_r) |
Private Attributes | |
ValueType | _factor |
std::string | _symbol |
unsigned | _prec |
Simple handling of Units.
Unit stores factor and symbol, and a precision value for printing. form builds a string from a value according to the format specification.
typedef long long zypp::base::Unit::ValueType |
zypp::base::Unit::Unit | ( | ValueType | factor_r, |
std::string | symbol_r, | ||
unsigned | prec_r | ||
) | [inline] |
const std::string& zypp::base::Unit::symbol | ( | ) | const [inline] |
std::string zypp::base::Unit::form | ( | ValueType | val_r, |
unsigned | field_width_r = 0 , |
||
unsigned | unit_width_r = 1 |
||
) | const [inline] |
std::string zypp::base::Unit::form | ( | ValueType | val_r, |
unsigned | field_width_r, | ||
unsigned | unit_width_r, | ||
unsigned | prec_r | ||
) | const [inline] |
std::string zypp::base::Unit::form | ( | double | val_r, |
const std::string & | symbol_r, | ||
unsigned | field_width_r, | ||
unsigned | unit_width_r, | ||
unsigned | prec_r | ||
) | [static] |
ValueType zypp::base::Unit::_factor [private] |
std::string zypp::base::Unit::_symbol [private] |
unsigned zypp::base::Unit::_prec [private] |