ByteCount Package::archivesize() const
{ return pimpl().archivesize(); }
+ DiskUsage Package::diskusage() const
+ { return pimpl().diskusage(); }
+
/** */
std::list<std::string> Package::authors() const
{ return pimpl().authors(); }
std::list<std::string> authors() const;
/** */
std::list<std::string> filenames() const;
+
+ /** Disk usage per directory */
+ DiskUsage diskusage() const;
+
/** */
License licenseToConfirm() const;
/** */
ByteCount PackageImplIf::archivesize() const
{ return ByteCount(); }
+ DiskUsage PackageImplIf::diskusage() const
+ { return DiskUsage(); }
+
std::list<std::string> PackageImplIf::authors() const
{ return std::list<std::string>(); }
#include "zypp/Changelog.h"
#include "zypp/PatchRpm.h"
#include "zypp/DeltaRpm.h"
+#include "zypp/DiskUsage.h"
///////////////////////////////////////////////////////////////////
namespace zypp
/** */
virtual ByteCount archivesize() const PURE_VIRTUAL;
/** */
+ virtual DiskUsage diskusage() const PURE_VIRTUAL;
+ /** */
virtual std::list<std::string> authors() const PURE_VIRTUAL;
/** */
virtual std::list<std::string> filenames() const PURE_VIRTUAL;
using namespace parser::tagfile;
+
+ struct PackageDiskUsageParser : public parser::tagfile::TagFileParser
+ {
+ PkgDiskUsage result;
+ NVRAD _current_nvrad;
+ bool _pkg_pending;
+
+ virtual void beginParse()
+ {
+ _pkg_pending = false;
+ }
+
+ /* Consume SingleTag data. */
+ virtual void consume( const SingleTag & stag_r )
+ {
+ if ( stag_r.name == "Pkg" )
+ {
+ std::vector<std::string> words;
+ str::split( stag_r.value, std::back_inserter(words) );
+
+ if ( str::split( stag_r.value, std::back_inserter(words) ) != 4 )
+ ZYPP_THROW( ParseException( "Pkg" ) );
+
+ _pkg_pending = true;
+ _current_nvrad = NVRAD( words[0], Edition(words[1],words[2]), Arch(words[3]) );
+ }
+ else
+ {
+ //ZYPP_THROW( ParseException( "Loc" ) );
+ ERR << "warning found unexpected tag " << stag_r.name << std::endl;
+ }
+ }
+
+ /* Consume MulitTag data. */
+ virtual void consume( const MultiTag & mtag_r )
+ {
+ if ( ! _pkg_pending )
+ return;
+
+ if ( mtag_r.name == "Dir" )
+ {
+ //collectDeps( mtag_r.values, _nvrad[Dep::PROVIDES] );
+ }
+ }
+
+ virtual void endParse()
+ {}
+
+ };
+
+
struct PackagesParser : public parser::tagfile::TagFileParser
{
PkgContent _result;
#include "zypp/base/PtrTypes.h"
#include "zypp/Pathname.h"
#include "zypp/Package.h"
+#include "zypp/DiskUsage.h"
#include "zypp/NVRAD.h"
#include "zypp/source/susetags/SuseTagsImpl.h"
#include "zypp/source/susetags/SuseTagsPackageImpl.h"
typedef shared_ptr<SuseTagsPackageImpl> PkgImplPtr;
typedef std::map<NVRAD, PkgImplPtr> PkgContent;
+ typedef std::map<NVRAD, DiskUsage> PkgDiskUsage;
/** \deprecated Just temporary.
* \throws ParseException and others.