File: test_rpackageview.cc

package info (click to toggle)
synaptic 0.70~pre1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 12,428 kB
  • ctags: 2,525
  • sloc: cpp: 23,288; xml: 7,938; ansic: 2,084; sh: 1,509; makefile: 642; sed: 93; python: 71
file content (26 lines) | stat: -rw-r--r-- 705 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <apt-pkg/init.h>
#include <apt-pkg/configuration.h>
#include <iostream>

#include "config.h"
#include "rpackagelister.h"
#include "rpackageview.h"
#include "rpackage.h"

using namespace std;

int main(int argc, char **argv)
{
   pkgInitConfig(*_config);
   pkgInitSystem(*_config, _system);
   
   RPackageLister *lister = new RPackageLister();
   lister->openCache();
   lister->setView(PACKAGE_VIEW_SEARCH);
   OpProgress progress;

   _config->Set("Debug::Synaptic::View","true");
   unsigned long now = clock();
   lister->searchView()->setSearch("synaptic",  RPatternPackageFilter::Description, "synaptic", progress);
   cerr << "searching: " << float(clock()-now)/CLOCKS_PER_SEC << endl;
}