libzypp 17.31.23
MediaNetwork.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_MEDIA_MEDIANETWORK_H
13#define ZYPP_MEDIA_MEDIANETWORK_H
14
15#include <zypp/base/Flags.h>
16#include <zypp/ZYppCallbacks.h>
18
19namespace internal {
20 struct SharedData;
21}
22
23namespace zyppng {
24 class DownloadSpec;
25}
26
27namespace zypp {
28 namespace media {
29 //
30 // CLASS NAME : MediaNetwork
36 {
37 protected:
38
39 void attachTo (bool next = false) override;
40 void releaseFrom( const std::string & ejectDev ) override;
41 void getFile( const OnMediaLocation & file ) const override;
42 void getFileCopy( const OnMediaLocation & file, const Pathname & targetFilename ) const override;
43 void getDir( const Pathname & dirname, bool recurse_r ) const override;
44 void getDirInfo( std::list<std::string> & retlist,
45 const Pathname & dirname, bool dots = true ) const override;
46 void getDirInfo( filesystem::DirContent & retlist,
47 const Pathname & dirname, bool dots = true ) const override;
53 void disconnectFrom() override;
54
60 bool getDoesFileExist( const Pathname & filename ) const override;
61
62 bool checkAttachPoint(const Pathname &apoint) const override;
63
64
65 public:
66
67 MediaNetwork( const Url & url_r,
68 const Pathname & attach_point_hint_r );
69
70 ~MediaNetwork() override { try { release(); } catch(...) {} }
71
72 private:
73
74 void runRequest ( const zyppng::DownloadSpec &spec, callback::SendReport<DownloadProgressReport> *report = nullptr ) const;
75
76 private:
77 mutable std::shared_ptr<::internal::SharedData> _shared;
78 };
79
80 } // namespace media
81} // namespace zypp
82
83#endif // ZYPP_MEDIA_MEDIANETWORK_H
Describes a resource file located on a medium.
Url manipulation class.
Definition: Url.h:92
void release(const std::string &ejectDev="")
Use concrete handler to release the media.
Common baseclass for MediaCurl and MediaNetwork.
Implementation class for FTP, HTTP and HTTPS MediaHandler.
Definition: MediaNetwork.h:36
bool checkAttachPoint(const Pathname &apoint) const override
Verify if the specified directory as attach point (root) as requires by the particular media handler ...
void disconnectFrom() override
void attachTo(bool next=false) override
Call concrete handler to attach the media.
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.
void getDir(const Pathname &dirname, bool recurse_r) const override
Call concrete handler to provide directory content (not recursive!) below attach point.
bool getDoesFileExist(const Pathname &filename) const override
void runRequest(const zyppng::DownloadSpec &spec, callback::SendReport< DownloadProgressReport > *report=nullptr) const
void releaseFrom(const std::string &ejectDev) override
Call concrete handler to release the media.
void getFile(const OnMediaLocation &file) const override
Call concrete handler to provide file below attach point.
void getFileCopy(const OnMediaLocation &file, const Pathname &targetFilename) const override
Call concrete handler to provide a file under a different place in the file system (usually not under...
std::shared_ptr<::internal::SharedData > _shared
Definition: MediaNetwork.h:77
std::list< DirEntry > DirContent
Returned by readdir.
Definition: PathInfo.h:518
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2