libzypp 17.37.17
MediaPlugin.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_MEDIA_MEDIAPLUGIN_H
13#define ZYPP_MEDIA_MEDIAPLUGIN_H
14
16
18namespace zypp
19{
21 namespace media
22 {
23
30 {
31 public:
32 MediaPlugin(const MirroredOrigin &origin_r, const Pathname & attach_point_hint_r );
33
34 ~MediaPlugin() override { try { release(); } catch(...) {} }
35
36 protected:
37 void attachTo( bool next_r = false ) override;
38 void releaseFrom( const std::string & ejectDev_r ) override;
39 void getFile( const OnMediaLocation & file ) const override;
40 void getDir( const Pathname & dirname_r, bool recurse_r ) const override;
41 void getDirInfo( std::list<std::string> & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const override;
42 void getDirInfo( filesystem::DirContent & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const override;
43 bool getDoesFileExist( const Pathname & filename_r ) const override;
44 };
45
47 } // namespace media
50} // namespace zypp
52#endif // ZYPP_MEDIA_MEDIAPLUGIN_H
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
Describes a resource file located on a medium.
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.
void release(const std::string &ejectDev="")
Use concrete handler to release the media.
void attachTo(bool next_r=false) override
Call concrete handler to attach the media.
void getFile(const OnMediaLocation &file) const override
Call concrete handler to provide file below attach point.
bool getDoesFileExist(const Pathname &filename_r) const override
check if a file exists
MediaPlugin(const MirroredOrigin &origin_r, const Pathname &attach_point_hint_r)
void getDir(const Pathname &dirname_r, bool recurse_r) const override
Call concrete handler to provide directory content (not recursive!) below attach point.
void releaseFrom(const std::string &ejectDev_r) override
Call concrete handler to release the media.
void getDirInfo(std::list< std::string > &retlist_r, const Pathname &dirname_r, bool dots_r=true) const override
Call concrete handler to provide a content list of directory on media via retlist.
std::list< DirEntry > DirContent
Returned by readdir.
Definition PathInfo.h:526
Easy-to use interface to the ZYPP dependency resolver.