- add support for the HASH key. (#300982)
[platform/upstream/libzypp.git] / zypp / repo / susetags / Downloader.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9
10 #ifndef ZYPP_SOURCE_SUSETAGS_DOWNLOADER
11 #define ZYPP_SOURCE_SUSETAGS_DOWNLOADER
12
13 #include "zypp/Url.h"
14 #include "zypp/Pathname.h"
15 #include "zypp/ProgressData.h"
16 #include "zypp/RepoStatus.h"
17 #include "zypp/MediaSetAccess.h"
18 #include "zypp/repo/Downloader.h"
19 #include "zypp/parser/susetags/ContentFileReader.h"
20
21 namespace zypp
22 {
23   namespace repo
24   {
25     namespace susetags
26     {
27   
28       /**
29        * \short Downloader for SUSETags (YaST2) repositories
30        * Encapsulates all the knowledge of which files have
31        * to be downloaded to the local disk.
32        */
33       class Downloader : public repo::Downloader
34       {
35        public:
36         /**
37          * \short Constructor
38          *
39          * \param path Path to the repostory from the media
40          */
41         Downloader( const Pathname &path );
42         
43         /**
44          * \short Download metadata to a local directory
45          *
46          * \param media Media access to the repository url
47          * \param dest_dir Local destination directory
48          * \param progress progress receiver
49          */
50         void download( MediaSetAccess &media,
51                        const Pathname &dest_dir,
52                        const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc() );
53         /**
54          * \short Status of the remote repository
55          */
56         RepoStatus status( MediaSetAccess &media );
57         
58         /**
59          * Content file parser consumer
60          */
61         void consumeIndex( const parser::susetags::RepoIndex_Ptr & data_r );
62
63        private:
64         Pathname _path;
65         parser::susetags::RepoIndex_Ptr _repoindex;
66       };
67
68     } // ns susetags
69   } // ns source
70 } // ns zypp
71
72 #endif