1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
10 #ifndef ZYPP_FETCHER_H
11 #define ZYPP_FETCHER_H
14 #include "zypp/Pathname.h"
16 #include "zypp/OnMediaLocation.h"
22 * Edition represents <code>[epoch:]version[-release]</code>
24 * This class allows to retrieve a group of files which can
25 * be cached already on the local disk.
28 * Fetcher fetcher(url, path);
29 * fetcher.enqueue( OnMediaLocation().filename("/content") );
30 * fetcher.insertCache("/tmp/cache")
31 * fetcher.start( "/download-dir );
39 * Constructs a fetcher from a url and path
41 Fetcher( const Url &url, const Pathname &path );
44 * Enqueue a object for transferal, they will not
45 * be transfered until \ref start() is called
47 void enqueue( const OnMediaLocation &resource );
49 * adds a directory to the list of directories
50 * where to look for cached files
52 void insertCache( const Pathname &cache_dir );
54 * Reset the transfer list and cache list
58 * start the transfer to a destination directory
59 * The file tree will be replicated inside this
62 void start( const Pathname &dest_dir );
67 std::list<OnMediaLocation> _resources;
68 std::list<Pathname> _caches;