Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / media / MediaCIFS.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/media/MediaCIFS.h
10  *
11 */
12 #ifndef ZYPP_MEDIA_MEDIACIFS_H
13 #define ZYPP_MEDIA_MEDIACIFS_H
14
15 #include "zypp/media/MediaHandler.h"
16
17 namespace zypp {
18   namespace media {
19
20     class AuthData;
21
22     ///////////////////////////////////////////////////////////////////
23     //
24     //  CLASS NAME : MediaCIFS
25     /**
26      * @short Implementation class for CIFS MediaHandler
27      *
28      * NOTE: The implementation serves both, "smb" and "cifs" URL's,
29      * but passes "cifs" to the mount command in any case.
30      * @see MediaHandler
31      **/
32     class MediaCIFS : public MediaHandler {
33
34     protected:
35
36       virtual void attachTo (bool next = false);
37       virtual void releaseFrom( const std::string & ejectDev );
38       virtual void getFile( const Pathname & filename ) const;
39       virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
40       virtual void getDirInfo( std::list<std::string> & retlist,
41                                const Pathname & dirname, bool dots = true ) const;
42       virtual void getDirInfo( filesystem::DirContent & retlist,
43                                const Pathname & dirname, bool dots = true ) const;
44       virtual bool getDoesFileExist( const Pathname & filename ) const;
45
46     public:
47       MediaCIFS( const Url&       url_r,
48                 const Pathname & attach_point_hint_r );
49
50       virtual ~MediaCIFS() { try { release(); } catch(...) {} }
51
52       virtual bool isAttached() const;
53
54     private:
55       bool authenticate( AuthData & authdata, bool firstTry ) const;
56     };
57
58 ///////////////////////////////////////////////////////////////////A
59   } // namespace media
60 } // namespace zypp
61
62 #endif // ZYPP_MEDIA_MEDIACIFS_H