aboutsummaryrefslogtreecommitdiff
path: root/paludis/dep_spec_annotations.cc
diff options
context:
space:
mode:
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)
{