libzypp: zypp/Fetcher.h Source File

libzypp 17.25.10

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 {
123 AutoAddContentFileIndexes = 0x0001,
128 AutoAddChecksumsIndexes = 0x0002,
133 AutoAddIndexes = AutoAddContentFileIndexes | AutoAddChecksumsIndexes,
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,
321 const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc() );
322
323 private:
325 RWCOW_pointer<Impl> _pimpl;
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
Digest.h
FileChecker.h
Flags.h
MediaSetAccess.h
OnMediaLocation.h
Pathname.h
ProgressData.h
PtrTypes.h
Url.h
zypp::Fetcher::Impl
Fetcher implementation.
Definition: Fetcher.cc:127
zypp::Fetcher
This class allows to retrieve a group of files in a confortable way, providing some smartness that do...
Definition: Fetcher.h:106
zypp::Fetcher::_pimpl
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: Fetcher.h:325
zypp::Fetcher::addIndex
void addIndex(const OnMediaLocation &resource)
Adds an index containing metadata (for example checksums ) that will be retrieved and read before the...
Definition: Fetcher.cc:851
zypp::Fetcher::options
Options options() const
Get current options.
Definition: Fetcher.cc:826
zypp::Fetcher::reset
void reset()
Reset the transfer (jobs) list.
Definition: Fetcher.cc:867
zypp::Fetcher::operator<<
friend std::ostream & operator<<(std::ostream &str, const Fetcher &obj)
Definition: Fetcher.cc:879
zypp::Fetcher::start
void start(const Pathname &dest_dir, MediaSetAccess &media, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
start the transfer to a destination directory dest_dir You have to provde a media set access media to...
Definition: Fetcher.cc:872
zypp::Fetcher::ZYPP_DECLARE_FLAGS
ZYPP_DECLARE_FLAGS(Options, Option)
zypp::Fetcher::enqueue
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:857
zypp::Fetcher::enqueueDir
void enqueueDir(const OnMediaLocation &resource, bool recursive=false, const FileChecker &checker=FileChecker())
Enqueue a directory.
Definition: Fetcher.cc:836
zypp::Fetcher::setOptions
void setOptions(Options options)
Set the Fetcher options.
Definition: Fetcher.cc:821
zypp::Fetcher::Option
Option
Various option flags to change behavior.
Definition: Fetcher.h:118
zypp::Fetcher::AutoAddIndexes
@ AutoAddIndexes
If a content or CHECKSUMS file is found, it is downloaded and read.
Definition: Fetcher.h:133
zypp::Fetcher::AutoAddChecksumsIndexes
@ AutoAddChecksumsIndexes
If a CHECKSUMS file is found, it is downloaded and read.
Definition: Fetcher.h:128
zypp::Fetcher::AutoAddContentFileIndexes
@ AutoAddContentFileIndexes
If a content file is found, it is downloaded and read.
Definition: Fetcher.h:123
zypp::Fetcher::Fetcher
Fetcher()
Default ctor.
Definition: Fetcher.cc:814
zypp::Fetcher::enqueueDigestedDir
void enqueueDigestedDir(const OnMediaLocation &resource, bool recursive=false, const FileChecker &checker=FileChecker())
Enqueue a directory and always check for checksums.
Definition: Fetcher.cc:843
zypp::Fetcher::addCachePath
void addCachePath(const Pathname &cache_dir)
adds a directory to the list of directories where to look for cached files
Definition: Fetcher.cc:862
zypp::Fetcher::enqueueDigested
void enqueueDigested(const OnMediaLocation &resource, const FileChecker &checker=FileChecker(), const Pathname &deltafile=Pathname())
Enqueue a object for transferal, they will not be transferred until start() is called.
Definition: Fetcher.cc:831
zypp::Fetcher::~Fetcher
virtual ~Fetcher()
Dtor.
Definition: Fetcher.cc:818
zypp::MediaSetAccess
Media access layer responsible for handling files distributed on a set of media with media change and...
Definition: MediaSetAccess.h:81
zypp::OnMediaLocation
Describes a resource file located on a medium.
Definition: OnMediaLocation.h:39
zypp::ProgressData::ReceiverFnc
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
Definition: ProgressData.h:139
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:45
str
String related utilities and Regular expression matching.
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:147
zypp::FileChecker
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Definition: FileChecker.h:28
zypp::ZYPP_DECLARE_OPERATORS_FOR_FLAGS
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(DiskUsageCounter::MountPoint::HintFlags)
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition: PtrTypes.h:459