From 0e910ca254e4c9daf1830812380c4540bb21194b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Kupec?= Date: Mon, 26 Jan 2009 10:33:06 +0100 Subject: [PATCH] backup --- devel/devel.jkupec/play.cc | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/devel/devel.jkupec/play.cc b/devel/devel.jkupec/play.cc index fb5ea6d..4852540 100644 --- a/devel/devel.jkupec/play.cc +++ b/devel/devel.jkupec/play.cc @@ -2,9 +2,24 @@ #include "zypp/base/LogTools.h" +#include "zypp/parser/HistoryLogReader.h" +#include "zypp/parser/ParseException.h" + using std::endl; using std::cout; +using namespace zypp; + +struct HistoryItemCollector +{ +// vector items; + bool operator()( const HistoryItem::Ptr & item_ptr ) + { +// items.insert(item); + cout << *item_ptr << endl; + return true; + } +}; // --------------------------------------------------------------------------- @@ -12,7 +27,19 @@ int main( int argc, const char * argv[] ) { --argc; ++argv; // skip arg 0 + HistoryItemCollector ic; + parser::HistoryLogReader reader(*argv, ic); + + try + { + reader.readAll(); + } + catch (const parser::ParseException & e) + { + cout << "error in " << *argv << ":" << endl; + cout << e.asUserHistory() << endl; + } + cout << "done" << endl; return 0; } - -- 2.7.4