libzypp  10.5.0
zypp::target::SoftLocksFile Class Reference

Save and restore soft locks. More...

#include <SoftLocksFile.h>

List of all members.

Public Types

typedef
std::tr1::unordered_set
< IdString
Data

Public Member Functions

 SoftLocksFile (const Pathname &file_r)
 Ctor taking the file to read/write.
const Pathname & file () 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 SoftLocksFile &obj)

Related Functions

(Note that these are not member functions.)

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

Detailed Description

Save and restore soft locks.

Definition at line 35 of file SoftLocksFile.h.


Member Typedef Documentation

typedef std::tr1::unordered_set<IdString> zypp::target::SoftLocksFile::Data

Definition at line 39 of file SoftLocksFile.h.


Constructor & Destructor Documentation

zypp::target::SoftLocksFile::SoftLocksFile ( const Pathname &  file_r) [inline]

Ctor taking the file to read/write.

Definition at line 43 of file SoftLocksFile.h.


Member Function Documentation

const Pathname& zypp::target::SoftLocksFile::file ( ) const [inline]

Return the file path.

Definition at line 48 of file SoftLocksFile.h.

const Data& zypp::target::SoftLocksFile::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 55 of file SoftLocksFile.h.

void zypp::target::SoftLocksFile::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 71 of file SoftLocksFile.h.

bool zypp::target::SoftLocksFile::differs ( const Data lhs,
const Data rhs 
) const [inline, private]

Helper testing whether two Data differ.

Definition at line 85 of file SoftLocksFile.h.

void zypp::target::SoftLocksFile::load ( const Pathname &  file_r,
Data data_r 
) [static, private]

Read Data from file_r.

Definition at line 34 of file SoftLocksFile.cc.

void zypp::target::SoftLocksFile::store ( const Pathname &  file_r,
const Data data_r 
) [static, private]

Write Data to file_r.

Definition at line 54 of file SoftLocksFile.cc.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  str,
const SoftLocksFile obj 
) [friend]

Definition at line 80 of file SoftLocksFile.cc.

std::ostream & operator<< ( std::ostream &  str,
const SoftLocksFile obj 
) [related]

Stream output

Definition at line 80 of file SoftLocksFile.cc.


Member Data Documentation

Definition at line 103 of file SoftLocksFile.h.

scoped_ptr<Data> zypp::target::SoftLocksFile::_dataPtr [mutable, private]

Definition at line 104 of file SoftLocksFile.h.


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