cachefilter.h 761 B

1234567891011121314151617181920212223242526272829303132
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. /** \file cachefilter.h
  4. Collection of functor classes */
  5. /*}}}*/
  6. #ifndef APT_CACHEFILTER_H
  7. #define APT_CACHEFILTER_H
  8. // Include Files /*{{{*/
  9. #include <apt-pkg/pkgcache.h>
  10. #include <string>
  11. #include <regex.h>
  12. /*}}}*/
  13. namespace APT {
  14. namespace CacheFilter {
  15. // PackageNameMatchesRegEx /*{{{*/
  16. class PackageNameMatchesRegEx {
  17. /** \brief dpointer placeholder (for later in case we need it) */
  18. void *d;
  19. regex_t* pattern;
  20. public:
  21. PackageNameMatchesRegEx(std::string const &Pattern);
  22. bool operator() (pkgCache::PkgIterator const &Pkg);
  23. bool operator() (pkgCache::GrpIterator const &Grp);
  24. ~PackageNameMatchesRegEx();
  25. };
  26. /*}}}*/
  27. }
  28. }
  29. #endif