Author: mlandres
Date: Tue Jan 15 18:58:26 2008
New Revision: 8295
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8295&view=rev
Log:
move IdString to namespace zypp
Added:
branches/tmp/ma/jump_sat/libzypp/zypp/IdString.h
branches/tmp/ma/jump_sat/libzypp/zypp/IdStringType.h
branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.cc
- copied, changed from r8290, branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.cc
branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.h
- copied, changed from r8290, branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.h
branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStringType.h
- copied, changed from r8290, branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStrType.h
Removed:
branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.cc
branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.h
branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStrType.h
Modified:
branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt
branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h
branches/tmp/ma/jump_sat/libzypp/zypp/ResKind.h
branches/tmp/ma/jump_sat/libzypp/zypp/base/KindOf.h
branches/tmp/ma/jump_sat/libzypp/zypp/pool/Res2Sat.cc
branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.cc
branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.h
branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.cc
branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.h
branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolMember.h
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt Tue Jan 15 18:58:26 2008
@@ -187,6 +187,8 @@
RepoManager.h
MediaProducts.h
Locks.h
+ IdString.h
+ IdStringType.h
)
INSTALL( FILES ${zypp_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/zypp" )
@@ -682,7 +684,7 @@
sat/Pool.cc
sat/Repo.cc
sat/Solvable.cc
- sat/IdStr.cc
+ sat/IdString.cc
sat/Capability.cc
sat/Capabilities.cc
sat/SATResolver.cc
@@ -694,7 +696,8 @@
sat/Pool.h
sat/Repo.h
sat/Solvable.h
- sat/IdStr.h
+ sat/IdString.h
+ sat/IdStringType.h
sat/Capability.h
sat/Capabilities.h
sat/SATResolver.h
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/Edition.h Tue Jan 15 18:58:26 2008
@@ -16,7 +16,7 @@
#include <string>
#include <functional>
-#include "zypp/sat/IdStrType.h"
+#include "zypp/IdStringType.h"
#include "zypp/RelCompare.h"
#include "zypp/Range.h"
@@ -57,7 +57,7 @@
*
* \ingroup g_BackendSpecific
*/
- class Edition : public sat::IdStrType<Edition>
+ class Edition : public IdStringType<Edition>
{
public:
/** Type of an epoch. */
@@ -77,10 +77,10 @@
Edition() {}
/** Ctor taking edition as string. */
- explicit Edition( sat::detail::IdType id_r ) : _str( sat::IdStr(id_r).c_str() ) {}
- explicit Edition( const sat::IdStr & idstr_r ) : _str( idstr_r.c_str() ) {}
- explicit Edition( const std::string & str_r ) : _str( str_r ) {}
- explicit Edition( const char * cstr_r ) : _str( cstr_r ) {}
+ explicit Edition( sat::detail::IdType id_r ) : _str( IdString(id_r).c_str() ) {}
+ explicit Edition( const IdString & idstr_r ) : _str( idstr_r.c_str() ) {}
+ explicit Edition( const std::string & str_r ) : _str( str_r ) {}
+ explicit Edition( const char * cstr_r ) : _str( cstr_r ) {}
/** Ctor taking \a version_r, \a release_r and optional \a epoch_r */
Edition( const std::string & version_r,
@@ -119,29 +119,29 @@
* version/release strings as \c ANY.
*/
//@{
- static int match( const Edition & lhs, const Edition & rhs ) { return match( lhs.idStr(), rhs.idStr() ); }
- static int match( const Edition & lhs, const IdStr & rhs ) { return match( lhs.idStr(), rhs ); }
- static int match( const Edition & lhs, const std::string & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
- static int match( const Edition & lhs, const char * rhs ) { return _doMatch( lhs.c_str(), rhs );}
+ static int match( const Edition & lhs, const Edition & rhs ) { return match( lhs.idStr(), rhs.idStr() ); }
+ static int match( const Edition & lhs, const IdString & rhs ) { return match( lhs.idStr(), rhs ); }
+ static int match( const Edition & lhs, const std::string & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
+ static int match( const Edition & lhs, const char * rhs ) { return _doMatch( lhs.c_str(), rhs );}
- static int match( const IdStr & lhs, const Edition & rhs ) { return match( lhs, rhs.idStr() ); }
- static int match( const IdStr & lhs, const IdStr & rhs ) { return lhs.compareEQ( rhs ) ? 0 :
+ static int match( const IdString & lhs, const Edition & rhs ) { return match( lhs, rhs.idStr() ); }
+ static int match( const IdString & lhs, const IdString & rhs ) { return lhs.compareEQ( rhs ) ? 0 :
_doMatch( lhs.c_str(), rhs.c_str() ); }
- static int match( const IdStr & lhs, const std::string & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
- static int match( const IdStr & lhs, const char * rhs ) { return _doMatch( lhs.c_str(), rhs ); }
+ static int match( const IdString & lhs, const std::string & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
+ static int match( const IdString & lhs, const char * rhs ) { return _doMatch( lhs.c_str(), rhs ); }
static int match( const std::string & lhs, const Edition & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() );}
- static int match( const std::string & lhs, const IdStr & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
+ static int match( const std::string & lhs, const IdString & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
static int match( const std::string & lhs, const std::string & rhs ) { return _doMatch( lhs.c_str(), rhs.c_str() ); }
static int match( const std::string & lhs, const char * rhs ) { return _doMatch( lhs.c_str(), rhs ); }
static int match( const char * lhs, const Edition & rhs ) { return _doMatch( lhs, rhs.c_str() );}
- static int match( const char * lhs, const IdStr & rhs ) { return _doMatch( lhs, rhs.c_str() ); }
+ static int match( const char * lhs, const IdString & rhs ) { return _doMatch( lhs, rhs.c_str() ); }
static int match( const char * lhs, const std::string & rhs ) { return _doMatch( lhs, rhs.c_str() ); }
static int match( const char * lhs, const char * rhs ) { return _doMatch( lhs, rhs ); }
int match( const Edition & rhs ) const { return match( idStr(), rhs.idStr() ); }
- int match( const IdStr & rhs ) const { return match( idStr(), rhs ); }
+ int match( const IdString & rhs ) const { return match( idStr(), rhs ); }
int match( const std::string & rhs ) const { return _doMatch( c_str(), rhs.c_str() ); }
int match( const char * rhs ) const { return _doMatch( c_str(), rhs ); }
//@}
@@ -165,8 +165,8 @@
static int _doMatch( const char * lhs, const char * rhs );
private:
- friend class sat::IdStrType<Edition>;
- sat::IdStr _str;
+ friend class IdStringType<Edition>;
+ IdString _str;
};
///////////////////////////////////////////////////////////////////
Added: branches/tmp/ma/jump_sat/libzypp/zypp/IdString.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/IdString.h?rev=8295&view=auto
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/IdString.h (added)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/IdString.h Tue Jan 15 18:58:26 2008
@@ -0,0 +1,2 @@
+#include "sat/IdString.h"
+
Added: branches/tmp/ma/jump_sat/libzypp/zypp/IdStringType.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/IdStringType.h?rev=8295&view=auto
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/IdStringType.h (added)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/IdStringType.h Tue Jan 15 18:58:26 2008
@@ -0,0 +1,2 @@
+#include "sat/IdStringType.h"
+
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/ResKind.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/ResKind.h?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/ResKind.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/ResKind.h Tue Jan 15 18:58:26 2008
@@ -16,7 +16,7 @@
#include <string>
#include "zypp/base/String.h"
-#include "zypp/sat/IdStrType.h"
+#include "zypp/IdStringType.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -31,7 +31,7 @@
* Comparison against string values is always case
* insensitive.
*/
- class ResKind : public sat::IdStrType<ResKind>
+ class ResKind : public IdStringType<ResKind>
{
public:
/** \name Some builtin ResKind constants. */
@@ -57,10 +57,10 @@
ResKind() {}
/** Ctor taking kind as string. */
- explicit ResKind( sat::detail::IdType id_r ) : _str( str::toLower(sat::IdStr(id_r).c_str()) ) {}
- explicit ResKind( const sat::IdStr & idstr_r ) : _str( str::toLower(idstr_r.c_str()) ) {}
- explicit ResKind( const std::string & str_r ) : _str( str::toLower(str_r) ) {}
- explicit ResKind( const char * cstr_r ) : _str( str::toLower(cstr_r) ) {}
+ explicit ResKind( sat::detail::IdType id_r ) : _str( str::toLower(IdString(id_r).c_str()) ) {}
+ explicit ResKind( const IdString & idstr_r ) : _str( str::toLower(idstr_r.c_str()) ) {}
+ explicit ResKind( const std::string & str_r ) : _str( str::toLower(str_r) ) {}
+ explicit ResKind( const char * cstr_r ) : _str( str::toLower(cstr_r) ) {}
private:
static int _doCompare( const char * lhs, const char * rhs )
@@ -71,8 +71,8 @@
}
private:
- friend class sat::IdStrType<ResKind>;
- sat::IdStr _str;
+ friend class IdStringType<ResKind>;
+ IdString _str;
};
/////////////////////////////////////////////////////////////////
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/base/KindOf.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/base/KindOf.h?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/base/KindOf.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/base/KindOf.h Tue Jan 15 18:58:26 2008
@@ -15,7 +15,7 @@
#include <iosfwd>
#include "zypp/base/String.h"
-#include "zypp/sat/IdStr.h"
+#include "zypp/IdString.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -37,7 +37,7 @@
* identification. Comparison against string values is always case insensitive.
*/
template<class _Tp>
- class KindOf : private sat::IdStr
+ class KindOf : private IdString
{
public:
/** DefaultCtor: empty string */
@@ -48,29 +48,29 @@
*/
explicit
KindOf( const std::string & value_r )
- : sat::IdStr( str::toLower(value_r) )
+ : IdString( str::toLower(value_r) )
{}
/** Dtor */
~KindOf()
{}
public:
- sat::IdStr::empty;
- sat::IdStr::size;
- sat::IdStr::c_str;
- sat::IdStr::string;
- sat::IdStr::asString;
+ IdString::empty;
+ IdString::size;
+ IdString::c_str;
+ IdString::string;
+ IdString::asString;
public:
/** Fast compare equal. */
bool compareEQ( const KindOf & rhs ) const
- { return sat::IdStr::compareEQ( rhs ); }
+ { return IdString::compareEQ( rhs ); }
/** Compare KindOf returning <tt>-1,0,1</tt>. */
int compare( const KindOf & rhs ) const
- { return sat::IdStr::compare( rhs ); }
+ { return IdString::compare( rhs ); }
/** \overload Remember to compare case insensitive. */
- int compare( const IdStr & rhs ) const
+ int compare( const IdString & rhs ) const
{
- if ( sat::IdStr::compareEQ( rhs ) )
+ if ( IdString::compareEQ( rhs ) )
return 0;
return str::compareCI( c_str(), rhs.c_str() );
}
@@ -81,7 +81,7 @@
int compare( const std::string & rhs ) const
{ return str::compareCI( c_str(), rhs ); }
public:
- sat::IdStr::id;
+ IdString::id;
};
///////////////////////////////////////////////////////////////////
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/pool/Res2Sat.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/pool/Res2Sat.cc?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/pool/Res2Sat.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/pool/Res2Sat.cc Tue Jan 15 18:58:26 2008
@@ -43,7 +43,7 @@
inline void store( ::Id & where_r, const::std::string & str_r )
{
- where_r = sat::IdStr( str_r ).id();
+ where_r = IdString( str_r ).id();
}
inline void store( ::Offset & where_r, ::_Solvable * slv_r, const Dependencies & dep_r, Dep which_r )
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.cc?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.cc Tue Jan 15 18:58:26 2008
@@ -39,12 +39,12 @@
detail::IdType nid( detail::noId );
if ( ! kind_r || kind_r == ResKind::package )
{
- nid = IdStr( name_r ).id();
+ nid = IdString( name_r ).id();
}
else
{
// non-packages prefixed by kind
- nid = IdStr( str::form( "%s:%s",
+ nid = IdString( str::form( "%s:%s",
kind_r.c_str(),
name_r.c_str() ) ).id();
}
@@ -52,7 +52,7 @@
if ( op_r != Rel::ANY && ed_r != Edition::noedition )
{
#warning glue edition
- nid = ::rel2id( pool_r, nid, IdStr( ed_r.asString() ).id(), op_r.bits(), /*create*/true );
+ nid = ::rel2id( pool_r, nid, IdString( ed_r.asString() ).id(), op_r.bits(), /*create*/true );
}
return nid;
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.h?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/Capability.h Tue Jan 15 18:58:26 2008
@@ -18,8 +18,8 @@
#include "zypp/base/SafeBool.h"
#include "zypp/sat/detail/PoolMember.h"
-#include "zypp/sat/IdStr.h"
+#include "zypp/IdString.h"
#include "zypp/ResTraits.h"
///////////////////////////////////////////////////////////////////
Copied: branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.cc (from r8290, branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.cc)
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.cc?p2=branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.cc&p1=branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.cc&r1=8290&r2=8295&rev=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.cc Tue Jan 15 18:58:26 2008
@@ -6,14 +6,15 @@
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zypp/sat/IdStr.cc
+/** \file zypp/sat/IdString.cc
*
*/
#include <iostream>
#include
+#include "zypp/IdString.h"
+
#include "zypp/sat/detail/PoolImpl.h"
-#include "zypp/sat/IdStr.h"
#include "zypp/sat/Pool.h"
using std::endl;
@@ -21,39 +22,36 @@
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace sat
- { /////////////////////////////////////////////////////////////////
// MPL checks for satlib constants we explicity use in
// the header file.
BOOST_MPL_ASSERT_RELATION( 0, ==, STRID_NULL );
BOOST_MPL_ASSERT_RELATION( 1, ==, STRID_EMPTY );
- const IdStr IdStr::Null ( STRID_NULL );
- const IdStr IdStr::Empty( STRID_EMPTY );
+ const IdString IdString::Null ( STRID_NULL );
+ const IdString IdString::Empty( STRID_EMPTY );
/////////////////////////////////////////////////////////////////
- IdStr::IdStr( const char * str_r )
+ IdString::IdString( const char * str_r )
: _id( ::str2id( myPool().getPool(), str_r, /*create*/true ) )
{}
- IdStr::IdStr( const std::string & str_r )
+ IdString::IdString( const std::string & str_r )
: _id( ::str2id( myPool().getPool(), str_r.c_str(), /*create*/true ) )
{}
- unsigned IdStr::size() const
+ unsigned IdString::size() const
{ return ::strlen( c_str() ); }
- const char * IdStr::c_str() const
+ const char * IdString::c_str() const
{ return _id ? ::id2str( myPool().getPool(), _id ) : ""; }
- int IdStr::compare( const IdStr & rhs ) const
+ int IdString::compare( const IdString & rhs ) const
{
if ( _id == rhs._id )
return 0;
- // Explicitly handle IdStr::Null < ""
+ // Explicitly handle IdString::Null < ""
if ( ! _id )
return -1;
if ( ! rhs._id )
@@ -61,9 +59,9 @@
return ::strcmp( c_str(), rhs.c_str() );
}
- int IdStr::compare( const char * rhs ) const
+ int IdString::compare( const char * rhs ) const
{
- // Explicitly handle IdStr::Null == (const char *)0
+ // Explicitly handle IdString::Null == (const char *)0
if ( ! _id )
return rhs ? -1 : 0;
if ( ! rhs )
@@ -76,14 +74,11 @@
** FUNCTION NAME : operator<<
** FUNCTION TYPE : std::ostream &
*/
- std::ostream & operator<<( std::ostream & str, const IdStr & obj )
+ std::ostream & operator<<( std::ostream & str, const IdString & obj )
{
return str << obj.c_str();
}
- /////////////////////////////////////////////////////////////////
- } // namespace sat
- ///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
Copied: branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.h (from r8290, branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.h)
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.h?p2=branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.h&p1=branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.h&r1=8290&r2=8295&rev=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStr.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdString.h Tue Jan 15 18:58:26 2008
@@ -6,7 +6,7 @@
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zypp/sat/IdStr.h
+/** \file zypp/sat/IdString.h
*
*/
#ifndef ZYPP_SAT_IDSTR_H
@@ -22,48 +22,44 @@
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace sat
- { /////////////////////////////////////////////////////////////////
-
///////////////////////////////////////////////////////////////////
//
- // CLASS NAME : IdStr
+ // CLASS NAME : IdString
//
/** Access to the sat-pools string space.
*
* Construction from string will place a copy of the string in the
* string space, if it is not already present.
*
- * While comparison differs between \ref IdStr::Null and \ref IdStr::Empty
+ * While comparison differs between \ref IdString::Null and \ref IdString::Empty
* ( \c NULL and \c "" ), both are represented by an empty string \c "".
*/
- class IdStr: protected detail::PoolMember,
- private base::SafeBool<IdStr>
+ class IdString: protected sat::detail::PoolMember,
+ private base::SafeBool<IdString>
{
public:
/** Default ctor, empty string. */
- IdStr() : _id( 1 ) {}
+ IdString() : _id( 1 ) {}
/** Ctor from id. */
- explicit IdStr( detail::IdType id_r ) : _id( id_r ) {}
+ explicit IdString( sat::detail::IdType id_r ) : _id( id_r ) {}
/** Ctor from string. */
- explicit IdStr( const char * str_r );
+ explicit IdString( const char * str_r );
/** Ctor from string. */
- explicit IdStr( const std::string & str_r );
+ explicit IdString( const std::string & str_r );
public:
/** No or Null string ( Id \c 0 ). */
- static const IdStr Null;
+ static const IdString Null;
/** Empty string. */
- static const IdStr Empty;
+ static const IdString Empty;
public:
/** Evaluate in a boolean context <tt>( != \c Null )</tt>. */
- using base::SafeBool<IdStr>::operator bool_type;
+ using base::SafeBool<IdString>::operator bool_type;
/** Whether the string is empty.
* This is true for \ref Null and \ref Empty.
@@ -88,11 +84,11 @@
public:
/** Fast compare equal. */
- bool compareEQ( const IdStr & rhs ) const
+ bool compareEQ( const IdString & rhs ) const
{ return( _id == rhs.id() ); }
- /** Compare IdStr returning <tt>-1,0,1</tt>. */
- int compare( const IdStr & rhs ) const;
+ /** Compare IdString returning <tt>-1,0,1</tt>. */
+ int compare( const IdString & rhs ) const;
/** \overload */
int compare( const char * rhs ) const;
@@ -103,122 +99,115 @@
public:
/** Expert backdoor. */
- detail::IdType id() const
+ sat::detail::IdType id() const
{ return _id; }
private:
- friend base::SafeBool<IdStr>::operator bool_type() const;
+ friend base::SafeBool<IdString>::operator bool_type() const;
bool boolTest() const { return _id; }
private:
- detail::IdType _id;
+ sat::detail::IdType _id;
};
///////////////////////////////////////////////////////////////////
- /** \relates IdStr Stream output */
- std::ostream & operator<<( std::ostream & str, const IdStr & obj );
+ /** \relates IdString Stream output */
+ std::ostream & operator<<( std::ostream & str, const IdString & obj );
- /** \relates IdStr Equal */
- inline bool operator==( const IdStr & lhs, const IdStr & rhs )
+ /** \relates IdString Equal */
+ inline bool operator==( const IdString & lhs, const IdString & rhs )
{ return lhs.compareEQ( rhs ); }
/** \overload */
- inline bool operator==( const IdStr & lhs, const char * rhs )
+ inline bool operator==( const IdString & lhs, const char * rhs )
{ return lhs.compare( rhs ) == 0; }
/** \overload */
- inline bool operator==( const IdStr & lhs, const std::string & rhs )
+ inline bool operator==( const IdString & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) == 0; }
/** \overload */
- inline bool operator==( const char * lhs, const IdStr & rhs )
+ inline bool operator==( const char * lhs, const IdString & rhs )
{ return rhs.compare( lhs ) == 0; }
/** \overload */
- inline bool operator==( const std::string & lhs, const IdStr & rhs )
+ inline bool operator==( const std::string & lhs, const IdString & rhs )
{ return rhs.compare( lhs ) == 0; }
- /** \relates IdStr NotEqual */
- inline bool operator!=( const IdStr & lhs, const IdStr & rhs )
+ /** \relates IdString NotEqual */
+ inline bool operator!=( const IdString & lhs, const IdString & rhs )
{ return ! lhs.compareEQ( rhs ); }
/** \overload */
- inline bool operator!=( const IdStr & lhs, const char * rhs )
+ inline bool operator!=( const IdString & lhs, const char * rhs )
{ return lhs.compare( rhs ) != 0; }
/** \overload */
- inline bool operator!=( const IdStr & lhs, const std::string & rhs )
+ inline bool operator!=( const IdString & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) != 0; }
/** \overload */
- inline bool operator!=( const char * lhs, const IdStr & rhs )
+ inline bool operator!=( const char * lhs, const IdString & rhs )
{ return rhs.compare( lhs ) != 0; }
/** \overload */
- inline bool operator!=( const std::string & lhs, const IdStr & rhs )
+ inline bool operator!=( const std::string & lhs, const IdString & rhs )
{ return rhs.compare( lhs ) != 0; }
- /** \relates IdStr Less */
- inline bool operator<( const IdStr & lhs, const IdStr & rhs )
+ /** \relates IdString Less */
+ inline bool operator<( const IdString & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) < 0; }
/** \overload */
- inline bool operator<( const IdStr & lhs, const char * rhs )
+ inline bool operator<( const IdString & lhs, const char * rhs )
{ return lhs.compare( rhs ) < 0; }
/** \overload */
- inline bool operator<( const IdStr & lhs, const std::string & rhs )
+ inline bool operator<( const IdString & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) < 0; }
/** \overload */
- inline bool operator<( const char * lhs, const IdStr & rhs )
+ inline bool operator<( const char * lhs, const IdString & rhs )
{ return rhs.compare( lhs ) >= 0; }
/** \overload */
- inline bool operator<( const std::string & lhs, const IdStr & rhs )
+ inline bool operator<( const std::string & lhs, const IdString & rhs )
{ return rhs.compare( lhs ) >= 0; }
- /** \relates IdStr LessEqual*/
- inline bool operator<=( const IdStr & lhs, const IdStr & rhs )
+ /** \relates IdString LessEqual*/
+ inline bool operator<=( const IdString & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) <= 0; }
/** \overload */
- inline bool operator<=( const IdStr & lhs, const char * rhs )
+ inline bool operator<=( const IdString & lhs, const char * rhs )
{ return lhs.compare( rhs ) <= 0; }
/** \overload */
- inline bool operator<=( const IdStr & lhs, const std::string & rhs )
+ inline bool operator<=( const IdString & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) <= 0; }
/** \overload */
- inline bool operator<=( const char * lhs, const IdStr & rhs )
+ inline bool operator<=( const char * lhs, const IdString & rhs )
{ return rhs.compare( lhs ) > 0; }
/** \overload */
- inline bool operator<=( const std::string & lhs, const IdStr & rhs )
+ inline bool operator<=( const std::string & lhs, const IdString & rhs )
{ return rhs.compare( lhs ) > 0; }
- /** \relates IdStr Greater */
- inline bool operator>( const IdStr & lhs, const IdStr & rhs )
+ /** \relates IdString Greater */
+ inline bool operator>( const IdString & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) > 0; }
/** \overload */
- inline bool operator>( const IdStr & lhs, const char * rhs )
+ inline bool operator>( const IdString & lhs, const char * rhs )
{ return lhs.compare( rhs ) > 0; }
/** \overload */
- inline bool operator>( const IdStr & lhs, const std::string & rhs )
+ inline bool operator>( const IdString & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) > 0; }
/** \overload */
- inline bool operator>( const char * lhs, const IdStr & rhs )
+ inline bool operator>( const char * lhs, const IdString & rhs )
{ return rhs.compare( lhs ) <= 0; }
/** \overload */
- inline bool operator>( const std::string & lhs, const IdStr & rhs )
+ inline bool operator>( const std::string & lhs, const IdString & rhs )
{ return rhs.compare( lhs ) <= 0; }
- /** \relates IdStr GreaterEqual */
- inline bool operator>=( const IdStr & lhs, const IdStr & rhs )
+ /** \relates IdString GreaterEqual */
+ inline bool operator>=( const IdString & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) >= 0; }
/** \overload */
- inline bool operator>=( const IdStr & lhs, const char * rhs )
+ inline bool operator>=( const IdString & lhs, const char * rhs )
{ return lhs.compare( rhs ) >= 0; }
/** \overload */
- inline bool operator>=( const IdStr & lhs, const std::string & rhs )
+ inline bool operator>=( const IdString & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) >= 0; }
/** \overload */
- inline bool operator>=( const char * lhs, const IdStr & rhs )
+ inline bool operator>=( const char * lhs, const IdString & rhs )
{ return rhs.compare( lhs ) < 0; }
/** \overload */
- inline bool operator>=( const std::string & lhs, const IdStr & rhs )
+ inline bool operator>=( const std::string & lhs, const IdString & rhs )
{ return rhs.compare( lhs ) < 0; }
- /////////////////////////////////////////////////////////////////
- } // namespace sat
- ///////////////////////////////////////////////////////////////////
-
- /** Drag into namespace zypp*/
- using sat::IdStr;
-
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
Copied: branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStringType.h (from r8290, branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStrType.h)
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStringType.h?p2=branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStringType.h&p1=branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStrType.h&r1=8290&r2=8295&rev=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStrType.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/IdStringType.h Tue Jan 15 18:58:26 2008
@@ -6,35 +6,32 @@
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
-/** \file zypp/sat/IdStrType.h
+/** \file zypp/IdStringType.h
*
*/
-#ifndef ZYPP_SAT_IDSTRTYPE_H
-#define ZYPP_SAT_IDSTRTYPE_H
+#ifndef ZYPP_IDSTRINGTYPE_H
+#define ZYPP_IDSTRINGTYPE_H
-#include "zypp/sat/IdStr.h"
+#include "zypp/IdString.h"
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
- namespace sat
- { /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//
- // CLASS NAME : IdStrType<Derived>
+ // CLASS NAME : IdStringType<Derived>
//
- /** Base class for creating \ref IdStr based types.
+ /** Base class for creating \ref IdString based types.
*
- * Just by deriving from \ref IdStrType a class provides all
- * the operations an \ref IdStr does. (incl. conversion to string types,
+ * Just by deriving from \ref IdStringType a class provides all
+ * the operations an \ref IdString does. (incl. conversion to string types,
* comparison of string types and stream output).
*
* To disable any comparison, declare (but do not define) \ref _doCompare
* in your class.
* \code
- * class NoCompare : : public sat::IdStrType<NoCompare>
+ * class NoCompare : public IdStringType<NoCompare>
* {
* private:
* static int _doCompare( const char * lhs, const char * rhs );
@@ -47,18 +44,18 @@
*
* \code
* // uses default lexicographical order
- * class CaseCmp : public sat::IdStrType<CaseCmp>
+ * class CaseCmp : public IdStringType<CaseCmp>
* {
* public:
* CaseCmp() {}
* explicit CaseCmp( const char * cstr_r ) : _str( cstr_r ) {}
* private:
- * friend class sat::IdStrType<CaseCmp>;
- * sat::IdStr _str;
+ * friend class IdStringType<CaseCmp>;
+ * IdString _str;
* };
*
* // uses case insensitive comparison order
- * class NoCaseCmp : public sat::IdStrType<NoCaseCmp>
+ * class NoCaseCmp : public IdStringType<NoCaseCmp>
* {
* public:
* NoCaseCmp() {}
@@ -71,8 +68,8 @@
* return( lhs ? 1 : -1 );
* }
* private:
- * friend class sat::IdStrType<NoCaseCmp>;
- * sat::IdStr _str;
+ * friend class IdStringType<NoCaseCmp>;
+ * IdString _str;
* };
*
* CaseCmp ca( "a" );
@@ -85,20 +82,20 @@
* \ingroup g_CRTP
*/
template <class Derived>
- class IdStrType : private base::SafeBool<Derived>
+ class IdStringType : private base::SafeBool<Derived>
{
typedef typename base::SafeBool<Derived>::bool_type bool_type;
protected:
- IdStrType() {}
- IdStrType(const IdStrType &) {}
- void operator=(const IdStrType &) {}
+ IdStringType() {}
+ IdStringType(const IdStringType &) {}
+ void operator=(const IdStringType &) {}
private:
const Derived & self() const { return *static_cast( this ); }
public:
- const IdStr & idStr() const { return self()._str; }
+ const IdString & idStr() const { return self()._str; }
bool empty() const { return idStr().empty(); }
unsigned size() const { return idStr().size(); }
@@ -112,32 +109,32 @@
public:
static int compare( const Derived & lhs, const Derived & rhs ) { return compare( lhs.idStr(), rhs.idStr() ); }
- static int compare( const Derived & lhs, const IdStr & rhs ) { return compare( lhs.idStr(), rhs ); }
+ static int compare( const Derived & lhs, const IdString & rhs ) { return compare( lhs.idStr(), rhs ); }
static int compare( const Derived & lhs, const std::string & rhs ) { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
static int compare( const Derived & lhs, const char * rhs ) { return Derived::_doCompare( lhs.c_str(), rhs );}
- static int compare( const IdStr & lhs, const Derived & rhs ) { return compare( lhs, rhs.idStr() ); }
- static int compare( const IdStr & lhs, const IdStr & rhs ) { return lhs.compareEQ( rhs ) ? 0 :
+ static int compare( const IdString & lhs, const Derived & rhs ) { return compare( lhs, rhs.idStr() ); }
+ static int compare( const IdString & lhs, const IdString & rhs ) { return lhs.compareEQ( rhs ) ? 0 :
Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
- static int compare( const IdStr & lhs, const std::string & rhs ) { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
- static int compare( const IdStr & lhs, const char * rhs ) { return Derived::_doCompare( lhs.c_str(), rhs ); }
+ static int compare( const IdString & lhs, const std::string & rhs ) { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
+ static int compare( const IdString & lhs, const char * rhs ) { return Derived::_doCompare( lhs.c_str(), rhs ); }
static int compare( const std::string & lhs, const Derived & rhs ) { return Derived::_doCompare( lhs.c_str(), rhs.c_str() );}
- static int compare( const std::string & lhs, const IdStr & rhs ) { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
+ static int compare( const std::string & lhs, const IdString & rhs ) { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
static int compare( const std::string & lhs, const std::string & rhs ) { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
static int compare( const std::string & lhs, const char * rhs ) { return Derived::_doCompare( lhs.c_str(), rhs ); }
static int compare( const char * lhs, const Derived & rhs ) { return Derived::_doCompare( lhs, rhs.c_str() );}
- static int compare( const char * lhs, const IdStr & rhs ) { return Derived::_doCompare( lhs, rhs.c_str() ); }
+ static int compare( const char * lhs, const IdString & rhs ) { return Derived::_doCompare( lhs, rhs.c_str() ); }
static int compare( const char * lhs, const std::string & rhs ) { return Derived::_doCompare( lhs, rhs.c_str() ); }
static int compare( const char * lhs, const char * rhs ) { return Derived::_doCompare( lhs, rhs ); }
public:
- int compare( const Derived & rhs ) const { return compare( idStr(), rhs.idStr() ); }
- int compare( const IdStrType & rhs ) const { return compare( idStr(), rhs.idStr() ); }
- int compare( const IdStr & rhs ) const { return compare( idStr(), rhs ); }
- int compare( const std::string & rhs ) const { return Derived::_doCompare( c_str(), rhs.c_str() ); }
- int compare( const char * rhs ) const { return Derived::_doCompare( c_str(), rhs ); }
+ int compare( const Derived & rhs ) const { return compare( idStr(), rhs.idStr() ); }
+ int compare( const IdStringType & rhs ) const { return compare( idStr(), rhs.idStr() ); }
+ int compare( const IdString & rhs ) const { return compare( idStr(), rhs ); }
+ int compare( const std::string & rhs ) const { return Derived::_doCompare( c_str(), rhs.c_str() ); }
+ int compare( const char * rhs ) const { return Derived::_doCompare( c_str(), rhs ); }
private:
static int _doCompare( const char * lhs, const char * rhs )
@@ -154,189 +151,186 @@
};
///////////////////////////////////////////////////////////////////
- /** \relates IdStrType Stream output */
+ /** \relates IdStringType Stream output */
template <class Derived>
- inline std::ostream & operator<<( std::ostream & str, const IdStrType<Derived> & obj )
+ inline std::ostream & operator<<( std::ostream & str, const IdStringType<Derived> & obj )
{ return str << obj.c_str(); }
- /** \relates IdStrType Equal */
+ /** \relates IdStringType Equal */
template <class Derived>
- inline bool operator==( const IdStrType<Derived> & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator==( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
{ return lhs.idStr().compareEQ( rhs.idStr() ); }
/** \overload */
template <class Derived>
- inline bool operator==( const IdStrType<Derived> & lhs, const IdStr & rhs )
+ inline bool operator==( const IdStringType<Derived> & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) == 0; }
/** \overload */
template <class Derived>
- inline bool operator==( const IdStrType<Derived> & lhs, const char * rhs )
+ inline bool operator==( const IdStringType<Derived> & lhs, const char * rhs )
{ return lhs.compare( rhs ) == 0; }
/** \overload */
template <class Derived>
- inline bool operator==( const IdStrType<Derived> & lhs, const std::string & rhs )
+ inline bool operator==( const IdStringType<Derived> & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) == 0; }
/** \overload */
template <class Derived>
- inline bool operator==( const IdStr & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator==( const IdString & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) == 0; }
/** \overload */
template <class Derived>
- inline bool operator==( const char * lhs, const IdStrType<Derived> & rhs )
+ inline bool operator==( const char * lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) == 0; }
/** \overload */
template <class Derived>
- inline bool operator==( const std::string & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator==( const std::string & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) == 0; }
- /** \relates IdStrType NotEqual */
+ /** \relates IdStringType NotEqual */
template <class Derived>
- inline bool operator!=( const IdStrType<Derived> & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator!=( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
{ return lhs.idStr().compareEQ( rhs.idStr() ); }
/** \overload */
template <class Derived>
- inline bool operator!=( const IdStrType<Derived> & lhs, const IdStr & rhs )
+ inline bool operator!=( const IdStringType<Derived> & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) != 0; }
/** \overload */
template <class Derived>
- inline bool operator!=( const IdStrType<Derived> & lhs, const char * rhs )
+ inline bool operator!=( const IdStringType<Derived> & lhs, const char * rhs )
{ return lhs.compare( rhs ) != 0; }
/** \overload */
template <class Derived>
- inline bool operator!=( const IdStrType<Derived> & lhs, const std::string & rhs )
+ inline bool operator!=( const IdStringType<Derived> & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) != 0; }
/** \overload */
template <class Derived>
- inline bool operator!=( const IdStr & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator!=( const IdString & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) != 0; }
/** \overload */
template <class Derived>
- inline bool operator!=( const char * lhs, const IdStrType<Derived> & rhs )
+ inline bool operator!=( const char * lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) != 0; }
/** \overload */
template <class Derived>
- inline bool operator!=( const std::string & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator!=( const std::string & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) != 0; }
- /** \relates IdStrType Less */
+ /** \relates IdStringType Less */
template <class Derived>
- inline bool operator<( const IdStrType<Derived> & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator<( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
{ return lhs.compare( rhs ) < 0; }
/** \overload */
template <class Derived>
- inline bool operator<( const IdStrType<Derived> & lhs, const IdStr & rhs )
+ inline bool operator<( const IdStringType<Derived> & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) < 0; }
/** \overload */
template <class Derived>
- inline bool operator<( const IdStrType<Derived> & lhs, const char * rhs )
+ inline bool operator<( const IdStringType<Derived> & lhs, const char * rhs )
{ return lhs.compare( rhs ) < 0; }
/** \overload */
template <class Derived>
- inline bool operator<( const IdStrType<Derived> & lhs, const std::string & rhs )
+ inline bool operator<( const IdStringType<Derived> & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) < 0; }
/** \overload */
template <class Derived>
- inline bool operator<( const IdStr & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator<( const IdString & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) >= 0; }
/** \overload */
template <class Derived>
- inline bool operator<( const char * lhs, const IdStrType<Derived> & rhs )
+ inline bool operator<( const char * lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) >= 0; }
/** \overload */
template <class Derived>
- inline bool operator<( const std::string & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator<( const std::string & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) >= 0; }
- /** \relates IdStrType LessEqual */
+ /** \relates IdStringType LessEqual */
template <class Derived>
- inline bool operator<=( const IdStrType<Derived> & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator<=( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
{ return lhs.compare( rhs ) <= 0; }
/** \overload */
template <class Derived>
- inline bool operator<=( const IdStrType<Derived> & lhs, const IdStr & rhs )
+ inline bool operator<=( const IdStringType<Derived> & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) <= 0; }
/** \overload */
template <class Derived>
- inline bool operator<=( const IdStrType<Derived> & lhs, const char * rhs )
+ inline bool operator<=( const IdStringType<Derived> & lhs, const char * rhs )
{ return lhs.compare( rhs ) <= 0; }
/** \overload */
template <class Derived>
- inline bool operator<=( const IdStrType<Derived> & lhs, const std::string & rhs )
+ inline bool operator<=( const IdStringType<Derived> & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) <= 0; }
/** \overload */
template <class Derived>
- inline bool operator<=( const IdStr & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator<=( const IdString & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) > 0; }
/** \overload */
template <class Derived>
- inline bool operator<=( const char * lhs, const IdStrType<Derived> & rhs )
+ inline bool operator<=( const char * lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) > 0; }
/** \overload */
template <class Derived>
- inline bool operator<=( const std::string & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator<=( const std::string & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) > 0; }
- /** \relates IdStrType Greater */
+ /** \relates IdStringType Greater */
template <class Derived>
- inline bool operator>( const IdStrType<Derived> & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator>( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
{ return lhs.compare( rhs ) > 0; }
/** \overload */
template <class Derived>
- inline bool operator>( const IdStrType<Derived> & lhs, const IdStr & rhs )
+ inline bool operator>( const IdStringType<Derived> & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) > 0; }
/** \overload */
template <class Derived>
- inline bool operator>( const IdStrType<Derived> & lhs, const char * rhs )
+ inline bool operator>( const IdStringType<Derived> & lhs, const char * rhs )
{ return lhs.compare( rhs ) > 0; }
/** \overload */
template <class Derived>
- inline bool operator>( const IdStrType<Derived> & lhs, const std::string & rhs )
+ inline bool operator>( const IdStringType<Derived> & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) > 0; }
/** \overload */
template <class Derived>
- inline bool operator>( const IdStr & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator>( const IdString & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) <= 0; }
/** \overload */
template <class Derived>
- inline bool operator>( const char * lhs, const IdStrType<Derived> & rhs )
+ inline bool operator>( const char * lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) <= 0; }
/** \overload */
template <class Derived>
- inline bool operator>( const std::string & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator>( const std::string & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) <= 0; }
- /** \relates IdStrType GreaterEqual */
+ /** \relates IdStringType GreaterEqual */
template <class Derived>
- inline bool operator>=( const IdStrType<Derived> & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator>=( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
{ return lhs.compare( rhs ) >= 0; }
/** \overload */
template <class Derived>
- inline bool operator>=( const IdStrType<Derived> & lhs, const IdStr & rhs )
+ inline bool operator>=( const IdStringType<Derived> & lhs, const IdString & rhs )
{ return lhs.compare( rhs ) >= 0; }
/** \overload */
template <class Derived>
- inline bool operator>=( const IdStrType<Derived> & lhs, const char * rhs )
+ inline bool operator>=( const IdStringType<Derived> & lhs, const char * rhs )
{ return lhs.compare( rhs ) >= 0; }
/** \overload */
template <class Derived>
- inline bool operator>=( const IdStrType<Derived> & lhs, const std::string & rhs )
+ inline bool operator>=( const IdStringType<Derived> & lhs, const std::string & rhs )
{ return lhs.compare( rhs ) >= 0; }
/** \overload */
template <class Derived>
- inline bool operator>=( const IdStr & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator>=( const IdString & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) < 0; }
/** \overload */
template <class Derived>
- inline bool operator>=( const char * lhs, const IdStrType<Derived> & rhs )
+ inline bool operator>=( const char * lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) < 0; }
/** \overload */
template <class Derived>
- inline bool operator>=( const std::string & lhs, const IdStrType<Derived> & rhs )
+ inline bool operator>=( const std::string & lhs, const IdStringType<Derived> & rhs )
{ return rhs.compare( lhs ) < 0; }
- /////////////////////////////////////////////////////////////////
- } // namespace sat
- ///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
-#endif // ZYPP_SAT_IDSTRTYPE_H
+#endif // ZYPP_IDSTRINGTYPE_H
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.cc?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.cc Tue Jan 15 18:58:26 2008
@@ -16,7 +16,6 @@
#include "zypp/base/Exception.h"
#include "zypp/sat/detail/PoolImpl.h"
-#include "zypp/sat/IdStr.h"
#include "zypp/sat/Solvable.h"
#include "zypp/sat/Repo.h"
@@ -66,10 +65,10 @@
bool Solvable::isSystem() const
{ return repo().isSystemRepo(); }
- IdStr Solvable::ident() const
+ IdString Solvable::ident() const
{
- NO_SOLVABLE_RETURN( IdStr() );
- return IdStr( _solvable->name );
+ NO_SOLVABLE_RETURN( IdString() );
+ return IdString( _solvable->name );
}
ResKind Solvable::kind() const
@@ -84,7 +83,7 @@
break;
}
- const char * ident = IdStr( _solvable->name ).c_str();
+ const char * ident = IdString( _solvable->name ).c_str();
const char * sep = ::strchr( ident, ':' );
// no ':' in package names (hopefully)
@@ -120,7 +119,7 @@
std::string Solvable::name() const
{
NO_SOLVABLE_RETURN( std::string() );
- const char * ident = IdStr( _solvable->name ).c_str();
+ const char * ident = IdString( _solvable->name ).c_str();
const char * sep = ::strchr( ident, ':' );
return( sep ? sep+1 : ident );
}
@@ -141,14 +140,14 @@
return Arch_noarch; //ArchId( ARCH_NOARCH );
break;
}
- return Arch( IdStr(_solvable->arch).asString() );
+ return Arch( IdString(_solvable->arch).asString() );
//return ArchId( _solvable->arch );
}
- IdStr Solvable::vendor() const
+ IdString Solvable::vendor() const
{
- NO_SOLVABLE_RETURN( IdStr() );
- return IdStr( _solvable->vendor );
+ NO_SOLVABLE_RETURN( IdString() );
+ return IdString( _solvable->vendor );
}
Capabilities Solvable::operator[]( Dep which_r ) const
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.h?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/Solvable.h Tue Jan 15 18:58:26 2008
@@ -19,9 +19,9 @@
#include "zypp/sat/detail/PoolMember.h"
#include "zypp/sat/Capabilities.h"
#include "zypp/sat/Capability.h"
-#include "zypp/sat/IdStr.h"
#include "zypp/ResTraits.h"
+#include "zypp/IdString.h"
#include "zypp/Edition.h"
#include "zypp/Arch.h"
#include "zypp/Dep.h"
@@ -77,14 +77,14 @@
Repo repo() const;
public:
- IdStr ident() const;
+ IdString ident() const;
ResKind kind() const;
std::string name() const;
Edition edition() const;
Arch arch() const;
- IdStr vendor() const;
+ IdString vendor() const;
public:
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolMember.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolMember.h?rev=8295&r1=8294&r2=8295&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolMember.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolMember.h Tue Jan 15 18:58:26 2008
@@ -24,11 +24,13 @@
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
+
+ class IdString;
+
///////////////////////////////////////////////////////////////////
namespace sat
{ /////////////////////////////////////////////////////////////////
- class IdStr;
class Capability;
class Capabilities;
class Solvable;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org