libzypp 17.37.17
zypp::sat::LocaleSupport Class Reference

Convenience methods to manage support for a specific Locale. More...

#include <zypp/sat/LocaleSupport.h>

Inheritance diagram for zypp::sat::LocaleSupport:

Public Member Functions

 LocaleSupport ()
 Default ctor.
 LocaleSupport (const Locale &locale_r)
 Ctor taking a Locale.
const Localelocale () const
 My Locale.
bool isAvailable () const
 Whether there are language specific packages supporting my Locale.
bool isRequested () const
 Whether the solver will automatically select language specific packages for my Locale.
void setRequested (bool yesno_r)
 Turn on/off solver support for my Locale.
Public Member Functions inherited from zypp::sat::SolvIterMixin< LocaleSupport, filter_iterator< filter::ByLocaleSupport, Pool::SolvableIterator > >
bool empty () const
 Whether the collection is epmty.
size_type size () const
 Size of the collection.
bool contains (const TSolv &solv_r) const
 Whether collection contains a specific Solvable.
Solvable_iterator solvableBegin () const
Solvable_iterator solvableEnd () const
Iterable< Solvable_iteratorsolvable () const
PoolItem_iterator poolItemBegin () const
PoolItem_iterator poolItemEnd () const
Iterable< PoolItem_iteratorpoolItem () const
Selectable_iterator selectableBegin () const
Selectable_iterator selectableEnd () const
Iterable< Selectable_iteratorselectable () const

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &str, const LocaleSupport &obj)
 Stream output.
std::ostream & dumpOn (std::ostream &str, const LocaleSupport &obj)
 More verbose stream output including dependencies.
bool operator== (const LocaleSupport &lhs, const LocaleSupport &rhs)
bool operator!= (const LocaleSupport &lhs, const LocaleSupport &rhs)
bool operator< (const LocaleSupport &lhs, const LocaleSupport &rhs)

Iterate through all \ref sat::Solvables supporting my \ref Locale.

using iterator = Solvable_iterator
Locale _locale
iterator begin () const
iterator end () const

Additional Inherited Members

Public Types inherited from zypp::sat::SolvIterMixin< LocaleSupport, filter_iterator< filter::ByLocaleSupport, Pool::SolvableIterator > >
using size_type
using Solvable_iterator
using PoolItem_iterator
using Selectable_iterator
 SolvIterMixin ()
 ~SolvIterMixin ()
SolvIterMixinoperator= (const SolvIterMixin &)=default
Static Protected Member Functions inherited from zypp::sat::detail::PoolMember
static PoolImplmyPool ()

Detailed Description

Convenience methods to manage support for a specific Locale.

sat::LocaleSupport myLocale( Locale("de") );
if ( myLocale.isAvailable() )
{
MIL << "Support for locale '" << myLocale.locale() << "' is available." << endl;
}
if ( ! myLocale.isRequested() )
{
MIL << "Will enable support for locale '" << myLocale.locale() << "'." << endl;
myLocale.setRequested( true );
}
MIL << "Packages supporting locale '" << myLocale.locale() << "':" << endl;
for_( it, myLocale.begin(), myLocale.end() )
{
// iterate over sat::Solvables
MIL << " " << *it << endl;
// or get the PoolItems
DBG << " " << PoolItem(*it) << endl;
}
'Language[_Country]' codes.
Definition Locale.h:51
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
Convenience methods to manage support for a specific Locale.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
#define DBG
Definition Logger.h:99
#define MIL
Definition Logger.h:100
Todo
If iterator is too slow install a proxy watching the Pool::serial.

Definition at line 59 of file LocaleSupport.h.

Member Typedef Documentation

◆ iterator

Constructor & Destructor Documentation

◆ LocaleSupport() [1/2]

zypp::sat::LocaleSupport::LocaleSupport ( )
inline

Default ctor.

Definition at line 64 of file LocaleSupport.h.

◆ LocaleSupport() [2/2]

zypp::sat::LocaleSupport::LocaleSupport ( const Locale & locale_r)
inline

Ctor taking a Locale.

Definition at line 67 of file LocaleSupport.h.

Member Function Documentation

◆ locale()

const Locale & zypp::sat::LocaleSupport::locale ( ) const
inline

My Locale.

Definition at line 73 of file LocaleSupport.h.

◆ isAvailable()

bool zypp::sat::LocaleSupport::isAvailable ( ) const
inline

Whether there are language specific packages supporting my Locale.

Definition at line 77 of file LocaleSupport.h.

◆ isRequested()

bool zypp::sat::LocaleSupport::isRequested ( ) const
inline

Whether the solver will automatically select language specific packages for my Locale.

Definition at line 81 of file LocaleSupport.h.

◆ setRequested()

void zypp::sat::LocaleSupport::setRequested ( bool yesno_r)
inline

Turn on/off solver support for my Locale.

Definition at line 85 of file LocaleSupport.h.

◆ begin()

iterator zypp::sat::LocaleSupport::begin ( ) const
inline

Definition at line 93 of file LocaleSupport.h.

◆ end()

iterator zypp::sat::LocaleSupport::end ( ) const
inline

Definition at line 96 of file LocaleSupport.h.

◆ operator<<()

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

Stream output.

Definition at line 31 of file LocaleSupport.cc.

◆ dumpOn()

std::ostream & dumpOn ( std::ostream & str,
const LocaleSupport & obj )
related

More verbose stream output including dependencies.

Definition at line 41 of file LocaleSupport.cc.

◆ operator==()

bool operator== ( const LocaleSupport & lhs,
const LocaleSupport & rhs )
related

Definition at line 112 of file LocaleSupport.h.

◆ operator!=()

bool operator!= ( const LocaleSupport & lhs,
const LocaleSupport & rhs )
related

Definition at line 116 of file LocaleSupport.h.

◆ operator<()

bool operator< ( const LocaleSupport & lhs,
const LocaleSupport & rhs )
related

Definition at line 120 of file LocaleSupport.h.

Member Data Documentation

◆ _locale

Locale zypp::sat::LocaleSupport::_locale
private

Definition at line 101 of file LocaleSupport.h.


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