zypp::media::MediaAccess::FileProvider Class Reference

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

#include <MediaAccess.h>

List of all members.

Public Member Functions

 FileProvider (MediaAccess::constPtr media_r, const Pathname &file_r)
 
Exceptions:
MediaException 

 ~FileProvider ()
Pathname localFile () const
 If no error, expect operator() to return the local Pathname of the provided file.
Pathname operator() () const
 Return the local Pathname of the provided file or an empty Pathname on error.

Private Member Functions

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

Private Attributes

MediaAccess::constPtr _media
Pathname _file
Pathname _local_file


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).

Exceptions:
MediaBadFilenameException 
MediaException 

Definition at line 362 of file MediaAccess.h.


Constructor & Destructor Documentation

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

zypp::media::MediaAccess::FileProvider::FileProvider MediaAccess::constPtr  media_r,
const Pathname file_r
[inline]
 

Exceptions:
MediaException 

Definition at line 373 of file MediaAccess.h.

References _file, zypp::filesystem::Pathname::asString(), zypp::filesystem::Pathname::empty(), and ZYPP_THROW.

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

Definition at line 394 of file MediaAccess.h.

References ZYPP_CAUGHT.


Member Function Documentation

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

Pathname zypp::media::MediaAccess::FileProvider::localFile  )  const [inline]
 

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

Definition at line 414 of file MediaAccess.h.

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

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

Definition at line 420 of file MediaAccess.h.


Member Data Documentation

MediaAccess::constPtr zypp::media::MediaAccess::FileProvider::_media [private]
 

Definition at line 366 of file MediaAccess.h.

Pathname zypp::media::MediaAccess::FileProvider::_file [private]
 

Definition at line 367 of file MediaAccess.h.

Referenced by FileProvider().

Pathname zypp::media::MediaAccess::FileProvider::_local_file [private]
 

Definition at line 368 of file MediaAccess.h.


The documentation for this class was generated from the following file:
Generated on Thu Jul 6 00:07:32 2006 for zypp by  doxygen 1.4.6