libzypp 17.37.10

MediaNFS.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_MEDIA_MEDIANFS_H
13#define ZYPP_MEDIA_MEDIANFS_H
14
15#include <zypp/media/MediaHandler.h>
16
24#define NFS_MOUNT_TIMEOUT 300
25
26 namespace zypp {
27 namespace media {
28
30 //
31 // CLASS NAME : MediaNFS
36 class MediaNFS : public MediaHandler {
37
38 protected:
39
40 void attachTo (bool next = false) override;
41
42 void releaseFrom( const std::string & ejectDev ) override;
43 void getFile( const OnMediaLocation & file ) const override;
44 void getDir( const Pathname & dirname, bool recurse_r ) const override;
45 void getDirInfo( std::list<std::string> & retlist,
46 const Pathname & dirname, bool dots = true ) const override;
47 void getDirInfo( filesystem::DirContent & retlist,
48 const Pathname & dirname, bool dots = true ) const override;
49 bool getDoesFileExist( const Pathname & filename ) const override;
50
51 public:
52
53 MediaNFS(const MirroredOrigin &origin_r,
54 const Pathname &attach_point_hint_r );
55
56 ~MediaNFS() override { try { release(); } catch(...) {} }
57
58 bool isAttached() const override;
59 };
60
62 } // namespace media
63} // namespace zypp
64
65#endif // ZYPP_MEDIA_MEDIANFS_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:47
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::media::MediaNFS::attachTo
void attachTo(bool next=false) override
Call concrete handler to attach the media.
Definition MediaNFS.cc:59
zypp::media::MediaNFS::getDir
void getDir(const Pathname &dirname, bool recurse_r) const override
Call concrete handler to provide directory content (not recursive!) below attach point.
Definition MediaNFS.cc:221
zypp::media::MediaNFS::~MediaNFS
~MediaNFS() override
Definition MediaNFS.h:56
zypp::media::MediaNFS::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 MediaNFS.cc:234
zypp::media::MediaNFS::MediaNFS
MediaNFS(const MirroredOrigin &origin_r, const Pathname &attach_point_hint_r)
Definition MediaNFS.cc:42
zypp::media::MediaNFS::releaseFrom
void releaseFrom(const std::string &ejectDev) override
Call concrete handler to release the media.
Definition MediaNFS.cc:196
zypp::media::MediaNFS::getFile
void getFile(const OnMediaLocation &file) const override
Call concrete handler to provide file below attach point.
Definition MediaNFS.cc:209
zypp::media::MediaNFS::getDoesFileExist
bool getDoesFileExist(const Pathname &filename) const override
check if a file exists
Definition MediaNFS.cc:254
zypp::media::MediaNFS::isAttached
bool isAttached() const override
True if media is attached.
Definition MediaNFS.cc:183
zypp::filesystem::DirContent
std::list< DirEntry > DirContent
Returned by readdir.
Definition PathInfo.h:526
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20