libzypp  13.10.6
MediaDISK.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_MEDIA_MEDIADISK_H
13 #define ZYPP_MEDIA_MEDIADISK_H
14 
16 
17 namespace zypp {
18  namespace media {
19 
21  //
22  // CLASS NAME : MediaDISK
27  class MediaDISK : public MediaHandler {
28 
29  private:
30 
31  unsigned long _mountflags;
32 
33  std::string _device;
34  std::string _filesystem;
35 
36  protected:
37 
38  virtual void attachTo (bool next = false);
39  virtual void releaseFrom( const std::string & ejectDev );
40  virtual void getFile( const Pathname & filename ) const;
41  virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
42  virtual void getDirInfo( std::list<std::string> & retlist,
43  const Pathname & dirname, bool dots = true ) const;
44  virtual void getDirInfo( filesystem::DirContent & retlist,
45  const Pathname & dirname, bool dots = true ) const;
46  virtual bool getDoesFileExist( const Pathname & filename ) const;
47 
48  public:
49 
50  MediaDISK( const Url & url_r,
51  const Pathname & attach_point_hint_r );
52 
53  virtual ~MediaDISK() { try { release(); } catch(...) {} }
54 
55  virtual bool isAttached() const;
56 
57  bool verifyIfDiskVolume(const Pathname &name);
58  };
59 
61 
62  } // namespace media
63 } // namespace zypp
64 
65 #endif // ZYPP_MEDIA_MEDIADISK_H
virtual ~MediaDISK()
Definition: MediaDISK.h:53
MediaDISK(const Url &url_r, const Pathname &attach_point_hint_r)
Definition: MediaDISK.cc:52
virtual bool getDoesFileExist(const Pathname &filename) const
check if a file exists
Definition: MediaDISK.cc:404
virtual bool isAttached() const
True if media is attached.
Definition: MediaDISK.cc:329
std::string _device
Definition: MediaDISK.h:33
Implementation class for DISK MediaHandler.
Definition: MediaDISK.h:27
virtual void attachTo(bool next=false)
Call concrete handler to attach the media.
Definition: MediaDISK.cc:182
virtual void getDirInfo(std::list< std::string > &retlist, const Pathname &dirname, bool dots=true) const
Call concrete handler to provide a content list of directory on media via retlist.
Definition: MediaDISK.cc:384
unsigned long _mountflags
Definition: MediaDISK.h:31
Abstract base class for &#39;physical&#39; MediaHandler like MediaCD, etc.
Definition: MediaHandler.h:45
std::list< DirEntry > DirContent
Returned by readdir.
Definition: PathInfo.h:544
bool verifyIfDiskVolume(const Pathname &name)
Definition: MediaDISK.cc:89
virtual void getFile(const Pathname &filename) const
Call concrete handler to provide file below attach point.
Definition: MediaDISK.cc:359
virtual void getDir(const Pathname &dirname, bool recurse_r) const
Call concrete handler to provide directory content (not recursive!) below attach point.
Definition: MediaDISK.cc:371
virtual void releaseFrom(const std::string &ejectDev)
Call concrete handler to release the media.
Definition: MediaDISK.cc:342
std::string _filesystem
Definition: MediaDISK.h:34
void release(const std::string &ejectDev="")
Use concrete handler to release the media.
Url manipulation class.
Definition: Url.h:87