zypp::CapFactory::Impl Struct Reference

CapFactory implementation. More...

List of all members.

Static Public Member Functions

static void assertResKind (const Resolvable::Kind &refers_r)
 Assert a valid Resolvable::Kind.
static bool isEditionSpec (Rel op_r, const Edition &edition_r)
 Check whether op_r and edition_r make a valid edition spec.
static bool isFileSpec (const std::string &name_r)
 Test for a FileCap.
static bool isSplitSpec (const std::string &name_r)
 Test for a SplitCap.
static bool isHalSpec (const std::string &name_r)
 Test for a HalCap.
static bool isModaliasSpec (const std::string &name_r)
 Test for a ModaliasCap.
static CapabilityImpl::Ptr buildFile (const Resolvable::Kind &refers_r, const std::string &name_r)
static CapabilityImpl::Ptr buildNamed (const Resolvable::Kind &refers_r, const std::string &name_r)
 Try to build a non versioned cap from name_r .
static CapabilityImpl::Ptr buildVersioned (const Resolvable::Kind &refers_r, const std::string &name_r, Rel op_r, const Edition &edition_r)
 Try to build a versioned cap from name_r .
static CapabilityImpl::Ptr buildHal (const Resolvable::Kind &refers_r, const std::string &name_r, Rel op_r=Rel::ANY, const std::string &value_r=std::string())
 Try to build a hal cap from name_r .
static CapabilityImpl::Ptr buildModalias (const Resolvable::Kind &refers_r, const std::string &name_r, Rel op_r=Rel::ANY, const std::string &value_r=std::string())
 Try to build a modalias cap from name_r .


Detailed Description

CapFactory implementation.

Provides various functions doing checks and log and throw. CapFactory::parse usually combines them, and if nothing fails, finaly builds the Capability.

Attention:
Each CapabilityImpl created by CapFactory, must be inserted into _uset, by calling usetInsert, before the Capability is created.

Definition at line 149 of file CapFactory.cc.


Member Function Documentation

static void zypp::CapFactory::Impl::assertResKind ( const Resolvable::Kind refers_r  )  [inline, static]

Assert a valid Resolvable::Kind.

Definition at line 152 of file CapFactory.cc.

References ZYPP_THROW.

Referenced by buildFile(), buildNamed(), and buildVersioned().

static bool zypp::CapFactory::Impl::isEditionSpec ( Rel  op_r,
const Edition edition_r 
) [inline, static]

Check whether op_r and edition_r make a valid edition spec.

Rel::NONE is not usefull thus forbidden. Rel::ANY can be ignored, so no VersionedCap is needed for this. Everything else requires a VersionedCap.

Returns:
Whether to build a VersionedCap (i.e. op_r is not Rel::ANY.

Definition at line 167 of file CapFactory.cc.

References zypp::Rel::ANY_e, zypp::Rel::EQ_e, zypp::Rel::GE_e, zypp::Rel::GT_e, zypp::Rel::inSwitch(), zypp::Rel::LE_e, zypp::Rel::LT_e, zypp::Rel::NE_e, zypp::Edition::noedition, zypp::Rel::NONE_e, WAR, and ZYPP_THROW.

Referenced by buildVersioned().

static bool zypp::CapFactory::Impl::isFileSpec ( const std::string &  name_r  )  [inline, static]

Test for a FileCap.

name_r starts with "/".

Definition at line 197 of file CapFactory.cc.

Referenced by buildNamed().

static bool zypp::CapFactory::Impl::isSplitSpec ( const std::string &  name_r  )  [inline, static]

Test for a SplitCap.

name_r constains ":/".

Definition at line 203 of file CapFactory.cc.

static bool zypp::CapFactory::Impl::isHalSpec ( const std::string &  name_r  )  [inline, static]

Test for a HalCap.

name_r starts with "hal(".

Definition at line 209 of file CapFactory.cc.

static bool zypp::CapFactory::Impl::isModaliasSpec ( const std::string &  name_r  )  [inline, static]

Test for a ModaliasCap.

name_r starts with "modalias(".

Definition at line 215 of file CapFactory.cc.

static CapabilityImpl::Ptr zypp::CapFactory::Impl::buildFile ( const Resolvable::Kind refers_r,
const std::string &  name_r 
) [inline, static]

Definition at line 220 of file CapFactory.cc.

References assertResKind(), zypp::capability::NullCap::instance(), and usetInsert().

static CapabilityImpl::Ptr zypp::CapFactory::Impl::buildNamed ( const Resolvable::Kind refers_r,
const std::string &  name_r 
) [inline, static]

Try to build a non versioned cap from name_r .

The CapabilityImpl is built here and inserted into _uset. The final Capability must be created by CapFactory, as it is a friend of Capability. Here we can't access the ctor.

Definition at line 242 of file CapFactory.cc.

References assertResKind(), zypp::capability::NullCap::instance(), isFileSpec(), zypp::solver::detail::str, and usetInsert().

Referenced by buildVersioned().

static CapabilityImpl::Ptr zypp::CapFactory::Impl::buildVersioned ( const Resolvable::Kind refers_r,
const std::string &  name_r,
Rel  op_r,
const Edition edition_r 
) [inline, static]

Try to build a versioned cap from name_r .

The CapabilityImpl is built here and inserted into _uset. The final Capability must be created by CapFactory, as it is a friend of Capability. Here we can't access the ctor.

Todo:
Quick check for name not being filename or split.

Definition at line 281 of file CapFactory.cc.

References assertResKind(), buildNamed(), isEditionSpec(), and usetInsert().

static CapabilityImpl::Ptr zypp::CapFactory::Impl::buildHal ( const Resolvable::Kind refers_r,
const std::string &  name_r,
Rel  op_r = Rel::ANY,
const std::string &  value_r = std::string() 
) [inline, static]

Try to build a hal cap from name_r .

The CapabilityImpl is built here and inserted into _uset. The final Capability must be created by CapFactory, as it is a friend of Capability. Here we can't access the ctor.

Todo:
Fix incaccuracy.

Definition at line 308 of file CapFactory.cc.

References zypp::Rel::ANY, zypp::solver::detail::str, usetInsert(), and ZYPP_THROW.

Referenced by zypp::CapFactory::halEvalCap().

static CapabilityImpl::Ptr zypp::CapFactory::Impl::buildModalias ( const Resolvable::Kind refers_r,
const std::string &  name_r,
Rel  op_r = Rel::ANY,
const std::string &  value_r = std::string() 
) [inline, static]

Try to build a modalias cap from name_r .

The CapabilityImpl is built here and inserted into _uset. The final Capability must be created by CapFactory, as it is a friend of Capability. Here we can't access the ctor.

Todo:
Fix incaccuracy.

Definition at line 342 of file CapFactory.cc.

References zypp::Rel::ANY, zypp::solver::detail::str, usetInsert(), and ZYPP_THROW.

Referenced by zypp::CapFactory::modaliasEvalCap().


The documentation for this struct was generated from the following file:
Generated on Tue Nov 28 16:49:36 2006 for zypp by  doxygen 1.5.0