libzypp 17.38.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
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
29namespace zypp
30{
31
111 * where a remote resource will be located.
112 */
113 class ZYPP_API Fetcher
114 {
115 friend std::ostream & operator<<( std::ostream & str,
116 const Fetcher & obj );
117 public:
119 class Impl;
120 public:
121
123 * Various option flags to change behavior
124 */
125 enum Option
126 {
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 );
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,
362
363 public:
372 */
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
#define ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Name)
Definition Flags.h:177
#define ZYPP_DECLARE_FLAGS(Name, Enum)
Definition Flags.h:174
#define ZYPP_DEPRECATED
The ZYPP_DEPRECATED macro can be used to trigger compile-time warnings with gcc >= 3....
Definition Globals.h:112
Fetcher implementation.
Definition Fetcher.cc:176
This class allows to retrieve a group of files in a confortable way, providing some smartness that do...
Definition Fetcher.h:112
static Pathname mapToCachePath(Pathname remotePath_r)
Map a resource filename to a local path below a destDir.
Definition Fetcher.cc:990
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition Fetcher.h:377
Option
Various option flags to change behavior.
Definition Fetcher.h:124
@ AutoAddIndexes
If a content or CHECKSUMS file is found, it is downloaded and read.
Definition Fetcher.h:139
@ AutoAddChecksumsIndexes
If a CHECKSUMS file is found, it is downloaded and read.
Definition Fetcher.h:134
@ AutoAddContentFileIndexes
If a content file is found, it is downloaded and read.
Definition Fetcher.h:129
Fetcher()
Default ctor.
Definition Fetcher.cc:904
Media access layer responsible for handling files distributed on a set of media with media change and...
Describes a resource file located on a medium.
const Pathname & filename() const
The path to the resource on the medium.
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Definition FileChecker.h:38
Mutable option.
Definition ZConfig.cc:377
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469