1b4be7934486b7cdb15b2d9b43c62fed8139c9dd
[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/RepoInfo.h"
17 #include "zypp/RepoStatus.h"
18 #include "zypp/MediaSetAccess.h"
19 #include "zypp/repo/Downloader.h"
20 #include "zypp/parser/susetags/ContentFileReader.h"
21
22 namespace zypp
23 {
24   namespace repo
25   {
26     namespace susetags
27     {
28   
29       /**
30        * \short Downloader for SUSETags (YaST2) repositories
31        * Encapsulates all the knowledge of which files have
32        * to be downloaded to the local disk.
33        */
34       class Downloader : public repo::Downloader
35       {
36       public:
37         /**
38          * \short Constructor from the repository information
39          *
40          * The repository information allows more context to be given
41          * to the user when something fails.
42          *
43          * \param info Repository information
44          */
45         Downloader( const RepoInfo &info, const Pathname &delta_dir = Pathname() );
46
47         /**
48          * \short Download metadata to a local directory
49          *
50          * \param media Media access to the repository url
51          * \param dest_dir Local destination directory
52          * \param progress progress receiver
53          */
54         void download( MediaSetAccess &media,
55                        const Pathname &dest_dir,
56                        const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc() );
57         /**
58          * \short Status of the remote repository
59          */
60         RepoStatus status( MediaSetAccess &media );
61         
62         /**
63          * Content file parser consumer
64          */
65         void consumeIndex( const parser::susetags::RepoIndex_Ptr & data_r );
66
67       private:
68         parser::susetags::RepoIndex_Ptr _repoindex;
69         Pathname _delta_dir;
70       };
71
72     } // ns susetags
73   } // ns source
74 } // ns zypp
75
76 #endif