zypp::sat::LocaleSupport Class Reference

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

#include <LocaleSupport.h>

Inheritance diagram for zypp::sat::LocaleSupport:
[legend]

List of all members.

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.

Private Attributes

Locale _locale

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const LocaleSupport &obj)
std::ostream & dumpOn (std::ostream &str, const LocaleSupport &obj)
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.

typedef Solvable_iterator iterator
iterator begin () const
iterator end () const


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;
   }

Todo:
If iterator is too slow install a proxy watching the Pool::serial.

Definition at line 59 of file LocaleSupport.h.


Member Typedef Documentation

Definition at line 91 of file LocaleSupport.h.


Constructor & Destructor Documentation

zypp::sat::LocaleSupport::LocaleSupport (  )  [inline]

Default ctor.

Definition at line 64 of file LocaleSupport.h.

zypp::sat::LocaleSupport::LocaleSupport ( const Locale locale_r  )  [inline]

Ctor taking a Locale.

Definition at line 67 of file LocaleSupport.h.


Member Function Documentation

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

My Locale.

Definition at line 73 of file LocaleSupport.h.

References _locale.

Referenced by operator!=(), operator<(), zypp::sat::operator<<(), and operator==().

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

Whether there are language specific packages supporting my Locale.

Definition at line 77 of file LocaleSupport.h.

References _locale.

Referenced by zypp::sat::operator<<().

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.

References _locale.

Referenced by zypp::sat::operator<<().

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.

References _locale.

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

Definition at line 93 of file LocaleSupport.h.

References _locale.

Referenced by zypp::sat::dumpOn().

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

Definition at line 96 of file LocaleSupport.h.

References _locale.

Referenced by zypp::sat::dumpOn().


Friends And Related Function Documentation

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

Stream output

Definition at line 31 of file LocaleSupport.cc.

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

More verbose stream output including dependencies

Definition at line 41 of file LocaleSupport.cc.

bool operator== ( const LocaleSupport lhs,
const LocaleSupport rhs 
) [related]

Definition at line 112 of file LocaleSupport.h.

References locale().

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

Definition at line 116 of file LocaleSupport.h.

References locale().

bool operator< ( const LocaleSupport lhs,
const LocaleSupport rhs 
) [related]

Definition at line 120 of file LocaleSupport.h.

References locale().


Member Data Documentation

Definition at line 101 of file LocaleSupport.h.

Referenced by begin(), end(), isAvailable(), isRequested(), locale(), and setRequested().


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

doxygen