*
*/
#include "zypp/detail/PackageImplIf.h"
+#include <iostream>
+
+using namespace std;
///////////////////////////////////////////////////////////////////
namespace zypp
std::list<std::string> PackageImplIf::postun() const
{ return std::list<std::string>(); }
- FSize PackageImplIf::sourcesize() const
- { return FSize(); }
+ ByteCount PackageImplIf::sourcesize() const
+ { return ByteCount(); }
- FSize PackageImplIf::archivesize() const
- { return FSize(); }
+ ByteCount PackageImplIf::archivesize() const
+ { return ByteCount(); }
std::list<std::string> PackageImplIf::authors() const
{ return std::list<std::string>(); }
License PackageImplIf::licenseToConfirm() const
{ return License(); }
+ // disk usage class methods
+
+ std::ostream & operator<<( std::ostream & str, const PackageImplIf::DiskUsage::Entry & obj )
+ {
+ return str << obj.path << '\t' << obj._size << "; files " << obj.files;
+ }
+
+ PackageImplIf::DiskUsage::Entry PackageImplIf::DiskUsage::extract( const std::string & dirname_r )
+ {
+ Entry ret( dirname_r );
+
+ iterator fst = begin();
+ for ( ; fst != end() && !fst->isBelow( ret ); ++fst )
+ ; // seek 1st equal or below
+
+ if ( fst != end() ) {
+ iterator lst = fst;
+ for ( ; lst != end() && lst->isBelow( ret ); ++lst ) {
+ // collect while below
+ ret += *lst;
+ }
+ // remove
+ _dirs.erase( fst, lst );
+ }
+
+ return ret;
+ }
+
+ std::ostream & operator<<( std::ostream & str, const PackageImplIf::DiskUsage & obj )
+ {
+ str << "Package Disk Usage {" << endl;
+ for ( PackageImplIf::DiskUsage::EntrySet::const_iterator it = obj._dirs.begin(); it != obj._dirs.end(); ++it ) {
+ str << " " << *it << endl;
+ }
+ return str << "}";
+ }
+
/////////////////////////////////////////////////////////////////
} // namespace detail
///////////////////////////////////////////////////////////////////