libzypp 17.37.17
zypp::target::HardLocksFile Class Reference

Save and restore hardlocks. More...

#include <zypp/target/HardLocksFile.h>

Public Types

using Data = pool::PoolTraits::HardLockQueries

Public Member Functions

 HardLocksFile (Pathname file_r)
 Ctor taking the file to read/write.
const Pathnamefile () const
 Return the file path.
const Datadata () const
 Return the data.
void setData (const Data &data_r)
 Store new Data.

Private Member Functions

bool differs (const Data &lhs, const Data &rhs) const
 Helper testing whether two Data differ.

Static Private Member Functions

static void load (const Pathname &file_r, Data &data_r)
 Read Data from file_r.
static void store (const Pathname &file_r, const Data &data_r)
 Write Data to file_r.

Private Attributes

Pathname _file
scoped_ptr< Data_dataPtr

Friends

std::ostream & operator<< (std::ostream &str, const HardLocksFile &obj)

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &str, const HardLocksFile &obj)
 Stream output.

Detailed Description

Save and restore hardlocks.

Definition at line 37 of file HardLocksFile.h.

Member Typedef Documentation

◆ Data

Constructor & Destructor Documentation

◆ HardLocksFile()

zypp::target::HardLocksFile::HardLocksFile ( Pathname file_r)
inline

Ctor taking the file to read/write.

Definition at line 46 of file HardLocksFile.h.

Member Function Documentation

◆ file()

const Pathname & zypp::target::HardLocksFile::file ( ) const
inline

Return the file path.

Definition at line 51 of file HardLocksFile.h.

◆ data()

const Data & zypp::target::HardLocksFile::data ( ) const
inline

Return the data.

The file is read once on demand. Returns empty Data if the file does not exist or is not readable.

Definition at line 58 of file HardLocksFile.h.

◆ setData()

void zypp::target::HardLocksFile::setData ( const Data & data_r)
inline

Store new Data.

Write the new Data to file, unless we know it did not change. The directory containing file must exist.

Definition at line 74 of file HardLocksFile.h.

◆ differs()

bool zypp::target::HardLocksFile::differs ( const Data & lhs,
const Data & rhs ) const
inlineprivate

Helper testing whether two Data differ.

Definition at line 92 of file HardLocksFile.h.

◆ load()

void zypp::target::HardLocksFile::load ( const Pathname & file_r,
Data & data_r )
staticprivate

Read Data from file_r.

Definition at line 35 of file HardLocksFile.cc.

◆ store()

void zypp::target::HardLocksFile::store ( const Pathname & file_r,
const Data & data_r )
staticprivate

Write Data to file_r.

Definition at line 49 of file HardLocksFile.cc.

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & str,
const HardLocksFile & obj )
friend

Definition at line 72 of file HardLocksFile.cc.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & str,
const HardLocksFile & obj )
related

Stream output.

Definition at line 72 of file HardLocksFile.cc.

Member Data Documentation

◆ _file

Pathname zypp::target::HardLocksFile::_file
private

Definition at line 113 of file HardLocksFile.h.

◆ _dataPtr

scoped_ptr<Data> zypp::target::HardLocksFile::_dataPtr
mutableprivate

Definition at line 114 of file HardLocksFile.h.


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