libzypp  15.28.6
zypp::DiskUsageCounter Class Reference

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

#include <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

typedef std::set< MountPointMountPointSet
 

Public Member Functions

 DiskUsageCounter ()
 
 DiskUsageCounter (const MountPointSet &mps_r)
 Ctor taking the MountPointSet to compute. More...
 
void setMountPoints (const MountPointSet &mps_r)
 Set a MountPointSet to compute. More...
 
const MountPointSetgetMountPoints () const
 Get the current MountPointSet. More...
 
MountPointSet disk_usage (const ResPool &pool) const
 Compute disk usage if the current transaction woud be commited. More...
 
MountPointSet disk_usage (sat::Solvable solv_r) const
 Compute disk usage of a single Solvable. More...
 
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. More...
 
template<class Iterator >
MountPointSet disk_usage (Iterator begin_r, Iterator end_r) const
 Compute disk usage of a collection (convertible by asSolvable). More...
 

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. More...
 
static MountPointSet justRootPartition ()
 Only one entry for "/" to collect total sizes. More...
 

Private Attributes

MountPointSet _mps
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const DiskUsageCounter &obj)
 

Detailed Description

Compute disk space occupied by packages across partitions/directories.

Definition at line 31 of file DiskUsageCounter.h.

Member Typedef Documentation

Definition at line 153 of file DiskUsageCounter.h.

Constructor & Destructor Documentation

zypp::DiskUsageCounter::DiskUsageCounter ( )
inline

Definition at line 155 of file DiskUsageCounter.h.

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

Ctor taking the MountPointSet to compute.

Definition at line 159 of file DiskUsageCounter.h.

Member Function Documentation

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

Set a MountPointSet to compute.

Definition at line 164 of file DiskUsageCounter.h.

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

Get the current MountPointSet.

Definition at line 168 of file DiskUsageCounter.h.

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.

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

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

Definition at line 337 of file DiskUsageCounter.cc.

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.

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.

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 188 of file DiskUsageCounter.h.

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 191 of file DiskUsageCounter.h.

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.

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 199 of file DiskUsageCounter.h.

Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  str,
const DiskUsageCounter obj 
)
related

Stream output

Definition at line 221 of file DiskUsageCounter.h.

Member Data Documentation

MountPointSet zypp::DiskUsageCounter::_mps
private

Definition at line 208 of file DiskUsageCounter.h.


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