Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / media / MediaPlugin.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/media/MediaPlugin.h
10  *
11 */
12 #ifndef ZYPP_MEDIA_MEDIAPLUGIN_H
13 #define ZYPP_MEDIA_MEDIAPLUGIN_H
14
15 #include "zypp/media/MediaHandler.h"
16
17 //////////////////////////////////////////////////////////////////////
18 namespace zypp
19 { ////////////////////////////////////////////////////////////////////
20   ////////////////////////////////////////////////////////////////////
21   namespace media
22   { //////////////////////////////////////////////////////////////////
23
24     /**
25      * \brief Implementation class for plugin MediaHandler
26      *
27      * @see MediaHandler
28      */
29     class MediaPlugin : public MediaHandler
30     {
31       public:
32         MediaPlugin( const Url & url_r, const Pathname & attach_point_hint_r );
33
34         virtual ~MediaPlugin() { try { release(); } catch(...) {} }
35
36       protected:
37         virtual void attachTo( bool next_r = false );
38         virtual void releaseFrom( const std::string & ejectDev_r );
39         virtual void getFile( const Pathname & filename_r ) const;
40         virtual void getDir( const Pathname & dirname_r, bool recurse_r ) const;
41         virtual void getDirInfo( std::list<std::string> & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const;
42         virtual void getDirInfo( filesystem::DirContent & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const;
43         virtual bool getDoesFileExist( const Pathname & filename_r ) const;
44     };
45
46     //////////////////////////////////////////////////////////////////
47   } // namespace media
48   ////////////////////////////////////////////////////////////////////
49   ////////////////////////////////////////////////////////////////////
50 } // namespace zypp
51 //////////////////////////////////////////////////////////////////////
52 #endif // ZYPP_MEDIA_MEDIAPLUGIN_H