aboutsummaryrefslogtreecommitdiff
path: root/paludis/dep_spec_annotations.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-19 16:46:09 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-19 16:46:09 +0000
commit17b625c28f10fbc765f1a99af433da1e39a9253e (patch)
treebb9afd6ea7d811dc67937d2fb54094e5fe78c77a /paludis/dep_spec_annotations.cc
parent7d994ad210d8fc308a506ad9c2cd3eeed4607a65 (diff)
downloadpaludis-17b625c28f10fbc765f1a99af433da1e39a9253e.tar.gz
paludis-17b625c28f10fbc765f1a99af433da1e39a9253e.tar.xz
Annotations have roles
Diffstat (limited to 'paludis/dep_spec_annotations.cc')
-rw-r--r--paludis/dep_spec_annotations.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/paludis/dep_spec_annotations.cc b/paludis/dep_spec_annotations.cc
index 32603a5c9..02eb34aaa 100644
--- a/paludis/dep_spec_annotations.cc
+++ b/paludis/dep_spec_annotations.cc
@@ -29,6 +29,8 @@
using namespace paludis;
+#include <paludis/dep_spec_annotations-se.cc>
+
typedef std::vector<DepSpecAnnotation> Annotations;
namespace paludis
@@ -71,6 +73,11 @@ namespace
{
return a.key() == k;
}
+
+ bool role_is(const DepSpecAnnotation & a, const DepSpecAnnotationRole k)
+ {
+ return a.role() == k;
+ }
}
DepSpecAnnotations::ConstIterator
@@ -80,6 +87,13 @@ DepSpecAnnotations::find(const std::string & s) const
std::bind(&key_is, std::placeholders::_1, s)));
}
+DepSpecAnnotations::ConstIterator
+DepSpecAnnotations::find(const DepSpecAnnotationRole r) const
+{
+ return ConstIterator(std::find_if(_imp->annotations.begin(), _imp->annotations.end(),
+ std::bind(&role_is, std::placeholders::_1, r)));
+}
+
void
DepSpecAnnotations::add(const DepSpecAnnotation & a)
{