fixup Fix to build with libxml 2.12.x (fixes #505)
[platform/upstream/libzypp.git] / zypp / Target.h
index 322e9e3..62cffba 100644 (file)
 
 #include <iosfwd>
 
-#include "zypp/base/ReferenceCounted.h"
-#include "zypp/base/NonCopyable.h"
-#include "zypp/base/PtrTypes.h"
-#include "zypp/APIConfig.h"
+#include <zypp/base/ReferenceCounted.h>
+#include <zypp/base/NonCopyable.h>
+#include <zypp/base/PtrTypes.h>
+#include <zypp/APIConfig.h>
 
-#include "zypp/Product.h"
-#include "zypp/Pathname.h"
-#include "zypp/ResPool.h"
+#include <zypp/Product.h>
+#include <zypp/Pathname.h>
+#include <zypp/ResPool.h>
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
@@ -78,9 +78,6 @@ namespace zypp
      */
     void unload();
 
-    /** Null implementation */
-    static Target_Ptr nullimpl();
-
     /** Refference to the RPM database */
     target::rpm::RpmDb & rpmDb();
 
@@ -96,13 +93,14 @@ namespace zypp
     /** Return the root set for this target */
     Pathname root() const;
 
+    /** Whether the targets \ref root is not \c "/". */
+    bool chrooted() const
+    { return( ! root().emptyOrRoot() ); }
+
     /** Return the path prefixed by the target root, unless it already is prefixed. */
     Pathname assertRootPrefix( const Pathname & path_r ) const
     { return Pathname::assertprefix( root(), path_r ); }
 
-    /** return the last modification date of the target */
-    Date timestamp() const;
-
     /**
      * returns the target base installed product, also known as
      * the distribution or platform.
@@ -130,6 +128,11 @@ namespace zypp
      */
     static LocaleSet requestedLocales( const Pathname & root_r );
 
+    /** Update the database of autoinstalled packages.
+     * This is done on commit, so you usually don't need to call this explicitly.
+     */
+    void updateAutoInstalled();
+
   public:
     /** \name Base product and registration.
      *
@@ -153,6 +156,14 @@ namespace zypp
     /** \overload */
     static std::string targetDistributionRelease( const Pathname & root_r );
 
+    /** This is \c register.flavor attribute of the installed base product.
+     * Used for registration.
+     * \note don't mistake this for \ref distributionFlavor
+     */
+    std::string targetDistributionFlavor() const;
+    /** \overload */
+    static std::string targetDistributionFlavor( const Pathname & root_r );
+
     struct DistributionLabel { std::string shortName; std::string summary; };
     /** This is \c shortName and \c summary attribute of the installed base product.
      * Used e.g. for the bootloader menu.
@@ -175,6 +186,7 @@ namespace zypp
      * the last used one. It can be empty is the target has never
      * been loaded, as the value is not present in the system
      * but computer from a package provides
+     * \note don't mistake this for \ref targetDistributionFlavor
      */
     std::string distributionFlavor() const;
     /** \overload */
@@ -214,8 +226,6 @@ namespace zypp
 
     /** Pointer to implementation */
     RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
-
-    static Target_Ptr _nullimpl;
   };
   ///////////////////////////////////////////////////////////////////