Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / media / MediaISO.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/media/MediaISO.h
10  *
11  */
12 #ifndef ZYPP_MEDIA_MEDIAISO_H
13 #define ZYPP_MEDIA_MEDIAISO_H
14
15 #include "zypp/media/MediaHandler.h"
16 #include "zypp/media/MediaManager.h"
17
18 //////////////////////////////////////////////////////////////////////
19 namespace zypp
20 { ////////////////////////////////////////////////////////////////////
21
22   ////////////////////////////////////////////////////////////////////
23   namespace media
24   { //////////////////////////////////////////////////////////////////
25
26
27     ///////////////////////////////////////////////////////////////////
28     //
29     // CLASS NAME : MediaISO
30     //
31     /**
32      * @short Implementation class for ISO MediaHandler
33      * @see MediaHandler
34      **/
35     class MediaISO : public MediaHandler
36     {
37       private:
38         Pathname      _isofile;
39         MediaAccessId _isosource;
40         std::string   _filesystem;
41
42       private:
43         std::string findUnusedLoopDevice();
44
45       protected:
46
47         virtual void attachTo (bool next = false);
48         virtual void releaseFrom( const std::string & ejectDev = "" );
49         virtual void getFile( const Pathname & filename ) const;
50         virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
51         virtual void getDirInfo( std::list<std::string> & retlist,
52                                  const Pathname & dirname, bool dots = true ) const;
53         virtual void getDirInfo( filesystem::DirContent & retlist,
54                                  const Pathname & dirname, bool dots = true ) const;
55         virtual bool getDoesFileExist( const Pathname & filename ) const;
56
57       public:
58
59         MediaISO(const Url      &url_r,
60                  const Pathname &attach_point_hint_r);
61
62         virtual
63         ~MediaISO();
64
65         virtual bool
66         isAttached() const;
67     };
68
69
70     //////////////////////////////////////////////////////////////////
71   } // namespace media
72   ////////////////////////////////////////////////////////////////////
73
74   ////////////////////////////////////////////////////////////////////
75 } // namespace zypp
76 //////////////////////////////////////////////////////////////////////
77
78 #endif // ZYPP_MEDIA_MEDIAISO_H
79
80 // vim: set ts=2 sts=2 sw=2 ai et:
81