1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Package.h
12 #ifndef ZYPP_PACKAGE_H
13 #define ZYPP_PACKAGE_H
15 #include "zypp/ResObject.h"
16 #include "zypp/PackageKeyword.h"
17 #include "zypp/Changelog.h"
18 #include "zypp/VendorSupportOptions.h"
20 ///////////////////////////////////////////////////////////////////
22 { /////////////////////////////////////////////////////////////////
24 DEFINE_PTR_TYPE(Package);
26 ///////////////////////////////////////////////////////////////////
28 // CLASS NAME : Package
30 /** Package interface.
32 class Package : public ResObject
36 typedef ResTraits<Self> TraitsType;
37 typedef TraitsType::PtrType Ptr;
38 typedef TraitsType::constPtrType constPtr;
41 typedef sat::ArrayAttr<PackageKeyword,IdString> Keywords;
42 typedef sat::ArrayAttr<std::string,std::string> FileList;
47 * Returns the level of supportability the vendor
48 * gives to this package.
50 * If the identical package happens to appear in multiple
51 * repos with different support levels, the maximum
54 * This is one value from \ref VendorSupportOption.
56 VendorSupportOption vendorSupport() const;
59 * True if the vendor support for this package
60 * is unknown or explictly unsupported.
62 bool maybeUnsupported() const;
64 /** Get the package change log */
65 Changelog changelog() const;
67 std::string buildhost() const;
69 std::string distribution() const;
71 std::string license() const;
73 std::string packager() const;
75 std::string group() const;
77 Keywords keywords() const;
78 /** Don't ship it as class Url, because it might be
79 * in fact anything but a legal Url. */
80 std::string url() const;
81 /** Size of corresponding the source package. */
82 ByteCount sourcesize() const;
84 std::list<std::string> authors() const;
86 /** Return the packages filelist (if available).
87 * The returned \ref FileList appears to be a container of
88 * \c std::string. In fact it is a query, so it does not
89 * consume much memory.
91 FileList filelist() const;
93 /** \name Source package handling
96 /** Name of the source rpm this package was built from.
98 std::string sourcePkgName() const;
100 /** Edition of the source rpm this package was built from.
102 Edition sourcePkgEdition() const;
104 /** The type of the source rpm (\c "src" or \c "nosrc").
106 std::string sourcePkgType() const;
108 /** The source rpms \c "name-version-release.type"
110 std::string sourcePkgLongName() const;
114 * Checksum the source says this package should have.
117 CheckSum checksum() const;
119 /** Location of the resolvable in the repository.
120 * \ref OnMediaLocation conatins all information required to
121 * retrieve the packge (url, checksum, etc.).
123 OnMediaLocation location() const;
125 /** Location of the downloaded package in cache or an empty path. */
126 Pathname cachedLocation() const;
128 /** Whether the package is cached. */
129 bool isCached() const
130 { return ! cachedLocation().empty(); }
133 friend Ptr make<Self>( const sat::Solvable & solvable_r );
135 Package( const sat::Solvable & solvable_r );
140 ///////////////////////////////////////////////////////////////////
142 /////////////////////////////////////////////////////////////////
144 ///////////////////////////////////////////////////////////////////
145 #endif // ZYPP_PACKAGE_H