#include <Fetcher.h>
Public Member Functions | |
| Fetcher () | |
| Default ctor. | |
| virtual | ~Fetcher () |
| Dtor. | |
| void | enqueue (const OnMediaLocation &resource, const FileChecker &checker=FileChecker()) |
| Enqueue a object for transferal, they will not be transfered until start() is called. | |
| void | enqueueDigested (const OnMediaLocation &resource, const FileChecker &checker=FileChecker()) |
| Enqueue a object for transferal, they will not be transfered until start() is called. | |
| void | addCachePath (const Pathname &cache_dir) |
| adds a directory to the list of directories where to look for cached files | |
| void | reset () |
| Reset the transfer list and cache list. | |
| 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 get the files from The file tree will be replicated inside this directory | |
Private Attributes | |
| RWCOW_pointer< Impl > | _pimpl |
| Pointer to implementation. | |
Friends | |
| std::ostream & | operator<< (std::ostream &str, const Fetcher &obj) |
| Stream output. | |
Classes | |
| struct | Impl |
| Fetcher implementation. More... | |
MediaSetAccess access(url, path); Fetcher fetcher; fetcher.enqueue( OnMediaLocation().filename("/content") ); fetcher.addCachePath("/tmp/cache") fetcher.start( "/download-dir, access ); fetcher.reset();
To use the checkers. just create a functor implementing bool operator()(const Pathname &file)
ChecksumFileChecker checker(CheckSum("sha1", "...."); fetcher.enqueue( location, checker);
If you need to use more than one checker
Definition at line 64 of file Fetcher.h.
| zypp::Fetcher::Fetcher | ( | ) |
| zypp::Fetcher::~Fetcher | ( | ) | [virtual] |
| void zypp::Fetcher::enqueue | ( | const OnMediaLocation & | resource, | |
| const FileChecker & | checker = FileChecker() | |||
| ) |
Enqueue a object for transferal, they will not be transfered until start() is called.
Definition at line 274 of file Fetcher.cc.
References _pimpl.
Referenced by zypp::repo::yum::Downloader::download(), zypp::repo::susetags::Downloader::download(), and zypp::repo::downloadMediaInfo().
| void zypp::Fetcher::enqueueDigested | ( | const OnMediaLocation & | resource, | |
| const FileChecker & | checker = FileChecker() | |||
| ) |
Enqueue a object for transferal, they will not be transfered until start() is called.
Definition at line 269 of file Fetcher.cc.
References _pimpl.
Referenced by zypp::repo::susetags::Downloader::download(), and zypp::repo::yum::Downloader::repomd_Callback().
| void zypp::Fetcher::addCachePath | ( | const Pathname & | cache_dir | ) |
adds a directory to the list of directories where to look for cached files
Definition at line 279 of file Fetcher.cc.
References _pimpl.
| void zypp::Fetcher::reset | ( | ) |
Reset the transfer list and cache list.
Definition at line 284 of file Fetcher.cc.
References _pimpl.
Referenced by zypp::repo::yum::Downloader::download(), zypp::repo::susetags::Downloader::download(), and zypp::repo::downloadMediaInfo().
| void zypp::Fetcher::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 get the files from The file tree will be replicated inside this directory
Definition at line 289 of file Fetcher.cc.
References _pimpl.
Referenced by zypp::repo::yum::Downloader::download(), zypp::repo::susetags::Downloader::download(), zypp::repo::downloadMediaInfo(), and zypp::repo::yum::Downloader::repomd_Callback().
| std::ostream & operator<< | ( | std::ostream & | str, | |
| const Fetcher & | obj | |||
| ) | [friend] |
RWCOW_pointer<Impl> zypp::Fetcher::_pimpl [private] |
Pointer to implementation.
Definition at line 127 of file Fetcher.h.
Referenced by addCachePath(), enqueue(), enqueueDigested(), zypp::operator<<(), reset(), and start().
1.5.3