Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

MediaAccess::FileProvider Class Reference

#include <MediaAccess.h>

List of all members.

Public Types

typedef MediaError Error

Public Member Functions

 FileProvider (constMediaAccessPtr media_r, const Pathname &file_r)
 ~FileProvider ()
PMError error () const
Pathname operator() () const

Private Member Functions

 FileProvider (const FileProvider &)
FileProvideroperator= (const FileProvider &)

Private Attributes

constMediaAccessPtr _media
Pathname _file
PMError _lasterr


Detailed Description

Helper class that provides file on construction and cleans up on destruction.

Caution: There's no synchronisation between multiple FileProvider instances, that provide the same file from the same media. If the first one goes out of scope, the file is cleaned. It's just a convenience for 'access and forgett'.

Caution: We should either store the reference MediaAccess' MediaHandler here (for this MediaHandler must become a ref counting pointer class), or we need more info from MediaHandler (whether he's downloading to the local fs. If not, no releasefile is necessary). Currently we can not releaseFile after the media was closed (it's passed to the handler, which is deleted on close).


Member Typedef Documentation

typedef MediaError MediaAccess::FileProvider::Error
 

default error class


Constructor & Destructor Documentation

MediaAccess::FileProvider::FileProvider const FileProvider  )  [private]
 

MediaAccess::FileProvider::FileProvider constMediaAccessPtr  media_r,
const Pathname file_r
[inline]
 

MediaAccess::FileProvider::~FileProvider  )  [inline]
 


Member Function Documentation

PMError MediaAccess::FileProvider::error  )  const [inline]
 

If no error, expect operator() to return the local Pathname of the provided file.

Pathname MediaAccess::FileProvider::operator()  )  const [inline]
 

Return the local Pathname of the provided file or an empty Pathname on error.

FileProvider& MediaAccess::FileProvider::operator= const FileProvider  )  [private]
 


Member Data Documentation

Pathname MediaAccess::FileProvider::_file [private]
 

PMError MediaAccess::FileProvider::_lasterr [private]
 

constMediaAccessPtr MediaAccess::FileProvider::_media [private]
 


The documentation for this class was generated from the following file:
Generated on Fri Nov 9 14:30:32 2007 for yast2-packagemanager by doxygen 1.3.6