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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
//
// C++ Interface: %{MODULE}
//
// Description:
//
//
// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef __NAPT_IAPTSEARCH_H_2005_02_20
#define __NAPT_IAPTSEARCH_H_2005_02_20
#include <string>
#include <vector>
#include <set>
#include <QString>
#include <QStringList>
using namespace std;
namespace NUtil
{
class IProgressObserver;
}
namespace NApt {
/**
@author Benjamin Mesing
*/
class IAptSearch
{
public:
IAptSearch();
virtual ~IAptSearch();
/** This exception is thrown if something is wrong with Apt.*/
class AptException
{
/** This holds the error message.
* @warning we can't use _error here because there is a MACRO in APT's "error.h" with this name!\n
* I <b>hate</b> Makros especially if they have such a common name! */
string _merror;
public:
AptException(const string& error) { _merror=error; }
const string& error() const { return _merror; }
};
/** @brief Searches for the given patterns in the package database.
*
* For a package it is neccessary to match all expressions from the given pattern list.
* @param result the set where the search result should be inserted. The names of the matching packages
* will be added to result.
* @param includePatterns list of patterns that must occur in the packages.
* @param searchDescr defines if the description should be searched too, else only the
* names will be serached
* @param wholeWords search for word boundaries
* @returns if at least one package was found.
* @pre !patterns.empty()
*/
virtual bool search(std::set<string>& result, const QStringList& includePatterns,
bool searchDescr, bool wholeWords) const = 0;
/** @brief This reloads the package information search upon.
* @param pLoader the observer where to report the reload progress, 0 if no progress should be reported
*/
virtual void reloadPackageInformation(NUtil::IProgressObserver* pObserver) = 0;
};
};
#endif // __NAPT_IAPTSEARCH_H_2005_02_20
|