libzypp: zypp::DiskUsageCounter Class Reference

libzypp 17.38.7

zypp::DiskUsageCounter Class Reference

Compute disk space occupied by packages across partitions/directories. More...

`#include <zypp/DiskUsageCounter.h>`

## Classes
class | MountPoint
| Mount point description If block_size is set DiskUsageCoutner will assume half a block_size is wasted per file, in case a package provides detailed isk usage information. More...

## Public Types
using | MountPointSet = std::set<MountPoint>

## Public Member Functions
| DiskUsageCounter ()
| DiskUsageCounter (MountPointSet mps_r)
| Ctor taking the MountPointSet to compute.
void | setMountPoints (const MountPointSet &mps_r)
| Set a MountPointSet to compute.
const MountPointSet & | getMountPoints () const
| Get the current MountPointSet.
MountPointSet | disk_usage (const ResPool &pool) const
| Compute disk usage if the current transaction woud be commited.
MountPointSet | disk_usage (sat::Solvable solv_r) const
| Compute disk usage of a single Solvable.
MountPointSet | disk_usage (const PoolItem &pi_r) const
MountPointSet | disk_usage (const ResObject::constPtr &obj_r) const
MountPointSet | disk_usage (const Bitmap &bitmap_r) const
| Compute disk usage of a collection defined by a solvable bitmap.
template<class Iterator>
MountPointSet | disk_usage (Iterator begin_r, Iterator end_r) const
| Compute disk usage of a collection (convertible by asSolvable).

## Static Public Member Functions
static MountPointSet | detectMountPoints (const std::string &rootdir="/")
| Get mountpoints of system below rootdir If we happen to detect snapshotting btrfs partitions, the MountPoint::growonly hint is set.
static MountPointSet | justRootPartition ()
| Only one entry for "/" to collect total sizes.

## Private Attributes
MountPointSet | _mps

## Detailed Description

Compute disk space occupied by packages across partitions/directories.

Definition at line 32 of file DiskUsageCounter.h.

## Member Typedef Documentation

## ◆ MountPointSet

using zypp::DiskUsageCounter::MountPointSet = std::set<MountPoint>

Definition at line 154 of file DiskUsageCounter.h.

## Constructor & Destructor Documentation

## ◆ DiskUsageCounter() [1/2]

zypp::DiskUsageCounter::DiskUsageCounter | ( |  | ) |
| inline

Definition at line 156 of file DiskUsageCounter.h.

## ◆ DiskUsageCounter() [2/2]

zypp::DiskUsageCounter::DiskUsageCounter | ( | MountPointSet | mps_r | ) |
| inline

Ctor taking the MountPointSet to compute.

Definition at line 160 of file DiskUsageCounter.h.

## Member Function Documentation

## ◆ setMountPoints()

void zypp::DiskUsageCounter::setMountPoints | ( | const MountPointSet & | mps_r | ) |
| inline

Set a MountPointSet to compute.

Definition at line 165 of file DiskUsageCounter.h.

## ◆ getMountPoints()

const MountPointSet & zypp::DiskUsageCounter::getMountPoints | ( |  | ) | const
| inline

Get the current MountPointSet.

Definition at line 169 of file DiskUsageCounter.h.

## ◆ detectMountPoints()

DiskUsageCounter::MountPointSet zypp::DiskUsageCounter::detectMountPoints | ( | const std::string & | rootdir = "/" | ) |
| static

Get mountpoints of system below rootdir If we happen to detect snapshotting btrfs partitions, the MountPoint::growonly hint is set.

Disk usage computation will assume that deleted packages will not free any space (kept in a snapshot).

Definition at line 129 of file DiskUsageCounter.cc.

## ◆ justRootPartition()

DiskUsageCounter::MountPointSet zypp::DiskUsageCounter::justRootPartition | ( |  | ) |
| static

Only one entry for "/" to collect total sizes.

Definition at line 337 of file DiskUsageCounter.cc.

## ◆ disk_usage() [1/6]

DiskUsageCounter::MountPointSet zypp::DiskUsageCounter::disk_usage | ( | const ResPool & | pool | ) | const

Compute disk usage if the current transaction woud be commited.

Definition at line 92 of file DiskUsageCounter.cc.

## ◆ disk_usage() [2/6]

DiskUsageCounter::MountPointSet zypp::DiskUsageCounter::disk_usage | ( | sat::Solvable | solv_r | ) | const

Compute disk usage of a single Solvable.

Definition at line 108 of file DiskUsageCounter.cc.

## ◆ disk_usage() [3/6]

MountPointSet zypp::DiskUsageCounter::disk_usage | ( | const PoolItem & | pi_r | ) | const
| inline

Definition at line 189 of file DiskUsageCounter.h.

## ◆ disk_usage() [4/6]

MountPointSet zypp::DiskUsageCounter::disk_usage | ( | const ResObject::constPtr & | obj_r | ) | const
| inline

Definition at line 192 of file DiskUsageCounter.h.

## ◆ disk_usage() [5/6]

DiskUsageCounter::MountPointSet zypp::DiskUsageCounter::disk_usage | ( | const Bitmap & | bitmap_r | ) | const

Compute disk usage of a collection defined by a solvable bitmap.

Definition at line 120 of file DiskUsageCounter.cc.

## ◆ disk_usage() [6/6]

template<class Iterator>

MountPointSet zypp::DiskUsageCounter::disk_usage | ( | Iterator | begin_r,
|  | Iterator | end_r ) const
| inline

Compute disk usage of a collection (convertible by asSolvable).

Definition at line 200 of file DiskUsageCounter.h.

## Member Data Documentation

## ◆ _mps

MountPointSet zypp::DiskUsageCounter::_mps
| private

Definition at line 209 of file DiskUsageCounter.h.

The documentation for this class was generated from the following files:

- zypp/DiskUsageCounter.h
- zypp/DiskUsageCounter.cc