27 #include <wibble/exception.h>
43 Exception(
const std::string& context)
throw ();
46 virtual const char*
type()
const throw () {
return "Apt"; }
51 class AptImplementation;
52 class RecordIteratorImpl;
134 class Iterator :
public std::iterator<std::input_iterator_tag, std::string, void, void, void>
162 class RecordIterator :
public std::iterator<std::input_iterator_tag, std::string, void, void, void>
164 RecordIteratorImpl* impl;
204 iterator
begin()
const;
205 iterator
end()
const;
218 bool isValid(
const std::string& pkg)
const;
226 return std::string();
258 std::string
rawRecord(
const std::string& pkg)
const;
PackageState(unsigned a)
Definition: apt.h:84
bool reinstall() const
Definition: apt.h:97
bool isValid() const
Definition: apt.h:91
Query
Definition: apt.h:55
Apt()
Create the Apt data provider.
Definition: apt.cc:441
bool hasNewVersion() const
Definition: apt.h:110
bool modify() const
Definition: apt.h:115
Iterator iterator
Definition: apt.h:194
bool willBreak() const
Definition: apt.h:102
bool newInstall() const
Definition: apt.h:106
void checkCacheUpdates()
Check if the cache has been changed by another process, and reopen it if that is the case...
Definition: apt.cc:637
record_iterator recordBegin() const
Definition: apt.cc:456
PackageState & operator|=(const PackageState &s)
Definition: apt.h:79
Iterator(void *cur)
Definition: apt.h:140
bool operator!=(const Iterator &) const
Definition: apt.cc:355
bool hold() const
Definition: apt.h:107
bool installed() const
Definition: apt.h:109
bool operator==(const RecordIterator &) const
Definition: apt.cc:431
PackageState state(const std::string &pkg) const
Return state information on a package.
Definition: apt.cc:530
bool install() const
Definition: apt.h:95
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:476
std::string operator*()
Definition: apt.cc:328
RecordIterator()
Definition: apt.h:174
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:222
PackageState()
Definition: apt.h:88
Version installedVersion(const std::string &pkg) const
Return the installed version for a package.
Definition: apt.cc:505
~RecordIterator()
Definition: apt.cc:383
High-level access to the Apt cache, as a data provider for the ept framework.
Definition: apt.h:127
time_t timestamp()
Timestamp of when the apt index was last modified.
Definition: apt.cc:471
RecordIterator & operator=(const RecordIterator &r)
Definition: apt.cc:419
iterator end() const
Definition: apt.cc:451
unsigned m_state
Definition: apt.h:118
virtual std::string desc() const
Definition: apt.h:47
bool keep() const
Definition: apt.h:101
Version candidateVersion(const std::string &pkg) const
Return the candidate version for a package.
Definition: apt.cc:496
void invalidateTimestamp()
Invalidate the cache timestamp used to track cache updates.
Definition: apt.cc:647
iterator begin() const
Definition: apt.cc:444
record_iterator recordEnd() const
Definition: apt.cc:461
std::string m_message
Definition: apt.h:40
RecordIterator & operator++()
Definition: apt.cc:406
bool operator!=(const RecordIterator &) const
Definition: apt.cc:435
std::string rawRecord(const std::string &pkg) const
Perform a package search.
Definition: apt.cc:577
Iterator()
Definition: apt.h:143
Representation of a package with a version.
virtual const char * type() const
Definition: apt.h:46
Iterator & operator=(const Iterator &)
Definition: apt.cc:308
AptImplementation * impl
Definition: apt.h:130
~Exception()
Definition: apt.h:44
~Apt()
Definition: apt.cc:442
~Iterator()
Definition: apt.cc:324
bool upgrade() const
Definition: apt.h:104
bool operator==(const Iterator &) const
Definition: apt.cc:345
std::string operator*()
Definition: apt.cc:388
PackageState & operator=(unsigned i)
Definition: apt.h:74
Exception(const std::string &context)
Definition: apt.cc:55
Version anyVersion(const std::string &pkg) const
Return the candidate version for a package, if available, or the installed version otherwise...
Definition: apt.cc:515
RecordIterator record_iterator
Definition: apt.h:195
size_t size() const
Return the number of packages in the archive.
Definition: apt.cc:466
bool isInstalled() const
Definition: apt.h:93
unsigned state
Definition: apt.h:70
bool held() const
Definition: apt.h:112
const pkgCache * aptPkgCache() const
Returns the pointer to the internal libapt pkgCache object used.
Definition: apt.cc:631
Lightweight Version class that represent a package with a version, with very cheap value copy operati...
Definition: version.h:40
bool purge() const
Definition: apt.h:100
bool nowBroken() const
Definition: apt.h:113
std::string * operator->()
Definition: apt.cc:397
Iterator & operator++()
Definition: apt.cc:332
bool upgradable() const
Definition: apt.h:111