Author: mlandres Date: Thu Apr 17 09:48:55 2008 New Revision: 9674 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9674&view=rev Log: backup Modified: trunk/libzypp/zypp/Capability.cc trunk/libzypp/zypp/Capability.h Modified: trunk/libzypp/zypp/Capability.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Capability.cc?rev=9674&r1=9673&r2=9674&view=diff ============================================================================== --- trunk/libzypp/zypp/Capability.cc (original) +++ trunk/libzypp/zypp/Capability.cc Thu Apr 17 09:48:55 2008 @@ -17,6 +17,7 @@ #include "zypp/base/Gettext.h" #include "zypp/base/Exception.h" +#include "zypp/Arch.h" #include "zypp/Rel.h" #include "zypp/Edition.h" #include "zypp/Capability.h" @@ -32,11 +33,19 @@ /////////////////////////////////////////////////////////////////// namespace { ///////////////////////////////////////////////////////////////// - sat::detail::IdType relFromStr( ::_Pool * pool_r, + const Arch & arch_r, const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & kind_r ) { sat::detail::IdType nid( sat::detail::noId ); + return nid; + } + + sat::detail::IdType relFromStr( ::_Pool * pool_r, + const std::string & name_r, Rel op_r, const Edition & ed_r, + const ResKind & kind_r ) + { + sat::detail::IdType nid( sat::detail::noId ); if ( ! kind_r || kind_r == ResKind::package ) { nid = IdString( name_r ).id(); @@ -58,7 +67,8 @@ } sat::detail::IdType relFromStr( ::_Pool * pool_r, - const std::string & str_r, const ResKind & kind_r, Capability::CtorFlag flag_r ) + const std::string & str_r, const ResKind & kind_r, + Capability::CtorFlag flag_r ) { // strval_r has at least two words which could make 'op edition'? // improve regex! @@ -130,6 +140,15 @@ : _id( relFromStr( myPool().getPool(), name_r, op_r, ed_r, prefix_r ) ) {} +#if 0 + Capability::Capability( const std::string & arch_r, const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); + Capability::Capability( const std::string & arch_r, const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); + Capability::Capability( const std::string & arch_r, const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r = ResKind() ); + Capability::Capability( const Arch & arch_r, const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); + Capability::Capability( const Arch & arch_r, const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); + Capability::Capability( const Arch & arch_r, const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r = ResKind() ); +#endif + const char * Capability::c_str() const { return( _id ? ::dep2str( myPool().getPool(), _id ) : "" ); } Modified: trunk/libzypp/zypp/Capability.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Capability.h?rev=9674&r1=9673&r2=9674&view=diff ============================================================================== --- trunk/libzypp/zypp/Capability.h (original) +++ trunk/libzypp/zypp/Capability.h Thu Apr 17 09:48:55 2008 @@ -41,8 +41,12 @@ // /** A sat capability. * + * A Capability: <tt>"name[.arch] [op edition]"</tt> + * * If a certain \ref ResKind is specified upon construction, the - * capabilities name part is prefixed accordingly: + * capabilities name part is prefixed accordingly. If no \ref ResKind + * is specified, it's assumed you refer to a package or the name is + * already prefixed: * \code * Capability( "foo" ) ==> 'foo' * Capability( "foo", ResKind::package ) ==> 'foo' @@ -65,9 +69,13 @@ /** Ctor from id. */ explicit Capability( sat::detail::IdType id_r ) : _id( id_r ) {} + /** \name Ctors parsing a Capability: <tt>"name[.arch] [op edition]"</tt> + */ + //@{ /** Ctor from string. * \a str_r is parsed to check whether it contains an <tt>[op edition]</tt> part, - * unless the \ref PARSED flag is passed to the ctor. + * unless the \ref PARSED flag is passed to the ctor. In that case <tt>"name[.arch]"</tt> + * is assumed. */ explicit Capability( const char * str_r, const ResKind & prefix_r = ResKind(), CtorFlag flag_r = UNPARSED ); /** \overload */ @@ -76,13 +84,37 @@ Capability( const char * str_r, CtorFlag flag_r, const ResKind & prefix_r = ResKind() ); /** \overload */ Capability( const std::string & str_r, CtorFlag flag_r, const ResKind & prefix_r = ResKind() ); + //@} - /** Ctor from <tt>name op edition</tt>. */ + /** \name Ctors parsing a broken down Capability: <tt>( "name[.arch]", op, edition )</tt> + */ + //@{ + /** Ctor from <tt>name[.arch] op edition</tt>. */ Capability( const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); /** \overload */ Capability( const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); /** \overload */ Capability( const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r = ResKind() ); + //@} + +#if 0 + /** \name Ctors taking a broken down Capability: <tt>( arch, name, op, edition )</tt> + */ + //@{ + /** Ctor from <tt>arch name op edition</tt>. */ + Capability( const std::string & arch_r, const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); + /** \overload */ + Capability( const std::string & arch_r, const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); + /** \overload */ + Capability( const std::string & arch_r, const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r = ResKind() ); + /** \overload */ + Capability( const Arch & arch_r, const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); + /** \overload */ + Capability( const Arch & arch_r, const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); + /** \overload */ + Capability( const Arch & arch_r, const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r = ResKind() ); + //@} +#endif public: /** No or Null \ref Capability ( Id \c 0 ). */ -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org