13#ifndef ZYPP_MEDIA_MEDIAHANDLERL_H
14#define ZYPP_MEDIA_MEDIAHANDLERL_H
27#include <zypp-media/MediaException>
28#include <zypp/APIConfig.h>
29#include <zypp-core/OnMediaLocation>
31#undef ZYPP_BASE_LOGGER_LOGGROUP
32#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::media"
55 using Ptr = shared_ptr<MediaHandler>;
56 using constPtr = shared_ptr<const MediaHandler>;
58 static bool setAttachPrefix(
const Pathname &attach_prefix);
60 static std::string getRealPath(
const std::string &path);
130 bool dependsOnParent();
137 void resetParentId();
149 void setAttachPoint(
const Pathname &path,
bool temp);
167 void attachPointHint(
const Pathname &path,
bool temp);
189 void removeAttachPoint();
197 virtual bool checkAttachPoint(
const Pathname &apoint)
const;
207 static bool checkAttachPoint(
const Pathname &apoint,
219 bool isUseableAttachPoint(
const Pathname &path,
220 bool mtab=
true)
const;
228 return _mediaSource ? _mediaSource->name :
"";
261 bool isSharedMedia()
const;
271 bool checkAttached(
bool matchMountFs)
const;
281 void forceRelaseAllMedia(
bool matchMountFs);
336 virtual void releaseFrom(
const std::string & ejectDev =
"" ) = 0;
388 virtual void getDir(
const Pathname & dirname,
bool recurse_r )
const = 0;
405 virtual void getDirInfo( std::list<std::string> & retlist,
406 const Pathname & dirname,
bool dots =
true )
const = 0;
420 const Pathname & dirname,
bool dots =
true )
const = 0;
430 virtual bool getDoesFileExist(
const Pathname & filename )
const = 0;
442 void getDirectoryYast( std::list<std::string> & retlist,
443 const Pathname & dirname,
bool dots =
true )
const;
454 const Pathname & dirname,
bool dots =
true )
const;
471 Pathname urlpath_below_attachpoint_r,
472 const bool does_download_r );
515 void attach(
bool next);
520 virtual bool isAttached()
const {
return _mediaSource !=
nullptr; }
560 void release(
const std::string & ejectDev =
"" );
594 void provideDir(
const Pathname& dirname )
const;
605 void provideDirTree(
const Pathname& dirname )
const;
637 void releasePath(
const Pathname& pathname )
const;
654 void dirInfo( std::list<std::string> & retlist,
655 const Pathname & dirname,
bool dots =
true )
const;
670 const Pathname & dirname,
bool dots =
true )
const;
680 bool doesFileExist(
const Pathname & filename )
const;
685 virtual bool hasMoreDevices();
696 getDetectedDevices(std::vector<std::string> & devices,
697 unsigned int & index)
const;
710 precacheFiles (
const std::vector< OnMediaLocation > &files );
std::ostream & operator<<(std::ostream &str, const zypp::sat::detail::CDataiterator *obj)
std::string getScheme() const
Returns the scheme name of the URL.
String related utilities and Regular expression matching.
std::list< DirEntry > DirContent
Returned by readdir.
Easy-to use interface to the ZYPP dependency resolver.