libzypp: zypp/media/MediaDISK.h Source File

libzypp 17.38.14

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
15#include <zypp/media/MediaHandler.h>
16
17namespace zypp {
18 namespace media {
19
21 //
22 // CLASS NAME : MediaDISK
27 class MediaDISK : public MediaHandler {
28
29 private:
30 std::string _device;
31 std::string _filesystem;
32
33 protected:
34
35 void attachTo (bool next = false) override;
36 void releaseFrom( const std::string & ejectDev ) override;
37 void getFile( const OnMediaLocation & file ) const override;
38 void getDir( const Pathname & dirname, bool recurse_r ) const override;
39 void getDirInfo( std::list<std::string> & retlist,
40 const Pathname & dirname, bool dots = true ) const override;
41 void getDirInfo( filesystem::DirContent & retlist,
42 const Pathname & dirname, bool dots = true ) const override;
43 bool getDoesFileExist( const Pathname & filename ) const override;
44
45 public:
46
47 MediaDISK(const MirroredOrigin &origin_r,
48 const Pathname & attach_point_hint_r );
49
50 ~MediaDISK() override { try { release(); } catch(...) {} }
51
52 bool isAttached() const override;
53
54 bool verifyIfDiskVolume(const Pathname &name);
55 };
56
58
59 } // namespace media
60} // namespace zypp
61
62#endif // ZYPP_MEDIA_MEDIADISK_H
MediaHandler.h
zypp::MirroredOrigin
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
Definition MirroredOrigin.h:170
zypp::OnMediaLocation
Describes a resource file located on a medium.
Definition onmedialocation.h:37
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::media::MediaDISK::releaseFrom
void releaseFrom(const std::string &ejectDev) override
Call concrete handler to release the media.
Definition MediaDISK.cc:340
zypp::media::MediaDISK::getDirInfo
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 MediaDISK.cc:382
zypp::media::MediaDISK::_device
std::string _device
Definition MediaDISK.h:30
zypp::media::MediaDISK::verifyIfDiskVolume
bool verifyIfDiskVolume(const Pathname &name)
Definition MediaDISK.cc:90
zypp::media::MediaDISK::_filesystem
std::string _filesystem
Definition MediaDISK.h:31
zypp::media::MediaDISK::attachTo
void attachTo(bool next=false) override
Call concrete handler to attach the media.
Definition MediaDISK.cc:183
zypp::media::MediaDISK::isAttached
bool isAttached() const override
True if media is attached.
Definition MediaDISK.cc:327
zypp::media::MediaDISK::getDoesFileExist
bool getDoesFileExist(const Pathname &filename) const override
check if a file exists
Definition MediaDISK.cc:402
zypp::media::MediaDISK::~MediaDISK
~MediaDISK() override
Definition MediaDISK.h:50
zypp::media::MediaDISK::getDir
void getDir(const Pathname &dirname, bool recurse_r) const override
Call concrete handler to provide directory content (not recursive!) below attach point.
Definition MediaDISK.cc:369
zypp::media::MediaDISK::MediaDISK
MediaDISK(const MirroredOrigin &origin_r, const Pathname &attach_point_hint_r)
Definition MediaDISK.cc:53
zypp::media::MediaDISK::getFile
void getFile(const OnMediaLocation &file) const override
Call concrete handler to provide file below attach point.
Definition MediaDISK.cc:357
zypp::media::MediaHandler::MediaHandler
MediaHandler(MirroredOrigin origin_r, const Pathname &attach_point_r, Pathname urlpath_below_attachpoint_r, const bool does_download_r)
If the concrete media handler provides a nonempty attach_point, it must be an existing directory.
Definition MediaHandler.cc:55
zypp::media::MediaHandler::release
void release(const std::string &ejectDev="")
Use concrete handler to release the media.
Definition MediaHandler.cc:704
zypp::filesystem::DirContent
std::list< DirEntry > DirContent
Returned by readdir.
Definition PathInfo.h:534
zypp::media
Definition MediaNetworkRequestExecutor.h:22
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2