libzypp  17.7.0
zypp::target::RequestedLocalesFile Class Reference

Save and restore locale set from file. More...

#include <RequestedLocalesFile.h>

Public Member Functions

 RequestedLocalesFile (const Pathname &file_r)
 Ctor taking the file to read/write. More...
 
const Pathnamefile () const
 Return the file path. More...
 
const LocaleSetlocales () const
 Return the loacale set. More...
 
void setLocales (const LocaleSet &locales_r)
 Store a new locale set. More...
 

Private Member Functions

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

Static Private Member Functions

static void load (const Pathname &file_r, LocaleSet &locales_r)
 Read LocaleSet from file_r. More...
 
static void store (const Pathname &file_r, const LocaleSet &locales_r)
 Write LocaleSet to file_r. More...
 

Private Attributes

Pathname _file
 
scoped_ptr< LocaleSet_localesPtr
 

Friends

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

Related Functions

(Note that these are not member functions.)

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

Detailed Description

Save and restore locale set from file.

Definition at line 35 of file RequestedLocalesFile.h.

Constructor & Destructor Documentation

◆ RequestedLocalesFile()

zypp::target::RequestedLocalesFile::RequestedLocalesFile ( const Pathname file_r)
inline

Ctor taking the file to read/write.

Definition at line 41 of file RequestedLocalesFile.h.

Member Function Documentation

◆ file()

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

Return the file path.

Definition at line 46 of file RequestedLocalesFile.h.

◆ locales()

const LocaleSet& zypp::target::RequestedLocalesFile::locales ( ) const
inline

Return the loacale set.

The file is read once on demand. returns an empty set if the file does not exist or is not readable.

Definition at line 53 of file RequestedLocalesFile.h.

◆ setLocales()

void zypp::target::RequestedLocalesFile::setLocales ( const LocaleSet locales_r)
inline

Store a new locale set.

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

Definition at line 68 of file RequestedLocalesFile.h.

◆ differs()

bool zypp::target::RequestedLocalesFile::differs ( const LocaleSet lhs,
const LocaleSet rhs 
) const
inlineprivate

Helper testing whether two LocaleSet differ.

Definition at line 82 of file RequestedLocalesFile.h.

◆ load()

void zypp::target::RequestedLocalesFile::load ( const Pathname file_r,
LocaleSet locales_r 
)
staticprivate

Read LocaleSet from file_r.

Definition at line 34 of file RequestedLocalesFile.cc.

◆ store()

void zypp::target::RequestedLocalesFile::store ( const Pathname file_r,
const LocaleSet locales_r 
)
staticprivate

Write LocaleSet to file_r.

Definition at line 54 of file RequestedLocalesFile.cc.

Friends And Related Function Documentation

◆ operator<< [1/2]

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

Definition at line 80 of file RequestedLocalesFile.cc.

◆ operator<<() [2/2]

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

Stream output

Definition at line 80 of file RequestedLocalesFile.cc.

Member Data Documentation

◆ _file

Pathname zypp::target::RequestedLocalesFile::_file
private

Definition at line 99 of file RequestedLocalesFile.h.

◆ _localesPtr

scoped_ptr<LocaleSet> zypp::target::RequestedLocalesFile::_localesPtr
mutableprivate

Definition at line 100 of file RequestedLocalesFile.h.


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