File: test_rpackageview.cc

package info (click to toggle)
synaptic 0.91.7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,676 kB
  • sloc: cpp: 19,830; xml: 10,562; ansic: 2,084; makefile: 498; sed: 93; python: 82; sh: 52
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;
}