- Introduce examples/
[platform/upstream/libzypp.git] / devel / devel.dmacvicar / testbed.cc
1 #include <zypp/base/Logger.h>
2 #include <zypp/ZYpp.h>
3 #include <zypp/ZYppFactory.h>
4
5 #include "zypp/Product.h"
6 #include "zypp/Package.h"
7
8 #include "zypp/SourceFactory.h"
9 #include "testsuite/src/utils/TestUtils.h"
10
11 using namespace zypp::detail;
12
13 using namespace std;
14 using namespace zypp;
15 using namespace zypp::source;
16 //using namespace DbXml;
17
18 #define TestKind Selection
19
20 int main()
21 {
22   try
23   {
24     ZYpp::Ptr z = getZYpp();
25     //z->initializeTarget("/");
26     
27     //SourceManager_Ptr manager = SourceManager::sourceManager();
28     
29     Source_Ref source = SourceFactory().createFrom( Url("dir:/space/rpms/duncan/vim/i386"), "/", "bleh", Pathname() );
30     ResStore store = source.resolvables();
31     //zypp::testsuite::utils::dump(store, true, true);
32     
33     for (ResStore::const_iterator it = store.begin(); it != store.end(); ++it)
34     {
35       zypp::Package::Ptr res = asKind<zypp::Package>( *it );
36       MIL << res->name() << " " << res->edition() << " " << res->location() << std::endl;
37     }
38         
39   }
40   catch ( const Exception &e )
41   {
42     MIL << "Sorry, bye" << endl;
43   }
44 }
45
46
47