apt: StateChanges Class Reference

apt 3.2.0 commandline package manager

Classes | Public Member Functions | List of all members
StateChanges Class Reference

`#include <apt-pkg/statechanges.h>`

## Classes
class | Private

## Public Member Functions
| APT_GETTERSETTER (Hold)
| APT_GETTERSETTER (Unhold)
| APT_GETTERSETTER (Install)
| APT_GETTERSETTER (Remove)
| APT_GETTERSETTER (Purge)
APT::VersionVector & | Error ()
void | clear ()
bool | empty () const
bool | Save (bool const DiscardOutput=false)
| StateChanges (StateChanges &&)
StateChanges & | operator= (StateChanges &&)

## Detailed Description

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

## Member Function Documentation

## ◆ 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

  DiscardOutput | controls 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.

Todo
  supported only since 1.17.7 in dpkg

Referenced by pkgDPkgPM::Go().

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

- apt-pkg/statechanges.h
- apt-pkg/statechanges.cc