1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/media/MediaCD.h
12 #ifndef ZYPP_MEDIA_MEDIACD_H
13 #define ZYPP_MEDIA_MEDIACD_H
15 #include "zypp/media/MediaHandler.h"
16 #include "zypp/media/MediaManager.h"
21 ///////////////////////////////////////////////////////////////////
23 // CLASS NAME : MediaCD
25 * @short Implementation class for CD/DVD MediaHandler
28 class MediaCD : public MediaHandler {
31 typedef std::list<MediaSource> DeviceList;
32 /** list of devices to try to mount */
33 mutable DeviceList _devices;
35 /** number of last successful mounted device in list */
39 static bool openTray( const std::string & device_r );
40 static bool closeTray( const std::string & device_r );
42 DeviceList detectDevices(bool supportingDVD) const;
46 virtual void attachTo (bool next = false);
47 virtual void releaseFrom( const std::string & ejectDev );
48 virtual void getFile(const Pathname & filename, const ByteCount &expectedFileSize_r ) const override;
49 virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
50 virtual void getDirInfo( std::list<std::string> & retlist,
51 const Pathname & dirname, bool dots = true ) const;
52 virtual void getDirInfo( filesystem::DirContent & retlist,
53 const Pathname & dirname, bool dots = true ) const;
54 virtual bool getDoesFileExist( const Pathname & filename ) const;
56 virtual void forceEject(const std::string & ejectDev);
58 virtual bool hasMoreDevices();
61 getDetectedDevices(std::vector<std::string> & devices,
62 unsigned int & index) const;
66 MediaCD( const Url & url_r,
67 const Pathname & attach_point_hint_r );
69 virtual ~MediaCD() { try { release(); } catch(...) {} }
71 virtual bool isAttached() const;
74 ///////////////////////////////////////////////////////////////////
77 #endif // ZYPP_MEDIA_MEDIACD_H