libzypp 17.32.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-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
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
202
203
210 const FileChecker &checker, const Pathname &deltafile );
211
212
253 bool recursive = false,
254 const FileChecker &checker = FileChecker() );
255
297 bool recursive = false,
298 const FileChecker &checker = FileChecker() );
299
304 void addCachePath( const Pathname &cache_dir );
305
310 void reset();
311
317 void setMediaSetAccess ( MediaSetAccess &media );
318
328 void start( const Pathname &dest_dir,
330
340 void start( const Pathname &dest_dir,
341 MediaSetAccess &media,
343
344 private:
347 };
349 ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Fetcher::Options);
350
352 std::ostream & operator<<( std::ostream & str, const Fetcher & obj );
353
355} // namespace zypp
357#endif // ZYPP_FETCHER_H
Pathname deltafile
RepoManager implementation.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition AutoDispose.h:95
void start(const Pathname &dest_dir, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
start the transfer to a destination directory dest_dir The media has to be provides with setMediaSetA...
Definition Fetcher.cc:914
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition Fetcher.h:344
void addIndex(const OnMediaLocation &resource)
Adds an index containing metadata (for example checksums ) that will be retrieved and read before the...
Definition Fetcher.cc:887
Options options() const
Get current options.
Definition Fetcher.cc:857
friend std::ostream & operator<<(std::ostream &str, const Fetcher &obj)
Definition Fetcher.cc:926
void reset()
Reset the transfer (jobs) list.
Definition Fetcher.cc:904
void enqueue(const OnMediaLocation &resource, const FileChecker &checker=FileChecker())
Enqueue a object for transferal, they will not be transferred until start() is called.
Definition Fetcher.cc:893
void enqueueDir(const OnMediaLocation &resource, bool recursive=false, const FileChecker &checker=FileChecker())
Enqueue a directory.
Definition Fetcher.cc:872
void setOptions(Options options)
Set the Fetcher options.
Definition Fetcher.cc:852
Option
Various option flags to change behavior.
Definition Fetcher.h:116
@ AutoAddIndexes
If a content or CHECKSUMS file is found, it is downloaded and read.
Definition Fetcher.h:131
@ AutoAddChecksumsIndexes
If a CHECKSUMS file is found, it is downloaded and read.
Definition Fetcher.h:126
@ AutoAddContentFileIndexes
If a content file is found, it is downloaded and read.
Definition Fetcher.h:121
Fetcher()
Default ctor.
Definition Fetcher.cc:845
void enqueueDigestedDir(const OnMediaLocation &resource, bool recursive=false, const FileChecker &checker=FileChecker())
Enqueue a directory and always check for checksums.
Definition Fetcher.cc:879
void enqueueDigested(const OnMediaLocation &resource, const FileChecker &checker=FileChecker())
Enqueue a object for transferal, they will not be transferred until start() is called.
Definition Fetcher.cc:867
void addCachePath(const Pathname &cache_dir)
adds a directory to the list of directories where to look for cached files
Definition Fetcher.cc:899
void setMediaSetAccess(MediaSetAccess &media)
Sets the media set access that will be used to precache and to download the files when start is calle...
Definition Fetcher.cc:909
virtual ~Fetcher()
Dtor.
Definition Fetcher.cc:849
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.
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.
function< void(const Pathname &file) FileChecker)
Functor signature used to check files.
Definition FileChecker.h:38
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Mutable option.
Definition ZConfig.cc:334
#define ZYPP_DEPRECATED
The ZYPP_DEPRECATED macro can be used to trigger compile-time warnings with gcc >= 3....
Definition Globals.h:99
#define ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Name)
Definition Flags.h:177
#define ZYPP_DECLARE_FLAGS(Name, Enum)
Definition Flags.h:174