libzypp: zypp/media/MediaDIR.h Source File

libzypp 17.38.14

MediaDIR.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_MEDIA_MEDIADIR_H
13#define ZYPP_MEDIA_MEDIADIR_H
14
15#include <zypp/media/MediaHandler.h>
16
17namespace zypp {
18 namespace media {
19
21 //
22 // CLASS NAME : MediaDIR
23
28 class MediaDIR : public MediaHandler {
29
30 protected:
31
32 void attachTo (bool next = false) override;
33 void releaseFrom( const std::string & ejectDev ) override;
34 void getFile( const OnMediaLocation & file ) const override;
35 void getDir( const Pathname & dirname, bool recurse_r ) const override;
36 void getDirInfo( std::list<std::string> & retlist,
37 const Pathname & dirname, bool dots = true ) const override;
38 void getDirInfo( filesystem::DirContent & retlist,
39 const Pathname & dirname, bool dots = true ) const override;
40 bool getDoesFileExist( const Pathname & filename ) const override;
41
42 public:
43
44 MediaDIR(const MirroredOrigin &origin,
45 const Pathname & attach_point_hint_r );
46
47 ~MediaDIR() override { try { release(); } catch(...) {} }
48 };
49
51
52 } // namespace media
53} // namespace zypp
54
55#endif // ZYPP_MEDIA_MEDIADIR_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::MediaDIR::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 MediaDIR.cc:158
zypp::media::MediaDIR::getDoesFileExist
bool getDoesFileExist(const Pathname &filename) const override
check if a file exists
Definition MediaDIR.cc:178
zypp::media::MediaDIR::releaseFrom
void releaseFrom(const std::string &ejectDev) override
Call concrete handler to release the media.
Definition MediaDIR.cc:120
zypp::media::MediaDIR::getFile
void getFile(const OnMediaLocation &file) const override
Call concrete handler to provide file below attach point.
Definition MediaDIR.cc:133
zypp::media::MediaDIR::~MediaDIR
~MediaDIR() override
Definition MediaDIR.h:47
zypp::media::MediaDIR::getDir
void getDir(const Pathname &dirname, bool recurse_r) const override
Call concrete handler to provide directory content (not recursive!) below attach point.
Definition MediaDIR.cc:145
zypp::media::MediaDIR::MediaDIR
MediaDIR(const MirroredOrigin &origin, const Pathname &attach_point_hint_r)
Definition MediaDIR.cc:42
zypp::media::MediaDIR::attachTo
void attachTo(bool next=false) override
Call concrete handler to attach the media.
Definition MediaDIR.cc:65
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::origin
const MirroredOrigin & origin() const
Access the internal MirroredOrigin (authority and mirrors).
Definition MediaHandler.h:502
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