1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/DiskUsageCounter.h
12 #ifndef ZYPP_DISKUSAGE_COUNTER_H
13 #define ZYPP_DISKUSAGE_COUNTER_H
15 #include <zypp/ResPool.h>
21 ///////////////////////////////////////////////////////////////////
23 { /////////////////////////////////////////////////////////////////
25 class DiskUsageCounter
31 * @short Mount point description
41 * Block size of the mount point
46 * Total size in kB (1024)
51 * Used size in kB (1024)
56 * Used size after commiting the pool (in kB)
58 mutable long long pkg_size;
63 * Ctor - initialize directory and package size
65 MountPoint(std::string d = "/", long long bs = 0LL, long long total = 0LL, long long used = 0LL, long long pkg = 0LL, bool ro=false) :
66 dir(d), block_size(bs), total_size(total), used_size(used), pkg_size(pkg), readonly(ro) {}
68 // sort by directory name
69 bool operator<( const MountPoint & rhs ) const
75 typedef std::set<MountPoint> MountPointSet;
79 bool setMountPoints(const MountPointSet &m)
85 MountPointSet getMountPoints()
90 static MountPointSet detectMountPoints(const std::string &rootdir = "/");
93 * Compute disk usage of the pool
95 MountPointSet disk_usage(const ResPool &pool);
101 ///////////////////////////////////////////////////////////////////
102 /////////////////////////////////////////////////////////////////
104 ///////////////////////////////////////////////////////////////////
105 #endif // ZYPP_DISKUSAGE_COUNTER_H