PkgDu Class Reference
Class to store package diskspace usage info.
More...
#include <PkgDu.h>
List of all members.
Detailed Description
Class to store package diskspace usage info.
PkgDu
maintains a set of PkgDu::Entry
to keep inforamtion about diskspace usage in several directories.
A PkgDu::Entry
is identified by a directory name (expected to be an absolute path, a trailing '/' is appended if not present). Values for size and number of files within this directory are mutable.
As the diskspace usage depends on the filesystems blocksize, you'll probabely get the closest result counting filesizes rounded up to full Kb and the number of files. Diskspace usage calculation will then add additional half blocksize for each file.
PkgDu dudata;
for ( all dirs ) {
PkgDu::Entry dirdata( dir.name );
for ( all files in dir ) {
dirdata._size +=
FSize( file.size ).fullBlock( **defaults to 1K** );
++dirdata._files;
}
dudata.add( dirdata );
}
Member Typedef Documentation
Constructor & Destructor Documentation
PkgDu::PkgDu |
( |
|
) |
[inline] |
|
Member Function Documentation
void PkgDu::add |
( |
const std::string & |
dirname_r, |
|
|
const FSize & |
size_r = 0, |
|
|
const unsigned & |
files_r = 0 |
|
) |
[inline] |
|
|
Add an entry. If already present, sum up the new entries size and files value. |
void PkgDu::add |
( |
const Entry & |
newent_r |
) |
[inline] |
|
|
Add an entry. If already present, sum up the new entries size and files value. |
void PkgDu::addFrom |
( |
const std::list< std::string > & |
dudata_r |
) |
|
|
|
Add entries parsed from a packages.DU file |
|
Forward const iterator pointing to the first entry (if any) |
|
Forward iterator pointing to the first entry (if any) |
void PkgDu::clear |
( |
|
) |
[inline] |
|
|
Forward const iterator pointing behind the last entry. |
|
Forward iterator pointing behind the last entry. |
PkgDu::Entry PkgDu::extract |
( |
const std::string & |
dirname_r |
) |
|
|
|
Sum up any entries for dirname_r and its descendants and remove them on the fly. Return the result. |
|
Reverse const iterator pointing to the last entry (if any) |
|
Reverse iterator pointing to the last entry (if any) |
|
Reverse const iterator pointing before the first entry. |
|
Reverse iterator pointing before the first entry. |
void PkgDu::setFrom |
( |
const std::list< std::string > & |
dudata_r |
) |
[inline] |
|
|
Set entries parsed from a packages.DU file |
unsigned PkgDu::size |
( |
|
) |
const [inline] |
|
Friends And Related Function Documentation
std::ostream& operator<< |
( |
std::ostream & |
str, |
|
|
const PkgDu & |
obj |
|
) |
[friend] |
|
Member Data Documentation
The documentation for this class was generated from the following files:
Generated on Fri Nov 9 14:30:32 2007 for yast2-packagemanager by
1.3.6