aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-06 20:03:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-06 20:03:29 +0000
commit0c38d912fcca684f6c44b5a0d0610fa4374efe74 (patch)
tree84a33f25784cbb7f41798c5811ce4aba03f6b345
parent6a94cc5e0dc653101014b422bb63d95264e0de76 (diff)
downloadpaludis-0c38d912fcca684f6c44b5a0d0610fa4374efe74.tar.gz
paludis-0c38d912fcca684f6c44b5a0d0610fa4374efe74.tar.xz
New query objects
-rw-r--r--paludis/query.cc29
-rw-r--r--paludis/query.hh40
2 files changed, 69 insertions, 0 deletions
diff --git a/paludis/query.cc b/paludis/query.cc
index 3826b9a..217eff3 100644
--- a/paludis/query.cc
+++ b/paludis/query.cc
@@ -194,6 +194,18 @@ query::Package::Package(const QualifiedPackageName & a) :
{
}
+query::Repository::Repository(const RepositoryName & a) :
+ Query(std::tr1::shared_ptr<QueryDelegate>(new MatchesDelegate(PackageDepSpec(
+ std::tr1::shared_ptr<QualifiedPackageName>(),
+ std::tr1::shared_ptr<CategoryNamePart>(),
+ std::tr1::shared_ptr<PackageNamePart>(),
+ std::tr1::shared_ptr<VersionRequirements>(),
+ vr_and,
+ std::tr1::shared_ptr<SlotName>(),
+ std::tr1::shared_ptr<RepositoryName>(new RepositoryName(a))))))
+{
+}
+
namespace
{
struct NotMaskedDelegate :
@@ -412,3 +424,20 @@ paludis::operator& (const Query & q1, const Query & q2)
return Query(std::tr1::shared_ptr<QueryDelegate>(new AndQueryDelegate(q1._d, q2._d)));
}
+namespace
+{
+ struct AllDelegate :
+ QueryDelegate
+ {
+ AllDelegate()
+ {
+ }
+ };
+}
+
+query::All::All() :
+ Query(std::tr1::shared_ptr<QueryDelegate>(
+ new AllDelegate))
+{
+}
+
diff --git a/paludis/query.hh b/paludis/query.hh
index e00124a..aee3837 100644
--- a/paludis/query.hh
+++ b/paludis/query.hh
@@ -208,6 +208,26 @@ namespace paludis
};
/**
+ * Fetch packages in a given repository.
+ *
+ * \see Query
+ * \see PackageData
+ * \ingroup grpquerybase::query
+ * \nosubgrouping
+ */
+ class Repository :
+ public Query
+ {
+ public:
+ ///\name Basic operations
+ ///\{
+
+ Repository(const RepositoryName &);
+
+ ///\}
+ };
+
+ /**
* Fetch packages that are not masked.
*
* \see Query
@@ -309,6 +329,26 @@ namespace paludis
///}
};
+
+ /**
+ * Fetch all packages.
+ *
+ * \see Query
+ * \see PackageDatabase::query
+ * \ingroup grpquery
+ * \nosubgrouping
+ */
+ class All :
+ public Query
+ {
+ public:
+ ///\name Basic operations
+ ///\{
+
+ All();
+
+ ///}
+ };
}
/**