12#ifndef ZYPP_BYTECOUNT_H
13#define ZYPP_BYTECOUNT_H
76 :
_count( unit_r.factor() )
80 :
_count( count_r * unit_r.factor() )
112 {
return ByteCount(*this).fillBlock( blocksize_r ); }
116 {
return fullBlocks( blocksize_r ) / blocksize_r; }
121 const Unit & bestUnit()
const;
124 const Unit & bestUnit1000()
const;
135 unsigned unit_width_r = 1 )
const
139 unsigned unit_width_r,
140 unsigned prec_r )
const
144 unsigned field_width_r = 0,
145 unsigned unit_width_r = 1 )
const
146 {
return asString( unit_r, field_width_r, unit_width_r, unit_r.
prec() ); }
149 unsigned field_width_r,
150 unsigned unit_width_r,
151 unsigned prec_r )
const
152 {
return unit_r.
form(
_count, field_width_r, unit_width_r, prec_r ); }
Store and operate with byte count.
static const Unit MB
1000^2 Byte
std::string asString(unsigned field_width_r, unsigned unit_width_r, unsigned prec_r) const
Auto selected Unit.
static const Unit G
1024^3 Byte
std::string asString(const Unit &unit_r, unsigned field_width_r, unsigned unit_width_r, unsigned prec_r) const
Nothing auto selected.
std::string asString(const Unit &unit_r, unsigned field_width_r=0, unsigned unit_width_r=1) const
Auto selected precision.
static const Unit kB
1000 Byte
ByteCount operator--(int)
ByteCount(const SizeType count_r, const Unit &unit_r=B)
Ctor taking a count and optinal Unit.
SizeType blocks(ByteCount blocksize_r=K) const
Return number of blocks of size blocksize_r (default 1K).
friend std::ostream & operator<<(std::ostream &str, const ByteCount &obj)
const Unit & bestUnit() const
Return the best Unit (B,K,M,G,T) for count.
ByteCount & operator+=(const SizeType rhs)
static const Unit K
1024 Byte
ByteCount(const Unit &unit_r)
Ctor taking 1 Unit.
ByteCount & operator*=(const SizeType rhs)
static const Unit TB
1000^4 Byte
ByteCount & operator/=(const SizeType rhs)
static const Unit B
1 Byte
ByteCount & operator-=(const SizeType rhs)
ByteCount operator++(int)
ByteCount fullBlocks(ByteCount blocksize_r=K) const
Return count adjusted to multiple of blocksize_r (default 1K).
static const Unit M
1024^2 Byte
static const Unit GB
1000^3 Byte
std::string asString(unsigned field_width_r=0, unsigned unit_width_r=1) const
Auto selected Unit and precision.
static const Unit T
1024^4 Byte
Simple handling of Units.
std::string form(ValueType val_r, unsigned field_width_r=0, unsigned unit_width_r=1) const
Build string representation of val_r.
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
std::string asString(const Patch::Category &obj)