Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / Product.h
index 57a03ad..c8233a7 100644 (file)
@@ -43,7 +43,7 @@ namespace zypp
      */
     sat::Solvable referencePackage() const;
 
-    /** For installed products the name of the coddesponding
+    /** For installed products the name of the corresponding
      * \c /etc/products.d entry.
     .*/
     std::string referenceFilename() const;
@@ -81,7 +81,7 @@ namespace zypp
     std::string productLine() const;
 
   public:
-    /** Untranslated short name like <tt>SLES 10</tt>*/
+    /** Untranslated short name like <tt>SLES 10</tt> (fallback: name) */
     std::string shortName() const;
 
     /** The product flavor (LiveCD Demo, FTP edition,...). */
@@ -97,14 +97,49 @@ namespace zypp
     /** The product flags */
     std::list<std::string> flags() const;
 
+    /** The date when this Product goes out of support as indicated by it's medadata.
+     * Use \ref hasEOfLife if it's important to distinguish whether the value
+     * is not defined in the metadata, or defined but empty/invalid/TBD.
+     */
+    Date endOfLife() const;
+
+    /** Return whether an EndOfLife value is actually defined in the metadata.
+     * A missing value (\c false) usually indicates that there will be no EOL,
+     * while an empty/invalid value indicates that there will be an  EOL date,
+     * but it's not yet known (FATE#320699).
+     */
+    bool hasEndOfLife() const;
+    /** \overload additionally returning the date (0 if TBD)
+     *         false, ( unchanged )    : no EOL
+     *         true,  ( 0 )            : EOL is still TBD
+     *         true,  ( !=0 )          : a valid EOL date
+     */
+    bool hasEndOfLife( Date & value ) const;
+
+    /** ContentIdentifier of required update repositories. */
+    std::vector<Repository::ContentIdentifier> updateContentIdentifier() const;
+
+    /** Whether \a cident_r is listed as required update repository. */
+    bool hasUpdateContentIdentifier( const Repository::ContentIdentifier & cident_r ) const;
+
+    /** Whether one of the ContentIdentifier is listed as required update repository. */
+    template <class TIterator>
+    bool hasUpdateContentIdentifier( TIterator begin, TIterator end ) const
+    {
+      for_( it, begin, end )
+       if ( hasUpdateContentIdentifier( *it ) )
+         return true;
+      return false;
+    }
+
   public:
     /** This is the \b installed product that is also targeted by the
      *  \c /etc/products.d/baseproduct symlink.
     */
     bool isTargetDistribution() const;
 
-    /** This is \c register.target attribute of an \b installed product.
-      * Used for registration.
+    /** This is \c register.target attribute of a product.
+      * Used for registration and filtering service repos.
       */
     std::string registerTarget() const;
 
@@ -113,11 +148,16 @@ namespace zypp
       */
     std::string registerRelease() const;
 
+    /** This is \c register.flavor attribute of a product.
+      * Used for registration.
+      */
+    std::string registerFlavor() const;
+
   public:
     /***/
     class UrlList;
 
-    /** Rerieve urls flagged with \c key_r for this product.
+    /** Retrieve URLs flagged with \c key_r for this product.
      *
      * This is the most common interface. There are convenience methods for
      * wellknown flags like \c "releasenotes", \c "register", \c "updateurls",