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 * This is one value from \ref VendorSupportOption
52 VendorSupportOption vendorSupport() const;
55 * True if the vendor support for this package
56 * is unknown or explictly unsupported.
58 bool maybeUnsupported() const;
60 /** Get the package change log */
61 Changelog changelog() const;
63 std::string buildhost() const;
65 std::string distribution() const;
67 std::string license() const;
69 std::string packager() const;
71 std::string group() const;
73 Keywords keywords() const;
74 /** Don't ship it as class Url, because it might be
75 * in fact anything but a legal Url. */
76 std::string url() const;
77 /** Size of corresponding the source package. */
78 ByteCount sourcesize() const;
80 std::list<std::string> authors() const;
82 /** Return the packages filelist (if available).
83 * The returned \ref FileList appears to be a container of
84 * \c std::string. In fact it is a query, so it does not
85 * consume much memory.
87 FileList filelist() const;
89 /** \name Source package handling
92 /** Name of the source rpm this package was built from.
94 std::string sourcePkgName() const;
96 /** Edition of the source rpm this package was built from.
98 Edition sourcePkgEdition() const;
100 /** The type of the source rpm (\c "src" or \c "nosrc").
102 std::string sourcePkgType() const;
104 /** The source rpms \c "name-version-release.type"
106 std::string sourcePkgLongName() const;
110 * Checksum the source says this package should have.
113 CheckSum checksum() const;
115 /** Location of the resolvable in the repository.
116 * \ref OnMediaLocation conatins all information required to
117 * retrieve the packge (url, checksum, etc.).
119 OnMediaLocation location() const;
122 friend Ptr make<Self>( const sat::Solvable & solvable_r );
124 Package( const sat::Solvable & solvable_r );
129 ///////////////////////////////////////////////////////////////////
131 /////////////////////////////////////////////////////////////////
133 ///////////////////////////////////////////////////////////////////
134 #endif // ZYPP_PACKAGE_H