Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / RepoManager.h
index 0de55e5..3d0bdfd 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "zypp/base/PtrTypes.h"
 #include "zypp/base/Iterator.h"
+#include "zypp/base/Flags.h"
 
 #include "zypp/Pathname.h"
 #include "zypp/ZConfig.h"
@@ -87,11 +88,7 @@ namespace zypp
      * Target distro ID to be used when refreshing repo index services.
      * Repositories not maching this ID will be skipped/removed.
      *
-     * The value is initialized upon construction to
-     * \ref Target::targetDistribution() if the Target is already initialized,
-     * otherwise the value is initially empty.
-     *
-     * If empty, no repositories contained in the index will be skipped.
+     * If empty, \ref Target::targetDistribution() will be used instead.
      */
     std::string servicesTargetDistro;
 
@@ -141,10 +138,17 @@ namespace zypp
       BuildForced
     };
 
-    enum RepoRemovePolicy
+    /** Flags for tuning RefreshService */
+    enum RefreshServiceBit
     {
-
+      RefreshService_restoreStatus     = (1<<0),       ///< Force restoring repo enabled/disabled status
+      RefreshService_forceRefresh      = (1<<1),       ///< Force refresh even if TTL is not reached
     };
+    ZYPP_DECLARE_FLAGS(RefreshServiceFlags,RefreshServiceBit);
+
+    /** Options tuning RefreshService */
+    typedef RefreshServiceFlags RefreshServiceOptions;
+
 
     /** \name Known repositories.
      *
@@ -591,7 +595,7 @@ namespace zypp
      *
      * \see refreshService(ServiceInfo)
      */
-    void refreshServices();
+    void refreshServices( const RefreshServiceOptions & options_r = RefreshServiceOptions() );
 
     /**
      * Refresh specific service.
@@ -601,9 +605,9 @@ namespace zypp
      * \throws RepoException if service is not found.
      * \throws MediaException If there's a problem downloading the repo index file.
      */
-    void refreshService( const std::string & alias );
+    void refreshService( const std::string & alias, const RefreshServiceOptions & options_r = RefreshServiceOptions() );
     /** \overload Take alias from ServiceInfo */
-    void refreshService( const ServiceInfo & service );
+    void refreshService( const ServiceInfo & service, const RefreshServiceOptions & options_r = RefreshServiceOptions() );
 
     /**
      * Modifies service file (rewrites it with new values) and underlying
@@ -689,6 +693,7 @@ namespace zypp
     /** Pointer to implementation */
     RWCOW_pointer<Impl> _pimpl;
   };
+  ZYPP_DECLARE_OPERATORS_FOR_FLAGS(RepoManager::RefreshServiceFlags);
   ///////////////////////////////////////////////////////////////////
 
   /** \relates RepoManager Stream output */