X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=zypp%2FPackage.h;h=2219b8d69e31c82a25b64b1b583c79f6604b67e3;hb=HEAD;hp=ff48aa994458c04fe592d4ec148cae74b303a1ab;hpb=14d6cb2e14e80f9d77a4018ea8d02ff1569be6db;p=platform%2Fupstream%2Flibzypp.git diff --git a/zypp/Package.h b/zypp/Package.h index ff48aa9..03ef46f 100644 --- a/zypp/Package.h +++ b/zypp/Package.h @@ -12,13 +12,17 @@ #ifndef ZYPP_PACKAGE_H #define ZYPP_PACKAGE_H -#include "zypp/ResObject.h" -#include "zypp/detail/PackageImplIf.h" +#include +#include +#include +#include /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// + DEFINE_PTR_TYPE(Package); + /////////////////////////////////////////////////////////////////// // // CLASS NAME : Package @@ -28,29 +32,111 @@ namespace zypp class Package : public ResObject { public: - typedef Package Self; - typedef detail::PackageImplIf Impl; - typedef base::intrusive_ptr Ptr; - typedef base::intrusive_ptr constPtr; + typedef Package Self; + typedef ResTraits TraitsType; + typedef TraitsType::PtrType Ptr; + typedef TraitsType::constPtrType constPtr; + + public: + typedef sat::ArrayAttr Keywords; + typedef sat::ArrayAttr FileList; public: + + /** + * Returns the level of supportability the vendor + * gives to this package. + * + * If the identical package happens to appear in multiple + * repos with different support levels, the maximum + * level is returned. + * + * This is one value from \ref VendorSupportOption. + */ + VendorSupportOption vendorSupport() const; + + /** + * True if the vendor support for this package + * is unknown or explictly unsupported. + */ + bool maybeUnsupported() const; + + /** Get the package change log */ + Changelog changelog() const; + /** */ + std::string buildhost() const; + /** */ + std::string distribution() const; + /** */ + std::string license() const; + /** */ + std::string packager() const; + /** */ + std::string group() const; + /** */ + Keywords keywords() const; + /** Don't ship it as class Url, because it might be + * in fact anything but a legal Url. */ + std::string url() const; + /** Size of corresponding the source package. */ + ByteCount sourcesize() const; /** */ - // data here: + std::list authors() const; + + /** Return the packages filelist (if available). + * The returned \ref FileList appears to be a container of + * \c std::string. In fact it is a query, so it does not + * consume much memory. + */ + FileList filelist() const; + + /** \name Source package handling + */ + //@{ + /** Name of the source rpm this package was built from. + */ + std::string sourcePkgName() const; + + /** Edition of the source rpm this package was built from. + */ + Edition sourcePkgEdition() const; + + /** The type of the source rpm (\c "src" or \c "nosrc"). + */ + std::string sourcePkgType() const; + + /** The source rpms \c "name-version-release.type" + */ + std::string sourcePkgLongName() const; + //@} + + /** + * Checksum the source says this package should have. + * \see \ref location + */ + CheckSum checksum() const; + + /** Location of the resolvable in the repository. + * \ref OnMediaLocation conatins all information required to + * retrieve the packge (url, checksum, etc.). + */ + OnMediaLocation location() const; + + /** Location of the downloaded package in cache or an empty path. */ + Pathname cachedLocation() const; + + /** Whether the package is cached. */ + bool isCached() const + { return ! cachedLocation().empty(); } protected: + friend Ptr make( const sat::Solvable & solvable_r ); /** Ctor */ - Package( const std::string & name_r, - const Edition & edition_r, - const Arch & arch_r ); + Package( const sat::Solvable & solvable_r ); /** Dtor */ virtual ~Package(); - - private: - /** Access implementation */ - virtual Impl & pimpl() = 0; - /** Access implementation */ - virtual const Impl & pimpl() const = 0; }; + /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////