- backup
authorMichael Andres <ma@suse.de>
Tue, 21 Feb 2006 11:17:14 +0000 (11:17 +0000)
committerMichael Andres <ma@suse.de>
Tue, 21 Feb 2006 11:17:14 +0000 (11:17 +0000)
devel/devel.ma/Main.cc
devel/devel.ma/Makefile.am
devel/devel.ma/Printing.h

index 8823525..3696277 100644 (file)
@@ -4,7 +4,7 @@
 
 #include "Printing.h"
 
-#include <zypp/base/Logger.h>
+#include <zypp/base/LogControl.h>
 #include <zypp/base/String.h>
 #include <zypp/base/Exception.h>
 #include <zypp/base/PtrTypes.h>
@@ -29,6 +29,26 @@ template<class _Iter, class _Function>
       for ( _Iter r = begin; r != end; ++r )
         fnc( *l, *r );
   }
+
+template<class _LIter, class _RIter, class _BinaryFunction>
+  inline _BinaryFunction
+  nest_for_earch( _LIter lbegin, _LIter lend,
+                  _RIter rbegin, _RIter rend,
+                  _BinaryFunction fnc )
+  {
+    for ( ; lbegin != lend; ++lbegin )
+      for ( _RIter r = rbegin; r != rend; ++r )
+        fnc( *lbegin, *r );
+    return fnc;
+  }
+
+template<class _Iter, class _BinaryFunction>
+  inline _BinaryFunction
+  nest_for_earch( _Iter begin, _Iter end,
+                  _BinaryFunction fnc )
+  { return nest_for_earch( begin, end, begin, end, fnc ); }
+
+
 template<class _Iter, class _Function>
   inline void sym_compare( _Iter begin, _Iter end )
   {
@@ -54,6 +74,7 @@ inline list<Arch> archList()
   ret.push_back( Arch( "unknown" ) );
   ret.push_back( Arch( "unknown2" ) );
   ret.push_back( Arch() );
+  ret.push_back( Arch("") );
   return ret;
 }
 
index ebd124f..459ea82 100644 (file)
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 ## ##################################################
 
-noinst_PROGRAMS =      Main Main.debug Parse
+noinst_PROGRAMS =      Main Parse Test
 
 ## ##################################################
 
@@ -16,15 +16,18 @@ LDADD =             -L$(top_srcdir)/zypp/.libs -lzypp -lboost_regex
 
 ## ##################################################
 
-Main_SOURCES =                 Main.cc
+Main_SOURCES =         Main.cc
+Main_LDFLAGS = -static
 
-Main_debug_SOURCES =   $(Main_SOURCES)
-Main_debug_LDFLAGS =   -static
+## ##################################################
+
+Parse_SOURCES = Parse.cc
+Parse_LDFLAGS =        -static
 
 ## ##################################################
 
-Parse_SOURCES =        Parse.cc
-Parse_LDFLAGS =                -static
+Test_SOURCES = Test.cc
+Test_LDFLAGS = -static
 
 ## ##################################################
 
index 7bc6ab7..aef0114 100644 (file)
@@ -52,5 +52,31 @@ template<class _Container>
                    PrintPtr<typename _Container::value_type>() );
   }
 
+template<class _Container>
+  void printMK( const _Container & c )
+  {
+    for ( typename _Container::const_iterator it = c.begin(); it != c.end(); ++it )
+      {
+        USR << it->first << std::endl;
+      }
+  }
+template<class _Container>
+  void printMV( const _Container & c )
+  {
+    for ( typename _Container::const_iterator it = c.begin(); it != c.end(); ++it )
+      {
+        USR << it->second << std::endl;
+      }
+  }
+
+template<class _Container>
+  void printMKV( const _Container & c )
+  {
+    for ( typename _Container::const_iterator it = c.begin(); it != c.end(); ++it )
+      {
+        USR << it->first << '\t' << it->second << std::endl;
+      }
+  }
+
 ///////////////////////////////////////////////////////////////////
 #endif // MA_PRINTING_H