Stefan Hundhammer wrote:
On Friday 29 June 2007 15:14, Jan Kupec wrote:
Here is my proposal of a new libzypp API for various metadata queries. It should be useful for YaST package managers, zypper, YaST online update and maybe others. Pease see attached QueryBuilder.h file and comment on the design and usability.
QueryBuilder is meant to build an sqlite query for libzypp's metadata cache database and to be used by ResolvableQuery::query(QueryBuilder,ProcessingFunctor) function (or other Query class) to do complex resolvable data queries. Result of these queries will be processed by ProcessingFunctor (read on).
The reason to create such an API is to have a convenient API for coding various kinds of user queries, so that apps using libzypp don't have to code the functionality by themselves by traversing the resolvable pool.
That's a nice API for querying resolvables. Will there be a counterpart for querying selectables (which is what the UI needs), too?
Sure! Note the comment in parenthesis after the code example: (the functor is function<bool( const data::RecordId &, data::ResObject_Ptr )> we can provide one which would use Selectables (or NameKindProxy) for yast as well) I hope it will be doable in a resource-sparing way. Maybe by adding name and kind to the 'order by' clause of the query so that the resolvables belonging to one selectable can be collected as the result is read. Anyway, the data::RecordId should probably better be hidden, so the functions might look like: function<bool(const zypp::Resolvable::Ptr &)> and function<bool(const zypp::ui::Selectable::Ptr &)> for YaST j. -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org