Go to the documentation of this file.
44 class AptImplementation;
45 class RecordIteratorImpl;
127 class Iterator :
public std::iterator<std::input_iterator_tag, std::string, void, void, void>
155 class RecordIterator :
public std::iterator<std::input_iterator_tag, std::string, void, void, void>
157 RecordIteratorImpl* impl;
211 bool isValid(
const std::string& pkg)
const;
219 return std::string();
251 std::string
rawRecord(
const std::string& pkg)
const;
@ Remove
Definition: apt.h:52
bool upgradable() const
Definition: apt.h:104
void register_tests() override
Definition: apt-test.cc:2
bool operator!=(const Iterator &) const
Definition: apt.cc:358
@ Installed
Definition: apt.h:53
bool remove() const
Definition: apt.h:91
std::string * operator->()
Definition: apt.cc:400
Iterator iterator
Definition: apt.h:187
size_t size() const
Return the number of packages in the archive.
Definition: apt.cc:469
bool hasNewVersion() const
Definition: apt.h:103
time_t timestamp()
Return the last update timestamp of the index.
Definition: axi.cc:48
Apt()
Create the Apt data provider.
Definition: apt.cc:444
Exception(const std::string &message)
Definition: apt.cc:68
Version candidateVersion(const std::string &pkg) const
Return the candidate version for a package.
Definition: apt.cc:499
unsigned state
Definition: apt.h:63
@ NowBroken
Definition: apt.h:55
void checkCacheUpdates()
Check if the cache has been changed by another process, and reopen it if that is the case.
Definition: apt.cc:637
bool operator==(const RecordIterator &) const
Definition: apt.cc:434
bool operator==(const Iterator &) const
Definition: apt.cc:348
PackageState & operator|=(const PackageState &s)
Definition: apt.h:72
Iterator(void *cur)
Definition: apt.h:133
RecordIterator & operator=(const RecordIterator &r)
Definition: apt.cc:422
Version anyVersion(const std::string &pkg) const
Return the candidate version for a package, if available, or the installed version otherwise.
Definition: apt.cc:518
@ Install
Definition: apt.h:49
@ Purge
Definition: apt.h:58
bool willBreak() const
Definition: apt.h:95
Representation of a package with a version.
@ Hold
Definition: apt.h:59
unsigned m_state
Definition: apt.h:111
@ Upgrade
Definition: apt.h:50
std::string name() const
Return the package name.
Definition: version.h:61
String functions.
Definition: apt.cc:40
std::string operator*()
Definition: apt.cc:331
set< string > & res
Definition: packagerecord.cc:73
bool isValid() const
Definition: apt.h:84
PackageState state(const std::string &pkg) const
Return state information on a package.
Definition: apt.cc:533
PackageState(unsigned a)
Definition: apt.h:77
bool localityCompare(const pkgCache::VerFile *a, const pkgCache::VerFile *b)
Definition: apt.cc:160
@ Valid
Definition: apt.h:60
High-level front-end to libapt-pkg, as a data provider for the ept framework.
iterator begin() const
Definition: apt.cc:447
PackageState()
Definition: apt.h:81
PackageState & operator=(unsigned i)
Definition: apt.h:67
~Exception() noexcept override
Definition: apt.cc:73
time_t timestamp()
Timestamp of when the apt index was last modified.
Definition: apt.cc:474
Actual< A > actual(const A &actual)
Definition: tests.h:320
const pkgCache * aptPkgCache() const
Returns the pointer to the internal libapt pkgCache object used.
Definition: apt.cc:631
RecordIterator & operator++()
Definition: apt.cc:409
@ Keep
Definition: apt.h:51
void invalidateTimestamp()
Invalidate the cache timestamp used to track cache updates.
Definition: apt.cc:647
Iterator()
Definition: apt.h:136
std::string rawRecord(const std::string &pkg) const
Perform a package search.
Definition: apt.cc:580
RecordIterator()
Definition: apt.h:167
AptImplementation * impl
Definition: apt.h:123
Test case collecting several test methods, and self-registering with the singleton instance of TestRe...
Definition: tests.h:615
bool nowBroken() const
Definition: apt.h:106
@ WillBreak
Definition: apt.h:56
size_t size(const std::string &file)
File size.
Definition: sys.cc:116
bool isValid() const
Return true if this package contains a valid value.
Definition: version.h:77
@ ReInstall
Definition: apt.h:57
~Iterator()
Definition: apt.cc:327
bool purge() const
Definition: apt.h:93
~RecordIterator()
Definition: apt.cc:386
Query
Definition: apt.h:48
bool isInstalled() const
Definition: apt.h:86
Iterator & operator=(const Iterator &)
Definition: apt.cc:311
Definition: packagerecord-test.cc:4
@ Upgradable
Definition: apt.h:54
High-level access to the Apt cache, as a data provider for the ept framework.
Definition: apt.h:121
std::string operator*()
Definition: apt.cc:391
~Apt()
Definition: apt.cc:445
record_iterator recordEnd() const
Definition: apt.cc:464
bool reinstall() const
Definition: apt.h:90
bool newInstall() const
Definition: apt.h:99
RecordIterator record_iterator
Definition: apt.h:188
#define wassert_true(...)
Shortcut to check that a given expression returns true.
Definition: tests.h:354
#define wassert(...)
Run the given command, raising TestFailed with the appropriate backtrace information if it threw an e...
Definition: tests.h:343
iterator end() const
Definition: apt.cc:454
std::string version() const
Return the package version, or the empty string if this is a versionless package.
Definition: version.h:67
record_iterator recordBegin() const
Definition: apt.cc:459
bool upgrade() const
Definition: apt.h:97
Version installedVersion(const std::string &pkg) const
Return the installed version for a package.
Definition: apt.cc:508
bool modify() const
Definition: apt.h:108
bool held() const
Definition: apt.h:105
bool installed() const
Definition: apt.h:102
Iterator & operator++()
Definition: apt.cc:335
bool hold() const
Definition: apt.h:100
bool operator!=(const RecordIterator &) const
Definition: apt.cc:438
bool isValid(const std::string &pkg) const
Validate a package name, returning trye if it exists in the APT database, or false if it does not.
Definition: apt.cc:479
bool keep() const
Definition: apt.h:94
bool install() const
Definition: apt.h:88
Lightweight Version class that represent a package with a version, with very cheap value copy operati...
Definition: version.h:41
std::string validate(const std::string &pkg) const
Validate a package name, returning it if it exists in the APT database, or returning the empty string...
Definition: apt.h:215