libzypp  11.13.5
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/base/Flags.h"
19 #include "zypp/base/PtrTypes.h"
20 #include "zypp/Pathname.h"
21 #include "zypp/Url.h"
22 #include "zypp/OnMediaLocation.h"
23 #include "zypp/Digest.h"
24 #include "zypp/MediaSetAccess.h"
25 #include "zypp/FileChecker.h"
26 #include "zypp/ProgressData.h"
27 
29 namespace zypp
30 {
31 
105  class Fetcher
106  {
107  friend std::ostream & operator<<( std::ostream & str,
108  const Fetcher & obj );
109  public:
111  class Impl;
112  public:
113 
117  enum Option
118  {
134  };
135  ZYPP_DECLARE_FLAGS(Options, Option);
136 
138  Fetcher();
140  virtual ~Fetcher();
141 
142  public:
143 
148  void setOptions( Options options );
149 
154  Options options() const;
155 
180  void addIndex( const OnMediaLocation &resource );
181 
187  void enqueue( const OnMediaLocation &resource,
188  const FileChecker &checker = FileChecker() );
189 
207  void enqueueDigested( const OnMediaLocation &resource,
208  const FileChecker &checker = FileChecker(), const Pathname &deltafile = Pathname());
209 
210 
250  void enqueueDir( const OnMediaLocation &resource,
251  bool recursive = false,
252  const FileChecker &checker = FileChecker() );
253 
294  void enqueueDigestedDir( const OnMediaLocation &resource,
295  bool recursive = false,
296  const FileChecker &checker = FileChecker() );
297 
302  void addCachePath( const Pathname &cache_dir );
303 
308  void reset();
309 
319  void start( const Pathname &dest_dir,
320  MediaSetAccess &media,
322 
323  private:
326  };
328  ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Fetcher::Options);
329 
331  std::ostream & operator<<( std::ostream & str, const Fetcher & obj );
332 
334 } // namespace zypp
336 #endif // ZYPP_FETCHER_H