apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

private-cachefile.h
Go to the documentation of this file.
1 #ifndef APT_PRIVATE_CACHEFILE_H
2 #define APT_PRIVATE_CACHEFILE_H
3 
4 #include <apt-pkg/cachefile.h>
5 #include <apt-pkg/cacheset.h>
6 #include <apt-pkg/configuration.h>
7 #include <apt-pkg/macros.h>
8 #include <apt-pkg/pkgcache.h>
9 #include <apt-pkg/progress.h>
10 #include <apt-pkg/sourcelist.h>
11 
12 // class CacheFile - Cover class for some dependency cache functions /*{{{*/
14 {
15  public:
16  std::vector<map_pointer<pkgCache::Package>> UniverseList;
17 
18  bool CheckDeps(bool AllowBroken = false);
19  bool BuildCaches(bool WithLock = true)
20  {
21  OpTextProgress Prog(*_config);
22  if (pkgCacheFile::BuildCaches(&Prog,WithLock) == false)
23  return false;
24  return true;
25  }
26  bool Open(bool WithLock = true)
27  {
28  OpTextProgress Prog(*_config);
29  return pkgCacheFile::Open(&Prog,WithLock);
30  };
32  {
33  if (_config->FindB("APT::Get::Print-URIs") == true)
34  return Open(false);
35  else
36  return Open(true);
37  }
38 };
39  /*}}}*/
40 
42 {
43  std::vector<map_pointer<pkgCache::Package>> &List;
44  void LazyInit() const;
45 
46 public:
47  explicit SortedPackageUniverse(CacheFile &Cache);
48 
49  class const_iterator : public APT::Container_iterator_base<APT::PackageContainerInterface, SortedPackageUniverse, SortedPackageUniverse::const_iterator, std::vector<map_pointer<pkgCache::Package>>::const_iterator, pkgCache::PkgIterator>
50  {
51  pkgCache * const Cache;
52  public:
53  inline pkgCache::PkgIterator getType(void) const
54  {
55  if (*_iter == 0) return pkgCache::PkgIterator(*Cache);
56  return pkgCache::PkgIterator(*Cache, Cache->PkgP + *_iter);
57  }
58  explicit const_iterator(pkgCache * const Owner, std::vector<map_pointer<pkgCache::Package>>::const_iterator i):
60 
61  };
63 
64  const_iterator begin() const { LazyInit(); return const_iterator(data(), List.begin()); }
65  const_iterator end() const { LazyInit(); return const_iterator(data(), List.end()); }
66  const_iterator cbegin() const { LazyInit(); return const_iterator(data(), List.begin()); }
67  const_iterator cend() const { LazyInit(); return const_iterator(data(), List.end()); }
68  iterator begin() { LazyInit(); return iterator(data(), List.begin()); }
69  iterator end() { LazyInit(); return iterator(data(), List.end()); }
70 };
71 
72 #endif
pkgCache * data() const
Definition: cacheset.h:660
bool OpenForInstall()
bool BuildCaches(bool WithLock=true)
bool Open(bool WithLock=true)
std::vector< map_pointer< pkgCache::Package > > UniverseList
bool FindB(const char *Name, bool const &Default=false) const
const_iterator(pkgCache *const Owner, std::vector< map_pointer< pkgCache::Package >>::const_iterator i)
pkgCache::PkgIterator getType(void) const
const_iterator begin() const
const_iterator cbegin() const
std::vector< map_pointer< pkgCache::Package > > & List
SortedPackageUniverse(CacheFile &Cache)
const_iterator cend() const
const_iterator end() const
bool Open(OpProgress *Progress=NULL, bool WithLock=true)
Definition: cachefile.cc:212
bool BuildCaches(OpProgress *Progress=NULL, bool WithLock=true)
Definition: cachefile.cc:84
Configuration * _config
#define APT_PUBLIC
Definition: macros.h:77
pkgCache - Structure definitions for the cache file