12 #ifndef ZYPP_DISKUSAGE_COUNTER_H
13 #define ZYPP_DISKUSAGE_COUNTER_H
67 const std::string & f = std::string(),
68 long long bs = 0LL,
long long total = 0LL,
long long used = 0LL,
long long pkg = 0LL,
81 const std::string & f = std::string(),
82 long long bs = 0LL,
long long total = 0LL,
long long used = 0LL,
long long pkg = 0LL,
84 :
MountPoint( std::string(d?d:
""), f, bs, total, used, pkg, hints )
90 long long bs,
long long total = 0LL,
long long used = 0LL,
long long pkg = 0LL,
92 :
MountPoint( d, std::string(), bs, total, used, pkg, hints )
96 long long bs,
long long total = 0LL,
long long used = 0LL,
long long pkg = 0LL,
98 :
MountPoint( std::string(d?d:
""), bs, total, used, pkg, hints )
104 :
MountPoint( d, std::string(), 0LL, 0LL, 0LL, 0LL, hints )
116 :
MountPoint( std::string(d?d:
""), HintFlags(hint) )
219 template<
class Iterator>
223 for_( it, begin_r, end_r )
248 #endif // ZYPP_DISKUSAGE_COUNTER_H
ByteCount blockSize() const
Block size of the filesystem as ByteCount for convenience.
A Solvable object within the sat Pool.
ByteCount commitDiff() const
Size change due to installation as ByteCount for convenience.
MountPoint(const std::string &d, Hint hint)
ZYPP_DEPRECATED MountPoint(const char *d, long long bs, long long total, long long used, long long pkg, bool ro)
growonly partitions (e.g. snapshotting btrfs)
Store and operate with byte count.
static MountPointSet justRootPartition()
Only one entry for "/" to collect total sizes.
bool readonly
hint for readonly partitions
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(DiskUsageCounter::MountPoint::HintFlags)
void set(size_type idx_r)
Set bit idx_r.
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.
friend std::ostream & operator<<(std::ostream &str, const MountPoint &obj)
TraitsType::constPtrType constPtr
long long total_size
Total size of the filesystem in KiB (0 if you don't care)
std::ostream & operator<<(std::ostream &str, const DiskUsageCounter &obj)
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)
DiskUsageCounter(const MountPointSet &mps_r)
Ctor taking the MountPointSet to compute.
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)
MountPointSet disk_usage(Iterator begin_r, Iterator end_r) const
Compute disk usage of a collection (convertible by asSolvable).
std::set< MountPoint > MountPointSet
MountPoint(const std::string &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)
Ctor initialize directory, fstype and sizes.
ZYPP_DEPRECATED MountPoint(const std::string &d, long long bs, long long total, long long used, long long pkg, bool ro)
std::ostream & operator<<(std::ostream &str, const Exception &obj)
ByteCount freeAfterCommit() const
Free size after installation as ByteCount for convenience.
Mount point description If block_size is set DiskUsageCoutner will assume half a block_size is wasted...
std::string dir
Directory name.
MountPoint(const char *d, Hint hint)
ByteCount totalSize() const
Total size of the filesystem as ByteCount for convenience.
long long pkg_size
Used size after installation in KiB (computed by DiskUsageCoutner)
static constexpr PoolSizeType poolSize
An object indicating the bitmap should match the current pools capacity.
MountPointSet disk_usage(const PoolItem &pi_r) const
static const Unit B
1 Byte
bool operator<(const MountPoint &rhs) const
Sort by directory name.
Compute disk space occupied by packages across partitions/directories.
MountPoint(const char *d, HintFlags hints)
ZYPP_DECLARE_FLAGS(HintFlags, Hint)
MountPointSet disk_usage(const ResObject::constPtr &obj_r) const
static const Unit K
1024 Byte
Reference to a PoolItem connecting ResObject and ResStatus.
ByteCount freeSize() const
Free size of the filesystem as ByteCount for convenience.
MountPoint(const char *d, long long bs, long long total=0LL, long long used=0LL, long long pkg=0LL, HintFlags hints=NoHint)
MountPointSet disk_usage(const ResPool &pool) const
Compute disk usage if the current transaction woud be commited.
bool growonly
hint for growonly partitions (e.g. snapshotting btrfs)
Libsolv (bit)Map wrapper.
#define ZYPP_DEPRECATED
The ZYPP_DEPRECATED macro can be used to trigger compile-time warnings with gcc >= 3...
To Solvable transform functor.
const MountPointSet & getMountPoints() const
Get the current MountPointSet.
ByteCount usedSize() const
Used size of the filesystem as ByteCount for convenience.
long long block_size
Block size of the filesystem in B (0 if you don't care)
ByteCount usedAfterCommit() const
Used size after installation as ByteCount for convenience.
void setMountPoints(const MountPointSet &mps_r)
Set a MountPointSet to compute.
static MountPointSet detectMountPoints(const std::string &rootdir="/")
Get mountpoints of system below rootdir If we happen to detect snapshotting btrfs partitions...
MountPoint(const std::string &d, HintFlags hints)
Ctor just name and hints, all sizes 0.