libzypp  17.38.7
Fetcher.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_FETCHER_H
13 #define ZYPP_FETCHER_H
14 
15 #include <iosfwd>
16 #include <list>
17 
18 #include <zypp-core/base/Flags.h>
20 #include <zypp-core/Pathname.h>
21 #include <zypp-core/Url.h>
22 #include <zypp-core/OnMediaLocation>
23 #include <zypp/Digest.h>
24 #include <zypp/MediaSetAccess.h>
25 #include <zypp/FileChecker.h>
26 #include <zypp-core/ui/ProgressData>
27 
29 namespace zypp
30 {
31 
114  {
115  friend std::ostream & operator<<( std::ostream & str,
116  const Fetcher & obj );
117  public:
119  class Impl;
120  public:
121 
125  enum Option
126  {
131  AutoAddContentFileIndexes = 0x0001,
136  AutoAddChecksumsIndexes = 0x0002,
141  AutoAddIndexes = AutoAddContentFileIndexes | AutoAddChecksumsIndexes,
142  };
143  ZYPP_DECLARE_FLAGS(Options, Option);
144 
146  Fetcher();
148  virtual ~Fetcher();
149 
150  public:
151 
156  void setOptions( Options options );
157 
162  Options options() const;
163 
188  void addIndex( const OnMediaLocation &resource );
189 
195  void enqueue( const OnMediaLocation &resource,
196  const FileChecker &checker = FileChecker() );
197 
209  void enqueueDigested( const OnMediaLocation &resource, const FileChecker &checker = FileChecker() );
210 
211 
217  ZYPP_DEPRECATED void enqueueDigested( const OnMediaLocation &resource,
218  const FileChecker &checker, const Pathname &deltafile );
219 
220 
260  void enqueueDir( const OnMediaLocation &resource,
261  bool recursive = false,
262  const FileChecker &checker = FileChecker() );
263 
304  void enqueueDigestedDir( const OnMediaLocation &resource,
305  bool recursive = false,
306  const FileChecker &checker = FileChecker() );
307 
312  void addCachePath( const Pathname &cache_dir );
313 
314 
316  Default = 0,
317  CleanFiles = 1
318  };
323  void addCachePath( const Pathname &cache_dir, CacheOptions options );
324 
329  void reset();
330 
336  void setMediaSetAccess ( MediaSetAccess &media );
337 
347  void start( const Pathname &dest_dir,
349 
359  void start( const Pathname &dest_dir,
360  MediaSetAccess &media,
362 
363  public:
373  static Pathname mapToCachePath( Pathname remotePath_r );
374  static Pathname mapToCachePath( const OnMediaLocation & resource_r )
375  { return mapToCachePath( resource_r.filename() ); }
376 
377  private:
380  };
382  ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Fetcher::Options);
383 
385  std::ostream & operator<<( std::ostream & str, const Fetcher & obj );
386 
388 } // namespace zypp
390 #endif // ZYPP_FETCHER_H
Mutable option.
Definition: ZConfig.cc:161
ZYPP_DECLARE_FLAGS(VendorSupportOptions, VendorSupportOption)
Pathname deltafile
static Pathname mapToCachePath(const OnMediaLocation &resource_r)
Definition: Fetcher.h:374
Describes a resource file located on a medium.
#define ZYPP_DEPRECATED
The ZYPP_DEPRECATED macro can be used to trigger compile-time warnings with gcc >= 3...
Definition: Globals.h:112
Option
Various option flags to change behavior.
Definition: Fetcher.h:125
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
Definition: progressdata.h:140
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(DiskUsageCounter::MountPoint::HintFlags)
String related utilities and Regular expression matching.
Request the standard behavior (as defined in zypp.conf or &#39;Job&#39;)
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: Fetcher.h:379
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition: Arch.h:173
const Pathname & filename() const
The path to the resource on the medium.
Fetcher implementation.
Definition: Fetcher.cc:175
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Definition: Capabilities.cc:65
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Definition: FileChecker.h:29
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
This class allows to retrieve a group of files in a confortable way, providing some smartness that do...
Definition: Fetcher.h:113