libzypp: zypp::HistoryLogData Class Reference

libzypp 17.38.6

zypp::HistoryLogData Class Reference
Libzypp History File

A zypp history log line split into fields. More...

`#include <zypp/HistoryLogData.h>`

Inheritance diagram for zypp::HistoryLogData:

## Classes
class | Impl

## Public Types
enum | Index { DATE_INDEX = 0 , ACTION_INDEX = 1 }
| < indices of known fields More...
using | Ptr = shared_ptr<HistoryLogData>
using | constPtr = shared_ptr<const HistoryLogData>
using | FieldVector = std::vector<std::string>
using | size_type = FieldVector::size_type
using | const_iterator = FieldVector::const_iterator

## Public Member Functions
| HistoryLogData (FieldVector &fields_r, size_type expect_r=2)
| Ctor moving FieldVector (via swap).
| HistoryLogData (FieldVector &fields_r, HistoryActionID action_r, size_type expect_r=2)
| Ctor moving FieldVector (via swap).
virtual | ~HistoryLogData ()
| Dtor.
bool | empty () const
| Whether FieldVector is empty.
size_type | size () const
| Number of fields in vector.
const_iterator | begin () const
| Iterator pointing to 1st element in vector (or end()).
const_iterator | end () const
| Iterator pointing behind the last element in vector.
const std::string & | optionalAt (size_type idx_r) const
| Access (optional) field by number.
const std::string & | operator[] (size_type idx_r) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
const std::string & | at (size_type idx_r) const
| Access (required) field by number.
Date | date () const
| date
HistoryActionID | action () const
| HistoryActionID (or `NONE_e` if unknown).

## Static Public Member Functions
static Ptr | create (FieldVector &fields_r)
| Factory method creating HistoryLogData classes.

## Protected Member Functions
HistoryLogData & | operator= (const HistoryLogData &)
| no base class assign

## Private Attributes
RWCOW_pointer< Impl > | _pimpl
| Implementation class.

## Detailed Description

A zypp history log line split into fields.

Each valid history log line starts with a date and HistoryActionID field. Subsequent fields depend on the kind of action. See derived classes for convenient access to those flields.

HistoryLogData itself provides mostly generic access to the fields plain string values. Derived classes for well known entries tell

Definition at line 105 of file HistoryLogData.h.

## Member Typedef Documentation

## ◆ Ptr

using zypp::HistoryLogData::Ptr = shared_ptr<HistoryLogData>

Definition at line 108 of file HistoryLogData.h.

## ◆ constPtr

using zypp::HistoryLogData::constPtr = shared_ptr<const HistoryLogData>

Definition at line 109 of file HistoryLogData.h.

## ◆ FieldVector

using zypp::HistoryLogData::FieldVector = std::vector<std::string>

Definition at line 111 of file HistoryLogData.h.

## ◆ size_type

using zypp::HistoryLogData::size_type = FieldVector::size_type

Definition at line 112 of file HistoryLogData.h.

## ◆ const_iterator

using zypp::HistoryLogData::const_iterator = FieldVector::const_iterator

Definition at line 113 of file HistoryLogData.h.

## Member Enumeration Documentation

## ◆ Index

enum zypp::HistoryLogData::Index

< indices of known fields

Enumerator
DATE_INDEX | date
ACTION_INDEX | HistoryActionID.

Definition at line 172 of file HistoryLogData.h.

## Constructor & Destructor Documentation

## ◆ HistoryLogData() [1/2]

zypp::HistoryLogData::HistoryLogData | ( | FieldVector & | fields_r,
|  | size_type | expect_r = 2 )
| explicit

Ctor moving FieldVector (via swap).

Exceptions

  ParseException | if fields_r has not at least expect_r entries

Note
  2 fields (date and action) are always required.

Definition at line 172 of file HistoryLogData.cc.

## ◆ HistoryLogData() [2/2]

zypp::HistoryLogData::HistoryLogData | ( | FieldVector & | fields_r,
|  | HistoryActionID | action_r,
|  | size_type | expect_r = 2 )

Ctor moving FieldVector (via swap).

Exceptions

  ParseException | if fields_r has the wrong HistoryActionID or not at least expect_r entries.

Note
  2 fields (date and action) are always required.

Definition at line 176 of file HistoryLogData.cc.

## ◆ ~HistoryLogData()

zypp::HistoryLogData::~HistoryLogData | ( |  | ) |
| virtual

Dtor.

Definition at line 180 of file HistoryLogData.cc.

## Member Function Documentation

## ◆ create()

HistoryLogData::Ptr zypp::HistoryLogData::create | ( | FieldVector & | fields_r | ) |
| static

Factory method creating HistoryLogData classes.

Moves fields_r into a HistoryLogData or derived object, depending on the HistoryActionID. For known action ids a coresponing HistoryLogData class is created, to allow convenient access to the field values. For unknown action ids a plain HistoryLogData object is created. HistoryActionID NONE_e id used in this case.

Exceptions

  ParseException | if fields_r does not contain the required format.

Definition at line 183 of file HistoryLogData.cc.

## ◆ empty()

bool zypp::HistoryLogData::empty | ( |  | ) | const

Whether FieldVector is empty.

Definition at line 209 of file HistoryLogData.cc.

## ◆ size()

HistoryLogData::size_type zypp::HistoryLogData::size | ( |  | ) | const

Number of fields in vector.

Definition at line 212 of file HistoryLogData.cc.

## ◆ begin()

HistoryLogData::const_iterator zypp::HistoryLogData::begin | ( |  | ) | const

Iterator pointing to 1st element in vector (or end()).

Definition at line 215 of file HistoryLogData.cc.

## ◆ end()

HistoryLogData::const_iterator zypp::HistoryLogData::end | ( |  | ) | const

Iterator pointing behind the last element in vector.

Definition at line 218 of file HistoryLogData.cc.

## ◆ optionalAt()

const std::string & zypp::HistoryLogData::optionalAt | ( | size_type | idx_r | ) | const

Access (optional) field by number.

Returns
  an empty string if idx_r is out of range.

See also
  at

Definition at line 221 of file HistoryLogData.cc.

## ◆ operator[]()

const std::string & zypp::HistoryLogData::operator[] | ( | size_type | idx_r | ) | const
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 162 of file HistoryLogData.h.

## ◆ at()

const std::string & zypp::HistoryLogData::at | ( | size_type | idx_r | ) | const

Access (required) field by number.

Exceptions

  std::out_of_range | if idx_r is out of range.

See also
  optionalAt

Definition at line 227 of file HistoryLogData.cc.

## ◆ date()

Date zypp::HistoryLogData::date | ( |  | ) | const

date

Definition at line 231 of file HistoryLogData.cc.

## ◆ action()

HistoryActionID zypp::HistoryLogData::action | ( |  | ) | const

HistoryActionID (or `NONE_e` if unknown).

Definition at line 234 of file HistoryLogData.cc.

## ◆ operator=()

HistoryLogData & zypp::HistoryLogData::operator= | ( | const HistoryLogData & |  | ) |
| protected

no base class assign

## Member Data Documentation

## ◆ _pimpl

RWCOW_pointer<Impl> zypp::HistoryLogData::_pimpl
| private

Implementation class.

Pointer to implementation

Definition at line 185 of file HistoryLogData.h.

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

- zypp/HistoryLogData.h
- zypp/HistoryLogData.cc