zypp::MediaSetAccess Class Reference

#include <MediaSetAccess.h>

Inheritance diagram for zypp::MediaSetAccess:

zypp::base::ReferenceCounted NonCopyable List of all members.

Public Member Functions

 MediaSetAccess (const Url &url, const Pathname &path)
 creates a callback enabled media access for
 ~MediaSetAccess ()
void setVerifiers (const std::vector< media::MediaVerifierRef > &verifiers)
 the media change callbacks depend on the verifiers given for each media.
Pathname provideFile (const Pathname &file, unsigned media_nr=1)
Pathname provideFile (const Pathname &file, unsigned media_nr, const FileChecker checker)
void providePossiblyCachedMetadataFile (const Pathname &file_to_download, unsigned medianr, const Pathname &destination, const Pathname &cached_file, const CheckSum &checksum)

Protected Member Functions

Pathname provideFileInternal (const Pathname &file, unsigned media_nr, bool checkonly, bool cached)
Url rewriteUrl (const Url &url_r, const media::MediaNr medianr)
media::MediaAccessId getMediaAccessId (media::MediaNr medianr)
virtual std::ostream & dumpOn (std::ostream &str) const
 Overload to realize std::ostream & operator<<.

Private Types

typedef std::map< media::MediaNr,
media::MediaAccessId
MediaMap

Private Attributes

Url _url
Pathname _path
std::vector< media::MediaVerifierRef_verifiers
MediaMap medias
 Mapping between each CD and Media Access ID.

Friends

std::ostream & operator<< (std::ostream &str, const MediaSetAccess &obj)
 Stream output.

Detailed Description

Definition at line 78 of file MediaSetAccess.h.


Member Typedef Documentation

typedef std::map<media::MediaNr, media::MediaAccessId> zypp::MediaSetAccess::MediaMap [private]

Definition at line 105 of file MediaSetAccess.h.


Constructor & Destructor Documentation

zypp::MediaSetAccess::MediaSetAccess ( const Url url,
const Pathname &  path 
)

creates a callback enabled media access for

Parameters:
url and
path. with only media no verified

Definition at line 51 of file MediaSetAccess.cc.

References MIL.

zypp::MediaSetAccess::~MediaSetAccess (  ) 

Definition at line 61 of file MediaSetAccess.cc.


Member Function Documentation

void zypp::MediaSetAccess::setVerifiers ( const std::vector< media::MediaVerifierRef > &  verifiers  ) 

the media change callbacks depend on the verifiers given for each media.

Definition at line 65 of file MediaSetAccess.cc.

References _verifiers.

Pathname zypp::MediaSetAccess::provideFile ( const Pathname &  file,
unsigned  media_nr = 1 
)

Definition at line 103 of file MediaSetAccess.cc.

References provideFileInternal().

Referenced by providePossiblyCachedMetadataFile().

Pathname zypp::MediaSetAccess::provideFile ( const Pathname &  file,
unsigned  media_nr,
const FileChecker  checker 
)

Definition at line 108 of file MediaSetAccess.cc.

References provideFileInternal(), and ZYPP_THROW.

void zypp::MediaSetAccess::providePossiblyCachedMetadataFile ( const Pathname &  file_to_download,
unsigned  medianr,
const Pathname &  destination,
const Pathname &  cached_file,
const CheckSum checksum 
)

Definition at line 81 of file MediaSetAccess.cc.

References _url, zypp::Url::asString(), zypp::filesystem::checksum(), zypp::filesystem::copy(), zypp::filesystem::is_checksum(), MIL, provideFile(), and ZYPP_THROW.

Pathname zypp::MediaSetAccess::provideFileInternal ( const Pathname &  file,
unsigned  media_nr,
bool  checkonly,
bool  cached 
) [protected]

Definition at line 119 of file MediaSetAccess.cc.

References zypp::media::MediaChangeReport::ABORT, zypp::media::MediaManager::attach(), zypp::media::MediaChangeReport::CHANGE_URL, DBG, zypp::media::MediaChangeReport::EJECT, ERR, getMediaAccessId(), zypp::media::MediaChangeReport::IGNORE, zypp::media::MediaChangeReport::INVALID, zypp::media::MediaManager::isAttached(), zypp::media::MediaManager::localPath(), zypp::media_mgr, MIL, zypp::Source_Ref::noSource, zypp::media::MediaChangeReport::NOT_FOUND, zypp::media::MediaManager::provideFile(), zypp::media::MediaManager::release(), report, zypp::media::MediaChangeReport::RETRY, zypp::media::MediaChangeReport::WRONG, ZYPP_CAUGHT, ZYPP_RETHROW, and ZYPP_THROW.

Referenced by provideFile().

Url zypp::MediaSetAccess::rewriteUrl ( const Url url_r,
const media::MediaNr  medianr 
) [protected]

Definition at line 270 of file MediaSetAccess.cc.

References DBG, zypp::Url::getPathName(), zypp::Url::getQueryParam(), zypp::Url::getScheme(), zypp::str::numstring(), zypp::Url::setPathName(), zypp::Url::setQueryParam(), and url.

Referenced by getMediaAccessId().

media::MediaAccessId zypp::MediaSetAccess::getMediaAccessId ( media::MediaNr  medianr  )  [protected]

Definition at line 238 of file MediaSetAccess.cc.

References _path, _url, zypp::media_mgr, medias, zypp::media::MediaManager::open(), rewriteUrl(), and url.

Referenced by provideFileInternal().

std::ostream & zypp::MediaSetAccess::dumpOn ( std::ostream &  str  )  const [protected, virtual]

Overload to realize std::ostream & operator<<.

Reimplemented from zypp::base::ReferenceCounted.

Definition at line 309 of file MediaSetAccess.cc.


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  str,
const MediaSetAccess obj 
) [friend]

Stream output.

Definition at line 112 of file MediaSetAccess.h.


Member Data Documentation

Url zypp::MediaSetAccess::_url [private]

Definition at line 102 of file MediaSetAccess.h.

Referenced by getMediaAccessId(), and providePossiblyCachedMetadataFile().

Pathname zypp::MediaSetAccess::_path [private]

Definition at line 103 of file MediaSetAccess.h.

Referenced by getMediaAccessId().

std::vector<media::MediaVerifierRef> zypp::MediaSetAccess::_verifiers [private]

Definition at line 104 of file MediaSetAccess.h.

Referenced by setVerifiers().

MediaMap zypp::MediaSetAccess::medias [private]

Mapping between each CD and Media Access ID.

Definition at line 107 of file MediaSetAccess.h.

Referenced by getMediaAccessId().


The documentation for this class was generated from the following files:
Generated on Tue Nov 28 16:49:37 2006 for zypp by  doxygen 1.5.0