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)  

StateChanges Class Reference

#include <statechanges.h>

Classes

class  Private
 

Public Member Functions

APT::VersionVectorHold ()
 
void Hold (pkgCache::VerIterator const &Ver)
 
APT::VersionVectorUnhold ()
 
void Unhold (pkgCache::VerIterator const &Ver)
 
APT::VersionVectorInstall ()
 
void Install (pkgCache::VerIterator const &Ver)
 
APT::VersionVectorRemove ()
 
void Remove (pkgCache::VerIterator const &Ver)
 
APT::VersionVectorPurge ()
 
void Purge (pkgCache::VerIterator const &Ver)
 
APT::VersionVectorError ()
 
void clear ()
 
bool empty () const
 
bool Save (bool const DiscardOutput=false)
 
 StateChanges ()
 
 StateChanges (StateChanges &&)
 
StateChangesoperator= (StateChanges &&)
 
 ~StateChanges ()
 

Private Attributes

class APT_HIDDEN Private
 
std::unique_ptr< Privated
 

Detailed Description

Simple wrapper class to abstract away the differences in storing different states in different places potentially in different versions.

Definition at line 13 of file statechanges.h.

Constructor & Destructor Documentation

◆ StateChanges() [1/2]

Definition at line 224 of file statechanges.cc.

◆ StateChanges() [2/2]

StateChanges ( StateChanges &&  )
default

◆ ~StateChanges()

~StateChanges ( )
default

Member Function Documentation

◆ clear()

void clear ( )

Definition at line 48 of file statechanges.cc.

References StateChanges::d.

Referenced by pkgDPkgPM::Go().

◆ empty()

bool empty ( ) const

Definition at line 58 of file statechanges.cc.

References StateChanges::d.

Referenced by pkgDPkgPM::Go().

◆ Error()

APT::VersionVector & Error ( )

Definition at line 43 of file statechanges.cc.

References StateChanges::d.

◆ Hold() [1/2]

APT::VersionVector & Hold ( )

Definition at line 37 of file statechanges.cc.

Referenced by DoSelection().

◆ Hold() [2/2]

void Hold ( pkgCache::VerIterator const &  Ver)

Definition at line 37 of file statechanges.cc.

◆ Install() [1/2]

APT::VersionVector & Install ( )

Definition at line 39 of file statechanges.cc.

Referenced by DoSelection(), and pkgDPkgPM::Go().

◆ Install() [2/2]

void Install ( pkgCache::VerIterator const &  Ver)

Definition at line 39 of file statechanges.cc.

◆ operator=()

StateChanges & operator= ( StateChanges &&  )
default

◆ Purge() [1/2]

APT::VersionVector & Purge ( )

Definition at line 41 of file statechanges.cc.

Referenced by DoSelection(), and pkgDPkgPM::Go().

◆ Purge() [2/2]

void Purge ( pkgCache::VerIterator const &  Ver)

Definition at line 41 of file statechanges.cc.

◆ Remove() [1/2]

APT::VersionVector & Remove ( )

Definition at line 40 of file statechanges.cc.

Referenced by DoSelection(), and pkgDPkgPM::Go().

◆ Remove() [2/2]

void Remove ( pkgCache::VerIterator const &  Ver)

Definition at line 40 of file statechanges.cc.

◆ Save()

bool Save ( bool const  DiscardOutput = false)

commit the staged changes to the database(s).

Makes the needed calls to store the requested states. After this call the state containers will hold only versions for which the storing operation succeeded. Versions where the storing operation failed are collected in Error(). Note that error is an upper bound as states are changed in batches so it isn't always clear which version triggered the failure exactly.

Parameters
DiscardOutputcontrols if stdout/stderr should be used by subprocesses for (detailed) error reporting if needed.
Returns
false if storing failed, true otherwise. Note that some states might be applied even if the whole operation failed.

Definition at line 68 of file statechanges.cc.

References _config, _system, StateChanges::d, VersionContainer< Container >::empty(), debSystem::ExecDpkg(), ExecWait(), FILE, Configuration::FindB(), debSystem::GetDpkgBaseCommand(), ioprintf(), pkgSystem::MultiArchSupported(), pkgCache< Str, Itr >::PkgIterator(), and pkgCache< Str, Itr >::VerIterator().

Referenced by DoSelection(), and pkgDPkgPM::Go().

◆ Unhold() [1/2]

APT::VersionVector & Unhold ( )

Definition at line 38 of file statechanges.cc.

Referenced by DoSelection().

◆ Unhold() [2/2]

void Unhold ( pkgCache::VerIterator const &  Ver)

Definition at line 38 of file statechanges.cc.

Member Data Documentation

◆ d

std::unique_ptr<Private> d
private

◆ Private

class APT_HIDDEN Private
private

Definition at line 51 of file statechanges.h.


The documentation for this class was generated from the following files: