12 #ifndef ZYPP_DISKUSAGE_H
13 #define ZYPP_DISKUSAGE_H
29 Entry(
const std::string& path_r,
30 const unsigned size_r = 0,
31 const unsigned files_r = 0)
37 if ( *
path.begin() !=
'/' )
path.insert(
path.begin(),
'/' );
38 if ( *
path.rbegin() !=
'/' )
path.insert(
path.end(),
'/' );
44 friend std::ostream &
operator<<( std::ostream & str,
const Entry & obj );
62 return(
path.compare( 0, rhs.
path.size(), rhs.
path ) == 0 );
67 bool isBelow(
const std::string & dirname_r )
const {
98 std::pair<EntrySet::iterator,bool> res =
_dirs.insert( newent_r );
100 *res.first += newent_r;
106 void add(
const std::string & dirname_r,
const unsigned & size_r = 0,
const unsigned & files_r = 0 ) {
107 add(
Entry( dirname_r, size_r, files_r ) );
125 Entry
extract(
const std::string & dirname_r );
178 #endif // ZYPP_DISKUSAGE_H