+void ttt( const char * lhs, const char * rhs )
+{
+ DBG << lhs << " <=> " << rhs << " --> " << ::strcmp( lhs, rhs ) << endl;
+}
+
+namespace filter
+{
+ template <class _MemFun, class _Value>
+ class HasValue
+ {
+ public:
+ HasValue( _MemFun fun_r, _Value val_r )
+ : _fun( fun_r ), _val( val_r )
+ {}
+ template <class _Tp>
+ bool operator()( const _Tp & obj_r ) const
+ { return( _fun && (obj_r.*_fun)() == _val ); }
+ private:
+ _MemFun _fun;
+ _Value _val;
+ };
+
+ template <class _MemFun, class _Value>
+ HasValue<_MemFun, _Value> byValue( _MemFun fun_r, _Value val_r )
+ { return HasValue<_MemFun, _Value>( fun_r, val_r ); }
+}
+
+namespace zypp
+{
+}
+
+template <class L>
+struct _TestO { _TestO( const L & lhs ) : _lhs( lhs ) {} const L & _lhs; };
+
+template <class L>
+std::ostream & operator<<( std::ostream & str, const _TestO<L> & obj )
+{ const L & lhs( obj._lhs); return str << (lhs?'_':'*') << (lhs.empty()?'e':'_') << "'" << lhs << "'"; }
+
+template <class L>
+_TestO<L> testO( const L & lhs )
+{ return _TestO<L>( lhs ); }
+
+template <class L, class R>
+void testCMP( const L & lhs, const R & rhs )
+{
+ MIL << "LHS " << testO(lhs) << endl;
+ MIL << "RHS " << rhs << endl;
+
+#define OUTS(S) DBG << #S << ": " << (S) << endl
+ OUTS( lhs.compare(rhs) );
+ OUTS( lhs != rhs );
+ OUTS( lhs < rhs );
+ OUTS( lhs <= rhs );
+ OUTS( lhs == rhs );
+ OUTS( lhs >= rhs );
+ OUTS( lhs > rhs );
+#undef OUTS
+}
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace sat
+{ /////////////////////////////////////////////////////////////////
+
+ class ByLocaleSupport
+ {
+ private:
+ typedef bool (sat::Solvable::*LS1) (const Locale &) const;
+ typedef bool (sat::Solvable::*LS2) (const LocaleSet &) const;
+
+ public:
+ /** Solvables with locale support. */
+ ByLocaleSupport()
+ : _sel( mem_fun_ref( &sat::Solvable::supportsLocales ) )
+ {}
+
+ /** Solvables supporting \c locale_r. */
+ ByLocaleSupport( const Locale & locale_r )
+ : _sel( bind( mem_fun_ref( (LS1)&sat::Solvable::supportsLocale ), _1, locale_r ) )
+ {}
+
+ /** Solvables supporting at least one locale in \c locales_r. */
+ ByLocaleSupport( const LocaleSet & locales_r )
+ : _sel( bind( boost::mem_fun_ref( (LS2)&sat::Solvable::supportsLocale ), _1, locales_r ) )
+ {}
+
+ public:
+ bool operator()( const sat::Solvable & solv_r ) const
+ { return _sel && _sel( solv_r ); }
+
+
+ template<class _Solv>
+ bool operator()( const _Solv & solv_r ) const
+ { return operator()( solv_r.satSolvable() ); }
+
+ private:
+ function<bool(const sat::Solvable &)> _sel;
+ };
+
+
+ /////////////////////////////////////////////////////////////////
+} // namespace sat
+///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+
+