Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / devel / devel.ma / Tools.h
index 10e5122..f67a8a4 100644 (file)
@@ -8,6 +8,9 @@
 #include <map>
 #include <set>
 
+#include "Printing.h"
+#include "FakePool.h"
+
 #define INCLUDE_TESTSETUP_WITHOUT_BOOST
 #include "zypp/../tests/lib/TestSetup.h"
 #undef  INCLUDE_TESTSETUP_WITHOUT_BOOST
@@ -74,27 +77,27 @@ void mksrc( const std::string & url, const std::string & alias, RepoManager & re
 
 ///////////////////////////////////////////////////////////////////
 //
-template<class TCondition>
+template<class _Condition>
   struct SetTrue
   {
-    SetTrue( TCondition cond_r )
+    SetTrue( _Condition cond_r )
     : _cond( cond_r )
     {}
 
-    template<class Tp>
-      bool operator()( Tp t ) const
+    template<class _Tp>
+      bool operator()( _Tp t ) const
       {
         _cond( t );
         return true;
       }
 
-    TCondition _cond;
+    _Condition _cond;
   };
 
-template<class TCondition>
-  inline SetTrue<TCondition> setTrue_c( TCondition cond_r )
+template<class _Condition>
+  inline SetTrue<_Condition> setTrue_c( _Condition cond_r )
   {
-    return SetTrue<TCondition>( cond_r );
+    return SetTrue<_Condition>( cond_r );
   }
 
 struct PrintPoolItem
@@ -103,9 +106,9 @@ struct PrintPoolItem
   { USR << pi << endl; }
 };
 
-template <class TIterator>
+template <class _Iterator>
   std::ostream & vdumpPoolStats( std::ostream & str,
-                                 TIterator begin_r, TIterator end_r )
+                                 _Iterator begin_r, _Iterator end_r )
   {
     pool::PoolStats stats;
     std::for_each( begin_r, end_r,
@@ -122,8 +125,8 @@ template <class TIterator>
 
 typedef zypp::pool::PoolStats Rstats;
 
-template<class TIterator>
-  void rstats( TIterator begin, TIterator end )
+template<class _Iterator>
+  void rstats( _Iterator begin, _Iterator end )
   {
     DBG << __PRETTY_FUNCTION__ << endl;
     Rstats stats;
@@ -131,8 +134,8 @@ template<class TIterator>
     MIL << stats << endl;
   }
 
-template<class TContainer>
-  void rstats( const TContainer & c )
+template<class _Container>
+  void rstats( const _Container & c )
   {
     rstats( c.begin(), c.end() );
   }
@@ -147,11 +150,11 @@ inline RepoManager makeRepoManager( const Pathname & mgrdir_r )
 
 ///////////////////////////////////////////////////////////////////
 
-template<class TRes>
+template<class _Res>
 ui::Selectable::Ptr getSel( const std::string & name_r )
 {
   ResPoolProxy uipool( getZYpp()->poolProxy() );
-  for_(it, uipool.byKindBegin<TRes>(), uipool.byKindEnd<TRes>() )
+  for_(it, uipool.byKindBegin<_Res>(), uipool.byKindEnd<_Res>() )
   {
     if ( (*it)->name() == name_r )
       return (*it);
@@ -161,12 +164,12 @@ ui::Selectable::Ptr getSel( const std::string & name_r )
 
 
 
-template<class TRes>
+template<class _Res>
 PoolItem getPi( const std::string & alias_r, const std::string & name_r, const Edition & ed_r, const Arch & arch_r )
 {
   PoolItem ret;
   ResPool pool( getZYpp()->pool() );
-  for_(it, pool.byIdentBegin<TRes>(name_r), pool.byIdentEnd<TRes>(name_r) )
+  for_(it, pool.byIdentBegin<_Res>(name_r), pool.byIdentEnd<_Res>(name_r) )
   {
     if (    ( ed_r.empty()    || ed_r.match((*it)->edition()) == 0 )
          && ( arch_r.empty()  || arch_r == (*it)->arch()  )
@@ -189,25 +192,25 @@ PoolItem getPi( const std::string & alias_r, const std::string & name_r, const E
   }
   return ret;
 }
-template<class TRes>
+template<class _Res>
 PoolItem getPi( const std::string & name_r, const Edition & ed_r, const Arch & arch_r )
 {
-  return getPi<TRes>( "", name_r, ed_r, arch_r );
+  return getPi<_Res>( "", name_r, ed_r, arch_r );
 }
-template<class TRes>
+template<class _Res>
 PoolItem getPi( const std::string & name_r )
 {
-  return getPi<TRes>( name_r, Edition(), Arch_empty );
+  return getPi<_Res>( name_r, Edition(), Arch_empty );
 }
-template<class TRes>
+template<class _Res>
 PoolItem getPi( const std::string & name_r, const Edition & ed_r )
 {
-  return getPi<TRes>( name_r, ed_r, Arch_empty );
+  return getPi<_Res>( name_r, ed_r, Arch_empty );
 }
-template<class TRes>
+template<class _Res>
 PoolItem getPi( const std::string & name_r, const Arch & arch_r )
 {
-  return getPi<TRes>( name_r, Edition(), arch_r );
+  return getPi<_Res>( name_r, Edition(), arch_r );
 }
 
 ///////////////////////////////////////////////////////////////////