LibPkg
|
A class for managing the updating of package components. More...
#include <component_update.h>
Classes | |
class | commit_error |
An exception class for reporting failure to commit table. More... | |
Public Types | |
typedef std::vector< component >::const_iterator | const_iterator |
Public Member Functions | |
component_update (const string &pathname=string()) | |
Construct component update. More... | |
virtual | ~component_update () |
Destroy component update. More... | |
const component & | operator[] (const std::string &name) const |
Get component details for a component name The updates cannot be modified using this operator. More... | |
const_iterator | begin () const |
Get const iterator for start of the updates. More... | |
const_iterator | end () const |
Get const iterator for end of the updates. More... | |
const_iterator | find (const std::string &name) const |
Find const iterator for a component name. More... | |
void | insert (const component &value) |
Add a component. More... | |
void | insert (const component_update &table) |
Insert contents of another table into this one, overwriting any existing items. More... | |
void | clear () |
Clear status of all components. More... | |
void | commit () |
Commit changes. More... | |
void | rollback () |
Roll back changes. More... | |
void | done () |
The updates have been completed, so remove the file. More... | |
A class for managing the updating of package components.
typedef std::vector<component>::const_iterator pkg::component_update::const_iterator |
pkg::component_update::component_update | ( | const string & | pathname = string() | ) |
Construct component update.
pathname | the pathname of the underlying component update file |
References rollback().
|
virtual |
Destroy component update.
const component & pkg::component_update::operator[] | ( | const std::string & | name | ) | const |
Get component details for a component name The updates cannot be modified using this operator.
key | the package name |
|
inline |
|
inline |
component_update::const_iterator pkg::component_update::find | ( | const std::string & | name | ) | const |
void pkg::component_update::insert | ( | const component & | value | ) |
Add a component.
The underlying updates file will not be modified until the change is committed.
value | the new component |
References pkg::component::name().
void pkg::component_update::insert | ( | const component_update & | table | ) |
void pkg::component_update::clear | ( | ) |
Clear status of all components.
Referenced by end().
void pkg::component_update::commit | ( | ) |
Commit changes.
Any changes since the last call to commit() or rollback() are committed to disc.
References dst_pathname, pkg::force_delete(), pkg::force_move(), and pkg::object_type().
Referenced by end().
void pkg::component_update::rollback | ( | ) |
Roll back changes.
Any changes since the last call to commit() or rollback() are discarded.
References done().
Referenced by component_update(), and end().
void pkg::component_update::done | ( | ) |
The updates have been completed, so remove the file.
References pkg::force_delete(), insert(), and pkg::object_type().
Referenced by end(), and rollback().
Reference Manual | LibPkg | Version 0.6.1 (28 Jan 2015) |