|
libzypp
9.1.2
|
Implementation class for plugin MediaHandler. More...
#include <MediaPlugin.h>

Public Member Functions | |
| MediaPlugin (const Url &url_r, const Pathname &attach_point_hint_r) | |
| virtual | ~MediaPlugin () |
Protected Member Functions | |
| virtual void | attachTo (bool next_r=false) |
| Call concrete handler to attach the media. | |
| virtual void | releaseFrom (const std::string &ejectDev_r) |
| Call concrete handler to release the media. | |
| virtual void | getFile (const Pathname &filename_r) const |
| Call concrete handler to provide file below attach point. | |
| virtual void | getDir (const Pathname &dirname_r, bool recurse_r) const |
| Call concrete handler to provide directory content (not recursive!) below attach point. | |
| virtual void | getDirInfo (std::list< std::string > &retlist_r, const Pathname &dirname_r, bool dots_r=true) const |
| Call concrete handler to provide a content list of directory on media via retlist. | |
| virtual void | getDirInfo (filesystem::DirContent &retlist_r, const Pathname &dirname_r, bool dots_r=true) const |
| Basically the same as getDirInfo above. | |
| virtual bool | getDoesFileExist (const Pathname &filename_r) const |
| check if a file exists | |
Implementation class for plugin MediaHandler.
Definition at line 29 of file MediaPlugin.h.
| zypp::media::MediaPlugin::MediaPlugin | ( | const Url & | url_r, |
| const Pathname & | attach_point_hint_r | ||
| ) |
Definition at line 31 of file MediaPlugin.cc.
References MIL.
| virtual zypp::media::MediaPlugin::~MediaPlugin | ( | ) | [inline, virtual] |
Definition at line 34 of file MediaPlugin.h.
References zypp::media::MediaHandler::release().
| void zypp::media::MediaPlugin::attachTo | ( | bool | next = false | ) | [protected, virtual] |
Call concrete handler to attach the media.
Asserted that not already attached, and attachPoint is a directory.
| next | try next available device in turn until end of device list is reached (for media which are accessible through multiple devices like cdroms). |
| MediaException |
Implements zypp::media::MediaHandler.
Definition at line 36 of file MediaPlugin.cc.
| void zypp::media::MediaPlugin::releaseFrom | ( | const std::string & | ejectDev | ) | [protected, virtual] |
Call concrete handler to release the media.
If eject is true, and the media is used in one handler instance only, physically eject the media (i.e. CD-ROM).
Asserted that media is attached.
| ejectDev | Device to eject. None if empty. |
| MediaException |
Implements zypp::media::MediaHandler.
Definition at line 39 of file MediaPlugin.cc.
| void zypp::media::MediaPlugin::getFile | ( | const Pathname & | filename | ) | const [protected, virtual] |
Call concrete handler to provide file below attach point.
Default implementation provided, that returns whether a file is located at 'localRoot + filename'.
Asserted that media is attached.
| MediaException |
Implements zypp::media::MediaHandler.
Definition at line 42 of file MediaPlugin.cc.
| void zypp::media::MediaPlugin::getDir | ( | const Pathname & | dirname, |
| bool | recurse_r | ||
| ) | const [protected, virtual] |
Call concrete handler to provide directory content (not recursive!) below attach point.
Return E_not_supported_by_media if media does not support retrieval of directory content.
Default implementation provided, that returns whether a directory is located at 'localRoot + dirname'.
Asserted that media is attached.
| MediaException |
Implements zypp::media::MediaHandler.
Definition at line 45 of file MediaPlugin.cc.
| void zypp::media::MediaPlugin::getDirInfo | ( | std::list< std::string > & | retlist, |
| const Pathname & | dirname, | ||
| bool | dots = true |
||
| ) | const [protected, virtual] |
Call concrete handler to provide a content list of directory on media via retlist.
If dots is false entries starting with '.' are not reported.
Return E_not_supported_by_media if media does not support retrieval of directory content.
Default implementation provided, that returns the content of a directory at 'localRoot + dirnname' retrieved via 'readdir'.
Asserted that media is attached and retlist is empty.
| MediaException |
Implements zypp::media::MediaHandler.
Definition at line 48 of file MediaPlugin.cc.
| void zypp::media::MediaPlugin::getDirInfo | ( | filesystem::DirContent & | retlist, |
| const Pathname & | dirname, | ||
| bool | dots = true |
||
| ) | const [protected, virtual] |
Basically the same as getDirInfo above.
The content list is returned as filesystem::DirContent, which includes name and filetype of each directory entry. Retrieving the filetype usg. requires an additional ::stat call for each entry, thus it's more expensive than a simple readdir.
Asserted that media is attached and retlist is empty.
| MediaException |
Implements zypp::media::MediaHandler.
Definition at line 51 of file MediaPlugin.cc.
| bool zypp::media::MediaPlugin::getDoesFileExist | ( | const Pathname & | filename | ) | const [protected, virtual] |
check if a file exists
Asserted that url is a file and not a dir.
| MediaException |
Implements zypp::media::MediaHandler.
Definition at line 54 of file MediaPlugin.cc.
1.7.6.1