#include <MediaAccess.h>
Inheritance diagram for MediaAccess:
Public Types | |
typedef MediaError | Error |
Public Member Functions | |
MediaAccess () | |
PMError | open (const Url &url, const Pathname &preferred_attach_point="") |
bool | isOpen () const |
Url::Protocol | protocol () const |
Url | url () const |
PMError | close () |
PMError | attach (bool next=false) |
bool | isAttached () const |
const Pathname & | localRoot () const |
Pathname | localPath (const Pathname &pathname) const |
PMError | disconnect () |
PMError | release (bool eject=false) |
PMError | provideFile (const Pathname &filename, bool cached=false) const |
PMError | releaseFile (const Pathname &filename) const |
PMError | provideDir (const Pathname &dirname) const |
PMError | releaseDir (const Pathname &dirname) const |
PMError | releasePath (const Pathname &pathname) const |
PMError | dirInfo (std::list< std::string > &retlist, const Pathname &dirname, bool dots=true) const |
PMError | dirInfo (PathInfo::dircontent &retlist, const Pathname &dirname, bool dots=true) const |
virtual | ~MediaAccess () |
virtual std::ostream & | dumpOn (std::ostream &str) const |
Static Public Member Functions | |
PMError | getFile (const Url &from, const Pathname &to) |
Private Member Functions | |
REP_BODY (MediaAccess) | |
Private Attributes | |
MediaHandler * | _handler |
Static Private Attributes | |
const Pathname | _noPath |
The concrete MediaHandler for a certain url is created on open and deleted on .
The inteface here basically checks whether the handler exists, then forwards the request to MediaHandler.
|
default error class |
|
constructor |
|
Destructor |
|
Use concrete handler to attach the media.
|
|
close url |
|
Basically the same as dirInfo above. The content is returned as PathInfo::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. Caution: This is not supported by all media types. Be prepared to handle E_not_supported_by_media. |
|
Return content of directory on media via retlist. If dots is false entries starting with '.' are not reported. The request is forwarded to the concrete handler, which may atempt to retieve the content e.g. via 'readdir' Caution: This is not supported by all media types. Be prepared to handle E_not_supported_by_media. |
|
Use concrete handler to disconnect the media. This is useful for media which e.g. holds open a connection to a server like FTP. After calling disconnect() the media object still is valid and files are present. After calling disconnect() it's not possible to call provideFile() or provideDir() anymore. |
|
Reimplemented from CountedRep. |
|
Get file from location at specified by URL and copy it to destination.
|
|
True if media is attached. |
|
True if media is open. |
|
Short for 'localRoot() + pathname', but returns an empty pathname if media is not open. Files provided will be available at 'localPath(filename)'. |
|
Return the local directory that corresponds to medias url, no matter if media isAttached or not. Files requested will be available at 'localRoot() + filename' or better 'localPath( filename )'. If media is not open an empty pathname is returned. |
|
open url. If preferred_attach_point is given, try to use it as attach point. Caution: The medium can choose a different attach point. Only getAttachPoint() knows the real attach point. |
|
Used Protocol if media is opened, otherwise 'unknown'. |
|
Use concrete handler to provide directory denoted by path below 'attach point' (not recursive!). 'dirname' is interpreted relative to the attached url and a path prefix is preserved. |
|
Use concrete handler to provide file denoted by path below 'attach point'. Filename is interpreted relative to the attached url and a path prefix is preserved.
|
|
Use concrete handler to release the media.
|
|
Remove directory tree below attach point IFF handler downloads files to the local filesystem. Never remove anything from media. |
|
Remove filename below attach point IFF handler downloads files to the local filesystem. Never remove anything from media. |
|
Remove pathname below attach point IFF handler downloads files to the local filesystem. Never remove anything from media. If pathname denotes a directory it is recursively removed. If pathname is empty or '/' everything below the attachpoint is recursively removed. |
|
|
|
Url if media is opened, otherwise empty. |
|
handler for 'physical' media == 0 if not open |
|
|