zypp::SourceFactory Class Reference

Factory to create a Source_Ref. More...

#include <SourceFactory.h>

List of all members.

Public Types

typedef std::set< ProductEntryProductSet

Public Member Functions

 SourceFactory ()
 Default ctor.
 ~SourceFactory ()
 Dtor.
Source_Ref createFrom (const source::SourceInfo &context)
 Construct source.
Source_Ref createFrom (const Source_Ref::Impl_Ptr &impl_r)
 Construct source from an implementation.
Source_Ref createFrom (const Url &url_r, const Pathname &path_r="/", const std::string &alias_r="", const Pathname &cache_dir_r="", bool base_source=false)
 Construct source.
Source_Ref createFrom (const std::string &type, const Url &url_r, const Pathname &path_r, const std::string &alias_r, const Pathname &cache_dir_r, bool base_source, tribool auto_refresh)
 Construct source of a given type.
void listProducts (const Url &url_r, ProductSet &products_r)
 Check which products are available on the media.

Protected Member Functions

template<class _SourceImpl>
Source_Ref createSourceImplWorkflow (media::MediaId id, const source::SourceInfo &context)

Private Member Functions

void scanProductsFile (const Pathname &file_r, ProductSet &pset_r) const

Private Attributes

RW_pointer< Impl_pimpl
 Pointer to implementation.

Friends

std::ostream & operator<< (std::ostream &str, const SourceFactory &obj)

Classes

struct  Impl
 SourceFactory implementation. More...
struct  ProductEntry


Detailed Description

Factory to create a Source_Ref.

Actually a Singleton

Definition at line 45 of file SourceFactory.h.


Member Typedef Documentation

typedef std::set<ProductEntry> zypp::SourceFactory::ProductSet
 

Definition at line 98 of file SourceFactory.h.


Constructor & Destructor Documentation

zypp::SourceFactory::SourceFactory  ) 
 

Default ctor.

Definition at line 67 of file SourceFactory.cc.

zypp::SourceFactory::~SourceFactory  ) 
 

Dtor.

Definition at line 75 of file SourceFactory.cc.


Member Function Documentation

Source_Ref zypp::SourceFactory::createFrom const source::SourceInfo context  ) 
 

Construct source.

Exceptions:
EXCEPTION on fail

Definition at line 111 of file SourceFactory.cc.

References zypp::source::SourceInfo::alias(), zypp::source::SourceInfo::baseSource(), zypp::source::SourceInfo::cacheDir(), zypp::source::SourceInfo::path(), zypp::source::SourceInfo::type(), and zypp::source::SourceInfo::url().

Referenced by zypp::source::SourceImpl::provideDirTree(), zypp::source::SourceImpl::provideJustFile(), and zypp::source::susetags::SuseTagsImpl::readContentFile().

Source_Ref zypp::SourceFactory::createFrom const Source_Ref::Impl_Ptr impl_r  ) 
 

Construct source from an implementation.

Returns Source_Ref::noSource on NULL impl_r.

Definition at line 83 of file SourceFactory.cc.

References zypp::Source_Ref::noSource.

Source_Ref zypp::SourceFactory::createFrom const Url url_r,
const Pathname path_r = "/",
const std::string &  alias_r = "",
const Pathname cache_dir_r = "",
bool  base_source = false
 

Construct source.

Exceptions:
EXCEPTION on fail

Definition at line 196 of file SourceFactory.cc.

References zypp::media::MediaManager::addVerifier(), zypp::Exception::asUserString(), zypp::media::MediaManager::attach(), zypp::media::MediaAccess::canBeVolatile(), zypp::Url::isValid(), zypp::media_mgr, MIL, zypp::media::MediaManager::open(), report, zypp::source::SourceInfo::setBaseSource(), ZYPP_RETHROW, and ZYPP_THROW.

Source_Ref zypp::SourceFactory::createFrom const std::string &  type,
const Url url_r,
const Pathname path_r,
const std::string &  alias_r,
const Pathname cache_dir_r,
bool  base_source,
tribool  auto_refresh
 

Construct source of a given type.

Exceptions:
EXCEPTION on fail

Definition at line 267 of file SourceFactory.cc.

References zypp::media::MediaManager::addVerifier(), zypp::media::MediaManager::attach(), zypp::media::MediaAccess::canBeVolatile(), zypp::Url::isValid(), zypp::media_mgr, MIL, zypp::media::MediaManager::open(), zypp::source::SourceInfo::setBaseSource(), zypp::source::SourceInfo::setType(), ZYPP_CAUGHT, ZYPP_RETHROW, and ZYPP_THROW.

template<class _SourceImpl>
Source_Ref zypp::SourceFactory::createSourceImplWorkflow media::MediaId  id,
const source::SourceInfo context
[protected]
 

Definition at line 152 of file SourceFactory.cc.

References MIL, report, zypp::source::SourceInfo::url(), ZYPP_CAUGHT, and ZYPP_THROW.

void zypp::SourceFactory::listProducts const Url url_r,
ProductSet products_r
 

Check which products are available on the media.

Exceptions:
Exception or MediaException on fail

Definition at line 88 of file SourceFactory.cc.

References zypp::media::MediaManager::attach(), zypp::Url::isValid(), zypp::media::MediaManager::localPath(), zypp::media_mgr, MIL, zypp::media::MediaManager::open(), zypp::media::MediaManager::provideFile(), zypp::media::MediaManager::release(), scanProductsFile(), ZYPP_CAUGHT, and ZYPP_THROW.

void zypp::SourceFactory::scanProductsFile const Pathname file_r,
ProductSet pset_r
const [private]
 

Definition at line 353 of file SourceFactory.cc.

References zypp::filesystem::Pathname::asString(), ERR, zypp::str::getline(), zypp::str::TRIM, and ZYPP_THROW.

Referenced by listProducts().


Friends And Related Function Documentation

std::ostream & operator<< std::ostream &  str,
const SourceFactory obj
[friend]
 

Stream output

Definition at line 348 of file SourceFactory.cc.


Member Data Documentation

RW_pointer<Impl> zypp::SourceFactory::_pimpl [private]
 

Pointer to implementation.

Definition at line 81 of file SourceFactory.h.


The documentation for this class was generated from the following files:
Generated on Thu Apr 24 02:25:08 2008 for zypp by  doxygen 1.4.6