From: Michael Andres Date: Tue, 21 Feb 2006 11:17:14 +0000 (+0000) Subject: - backup X-Git-Tag: BASE-SuSE-SLE-10-SP2-Branch~2040 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3773f50394c7459886d5ff456cdb002bda5a686e;p=platform%2Fupstream%2Flibzypp.git - backup --- diff --git a/devel/devel.ma/Main.cc b/devel/devel.ma/Main.cc index 8823525..3696277 100644 --- a/devel/devel.ma/Main.cc +++ b/devel/devel.ma/Main.cc @@ -4,7 +4,7 @@ #include "Printing.h" -#include +#include #include #include #include @@ -29,6 +29,26 @@ template for ( _Iter r = begin; r != end; ++r ) fnc( *l, *r ); } + +template + 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 + inline _BinaryFunction + nest_for_earch( _Iter begin, _Iter end, + _BinaryFunction fnc ) + { return nest_for_earch( begin, end, begin, end, fnc ); } + + template inline void sym_compare( _Iter begin, _Iter end ) { @@ -54,6 +74,7 @@ inline list archList() ret.push_back( Arch( "unknown" ) ); ret.push_back( Arch( "unknown2" ) ); ret.push_back( Arch() ); + ret.push_back( Arch("") ); return ret; } diff --git a/devel/devel.ma/Makefile.am b/devel/devel.ma/Makefile.am index ebd124f..459ea82 100644 --- a/devel/devel.ma/Makefile.am +++ b/devel/devel.ma/Makefile.am @@ -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 ## ################################################## diff --git a/devel/devel.ma/Printing.h b/devel/devel.ma/Printing.h index 7bc6ab7..aef0114 100644 --- a/devel/devel.ma/Printing.h +++ b/devel/devel.ma/Printing.h @@ -52,5 +52,31 @@ template PrintPtr() ); } +template + void printMK( const _Container & c ) + { + for ( typename _Container::const_iterator it = c.begin(); it != c.end(); ++it ) + { + USR << it->first << std::endl; + } + } +template + void printMV( const _Container & c ) + { + for ( typename _Container::const_iterator it = c.begin(); it != c.end(); ++it ) + { + USR << it->second << std::endl; + } + } + +template + 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