libzypp  17.25.1
MediaCIFS.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_MEDIA_MEDIACIFS_H
13 #define ZYPP_MEDIA_MEDIACIFS_H
14 
16 
17 namespace zypp {
18  namespace media {
19 
20  class AuthData;
21 
23  //
24  // CLASS NAME : MediaCIFS
32  class MediaCIFS : public MediaHandler {
33 
34  protected:
35 
36  virtual void attachTo (bool next = false) override;
37  virtual void releaseFrom( const std::string & ejectDev ) override;
38  virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override;
39  virtual void getDir( const Pathname & dirname, bool recurse_r ) const override;
40  virtual void getDirInfo( std::list<std::string> & retlist,
41  const Pathname & dirname, bool dots = true ) const override;
42  virtual void getDirInfo( filesystem::DirContent & retlist,
43  const Pathname & dirname, bool dots = true ) const override;
44  virtual bool getDoesFileExist( const Pathname & filename ) const override;
45 
46  public:
47  MediaCIFS( const Url& url_r,
48  const Pathname & attach_point_hint_r );
49 
50  virtual ~MediaCIFS() override { try { release(); } catch(...) {} }
51 
52  virtual bool isAttached() const override;
53 
54  private:
55  bool authenticate( AuthData & authdata, bool firstTry ) const;
56  };
57 
59  } // namespace media
60 } // namespace zypp
61 
62 #endif // ZYPP_MEDIA_MEDIACIFS_H
zypp::media::AuthData
Class for handling media authentication data.
Definition: MediaUserAuth.h:30
zypp::media::MediaCIFS::getFile
virtual void getFile(const Pathname &filename, const ByteCount &expectedFileSize_r) const override
Call concrete handler to provide file below attach point.
Definition: MediaCIFS.cc:351
zypp::media::MediaCIFS::releaseFrom
virtual void releaseFrom(const std::string &ejectDev) override
Call concrete handler to release the media.
Definition: MediaCIFS.cc:338
zypp::media::MediaCIFS::authenticate
bool authenticate(AuthData &authdata, bool firstTry) const
Definition: MediaCIFS.cc:401
MediaHandler.h
zypp::media::MediaHandler
Abstract base class for 'physical' MediaHandler like MediaCD, etc.
Definition: MediaHandler.h:45
zypp::ByteCount
Store and operate with byte count.
Definition: ByteCount.h:30
zypp::media::MediaCIFS
Implementation class for CIFS MediaHandler.
Definition: MediaCIFS.h:32
zypp::media::MediaCIFS::MediaCIFS
MediaCIFS(const Url &url_r, const Pathname &attach_point_hint_r)
Definition: MediaCIFS.cc:99
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::filesystem::DirContent
std::list< DirEntry > DirContent
Returned by readdir.
Definition: PathInfo.h:547
zypp::media::MediaCIFS::~MediaCIFS
virtual ~MediaCIFS() override
Definition: MediaCIFS.h:50
zypp::media::MediaCIFS::isAttached
virtual bool isAttached() const override
True if media is attached.
Definition: MediaCIFS.cc:325
zypp::media::MediaCIFS::attachTo
virtual void attachTo(bool next=false) override
Asserted that not already attached, and attachPoint is a directory.
Definition: MediaCIFS.cc:127
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:44
zypp::media::MediaHandler::release
void release(const std::string &ejectDev="")
Use concrete handler to release the media.
Definition: MediaHandler.cc:740
zypp::media::MediaCIFS::getDirInfo
virtual void getDirInfo(std::list< std::string > &retlist, const Pathname &dirname, bool dots=true) const override
Call concrete handler to provide a content list of directory on media via retlist.
Definition: MediaCIFS.cc:376
zypp::Url
Url manipulation class.
Definition: Url.h:87
zypp::media::MediaCIFS::getDoesFileExist
virtual bool getDoesFileExist(const Pathname &filename) const override
check if a file exists
Definition: MediaCIFS.cc:396
zypp::media::MediaCIFS::getDir
virtual void getDir(const Pathname &dirname, bool recurse_r) const override
Call concrete handler to provide directory content (not recursive!) below attach point.
Definition: MediaCIFS.cc:363