fixup Fix to build with libxml 2.12.x (fixes #505)
[platform/upstream/libzypp.git] / zypp / Package.h
index 1f3a8e1..03ef46f 100644 (file)
 #ifndef ZYPP_PACKAGE_H
 #define ZYPP_PACKAGE_H
 
-#include "zypp/ResObject.h"
-#include "zypp/PackageKeyword.h"
-#include "zypp/Changelog.h"
+#include <zypp/ResObject.h>
+#include <zypp/PackageKeyword.h>
+#include <zypp/Changelog.h>
+#include <zypp/VendorSupportOptions.h>
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
@@ -38,9 +39,28 @@ namespace zypp
 
   public:
     typedef sat::ArrayAttr<PackageKeyword,IdString> Keywords;
+    typedef sat::ArrayAttr<std::string,std::string> 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;
     /** */
@@ -62,9 +82,17 @@ namespace zypp
     ByteCount sourcesize() const;
     /** */
     std::list<std::string> authors() const;
-    /** */
-    std::list<std::string> filenames() 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;
@@ -73,6 +101,15 @@ namespace zypp
      */
     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
@@ -85,17 +122,12 @@ namespace zypp
      */
     OnMediaLocation location() const;
 
+    /** Location of the downloaded package in cache or an empty path. */
+    Pathname cachedLocation() const;
 
-    /** \deprecated no metadata always empty */
-    ZYPP_DEPRECATED std::string os() const { return std::string(); }
-    /** \deprecated no metadata always empty */
-    ZYPP_DEPRECATED std::string prein() const { return std::string(); }
-    /** \deprecated no metadata always empty */
-    ZYPP_DEPRECATED std::string postin() const { return std::string(); }
-    /** \deprecated no metadata always empty */
-    ZYPP_DEPRECATED std::string preun() const { return std::string(); }
-    /** \deprecated no metadata always empty */
-    ZYPP_DEPRECATED std::string postun() const { return std::string(); }
+    /** Whether the package is cached. */
+    bool isCached() const
+    { return ! cachedLocation().empty(); }
 
   protected:
     friend Ptr make<Self>( const sat::Solvable & solvable_r );
@@ -104,6 +136,7 @@ namespace zypp
     /** Dtor */
     virtual ~Package();
   };
+
   ///////////////////////////////////////////////////////////////////
 
   /////////////////////////////////////////////////////////////////