12 #ifndef ZYPP_DISKUSAGE_COUNTER_H 13 #define ZYPP_DISKUSAGE_COUNTER_H 61 Hint_readonly = (1<<0),
62 Hint_growonly = (1<<1),
68 std::string f = std::string(),
69 long long bs = 0LL,
long long total = 0LL,
long long used = 0LL,
long long pkg = 0LL,
70 HintFlags hints = NoHint )
71 : dir(
std::move(d)), fstype(
std::move(f))
72 , block_size(bs), total_size(total), used_size(used), pkg_size(pkg)
73 , readonly(hints.testFlag(Hint_readonly))
74 , growonly(hints.testFlag(Hint_growonly))
82 const std::string & f = std::string(),
83 long long bs = 0LL,
long long total = 0LL,
long long used = 0LL,
long long pkg = 0LL,
84 HintFlags hints = NoHint )
85 :
MountPoint(
std::string(d?d:
""), f, bs, total, used, pkg, hints )
91 long long bs,
long long total = 0LL,
long long used = 0LL,
long long pkg = 0LL,
92 HintFlags hints = NoHint )
97 long long bs,
long long total = 0LL,
long long used = 0LL,
long long pkg = 0LL,
98 HintFlags hints = NoHint )
99 :
MountPoint(
std::string(d?d:
""), bs, total, used, pkg, hints )
122 {
return dir < rhs.
dir; }
161 : _mps(
std::move( mps_r ))
177 static MountPointSet detectMountPoints(
const std::string & rootdir =
"/" );
180 static MountPointSet justRootPartition();
184 MountPointSet disk_usage(
const ResPool & pool )
const;
196 MountPointSet disk_usage(
const Bitmap & bitmap_r )
const;
199 template<
class Iterator>
203 for_( it, begin_r, end_r )
205 return disk_usage( bitmap );
228 #endif // ZYPP_DISKUSAGE_COUNTER_H static constexpr PoolSizeType poolSize
An object indicating the bitmap should match the current pools capacity.
ZYPP_DECLARE_FLAGS(VendorSupportOptions, VendorSupportOption)
A Solvable object within the sat Pool.
ByteCount freeAfterCommit() const
Free size after installation as ByteCount for convenience.
MountPoint(const std::string &d, Hint hint)
ByteCount blockSize() const
Block size of the filesystem as ByteCount for convenience.
std::set< MountPoint > MountPointSet
Store and operate with byte count.
bool readonly
hint for readonly partitions
ByteCount usedSize() const
Used size of the filesystem as ByteCount for convenience.
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(DiskUsageCounter::MountPoint::HintFlags)
void set(size_type idx_r)
Set bit idx_r.
String related utilities and Regular expression matching.
MountPoint(const std::string &d, long long bs, long long total=0LL, long long used=0LL, long long pkg=0LL, HintFlags hints=NoHint)
Ctor initialize directory and sizes.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
long long total_size
Total size of the filesystem in KiB (0 if you don't care)
bool operator<(const MountPoint &rhs) const
Sort by directory name.
MountPoint(const char *d, const std::string &f=std::string(), long long bs=0LL, long long total=0LL, long long used=0LL, long long pkg=0LL, HintFlags hints=NoHint)
std::string fstype
Filesystem type (provided by detectMountPoints)
long long used_size
Used size of the filesystem in KiB (0 if you don't care)
ByteCount totalSize() const
Total size of the filesystem as ByteCount for convenience.
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Mount point description If block_size is set DiskUsageCoutner will assume half a block_size is wasted...
std::string dir
Directory name.
TraitsType::constPtrType constPtr
MountPoint(const char *d, Hint hint)
MountPointSet disk_usage(Iterator begin_r, Iterator end_r) const
Compute disk usage of a collection (convertible by asSolvable).
MountPoint(std::string d="/", std::string f=std::string(), long long bs=0LL, long long total=0LL, long long used=0LL, long long pkg=0LL, HintFlags hints=NoHint)
Ctor initialize directory, fstype and sizes.
MountPointSet disk_usage(const ResObject::constPtr &obj_r) const
long long pkg_size
Used size after installation in KiB (computed by DiskUsageCoutner)
const MountPointSet & getMountPoints() const
Get the current MountPointSet.
static const Unit B
1 Byte
MountPointSet disk_usage(const PoolItem &pi_r) const
DiskUsageCounter(MountPointSet mps_r)
Ctor taking the MountPointSet to compute.
Compute disk space occupied by packages across partitions/directories.
MountPoint(const char *d, HintFlags hints)
static const Unit K
1024 Byte
ByteCount freeSize() const
Free size of the filesystem as ByteCount for convenience.
Combining sat::Solvable and ResStatus.
MountPoint(const char *d, long long bs, long long total=0LL, long long used=0LL, long long pkg=0LL, HintFlags hints=NoHint)
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
bool growonly
hint for growonly partitions (e.g. snapshotting btrfs)
Libsolv (bit)Map wrapper.
To Solvable transform functor.
ByteCount usedAfterCommit() const
Used size after installation as ByteCount for convenience.
Easy-to use interface to the ZYPP dependency resolver.
long long block_size
Block size of the filesystem in B (0 if you don't care)
void setMountPoints(const MountPointSet &mps_r)
Set a MountPointSet to compute.
ByteCount commitDiff() const
Size change due to installation as ByteCount for convenience.
MountPoint(const std::string &d, HintFlags hints)
Ctor just name and hints, all sizes 0.