repo = pool.reposFind(theone);
if (repo == Repository::noRepository)
{
- RepoInfo info; info.setAlias(theone);
- ERR << "Repository not found in sat pool." << endl;
- ZYPP_THROW(repo::RepoNotFoundException(info));
+ DBG << "Repository '" << theone << "' not found in sat pool." << endl;
+ return end();
}
}
bool PoolQuery::empty() const
- { return _pimpl->begin() == _pimpl->end(); }
+ {
+ try { return _pimpl->begin() == _pimpl->end(); }
+ catch (const Exception & ex) {}
+ return true;
+ }
+
- //! \todo collect the result, reuse if not dirty
PoolQuery::size_type PoolQuery::size() const
{
size_type count = 0;
- for(const_iterator it = _pimpl->begin(); it != _pimpl->end(); ++it, ++count);
+ try
+ {
+ for(const_iterator it = _pimpl->begin(); it != _pimpl->end(); ++it, ++count);
+ }
+ catch (const Exception & ex) {}
+
return count;
}
/** Query result accessers. */
//@{
- class PoolQueryIterator;
- /** */
+ /**
+ * Compile the query and return an iterator to the result.
+ *
+ * \return An iterator (\ref detail::PoolQueryIterator) returning
+ * sat::Solvable objects pointing at the beginning of the query result.
+ * \throws \ref Exception if the query was about to use a regex which
+ * failed to compile.
+ *
+ * \note Note that PoolQuery is derived from \ref sat::SolvIterMixin which
+ * makes PoolItem and Selectable iterators automatically available.
+ * \see sat::SolvIterMixin
+ */
const_iterator begin() const;
- /** */
+
+ /** An iterator pointing to the end of the query result. */
const_iterator end() const;
- /** */
+
+ /** Whether the result is empty. */
bool empty() const;
- /** */
+
+ /** Number of solvables in the query result. */
size_type size() const;
//@}