On Tue, Jan 29, Katarina Machalkova wrote:
i) returning an iterator over all available languages
Basic interface is in class ResPool const LocaleSet & ResPool::getAvailableLocales() const;
ii) for selected language, returning an it. over all its related packages ?
See class sat::LocaleSupport Example: const LocaleSet & avlocales( ResPool::instance().getAvailableLocales() ); for_( it, avlocales.begin(), avlocales.end() ) { sat::LocaleSupport myLocale( *it ); 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: PoolItem pi(*it); MIL << " " << pi << endl; } } Is it ok for the UIs to construct the PoolItem (ASAP as well the Selectable) from the sat::Solvable (inside the loop)? Or would you prefer to have a transform iterator like: for_( it, poolItemIterator(myLocale.begin()), poolItemIterator(myLocale.end()) ) { // *it now is a PoolItem } for_( it, selectableIterator(myLocale.begin()), selectableIterator(myLocale.end()) ) { // *it now is a ui::Selectable } A selectableIterator would also visit each Selectable only once, even if multiple PoolItems refer to it. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org